diff --git a/doc/input-output-reference/src/input-for-output.tex b/doc/input-output-reference/src/input-for-output.tex index 405ecef7834..d2b8226128a 100644 --- a/doc/input-output-reference/src/input-for-output.tex +++ b/doc/input-output-reference/src/input-for-output.tex @@ -14,7 +14,7 @@ \subsubsection{Inputs} \paragraph{Field: Key Field}\label{field-key-field} -For this field there are two choices: \textbf{IDF} and \textbf{regular}. The regular option is the default and produces a listing that shows the type of variable: Zone or HVAC, Average or Sum. ``\textbf{Zone}'' variables are calculated and can be reported after each Zone/Heat Balance timestep (ref: Timesteps input object). ``\textbf{HVAC}'' variables are calculated and can be reported with each variable HVAC timestep. ``\textbf{Average}'' variables will be averaged over the time interval being reported whereas ``\textbf{Sum}'' variables are summed over that time interval. (Meter variables are always summed.) Units for the variable are shown in ``{[}\}''. +For this field there are two choices: \textbf{IDF} and \textbf{regular}. The regular option is the default and produces a listing that shows the type of variable: Zone or HVAC, Average or Sum. ``\textbf{Zone}'' variables are calculated and can be reported after each Zone/Heat Balance timestep (ref: Timesteps input object). ``\textbf{HVAC}'' variables are calculated and can be reported with each variable HVAC timestep. ``\textbf{Average}'' variables will be averaged over the time interval being reported whereas ``\textbf{Sum}'' variables are summed over that time interval. (Meter variables are always summed.) Units for the variable are shown in ``{[} {]}''. \paragraph{Field: Sort Option}\label{field-sort-option} @@ -474,51 +474,98 @@ \subsubsection{Field: Name}\label{field-name-1-036} % table 38 \begin{longtable}[c]{@{}l@{}} -\caption{Table of Metered Resource Types \label{table:table-of-metered-resource-types}} \tabularnewline -\toprule -Utility/Fuel Types \tabularnewline -\midrule -\endfirsthead - -\caption[]{Table of Metered Resource Types} \tabularnewline -\toprule -Utility/Fuel Types \tabularnewline -\midrule -\endhead - -Electricity \tabularnewline -NaturalGas \tabularnewline -Gasoline \tabularnewline -Diesel \tabularnewline -Coal \tabularnewline -FuelOilNo1 \tabularnewline -FuelOilNo2 \tabularnewline -Propane \tabularnewline -OtherFuel1 \tabularnewline -OtherFuel2 \tabularnewline -Water \tabularnewline -DistrictCooling \tabularnewline -DistrictHeatingWater \tabularnewline -DistrictHeatingSteam \tabularnewline -ElectricityPurchased \tabularnewline -ElectricitySurplusSold \tabularnewline -ElectricityNet \tabularnewline -\bottomrule + \caption{Table of Metered Resource Types---Fuels \label{table:table-of-metered-resource-types}} \tabularnewline + \toprule + Utility/Fuel Resource Types \tabularnewline + \midrule + \endfirsthead + + \caption[]{Table of Metered Resource Types---Fuels \label{table:table-of-metered-resource-types-Fuels}} \tabularnewline + \toprule + Utility/Fuel Resource Types \tabularnewline + \midrule + \endhead + + Electricity \tabularnewline + NaturalGas \tabularnewline + Gasoline \tabularnewline + Diesel \tabularnewline + Coal \tabularnewline + FuelOilNo1 \tabularnewline + FuelOilNo2 \tabularnewline + Propane \tabularnewline + OtherFuel1 \tabularnewline + OtherFuel2 \tabularnewline + DistrictCooling \tabularnewline + DistrictHeatingWater \tabularnewline + DistrictHeatingSteam \tabularnewline + Water \tabularnewline + \bottomrule \end{longtable} \begin{longtable}[c]{@{}l@{}} -\toprule -Other Resource Types \tabularnewline -\midrule -\endfirsthead - -\toprule -Other Resource Types \tabularnewline -\midrule -\endhead - -EnergyTransfer \tabularnewline -\bottomrule + \caption{Table of Metered Resource Types---Pollutants \label{table:table-of-metered-resource-types-pollutants}} \tabularnewline + \toprule + Pollutant Resource Types \tabularnewline + \midrule + \endfirsthead + + \caption[]{Table of Metered Resource Types---Pollutants} \tabularnewline + \toprule + Pollutant Resource Types \tabularnewline + \midrule + \endhead + + SO2 \tabularnewline + NOx \tabularnewline + N2O \tabularnewline + PM \tabularnewline + PM2{\textunderscore}5 \tabularnewline + PM10 \tabularnewline + CO \tabularnewline + CO2 \tabularnewline + CH4 \tabularnewline + NH3 \tabularnewline + NMVOC \tabularnewline + Hg \tabularnewline + Pb \tabularnewline + NuclearHigh \tabularnewline + NuclearLow \tabularnewline + \bottomrule +\end{longtable} + +\begin{longtable}[c]{@{}l@{}} + \caption{Table of Metered Resource Types---Others \label{table:table-of-metered-resource-types-others}} \tabularnewline + \toprule + Other Resource Types \tabularnewline + \midrule + \endfirsthead + + \caption[]{Table of Metered Resource Types---Others} \tabularnewline + \toprule + Other Resource Types \tabularnewline + \midrule + \endhead + + EnergyTransfer \tabularnewline + ElectricityProduced \tabularnewline + ElectricityPurchased \tabularnewline + ElectricitySurplusSold \tabularnewline + ElectricityNet \tabularnewline + SolarWater \tabularnewline + SolarAir \tabularnewline + CarbonEquivalent \tabularnewline + PlantLoopHeatingDemand \tabularnewline + PlantLoopCoolingDemand \tabularnewline + OnSiteWater \tabularnewline + MainsWater \tabularnewline + RainWater \tabularnewline + WellWater \tabularnewline + Condensate \tabularnewline + WaterEnvironmentalFactors \tabularnewline + Source \tabularnewline + Generic \tabularnewline + \bottomrule \end{longtable} The end use types are shown in the following table (note that certain end use types apply only to the EnergyTransfer resource): @@ -612,7 +659,7 @@ \subsubsection{Field: Name}\label{field-name-1-036} Building = \sum\limits_1^{NumberOfZones} {Zone} = \sum\limits_1^{NumberOfSpaceTypes} {SpaceType} \end{equation} -There are also some special purpose meters used to describe electricity resource flows in greater detail.~ Electricity metering is tracked in more detail to accommodate the complexities of onsite electricity generation.~ There are three variations on the electricity resource type including:~ (1) ``ElectrictyPurchased'' which is the quantity of electricity purchased and is always positive, (2) ``ElectricitySold'' which is the quantity of electricity exported by the building, that which is typically ``sold'' back to the power company, and is always positive, and (3) ``ElectricityNet'' which is the net electricity demand considering all sources of onsite generation and demand and can be either positive or negative. +There are also some special purpose meters used to describe electricity resource flows in greater detail.~ Electricity metering is tracked in more detail to accommodate the complexities of onsite electricity generation.~ There are three variations on the electricity resource type including:~ (1) ``ElectrictyProduced'' which is the quantity of electricity generated onsite and is always non-negative (zero or positive), (2) ``ElectrictyPurchased'' which is the quantity of electricity purchased and is always non-negative (zero or positive), (3) ``ElectricitySold'' which is the quantity of electricity exported by the building, that which is typically ``sold'' back to the power company, and is always non-negative (zero or positive), and (4) ``ElectricityNet'' which is the net electricity demand considering all sources of onsite generation and demand and can be either positive or negative (or zero). \subsubsection{Field: Reporting Frequency}\label{field-reporting-frequency-1} @@ -654,24 +701,28 @@ \subsection{Output:EnvironmentalImpactFactors}\label{outputenvironmentalimpactfa The energy is obtained internally from the following facility meters: \begin{longtable}[c]{@{}ll@{}} -\toprule -%Electricity:Facility & Diesel:Facility \tabularnewline -%\midrule -%\endfirsthead -% -%\toprule -%Electricity:Facility & Diesel:Facility \tabularnewline -%\midrule -%\endhead -% -Electricity:Facility & Diesel:Facility \tabularnewline -DistrictCooling:Facility & DistrictHeatingWater:Facility \tabularnewline -NaturalGas:Facility & Gasoline:Facility \tabularnewline -Coal:Facility & FuelOilNo1:Facility \tabularnewline -FuelOilNo2:Facility & Propane:Facility \tabularnewline -ElectricityProduced:Facility & Steam:Facility \tabularnewline -OtherFuel1:Facility & OtherFuel2:Facility \tabularnewline -\bottomrule + \caption{Facility Meters \label{table:facility-meters}} \tabularnewline + \toprule + %Electricity:Facility & Diesel:Facility \tabularnewline + Facility Meters & \tabularnewline + \midrule + \endfirsthead + + \caption[]{Facility Meters} \tabularnewline + \toprule + %Electricity:Facility & Diesel:Facility \tabularnewline + Facility Meters & \tabularnewline + \midrule + \endhead + + Electricity:Facility & Diesel:Facility \tabularnewline + DistrictCooling:Facility & DistrictHeatingWater:Facility \tabularnewline + NaturalGas:Facility & Gasoline:Facility \tabularnewline + Coal:Facility & FuelOilNo1:Facility \tabularnewline + FuelOilNo2:Facility & Propane:Facility \tabularnewline + ElectricityProduced:Facility & DistrictHeatingSteam:Facility \tabularnewline + OtherFuel1:Facility & OtherFuel2:Facility \tabularnewline + \bottomrule \end{longtable} For the pollutant calculation only the total off-site or purchased electric energy is calculated using Electricity Factors. Off-Site Electricity = Electricity:Facility - ElectricityProduced:Facility, pollutants for the fuel type used by the on-site generator will be calculated, for example Diesel, in these cases. diff --git a/doc/readthedocs/requirements.txt b/doc/readthedocs/requirements.txt index 00bd730e07b..2bf22f5de9e 100644 --- a/doc/readthedocs/requirements.txt +++ b/doc/readthedocs/requirements.txt @@ -1,4 +1,4 @@ sphinx-rtd-theme sphinx>3 Jinja2<3.1 # cannot import name 'environmentfilter' from 'jinja2' -urllib3==1.26.15 +urllib3==1.26.18 diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 9620bbaff1e..6ab4644868e 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -198,7 +198,7 @@ namespace AirLoopHVACDOAS { int MixerNum = -1; for (auto &dSpec : state.dataAirLoopHVACDOAS->airloopMixer) { ++MixerNum; - if (UtilityRoutines::SameString(dSpec.name, objectName) && dSpec.m_AirLoopMixer_Num == object_num) { + if (Util::SameString(dSpec.name, objectName) && dSpec.m_AirLoopMixer_Num == object_num) { return &dSpec; } } @@ -226,8 +226,8 @@ namespace AirLoopHVACDOAS { ++AirLoopMixerNum; AirLoopMixer thisMixer; - thisMixer.name = UtilityRoutines::makeUPPER(thisObjectName); - thisMixer.OutletNodeName = UtilityRoutines::makeUPPER(fields.at("outlet_node_name").get()); + thisMixer.name = Util::makeUPPER(thisObjectName); + thisMixer.OutletNodeName = Util::makeUPPER(fields.at("outlet_node_name").get()); thisMixer.m_AirLoopMixer_Num = AirLoopMixerNum - 1; thisMixer.OutletNodeNum = NodeInputManager::GetOnlySingleNode(state, thisMixer.OutletNodeName, @@ -246,8 +246,8 @@ namespace AirLoopHVACDOAS { int num = 0; for (auto const &NodeDOASName : NodeArray) { num += 1; - std::string name = UtilityRoutines::makeUPPER(NodeDOASName.at("inlet_node_name").get()); - int NodeNum = UtilityRoutines::FindItemInList(name, state.dataLoopNodes->NodeID); + std::string name = Util::makeUPPER(NodeDOASName.at("inlet_node_name").get()); + int NodeNum = Util::FindItemInList(name, state.dataLoopNodes->NodeID); if (NodeNum > 0 && num <= thisMixer.numOfInletNodes) { thisMixer.InletNodeName.push_back(name); thisMixer.InletNodeNum.push_back(NodeNum); @@ -304,7 +304,7 @@ namespace AirLoopHVACDOAS { int index = -1; for (std::size_t loop = 0; loop < state.dataAirLoopHVACDOAS->airloopMixer.size(); ++loop) { AirLoopMixer *thisAirLoopMixerObjec = &state.dataAirLoopHVACDOAS->airloopMixer[loop]; - if (UtilityRoutines::SameString(objectName, thisAirLoopMixerObjec->name)) { + if (Util::SameString(objectName, thisAirLoopMixerObjec->name)) { index = loop; return index; } @@ -324,7 +324,7 @@ namespace AirLoopHVACDOAS { int SplitterNum = -1; for (auto &dSpec : state.dataAirLoopHVACDOAS->airloopSplitter) { SplitterNum++; - if (UtilityRoutines::SameString(dSpec.name, objectName) && dSpec.m_AirLoopSplitter_Num == object_num) { + if (Util::SameString(dSpec.name, objectName) && dSpec.m_AirLoopSplitter_Num == object_num) { return &dSpec; } } @@ -352,7 +352,7 @@ namespace AirLoopHVACDOAS { int index = -1; for (std::size_t loop = 0; loop < state.dataAirLoopHVACDOAS->airloopSplitter.size(); ++loop) { AirLoopSplitter *thisAirLoopSplitterObjec = &state.dataAirLoopHVACDOAS->airloopSplitter[loop]; - if (UtilityRoutines::SameString(objectName, thisAirLoopSplitterObjec->name)) { + if (Util::SameString(objectName, thisAirLoopSplitterObjec->name)) { index = loop; return index; } @@ -381,9 +381,9 @@ namespace AirLoopHVACDOAS { ++AirLoopSplitterNum; AirLoopSplitter thisSplitter; - thisSplitter.name = UtilityRoutines::makeUPPER(thisObjectName); - thisSplitter.InletNodeName = UtilityRoutines::makeUPPER(fields.at("inlet_node_name").get()); - thisSplitter.InletNodeNum = UtilityRoutines::FindItemInList(thisSplitter.InletNodeName, state.dataLoopNodes->NodeID); + thisSplitter.name = Util::makeUPPER(thisObjectName); + thisSplitter.InletNodeName = Util::makeUPPER(fields.at("inlet_node_name").get()); + thisSplitter.InletNodeNum = Util::FindItemInList(thisSplitter.InletNodeName, state.dataLoopNodes->NodeID); thisSplitter.m_AirLoopSplitter_Num = AirLoopSplitterNum - 1; auto NodeNames = fields.find("nodes"); @@ -393,8 +393,9 @@ namespace AirLoopHVACDOAS { int num = 0; for (auto const &NodeDOASName : NodeArray) { num += 1; - std::string name = UtilityRoutines::makeUPPER(NodeDOASName.at("outlet_node_name").get()); - int NodeNum = UtilityRoutines::FindItemInList(name, state.dataLoopNodes->NodeID); + + std::string name = Util::makeUPPER(NodeDOASName.at("outlet_node_name").get()); + int NodeNum = Util::FindItemInList(name, state.dataLoopNodes->NodeID); if (NodeNum > 0 && num <= thisSplitter.numOfOutletNodes) { thisSplitter.OutletNodeName.push_back(name); thisSplitter.OutletNodeNum.push_back(NodeNum); @@ -433,10 +434,11 @@ namespace AirLoopHVACDOAS { ++AirLoopDOASNum; AirLoopDOAS thisDOAS; - thisDOAS.Name = UtilityRoutines::makeUPPER(thisObjectName); + thisDOAS.Name = Util::makeUPPER(thisObjectName); // get OA and avail num - thisDOAS.OASystemName = UtilityRoutines::makeUPPER(fields.at("airloophvac_outdoorairsystem_name").get()); - thisDOAS.m_OASystemNum = UtilityRoutines::FindItemInList(thisDOAS.OASystemName, state.dataAirLoop->OutsideAirSys); + thisDOAS.OASystemName = Util::makeUPPER(fields.at("airloophvac_outdoorairsystem_name").get()); + thisDOAS.m_OASystemNum = Util::FindItemInList(thisDOAS.OASystemName, state.dataAirLoop->OutsideAirSys); + if (thisDOAS.m_OASystemNum == 0) { cFieldName = "AirLoopHVAC:OutdoorAirSystem Name"; ShowSevereError(state, @@ -447,7 +449,7 @@ namespace AirLoopHVACDOAS { std::string_view CurrentModuleObject = "AirLoopHVAC:OutdoorAirSystem"; auto &thisOutsideAirSys = state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum); for (int InListNum = 1; InListNum <= thisOutsideAirSys.NumControllers; ++InListNum) { - if (UtilityRoutines::SameString(thisOutsideAirSys.ControllerType(InListNum), "Controller:OutdoorAir")) { + if (Util::SameString(thisOutsideAirSys.ControllerType(InListNum), "Controller:OutdoorAir")) { ShowSevereError(state, format("When {} = {} is used in AirLoopHVAC:DedicatedOutdoorAirSystem,", CurrentModuleObject, @@ -468,7 +470,7 @@ namespace AirLoopHVACDOAS { bool InletNodeErrFlag = false; bool OutletNodeErrFlag = false; - const std::string typeNameUC = UtilityRoutines::makeUPPER(thisOutsideAirSys.ComponentType(CompNum)); + const std::string typeNameUC = Util::makeUPPER(thisOutsideAirSys.ComponentType(CompNum)); ValidEquipListType foundType = static_cast(getEnumValue(validEquipNamesUC, typeNameUC)); switch (foundType) { @@ -732,7 +734,7 @@ namespace AirLoopHVACDOAS { thisDOAS.m_HeatExchangerFlag = true; } - thisDOAS.AvailManagerSchedName = UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); + thisDOAS.AvailManagerSchedName = Util::makeUPPER(fields.at("availability_schedule_name").get()); thisDOAS.m_AvailManagerSchedPtr = ScheduleManager::GetScheduleIndex(state, thisDOAS.AvailManagerSchedName); if (thisDOAS.m_AvailManagerSchedPtr == 0) { cFieldName = "Availability Schedule Name"; @@ -742,7 +744,7 @@ namespace AirLoopHVACDOAS { errorsFound = true; } - thisDOAS.AirLoopMixerName = UtilityRoutines::makeUPPER(fields.at("airloophvac_mixer_name").get()); // + thisDOAS.AirLoopMixerName = Util::makeUPPER(fields.at("airloophvac_mixer_name").get()); // thisDOAS.m_AirLoopMixerIndex = getAirLoopMixerIndex(state, thisDOAS.AirLoopMixerName); if (thisDOAS.m_AirLoopMixerIndex < 0) { cFieldName = "AirLoopHVAC:Mixer Name"; @@ -752,7 +754,7 @@ namespace AirLoopHVACDOAS { } AirLoopMixer thisAirLoopMixer; thisDOAS.m_CompPointerAirLoopMixer = thisAirLoopMixer.factory(state, thisDOAS.m_AirLoopMixerIndex, thisDOAS.AirLoopMixerName); - thisDOAS.AirLoopSplitterName = UtilityRoutines::makeUPPER(fields.at("airloophvac_splitter_name").get()); // + thisDOAS.AirLoopSplitterName = Util::makeUPPER(fields.at("airloophvac_splitter_name").get()); // thisDOAS.m_AirLoopSplitterIndex = getAirLoopSplitterIndex(state, thisDOAS.AirLoopSplitterName); if (thisDOAS.m_AirLoopSplitterIndex < 0) { cFieldName = "AirLoopHVAC:Splitter Name"; @@ -785,8 +787,9 @@ namespace AirLoopHVACDOAS { auto const &AirLoopArray = AirLoopNames.value(); int num = 0; for (auto const &AirLoopHVACName : AirLoopArray) { - std::string name = UtilityRoutines::makeUPPER(AirLoopHVACName.at("airloophvac_name").get()); - int LoopNum = UtilityRoutines::FindItemInList(name, state.dataAirSystemsData->PrimaryAirSystems); + std::string name = Util::makeUPPER(AirLoopHVACName.at("airloophvac_name").get()); + int LoopNum = Util::FindItemInList(name, state.dataAirSystemsData->PrimaryAirSystems); + num += 1; if (LoopNum > 0 && num <= thisDOAS.NumOfAirLoops) { thisDOAS.AirLoopName.push_back(name); @@ -826,7 +829,7 @@ namespace AirLoopHVACDOAS { // Check valid OA controller for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; OASysNum++) { - if (UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerListName, "")) { + if (Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerListName, "")) { if (state.dataAirLoop->OutsideAirSys(OASysNum).AirLoopDOASNum == -1) { ShowSevereError(state, format("AirLoopHVAC:OutdoorAirSystem = \"{}\" invalid Controller List Name = \" not found.", @@ -854,14 +857,14 @@ namespace AirLoopHVACDOAS { for (int CompNum = 1; CompNum <= state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).NumComponents; ++CompNum) { std::string CompType = state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).ComponentType(CompNum); std::string CompName = state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).ComponentName(CompNum); - if (UtilityRoutines::SameString(CompType, "FAN:SYSTEMMODEL")) { + if (Util::SameString(CompType, "FAN:SYSTEMMODEL")) { state.dataHVACFan->fanObjs[this->m_FanIndex]->simulate(state); } - if (UtilityRoutines::SameString(CompType, "FAN:COMPONENTMODEL")) { + if (Util::SameString(CompType, "FAN:COMPONENTMODEL")) { Fans::SimulateFanComponents(state, CompName, FirstHVACIteration, this->m_FanIndex); } - if (UtilityRoutines::SameString(CompType, "COIL:HEATING:WATER")) { + if (Util::SameString(CompType, "COIL:HEATING:WATER")) { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_HeatCoilNum); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, @@ -875,7 +878,7 @@ namespace AirLoopHVACDOAS { this->HWCtrlNodeNum, state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).OutletNodeNum(CompNum)); } - if (UtilityRoutines::SameString(CompType, "COIL:COOLING:WATER")) { + if (Util::SameString(CompType, "COIL:COOLING:WATER")) { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, @@ -889,7 +892,7 @@ namespace AirLoopHVACDOAS { this->CWCtrlNodeNum, state.dataAirLoop->OutsideAirSys(this->m_OASystemNum).OutletNodeNum(CompNum)); } - if (UtilityRoutines::SameString(CompType, "COIL:COOLING:WATER:DETAILEDGEOMETRY")) { + if (Util::SameString(CompType, "COIL:COOLING:WATER:DETAILEDGEOMETRY")) { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound); @@ -999,23 +1002,23 @@ namespace AirLoopHVACDOAS { void AirLoopDOAS::GetDesignDayConditions(EnergyPlusData &state) { - for (auto &env : state.dataWeatherManager->Environment) { + for (auto &env : state.dataWeather->Environment) { if (env.KindOfEnvrn != Constant::KindOfSim::DesignDay && env.KindOfEnvrn != Constant::KindOfSim::RunPeriodDesign) continue; if (env.maxCoolingOATSizing > this->SizingCoolOATemp) { this->SizingCoolOATemp = env.maxCoolingOATSizing; // DesignDayNum = 0 for KindOfSim == RunPeriodDesign - if (env.KindOfEnvrn == Constant::KindOfSim::DesignDay && state.dataWeatherManager->DesDayInput(env.DesignDayNum).PressureEntered) { - this->SizingCoolOAHumRat = Psychrometrics::PsyWFnTdpPb( - state, env.maxCoolingOADPSizing, state.dataWeatherManager->DesDayInput(env.DesignDayNum).PressBarom); + if (env.KindOfEnvrn == Constant::KindOfSim::DesignDay && state.dataWeather->DesDayInput(env.DesignDayNum).PressureEntered) { + this->SizingCoolOAHumRat = + Psychrometrics::PsyWFnTdpPb(state, env.maxCoolingOADPSizing, state.dataWeather->DesDayInput(env.DesignDayNum).PressBarom); } else { this->SizingCoolOAHumRat = Psychrometrics::PsyWFnTdpPb(state, env.maxCoolingOADPSizing, state.dataEnvrn->StdBaroPress); } } if (env.minHeatingOATSizing < this->HeatOutTemp) { this->HeatOutTemp = env.minHeatingOATSizing; - if (env.KindOfEnvrn == Constant::KindOfSim::DesignDay && state.dataWeatherManager->DesDayInput(env.DesignDayNum).PressureEntered) { - this->HeatOutHumRat = Psychrometrics::PsyWFnTdpPb( - state, env.minHeatingOADPSizing, state.dataWeatherManager->DesDayInput(env.DesignDayNum).PressBarom); + if (env.KindOfEnvrn == Constant::KindOfSim::DesignDay && state.dataWeather->DesDayInput(env.DesignDayNum).PressureEntered) { + this->HeatOutHumRat = + Psychrometrics::PsyWFnTdpPb(state, env.minHeatingOADPSizing, state.dataWeather->DesDayInput(env.DesignDayNum).PressBarom); } else { this->HeatOutHumRat = Psychrometrics::PsyWFnTdpPb(state, env.minHeatingOADPSizing, state.dataEnvrn->StdBaroPress); } diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp index 3e2b0d4b46f..e3c1b5f51af 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp @@ -58,7 +58,7 @@ #define AIRDYNAMICVISCOSITY_CONSTEXPR(T) air_dynamic_viscosity(T) #ifndef TOKELVIN #include "../../../DataGlobals.hh" -#define TOKELVIN(T) (T + Constant::KelvinConv) +#define TOKELVIN(T) (T + Constant::Kelvin) #endif namespace EnergyPlus { diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 8600016ba53..b05a1169f87 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -343,7 +343,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); Real64 temperature(20.0); if (fields.find("reference_temperature") != fields.end()) { // required field, has default value temperature = fields.at("reference_temperature").get(); @@ -403,7 +403,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_at_reference_conditions")}; // Required field @@ -417,7 +417,8 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); + auto result = referenceConditions.find(Util::makeUPPER(refCrackCondName)); + if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -461,7 +462,8 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); + m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_the_zone_exhaust_fan_is_off_at_reference_conditions")}; // Required field @@ -506,7 +508,7 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); + auto result = referenceConditions.find(Util::makeUPPER(refCrackCondName)); if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -562,10 +564,10 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround - std::string mixer_name = UtilityRoutines::makeUPPER(fields.at("outdoor_air_mixer_name").get()); + std::string mixer_name = Util::makeUPPER(fields.at("outdoor_air_mixer_name").get()); Real64 coeff{fields.at("air_mass_flow_coefficient_when_no_outdoor_air_flow_at_reference_conditions")}; Real64 expnt{0.65}; if (fields.find("air_mass_flow_exponent_when_no_outdoor_air_flow") != fields.end()) { @@ -589,7 +591,7 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); + auto result = referenceConditions.find(Util::makeUPPER(refCrackCondName)); if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -643,10 +645,10 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround - std::string mixer_name = UtilityRoutines::makeUPPER(fields.at("outdoor_air_mixer_name").get()); + std::string mixer_name = Util::makeUPPER(fields.at("outdoor_air_mixer_name").get()); Real64 coeff{fields.at("air_mass_flow_coefficient_when_no_outdoor_air_flow_at_reference_conditions")}; Real64 expnt{0.65}; if (fields.find("air_mass_flow_exponent_when_no_outdoor_air_flow") != fields.end()) { @@ -667,7 +669,7 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); + auto result = referenceConditions.find(Util::makeUPPER(refCrackCondName)); if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -720,7 +722,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")}; @@ -733,9 +735,9 @@ namespace AirflowNetwork { std::string LVOstring; if (fields.find("type_of_rectangular_large_vertical_opening_lvo_") != fields.end()) { LVOstring = fields.at("type_of_rectangular_large_vertical_opening_lvo_").get(); - if (UtilityRoutines::SameString(LVOstring, "NonPivoted") || UtilityRoutines::SameString(LVOstring, "1")) { + if (Util::SameString(LVOstring, "NonPivoted") || Util::SameString(LVOstring, "1")) { LVOtype = 1; // Large vertical opening type number - } else if (UtilityRoutines::SameString(LVOstring, "HorizontallyPivoted") || UtilityRoutines::SameString(LVOstring, "2")) { + } else if (Util::SameString(LVOstring, "HorizontallyPivoted") || Util::SameString(LVOstring, "2")) { LVOtype = 2; // Large vertical opening type number } else { // Code will never be executed, validation will catch invalid input @@ -1003,7 +1005,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")}; @@ -1046,7 +1048,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")}; @@ -1092,7 +1094,8 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); + m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 ela{fields.at("effective_leakage_area")}; @@ -1144,7 +1147,8 @@ namespace AirflowNetwork { instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); + m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 flow_rate{fields.at("air_flow_value")}; @@ -1193,7 +1197,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient")}; @@ -1231,7 +1235,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 elr{fields.at("effective_leakage_ratio")}; @@ -1273,7 +1277,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 L{fields.at("duct_length")}; @@ -1358,10 +1362,10 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround - std::string fan_name = UtilityRoutines::makeUPPER(fields.at("fan_name").get()); + std::string fan_name = Util::makeUPPER(fields.at("fan_name").get()); std::string fan_type = fields.at("supply_fan_object_type").get(); int fanIndex; @@ -1370,7 +1374,7 @@ namespace AirflowNetwork { int inletNode; int outletNode; - if (UtilityRoutines::SameString(UtilityRoutines::makeUPPER(fan_type), "FAN:SYSTEMMODEL")) { + if (Util::SameString(Util::makeUPPER(fan_type), "FAN:SYSTEMMODEL")) { m_state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(m_state, fan_name)); fanIndex = HVACFan::getFanObjectVectorIndex(m_state, fan_name); if (fanIndex < 0) { @@ -1415,12 +1419,12 @@ namespace AirflowNetwork { ShowContinueError(m_state, "Valid fan types are Fan:ConstantVolume, Fan:OnOff, Fan:VariableVolume, or Fan:SystemModel."); success = false; } else { - if (UtilityRoutines::SameString(fan_type, "Fan:ConstantVolume") && fanType_Num == FanType_SimpleOnOff) { + if (Util::SameString(fan_type, "Fan:ConstantVolume") && fanType_Num == FanType_SimpleOnOff) { ShowSevereError(m_state, "The Supply Fan Object Type defined in " + CurrentModuleObject + " is " + fan_type); ShowContinueError(m_state, "The Supply Fan Object Type defined in an AirLoopHVAC is Fan:OnOff"); success = false; } - if (UtilityRoutines::SameString(fan_type, "Fan:OnOff") && fanType_Num == FanType_SimpleConstVolume) { + if (Util::SameString(fan_type, "Fan:OnOff") && fanType_Num == FanType_SimpleConstVolume) { ShowSevereError(m_state, "The Supply Fan Object Type defined in " + CurrentModuleObject + " is " + fan_type); ShowContinueError(m_state, "The Supply Fan Object Type defined in an AirLoopHVAC is Fan:ConstantVolume"); success = false; @@ -1477,7 +1481,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + // auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround std::string coil_name = fields.at("coil_name").get(); @@ -1485,10 +1489,10 @@ namespace AirflowNetwork { Real64 L{fields.at("air_path_length")}; Real64 D{fields.at("air_path_hydraulic_diameter")}; - DisSysCompCoilData(i).name = UtilityRoutines::makeUPPER(coil_name); // Name of associated EPlus coil component - DisSysCompCoilData(i).EPlusType = coil_type; // coil type - DisSysCompCoilData(i).L = L; // Air path length - DisSysCompCoilData(i).hydraulicDiameter = D; // Air path hydraulic diameter + DisSysCompCoilData(i).name = Util::makeUPPER(coil_name); // Name of associated EPlus coil component + DisSysCompCoilData(i).EPlusType = coil_type; // coil type + DisSysCompCoilData(i).L = L; // Air path length + DisSysCompCoilData(i).hydraulicDiameter = D; // Air path hydraulic diameter // Add the element to the lookup table, check for name overlaps if (elements.find(DisSysCompCoilData(i).name) == elements.end()) { @@ -1517,7 +1521,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + // auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround std::string hx_name = fields.at("heatexchanger_name").get(); @@ -1525,10 +1529,10 @@ namespace AirflowNetwork { Real64 L{fields.at("air_path_length")}; Real64 D{fields.at("air_path_hydraulic_diameter")}; - DisSysCompHXData(i).name = UtilityRoutines::makeUPPER(hx_name); // Name of associated EPlus heat exchange component - DisSysCompHXData(i).EPlusType = hx_type; // coil type - DisSysCompHXData(i).L = L; // Air path length - DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter + DisSysCompHXData(i).name = Util::makeUPPER(hx_name); // Name of associated EPlus heat exchange component + DisSysCompHXData(i).EPlusType = hx_type; // coil type + DisSysCompHXData(i).L = L; // Air path length + DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter DisSysCompHXData(i).CoilParentExists = HVACHXAssistedCoolingCoil::VerifyHeatExchangerParent(m_state, hx_type, hx_name); // Add the element to the lookup table, check for name overlaps @@ -1557,7 +1561,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + // auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround std::string tu_name = fields.at("terminal_unit_name").get(); @@ -1565,10 +1569,10 @@ namespace AirflowNetwork { Real64 L{fields.at("air_path_length")}; Real64 D{fields.at("air_path_hydraulic_diameter")}; - DisSysCompTermUnitData(i).name = UtilityRoutines::makeUPPER(tu_name); // Name of associated EPlus coil component - DisSysCompTermUnitData(i).EPlusType = tu_type; // Terminal unit type - DisSysCompTermUnitData(i).L = L; // Air path length - DisSysCompTermUnitData(i).hydraulicDiameter = D; // Air path hydraulic diameter + DisSysCompTermUnitData(i).name = Util::makeUPPER(tu_name); // Name of associated EPlus coil component + DisSysCompTermUnitData(i).EPlusType = tu_type; // Terminal unit type + DisSysCompTermUnitData(i).L = L; // Air path length + DisSysCompTermUnitData(i).hydraulicDiameter = D; // Air path hydraulic diameter // Add the element to the lookup table, check for name overlaps if (elements.find(DisSysCompTermUnitData(i).name) == elements.end()) { @@ -1597,7 +1601,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 dp{fields.at("pressure_difference_across_the_component")}; @@ -1878,9 +1882,9 @@ namespace AirflowNetwork { } } if (!lAlphaBlanks(4)) { - if (UtilityRoutines::SameString(Alphas(4), "Yes")) { + if (Util::SameString(Alphas(4), "Yes")) { OccupantVentilationControl(i).OccupancyCheck = true; - } else if (UtilityRoutines::SameString(Alphas(4), "No")) { + } else if (Util::SameString(Alphas(4), "No")) { OccupantVentilationControl(i).OccupancyCheck = false; } else { // Code will never be executed, validation will catch invalid input @@ -1979,14 +1983,14 @@ namespace AirflowNetwork { // Retrieve flag allowing the support of zone equipment simulation_control.allow_unsupported_zone_equipment = false; - if (UtilityRoutines::SameString(Alphas(9), "Yes")) { + if (Util::SameString(Alphas(9), "Yes")) { simulation_control.allow_unsupported_zone_equipment = true; } // Find a flag for possible combination of vent and distribution system // This SELECT_CASE_var will go on input refactor, no need to fix { - auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(Alphas(2))); + auto const SELECT_CASE_var(Util::makeUPPER(Alphas(2))); if (SELECT_CASE_var == "NOMULTIZONEORDISTRIBUTION") { simulation_control.type = ControlType::NoMultizoneOrDistribution; SimAirNetworkKey = "NoMultizoneOrDistribution"; @@ -2108,7 +2112,7 @@ namespace AirflowNetwork { SetOutAirNodes(m_state); if (!control_defaulted) { bool SimObjectError = false; - if (UtilityRoutines::SameString(simulation_control.WPCCntr, "Input")) { + if (Util::SameString(simulation_control.WPCCntr, "Input")) { simulation_control.iWPCCnt = iWPCCntr::Input; if (lAlphaBlanks(4)) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " object, " + cAlphaFields(3) + " = INPUT."); @@ -2116,8 +2120,8 @@ namespace AirflowNetwork { ErrorsFound = true; SimObjectError = true; } else { - if (!(UtilityRoutines::SameString(simulation_control.HeightOption, "ExternalNode") || - UtilityRoutines::SameString(simulation_control.HeightOption, "OpeningHeight"))) { + if (!(Util::SameString(simulation_control.HeightOption, "ExternalNode") || + Util::SameString(simulation_control.HeightOption, "OpeningHeight"))) { ShowSevereError( m_state, format(RoutineName) + CurrentModuleObject + " object, " + cAlphaFields(4) + " = " + Alphas(4) + " is invalid."); ShowContinueError(m_state, @@ -2127,10 +2131,9 @@ namespace AirflowNetwork { SimObjectError = true; } } - } else if (UtilityRoutines::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { + } else if (Util::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { simulation_control.iWPCCnt = iWPCCntr::SurfAvg; - if (!(UtilityRoutines::SameString(simulation_control.BldgType, "LowRise") || - UtilityRoutines::SameString(simulation_control.BldgType, "HighRise"))) { + if (!(Util::SameString(simulation_control.BldgType, "LowRise") || Util::SameString(simulation_control.BldgType, "HighRise"))) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " object, " + cAlphaFields(5) + " = " + Alphas(5) + " is invalid."); ShowContinueError(m_state, @@ -2162,13 +2165,13 @@ namespace AirflowNetwork { } simulation_control.InitType = Alphas(6); - if (UtilityRoutines::SameString(simulation_control.InitType, "LinearInitializationMethod")) { + if (Util::SameString(simulation_control.InitType, "LinearInitializationMethod")) { simulation_control.InitFlag = 0; - } else if (UtilityRoutines::SameString(simulation_control.InitType, "ZeroNodePressures")) { + } else if (Util::SameString(simulation_control.InitType, "ZeroNodePressures")) { simulation_control.InitFlag = 1; - } else if (UtilityRoutines::SameString(simulation_control.InitType, "0")) { + } else if (Util::SameString(simulation_control.InitType, "0")) { simulation_control.InitFlag = 0; - } else if (UtilityRoutines::SameString(simulation_control.InitType, "1")) { + } else if (Util::SameString(simulation_control.InitType, "1")) { simulation_control.InitFlag = 1; } else { // Code will never be executed, validation will catch invalid input @@ -2181,13 +2184,13 @@ namespace AirflowNetwork { SimObjectError = true; } - if (!lAlphaBlanks(7) && UtilityRoutines::SameString(Alphas(7), "Yes")) simulation_control.temperature_height_dependence = true; + if (!lAlphaBlanks(7) && Util::SameString(Alphas(7), "Yes")) simulation_control.temperature_height_dependence = true; if (lAlphaBlanks(8)) { simulation_control.solver = SimulationControl::Solver::SkylineLU; - } else if (UtilityRoutines::SameString(Alphas(8), "SkylineLU")) { + } else if (Util::SameString(Alphas(8), "SkylineLU")) { simulation_control.solver = SimulationControl::Solver::SkylineLU; - } else if (UtilityRoutines::SameString(Alphas(8), "ConjugateGradient")) { + } else if (Util::SameString(Alphas(8), "ConjugateGradient")) { simulation_control.solver = SimulationControl::Solver::ConjugateGradient; } else { simulation_control.solver = SimulationControl::Solver::SkylineLU; @@ -2199,7 +2202,7 @@ namespace AirflowNetwork { // Get inputs for duct sizing simulation_control.autosize_ducts = false; if (NumAlphas == 10) { - if (UtilityRoutines::SameString(Alphas(10), "YES")) { + if (Util::SameString(Alphas(10), "YES")) { simulation_control.autosize_ducts = true; if (simulation_control.type == ControlType::MultizoneWithDistribution) { if (NumAPL > 1) { @@ -2264,11 +2267,11 @@ namespace AirflowNetwork { cNumericFields); simulation_control.ductSizing.name = Alphas(1); - if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("MaximumVelocity"))) { + if (Util::SameString(Alphas(2), Util::makeUPPER("MaximumVelocity"))) { simulation_control.ductSizing.method = DuctSizingMethod::MaxVelocity; - } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("PressureLoss"))) { + } else if (Util::SameString(Alphas(2), Util::makeUPPER("PressureLoss"))) { simulation_control.ductSizing.method = DuctSizingMethod::PressureLoss; - } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("PressureLossWithMaximumVelocity"))) { + } else if (Util::SameString(Alphas(2), Util::makeUPPER("PressureLossWithMaximumVelocity"))) { simulation_control.ductSizing.method = DuctSizingMethod::VelocityAndLoss; } else { ShowSevereError(m_state, format("{} {} object, {} = {} is invalid.", RoutineName, CurrentModuleObject, cAlphaFields(2), Alphas(2))); @@ -2338,7 +2341,7 @@ namespace AirflowNetwork { if (!lAlphaBlanks(6)) { MultizoneZoneData(i).OccupantVentilationControlName = Alphas(6); MultizoneZoneData(i).OccupantVentilationControlNum = - UtilityRoutines::FindItemInList(MultizoneZoneData(i).OccupantVentilationControlName, OccupantVentilationControl); + Util::FindItemInList(MultizoneZoneData(i).OccupantVentilationControlName, OccupantVentilationControl); if (MultizoneZoneData(i).OccupantVentilationControlNum == 0) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " object, " + cAlphaFields(6) + @@ -2347,18 +2350,13 @@ namespace AirflowNetwork { ErrorsFound = true; } } - if (UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "Temperature")) - MultizoneZoneData(i).VentCtrNum = VentControlType::Temp; - if (UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "Enthalpy")) - MultizoneZoneData(i).VentCtrNum = VentControlType::Enth; - if (UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "Constant")) - MultizoneZoneData(i).VentCtrNum = VentControlType::Const; - if (UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "ASHRAE55Adaptive")) - MultizoneZoneData(i).VentCtrNum = VentControlType::ASH55; - if (UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "CEN15251Adaptive")) + if (Util::SameString(MultizoneZoneData(i).VentControl, "Temperature")) MultizoneZoneData(i).VentCtrNum = VentControlType::Temp; + if (Util::SameString(MultizoneZoneData(i).VentControl, "Enthalpy")) MultizoneZoneData(i).VentCtrNum = VentControlType::Enth; + if (Util::SameString(MultizoneZoneData(i).VentControl, "Constant")) MultizoneZoneData(i).VentCtrNum = VentControlType::Const; + if (Util::SameString(MultizoneZoneData(i).VentControl, "ASHRAE55Adaptive")) MultizoneZoneData(i).VentCtrNum = VentControlType::ASH55; + if (Util::SameString(MultizoneZoneData(i).VentControl, "CEN15251Adaptive")) MultizoneZoneData(i).VentCtrNum = VentControlType::CEN15251; - if (UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "NoVent")) - MultizoneZoneData(i).VentCtrNum = VentControlType::NoVent; + if (Util::SameString(MultizoneZoneData(i).VentControl, "NoVent")) MultizoneZoneData(i).VentCtrNum = VentControlType::NoVent; if (MultizoneZoneData(i).VentCtrNum < NumOfVentCtrTypes) { if (NumAlphas >= 4 && (!lAlphaBlanks(4))) { @@ -2388,7 +2386,7 @@ namespace AirflowNetwork { // ==> Zone data validation for (int i = 1; i <= AirflowNetworkNumOfZones; ++i) { // Zone name validation - MultizoneZoneData(i).ZoneNum = UtilityRoutines::FindItemInList(MultizoneZoneData(i).ZoneName, Zone); + MultizoneZoneData(i).ZoneNum = Util::FindItemInList(MultizoneZoneData(i).ZoneName, Zone); if (MultizoneZoneData(i).ZoneNum == 0) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " object, invalid " + cAlphaFields(1) + " given."); ShowContinueError(m_state, "..invalid " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName + "\""); @@ -2405,11 +2403,10 @@ namespace AirflowNetwork { ShowContinueError(m_state, ".. in " + cAlphaFields(1) + " = \"" + MultizoneZoneData(i).ZoneName + "\""); ErrorsFound = true; } - if (UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "Temperature") || - UtilityRoutines::SameString(MultizoneZoneData(i).VentControl, "Enthalpy")) { + if (Util::SameString(MultizoneZoneData(i).VentControl, "Temperature") || Util::SameString(MultizoneZoneData(i).VentControl, "Enthalpy")) { // .or. & - // UtilityRoutines::SameString(MultizoneZoneData(i)%VentControl,'ASHRAE55Adaptive') .or. & - // UtilityRoutines::SameString(MultizoneZoneData(i)%VentControl,'CEN15251Adaptive')) then + // Util::SameString(MultizoneZoneData(i)%VentControl,'ASHRAE55Adaptive') .or. & + // Util::SameString(MultizoneZoneData(i)%VentControl,'CEN15251Adaptive')) then MultizoneZoneData(i).VentSchNum = GetScheduleIndex(m_state, MultizoneZoneData(i).VentSchName); if (MultizoneZoneData(i).VentSchName == std::string()) { ShowSevereError(m_state, @@ -2452,7 +2449,7 @@ namespace AirflowNetwork { { // These SELECT_CASE_vars will go on input refactor, no need to fix - auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(MultizoneZoneData(i).VentControl)); + auto const SELECT_CASE_var(Util::makeUPPER(MultizoneZoneData(i).VentControl)); if (SELECT_CASE_var == "TEMPERATURE") { // checks on Temperature control if (MultizoneZoneData(i).LowValueTemp < 0.0) { // Code will never be executed, validation will catch invalid input @@ -2564,7 +2561,7 @@ namespace AirflowNetwork { cNumericFields); MultizoneExternalNodeData(i).Name = Alphas(1); // Name of external node MultizoneExternalNodeData(i).height = Numbers(1); // Nodal height - if (UtilityRoutines::SameString(simulation_control.HeightOption, "ExternalNode") && lNumericBlanks(1)) { + if (Util::SameString(simulation_control.HeightOption, "ExternalNode") && lNumericBlanks(1)) { ShowWarningError(m_state, format(RoutineName) + CurrentModuleObject + " object =" + Alphas(1) + ". The input of " + cNumericFields(1) + " is required, but a blank is found."); @@ -2578,18 +2575,18 @@ namespace AirflowNetwork { ErrorsFound = true; } if (NumAlphas >= 3 && !lAlphaBlanks(3)) { // Symmetric curve - if (UtilityRoutines::SameString(Alphas(3), "Yes")) { + if (Util::SameString(Alphas(3), "Yes")) { MultizoneExternalNodeData(i).symmetricCurve = true; - } else if (!UtilityRoutines::SameString(Alphas(3), "No")) { + } else if (!Util::SameString(Alphas(3), "No")) { ShowWarningError( m_state, format(RoutineName) + CurrentModuleObject + " object, Invalid input " + cAlphaFields(3) + " = " + Alphas(3)); ShowContinueError(m_state, "The default value is assigned as No."); } } if (NumAlphas == 4 && !lAlphaBlanks(4)) { // Relative or absolute wind angle - if (UtilityRoutines::SameString(Alphas(4), "Relative")) { + if (Util::SameString(Alphas(4), "Relative")) { MultizoneExternalNodeData(i).useRelativeAngle = true; - } else if (!UtilityRoutines::SameString(Alphas(4), "Absolute")) { + } else if (!Util::SameString(Alphas(4), "Absolute")) { // Code will never be executed, validation will catch invalid input ShowWarningError( m_state, format(RoutineName) + CurrentModuleObject + " object, Invalid input " + cAlphaFields(4) + " = " + Alphas(4)); @@ -2625,9 +2622,9 @@ namespace AirflowNetwork { } if (NumAlphas > 6 && !lAlphaBlanks(7)) { // Symmetric curve - if (UtilityRoutines::SameString(Alphas(7), "Yes")) { + if (Util::SameString(Alphas(7), "Yes")) { MultizoneExternalNodeData(i).symmetricCurve = true; - } else if (!UtilityRoutines::SameString(Alphas(7), "No")) { + } else if (!Util::SameString(Alphas(7), "No")) { ShowWarningError(m_state, format(RoutineName) + CurrentModuleObject + " object, Invalid input " + cAlphaFields(7) + " = " + Alphas(7)); @@ -2636,9 +2633,9 @@ namespace AirflowNetwork { } if (NumAlphas > 7 && !lAlphaBlanks(8)) { // Relative or absolute wind angle - if (UtilityRoutines::SameString(Alphas(8), "Relative")) { + if (Util::SameString(Alphas(8), "Relative")) { MultizoneExternalNodeData(i).useRelativeAngle = true; - } else if (!UtilityRoutines::SameString(Alphas(8), "Absolute")) { + } else if (!Util::SameString(Alphas(8), "Absolute")) { ShowWarningError(m_state, format(RoutineName) + CurrentModuleObject + " object, Invalid input " + cAlphaFields(8) + " = " + Alphas(8)); @@ -2694,8 +2691,8 @@ namespace AirflowNetwork { MultizoneSurfaceData(i).OpeningName = Alphas(2); // Name of crack or opening component, // either simple or detailed large opening, or crack MultizoneSurfaceData(i).ExternalNodeName = Alphas(3); // Name of external node, but not used at WPC="INPUT" - if (UtilityRoutines::FindItemInList(Alphas(3), MultizoneExternalNodeData) && - m_state.afn->MultizoneExternalNodeData(UtilityRoutines::FindItemInList(Alphas(3), MultizoneExternalNodeData)).curve == 0) { + if (Util::FindItemInList(Alphas(3), MultizoneExternalNodeData) && + m_state.afn->MultizoneExternalNodeData(Util::FindItemInList(Alphas(3), MultizoneExternalNodeData)).curve == 0) { ShowSevereError(m_state, format(RoutineName) + "Invalid " + cAlphaFields(3) + "=" + Alphas(3)); ShowContinueError(m_state, "A valid wind pressure coefficient curve name is required but not found when Wind Pressure " @@ -2720,7 +2717,7 @@ namespace AirflowNetwork { if (!lAlphaBlanks(5)) MultizoneSurfaceData(i).VentSchName = Alphas(5); { // This SELECT_CASE_var will go on input refactor, no need to fix - auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(MultizoneSurfaceData(i).VentControl)); + auto const SELECT_CASE_var(Util::makeUPPER(MultizoneSurfaceData(i).VentControl)); if (SELECT_CASE_var == "TEMPERATURE") { MultizoneSurfaceData(i).VentSurfCtrNum = VentControlType::Temp; MultizoneSurfaceData(i).IndVentControl = true; @@ -2774,7 +2771,7 @@ namespace AirflowNetwork { if (!lAlphaBlanks(7)) { MultizoneSurfaceData(i).OccupantVentilationControlName = Alphas(7); MultizoneSurfaceData(i).OccupantVentilationControlNum = - UtilityRoutines::FindItemInList(MultizoneSurfaceData(i).OccupantVentilationControlName, OccupantVentilationControl); + Util::FindItemInList(MultizoneSurfaceData(i).OccupantVentilationControlName, OccupantVentilationControl); if (MultizoneSurfaceData(i).OccupantVentilationControlNum == 0) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " object, " + cAlphaFields(7) + @@ -2819,7 +2816,7 @@ namespace AirflowNetwork { for (int i = AirflowNetworkNumOfExtNode - AirflowNetworkNumOfOutAirNode + 1; i <= AirflowNetworkNumOfExtNode; ++i) { found = false; for (int j = 1; j <= AirflowNetworkNumOfSurfaces; ++j) { - if (UtilityRoutines::SameString(MultizoneSurfaceData(j).ExternalNodeName, MultizoneExternalNodeData(i).Name)) { + if (Util::SameString(MultizoneSurfaceData(j).ExternalNodeName, MultizoneExternalNodeData(i).Name)) { found = true; } } @@ -2844,7 +2841,7 @@ namespace AirflowNetwork { NumOfExtNodes = 0; for (int i = 1; i <= AirflowNetworkNumOfSurfaces; ++i) { // Check a valid surface defined earlier - MultizoneSurfaceData(i).SurfNum = UtilityRoutines::FindItemInList(MultizoneSurfaceData(i).SurfName, m_state.dataSurface->Surface); + MultizoneSurfaceData(i).SurfNum = Util::FindItemInList(MultizoneSurfaceData(i).SurfName, m_state.dataSurface->Surface); if (MultizoneSurfaceData(i).SurfNum == 0) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " object, Invalid " + cAlphaFields(1) + @@ -3037,7 +3034,7 @@ namespace AirflowNetwork { if (AirflowNetworkNumOfExtNode > 0) { found = false; for (j = 1; j <= AirflowNetworkNumOfExtNode; ++j) { - if (UtilityRoutines::SameString(MultizoneSurfaceData(i).ExternalNodeName, MultizoneExternalNodeData(j).Name)) { + if (Util::SameString(MultizoneSurfaceData(i).ExternalNodeName, MultizoneExternalNodeData(j).Name)) { MultizoneSurfaceData(i).NodeNums[1] = MultizoneExternalNodeData(j).ExtNum; found = true; break; @@ -3087,7 +3084,7 @@ namespace AirflowNetwork { continue; } } - if (UtilityRoutines::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { + if (Util::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { n = m_state.dataSurface->Surface(MultizoneSurfaceData(i).SurfNum).ExtBoundCond; if (n >= 1) { // exterior boundary condition is a surface found = false; @@ -3166,7 +3163,7 @@ namespace AirflowNetwork { } // Ensure the number of external node = the number of external surface with HeightOption choice = OpeningHeight - if (UtilityRoutines::SameString(simulation_control.HeightOption, "OpeningHeight") && simulation_control.iWPCCnt == iWPCCntr::Input) { + if (Util::SameString(simulation_control.HeightOption, "OpeningHeight") && simulation_control.iWPCCnt == iWPCCntr::Input) { if (AirflowNetworkNumOfExtSurfaces != AirflowNetworkNumOfExtNode) { ShowSevereError(m_state, format(RoutineName) + @@ -3369,7 +3366,7 @@ namespace AirflowNetwork { } // Calculate CP values - if (UtilityRoutines::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { + if (Util::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { calculate_Cps(); // Ensure automatic generation is OK n = 0; @@ -3407,14 +3404,14 @@ namespace AirflowNetwork { } // Assign external node height - if (UtilityRoutines::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation") || - UtilityRoutines::SameString(simulation_control.HeightOption, "OpeningHeight")) { + if (Util::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation") || + Util::SameString(simulation_control.HeightOption, "OpeningHeight")) { for (int i = 1; i <= AirflowNetworkNumOfExtNode; ++i) { for (int j = 1; j <= AirflowNetworkNumOfSurfaces; ++j) { if (m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).ExtBoundCond == ExternalEnvironment || (m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt && m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).ExtWind)) { - if (UtilityRoutines::SameString(MultizoneSurfaceData(j).ExternalNodeName, MultizoneExternalNodeData(i).Name)) { + if (Util::SameString(MultizoneSurfaceData(j).ExternalNodeName, MultizoneExternalNodeData(i).Name)) { MultizoneExternalNodeData(i).height = m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).Centroid.z; break; } @@ -3429,7 +3426,7 @@ namespace AirflowNetwork { if (m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).ExtBoundCond == ExternalEnvironment || (m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt && m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).ExtWind)) { - if (UtilityRoutines::SameString(MultizoneSurfaceData(j).ExternalNodeName, MultizoneExternalNodeData(i).Name)) { + if (Util::SameString(MultizoneSurfaceData(j).ExternalNodeName, MultizoneExternalNodeData(i).Name)) { MultizoneExternalNodeData(i).azimuth = m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).Azimuth; break; } @@ -3631,7 +3628,7 @@ namespace AirflowNetwork { ErrorsFound = true; } IntraZoneNodeData(i).AFNZoneNum = - UtilityRoutines::FindItemInList(Alphas(3), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); + Util::FindItemInList(Alphas(3), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); if (MultizoneZoneData(IntraZoneNodeData(i).AFNZoneNum).RAFNNodeNum == 0) { GetRAFNNodeNum(m_state, MultizoneZoneData(IntraZoneNodeData(i).AFNZoneNum).ZoneName, @@ -3650,7 +3647,7 @@ namespace AirflowNetwork { // check model compatibility if (IntraZoneNumOfNodes > 0) { - if (!UtilityRoutines::SameString(SimAirNetworkKey, "MultizoneWithoutDistribution")) { + if (!Util::SameString(SimAirNetworkKey, "MultizoneWithoutDistribution")) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " model requires Simulation Control = MultizoneWithoutDistribution, while the input choice is " + @@ -3702,8 +3699,8 @@ namespace AirflowNetwork { // Perform simple test first.The comprehensive input validation will occur later // Check valid surface name IntraZoneLinkageData(i).SurfaceName = Alphas(5); - IntraZoneLinkageData(i).LinkNum = UtilityRoutines::FindItemInList( - Alphas(5), MultizoneSurfaceData, &MultizoneSurfaceProp::SurfName, AirflowNetworkNumOfSurfaces); + IntraZoneLinkageData(i).LinkNum = + Util::FindItemInList(Alphas(5), MultizoneSurfaceData, &MultizoneSurfaceProp::SurfName, AirflowNetworkNumOfSurfaces); if (IntraZoneLinkageData(i).LinkNum == 0) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + "='" + Alphas(1) + "': Invalid " + cAlphaFields(5) + @@ -3713,17 +3710,17 @@ namespace AirflowNetwork { GlobalNames::VerifyUniqueInterObjectName( m_state, UniqueAirflowNetworkSurfaceName, Alphas(5), CurrentModuleObject, cAlphaFields(5), ErrorsFound); } - if (UtilityRoutines::SameString(Alphas(2), Alphas(3))) { + if (Util::SameString(Alphas(2), Alphas(3))) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + "='" + Alphas(1) + "': Invalid inputs of both node name with " + Alphas(2) + " = " + Alphas(3)); ErrorsFound = true; } // Check valid node names - IntraZoneLinkageData(i).NodeNums[0] = UtilityRoutines::FindItemInList(Alphas(2), IntraZoneNodeData, IntraZoneNumOfNodes); + IntraZoneLinkageData(i).NodeNums[0] = Util::FindItemInList(Alphas(2), IntraZoneNodeData, IntraZoneNumOfNodes); if (IntraZoneLinkageData(i).NodeNums[0] == 0) { IntraZoneLinkageData(i).NodeNums[0] = - UtilityRoutines::FindItemInList(Alphas(2), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); + Util::FindItemInList(Alphas(2), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); IntraZoneLinkageData(i).NodeHeights[0] = Zone(MultizoneZoneData(IntraZoneLinkageData(i).NodeNums[0]).ZoneNum).Centroid.z; if (IntraZoneLinkageData(i).NodeNums[0] == 0) { ShowSevereError(m_state, @@ -3735,10 +3732,10 @@ namespace AirflowNetwork { IntraZoneLinkageData(i).NodeHeights[0] = IntraZoneNodeData(IntraZoneLinkageData(i).NodeNums[0]).Height; IntraZoneLinkageData(i).NodeNums[0] = IntraZoneLinkageData(i).NodeNums[0] + AirflowNetworkNumOfZones + AirflowNetworkNumOfExtNode; } - IntraZoneLinkageData(i).NodeNums[1] = UtilityRoutines::FindItemInList(Alphas(3), IntraZoneNodeData, IntraZoneNumOfNodes); + IntraZoneLinkageData(i).NodeNums[1] = Util::FindItemInList(Alphas(3), IntraZoneNodeData, IntraZoneNumOfNodes); if (IntraZoneLinkageData(i).NodeNums[1] == 0) { IntraZoneLinkageData(i).NodeNums[1] = - UtilityRoutines::FindItemInList(Alphas(3), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); + Util::FindItemInList(Alphas(3), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); if (IntraZoneLinkageData(i).NodeNums[1] > 0) { IntraZoneLinkageData(i).NodeHeights[1] = Zone(MultizoneZoneData(IntraZoneLinkageData(i).NodeNums[1]).ZoneNum).Centroid.z; } else { @@ -3928,12 +3925,10 @@ namespace AirflowNetwork { DisSysNodeData(i).Height = Numbers(1); // Nodal height DisSysNodeData(i).EPlusNodeNum = 0; // EPlus node number // verify EnergyPlus object type - if (UtilityRoutines::SameString(Alphas(3), "AirLoopHVAC:ZoneMixer") || - UtilityRoutines::SameString(Alphas(3), "AirLoopHVAC:ZoneSplitter") || - UtilityRoutines::SameString(Alphas(3), "AirLoopHVAC:OutdoorAirSystem") || - UtilityRoutines::SameString(Alphas(3), "OAMixerOutdoorAirStreamNode") || - UtilityRoutines::SameString(Alphas(3), "OutdoorAir:NodeList") || UtilityRoutines::SameString(Alphas(3), "OutdoorAir:Node") || - UtilityRoutines::SameString(Alphas(3), "Other") || lAlphaBlanks(3)) { + if (Util::SameString(Alphas(3), "AirLoopHVAC:ZoneMixer") || Util::SameString(Alphas(3), "AirLoopHVAC:ZoneSplitter") || + Util::SameString(Alphas(3), "AirLoopHVAC:OutdoorAirSystem") || Util::SameString(Alphas(3), "OAMixerOutdoorAirStreamNode") || + Util::SameString(Alphas(3), "OutdoorAir:NodeList") || Util::SameString(Alphas(3), "OutdoorAir:Node") || + Util::SameString(Alphas(3), "Other") || lAlphaBlanks(3)) { } else { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + "=\"" + Alphas(1) + "\" invalid " + cAlphaFields(3) + "=\"" + @@ -3945,8 +3940,8 @@ namespace AirflowNetwork { } // Avoid duplication of EPlusName for (int j = 1; j < i; ++j) { - if (!UtilityRoutines::SameString(Alphas(2), "")) { - if (UtilityRoutines::SameString(DisSysNodeData(j).EPlusName, Alphas(2))) { + if (!Util::SameString(Alphas(2), "")) { + if (Util::SameString(DisSysNodeData(j).EPlusName, Alphas(2))) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + "=\"" + Alphas(1) + "\" Duplicated " + cAlphaFields(2) + "=\"" + Alphas(2) + "\". Please make a correction."); @@ -4032,8 +4027,7 @@ namespace AirflowNetwork { for (int surfNum = 1; surfNum < NumAlphas; ++surfNum) { this_VF_object.LinkageSurfaceData(surfNum).SurfaceName = Alphas(surfNum + 1); // Surface name - this_VF_object.LinkageSurfaceData(surfNum).SurfaceNum = - UtilityRoutines::FindItemInList(Alphas(surfNum + 1), m_state.dataSurface->Surface); + this_VF_object.LinkageSurfaceData(surfNum).SurfaceNum = Util::FindItemInList(Alphas(surfNum + 1), m_state.dataSurface->Surface); if (this_VF_object.LinkageSurfaceData(surfNum).SurfaceNum == 0) { ShowFatalError( @@ -4102,9 +4096,9 @@ namespace AirflowNetwork { cNumericFields); PressureControllerData(i).Name = Alphas(1); // Object Name PressureControllerData(i).ZoneName = Alphas(2); // Zone name - PressureControllerData(i).ZoneNum = UtilityRoutines::FindItemInList(Alphas(2), Zone); + PressureControllerData(i).ZoneNum = Util::FindItemInList(Alphas(2), Zone); PressureControllerData(i).AFNNodeNum = - UtilityRoutines::FindItemInList(Alphas(2), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); + Util::FindItemInList(Alphas(2), MultizoneZoneData, &MultizoneZoneProp::ZoneName, AirflowNetworkNumOfZones); if (PressureControllerData(i).ZoneNum == 0) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " object, invalid " + cAlphaFields(2) + " given."); ShowContinueError(m_state, "..invalid " + cAlphaFields(2) + " = \"" + PressureControllerData(i).ZoneName + "\""); @@ -4116,7 +4110,7 @@ namespace AirflowNetwork { { // This SELECT_CASE_var will go on input refactor, no need to fix - auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(Alphas(3))); + auto const SELECT_CASE_var(Util::makeUPPER(Alphas(3))); if (SELECT_CASE_var == "AIRFLOWNETWORK:MULTIZONE:COMPONENT:ZONEEXHAUSTFAN") { PressureControllerData(i).ControlTypeSet = PressureCtrlExhaust; } else if (SELECT_CASE_var == "AIRFLOWNETWORK:DISTRIBUTION:COMPONENT:RELIEFAIRFLOW") { @@ -4251,13 +4245,13 @@ namespace AirflowNetwork { // Search node types: OAMixerOutdoorAirStreamNode, OutdoorAir:NodeList, and OutdoorAir:Node int j = 0; for (int i = NumOfNodesMultiZone + 1; i <= AirflowNetworkNumOfNodes; ++i) { - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { ++j; } - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:NodeList")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:NodeList")) { ++j; } - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:Node")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:Node")) { ++j; } } @@ -4269,25 +4263,25 @@ namespace AirflowNetwork { AirflowNetworkNodeData(i).NodeHeight = DisSysNodeData(i - NumOfNodesMultiZone).Height; AirflowNetworkNodeData(i).EPlusNodeNum = DisSysNodeData(i - NumOfNodesMultiZone).EPlusNodeNum; // Get mixer information - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:ZoneMixer")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:ZoneMixer")) { AirflowNetworkNodeData(i).EPlusTypeNum = iEPlusNodeType::MIX; } // Get splitter information - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:ZoneSplitter")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:ZoneSplitter")) { AirflowNetworkNodeData(i).EPlusTypeNum = iEPlusNodeType::SPL; } // Get outside air system information - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:OutdoorAirSystem")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:OutdoorAirSystem")) { AirflowNetworkNodeData(i).EPlusTypeNum = iEPlusNodeType::OAN; } // Get OA system inlet information 'OAMixerOutdoorAirStreamNode' was specified as an outdoor air node implicitly - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { AirflowNetworkNodeData(i).EPlusTypeNum = iEPlusNodeType::EXT; AirflowNetworkNodeData(i).ExtNodeNum = AirflowNetworkNumOfExtNode + 1; AirflowNetworkNodeData(i).NodeTypeNum = 1; } - if (UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:NodeList") || - UtilityRoutines::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:Node")) { + if (Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:NodeList") || + Util::SameString(DisSysNodeData(i - NumOfNodesMultiZone).EPlusType, "OutdoorAir:Node")) { if (j > 1) { AirflowNetworkNodeData(i).EPlusTypeNum = iEPlusNodeType::EXT; AirflowNetworkNodeData(i).ExtNodeNum = AirflowNetworkNumOfExtNode + 1; @@ -4874,7 +4868,7 @@ namespace AirflowNetwork { } if (!lAlphaBlanks(5)) { - AirflowNetworkLinkageData(count).ZoneNum = UtilityRoutines::FindItemInList(AirflowNetworkLinkageData(count).ZoneName, Zone); + AirflowNetworkLinkageData(count).ZoneNum = Util::FindItemInList(AirflowNetworkLinkageData(count).ZoneName, Zone); if (AirflowNetworkLinkageData(count).ZoneNum == 0) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + ": Invalid " + cAlphaFields(5) + @@ -4946,7 +4940,7 @@ namespace AirflowNetwork { // Ensure no duplicated names in AirflowNetwork component objects // for (i = 1; i <= AirflowNetworkNumOfComps; ++i) { // for (j = i + 1; j <= AirflowNetworkNumOfComps; ++j) { - // if (UtilityRoutines::SameString(AirflowNetworkCompData(i).Name, + // if (Util::SameString(AirflowNetworkCompData(i).Name, // AirflowNetworkCompData(j).Name)) { // // SurfaceAirflowLeakageNames // if (i <= 4 && j <= 4) { @@ -5157,7 +5151,7 @@ namespace AirflowNetwork { for (int i = 1; i <= DisSysNumOfHXs; ++i) { count = 0; for (j = 1; j <= AirflowNetworkNumOfLinks; ++j) { - if (UtilityRoutines::SameString(AirflowNetworkLinkageData(j).CompName, DisSysCompHXData(i).name)) { + if (Util::SameString(AirflowNetworkLinkageData(j).CompName, DisSysCompHXData(i).name)) { ++count; } } @@ -5193,7 +5187,7 @@ namespace AirflowNetwork { k = AirflowNetworkLinkageData(count).NodeNums[1]; if (AirflowNetworkCompData(i).CompTypeNum == iComponentTypeNum::OAF) { - if (!UtilityRoutines::SameString(DisSysNodeData(j - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { + if (!Util::SameString(DisSysNodeData(j - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { ShowSevereError(m_state, format(RoutineName) + "AirflowNetwork:Distribution:Linkage: When the component type is " @@ -5203,7 +5197,7 @@ namespace AirflowNetwork { m_state, "the component type in the first node should be OAMixerOutdoorAirStreamNode at " + AirflowNetworkNodeData(j).Name); ErrorsFound = true; } - if (!UtilityRoutines::SameString(DisSysNodeData(k - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:OutdoorAirSystem")) { + if (!Util::SameString(DisSysNodeData(k - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:OutdoorAirSystem")) { ShowSevereError(m_state, format(RoutineName) + "AirflowNetwork:Distribution:Linkage: When the component type is " @@ -5217,7 +5211,7 @@ namespace AirflowNetwork { } if (AirflowNetworkCompData(i).CompTypeNum == iComponentTypeNum::REL) { - if (!UtilityRoutines::SameString(DisSysNodeData(j - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:OutdoorAirSystem")) { + if (!Util::SameString(DisSysNodeData(j - NumOfNodesMultiZone).EPlusType, "AirLoopHVAC:OutdoorAirSystem")) { ShowSevereError(m_state, format(RoutineName) + "AirflowNetwork:Distribution:Linkage: When the component type is " @@ -5228,7 +5222,7 @@ namespace AirflowNetwork { AirflowNetworkNodeData(j).Name); ErrorsFound = true; } - if (!UtilityRoutines::SameString(DisSysNodeData(k - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { + if (!Util::SameString(DisSysNodeData(k - NumOfNodesMultiZone).EPlusType, "OAMixerOutdoorAirStreamNode")) { ShowSevereError(m_state, format(RoutineName) + "AirflowNetwork:Distribution:Linkage: When the component type is " @@ -6955,7 +6949,7 @@ namespace AirflowNetwork { } else { // FacadeNum = 2 or 4 SideRatio = 1.0 / simulation_control.aspect_ratio; } - if (UtilityRoutines::SameString(simulation_control.BldgType, "HighRise") && FacadeNum != 5) { + if (Util::SameString(simulation_control.BldgType, "HighRise") && FacadeNum != 5) { SideRatio = 1.0 / SideRatio; } SideRatioFac = std::log(SideRatio); @@ -6970,7 +6964,7 @@ namespace AirflowNetwork { // Wind-pressure coefficients for vertical facades, low-rise building - if (UtilityRoutines::SameString(simulation_control.BldgType, "LowRise") && FacadeNum <= 4) { + if (Util::SameString(simulation_control.BldgType, "LowRise") && FacadeNum <= 4) { IncRad = IncAng * Constant::DegToRadians; Real64 const cos_IncRad_over_2(std::cos(IncRad / 2.0)); vals[windDirNum - 1] = 0.6 * std::log(1.248 - 0.703 * std::sin(IncRad / 2.0) - 1.175 * pow_2(std::sin(IncRad)) + @@ -6980,7 +6974,7 @@ namespace AirflowNetwork { // Wind-pressure coefficients for vertical facades, high-rise building - else if (UtilityRoutines::SameString(simulation_control.BldgType, "HighRise") && FacadeNum <= 4) { + else if (Util::SameString(simulation_control.BldgType, "HighRise") && FacadeNum <= 4) { SR = min(max(SideRatio, 0.25), 4.0); if (SR >= 0.25 && SR < 1.0) { ISR = 1; @@ -6995,8 +6989,8 @@ namespace AirflowNetwork { // Wind-pressure coefficients for roof (assumed same for low-rise and high-rise buildings) - else if ((UtilityRoutines::SameString(simulation_control.BldgType, "HighRise") || - UtilityRoutines::SameString(simulation_control.BldgType, "LowRise")) && + else if ((Util::SameString(simulation_control.BldgType, "HighRise") || + Util::SameString(simulation_control.BldgType, "LowRise")) && FacadeNum == 5) { SR = min(max(SideRatio, 0.25), 1.0); if (SR >= 0.25 && SR < 0.5) { @@ -7035,7 +7029,7 @@ namespace AirflowNetwork { } else { // FacadeNum = 2 or 4 SideRatio = 1.0 / simulation_control.aspect_ratio; } - if (UtilityRoutines::SameString(simulation_control.BldgType, "HighRise")) { + if (Util::SameString(simulation_control.BldgType, "HighRise")) { SideRatio = 1.0 / SideRatio; } SideRatioFac = std::log(SideRatio); @@ -7239,7 +7233,7 @@ namespace AirflowNetwork { // Free convection Real64 Pr = properties.prandtl_number(Pamb, (Ts + Tamb) / 2, Wamb); Real64 KinVisc = properties.kinematic_viscosity(Pamb, (Ts + Tamb) / 2, Wamb); - Real64 Beta = 2.0 / ((Tamb + Constant::KelvinConv) + (Ts + Constant::KelvinConv)); + Real64 Beta = 2.0 / ((Tamb + Constant::Kelvin) + (Ts + Constant::Kelvin)); Real64 Gr = Constant::GravityConstant * Beta * std::abs(Ts - Tamb) * pow_3(Dh) / pow_2(KinVisc); Real64 Ra = Gr * Pr; Real64 Nu_free(0); @@ -7395,10 +7389,10 @@ namespace AirflowNetwork { Real64 UThermal(10); // Initialize. This will get updated. Real64 UThermal_iter = 0; Real64 Tsurr = Tamb; - Real64 Tsurr_K = Tsurr + Constant::KelvinConv; + Real64 Tsurr_K = Tsurr + Constant::Kelvin; Real64 Tin = AirflowNetworkNodeSimu(LF).TZ; Real64 TDuctSurf = (Tamb + Tin) / 2.0; - Real64 TDuctSurf_K = TDuctSurf + Constant::KelvinConv; + Real64 TDuctSurf_K = TDuctSurf + Constant::Kelvin; Real64 DuctSurfArea = DisSysCompDuctData(TypeNum).L * DisSysCompDuctData(TypeNum).hydraulicDiameter * Constant::Pi; // If user defined view factors not present, calculate air-to-air heat transfer @@ -7487,7 +7481,7 @@ namespace AirflowNetwork { int ZoneSurfNum = VFObj.LinkageSurfaceData(j).SurfaceNum; Real64 TSurfj = m_state.dataHeatBalSurf->SurfOutsideTempHist(1)(ZoneSurfNum); - Real64 TSurfj_K = TSurfj + Constant::KelvinConv; + Real64 TSurfj_K = TSurfj + Constant::Kelvin; Real64 ZoneSurfEmissivity = m_state.dataConstruction->Construct(m_state.dataSurface->Surface(ZoneSurfNum).Construction).InsideAbsorpThermal; @@ -7512,7 +7506,7 @@ namespace AirflowNetwork { } Tsurr = (hOut * Tamb + hrjTj_sum) / (hOut + hrj_sum); // Surroundings temperature [C] - Tsurr_K = Tsurr + Constant::KelvinConv; + Tsurr_K = Tsurr + Constant::Kelvin; Real64 RThermTotal = RThermConvIn + RThermConduct + 1 / (hOut + hrj_sum); UThermal = pow(RThermTotal, -1); @@ -7521,13 +7515,13 @@ namespace AirflowNetwork { Tin_ave = Tsurr + (Tin - Tsurr) * (1 / NTU) * (1 - exp(-NTU)); TDuctSurf = Tin_ave - UThermal * (RThermConvIn + RThermConduct) * (Tin_ave - Tsurr); - TDuctSurf_K = TDuctSurf + Constant::KelvinConv; + TDuctSurf_K = TDuctSurf + Constant::Kelvin; } for (int j = 1; j <= VFObj.LinkageSurfaceData.u(); ++j) { int ZoneSurfNum = VFObj.LinkageSurfaceData(j).SurfaceNum; Real64 TSurfj = m_state.dataHeatBalSurf->SurfOutsideTempHist(1)(ZoneSurfNum); - Real64 TSurfj_K = TSurfj + Constant::KelvinConv; + Real64 TSurfj_K = TSurfj + Constant::Kelvin; VFObj.LinkageSurfaceData(j).SurfaceRadLoad = VFObj.LinkageSurfaceData(j).SurfaceResistanceFactor * (pow_4(TDuctSurf_K) - pow_4(TSurfj_K)); // Radiant load for this surface [W] int SurfNum = VFObj.LinkageSurfaceData(j).SurfaceNum; @@ -10193,8 +10187,7 @@ namespace AirflowNetwork { } // Validate EPlus Node names and types for (int i = 1; i <= DisSysNumOfNodes; ++i) { - if (UtilityRoutines::SameString(DisSysNodeData(i).EPlusName, "") || UtilityRoutines::SameString(DisSysNodeData(i).EPlusName, "Other")) - continue; + if (Util::SameString(DisSysNodeData(i).EPlusName, "") || 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)) { @@ -10216,8 +10209,8 @@ namespace AirflowNetwork { } } // Check outdoor air node - if (UtilityRoutines::SameString(DisSysNodeData(i).EPlusType, "OutdoorAir:NodeList") || - UtilityRoutines::SameString(DisSysNodeData(i).EPlusType, "OutdoorAir:Node")) { + if (Util::SameString(DisSysNodeData(i).EPlusType, "OutdoorAir:NodeList") || + Util::SameString(DisSysNodeData(i).EPlusType, "OutdoorAir:Node")) { if (!LocalError) { ShowSevereError(m_state, format(RoutineName) + "The Node or Component Name defined in " + DisSysNodeData(i).Name + @@ -10509,7 +10502,7 @@ namespace AirflowNetwork { MultiSpeedHPIndicator = 0; for (int i = 1; i <= DisSysNumOfCoils; ++i) { { - auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(DisSysCompCoilData(i).EPlusType)); + auto const SELECT_CASE_var(Util::makeUPPER(DisSysCompCoilData(i).EPlusType)); if (SELECT_CASE_var == "COIL:COOLING:DX") { ValidateComponent(m_state, "Coil:Cooling:DX", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject); @@ -10644,13 +10637,13 @@ namespace AirflowNetwork { // Validate terminal unit name and type for (int i = 1; i <= DisSysNumOfTermUnits; ++i) { - if (UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:ConstantVolume:Reheat") || - UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) { + if (Util::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:ConstantVolume:Reheat") || + Util::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) { LocalError = false; - if (UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:ConstantVolume:Reheat")) + if (Util::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:ConstantVolume:Reheat")) GetHVACSingleDuctSysIndex( m_state, DisSysCompTermUnitData(i).name, n, LocalError, "AirflowNetwork:Distribution:Component:TerminalUnit"); - if (UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) + if (Util::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) GetHVACSingleDuctSysIndex(m_state, DisSysCompTermUnitData(i).name, n, @@ -10663,7 +10656,7 @@ namespace AirflowNetwork { for (int j = 1; j <= DisSysNumOfCVFs; j++) { if (DisSysCompCVFData(j).FanTypeNum == FanType_SimpleVAV) { if (DisSysCompCVFData(j).AirLoopNum == DisSysCompTermUnitData(i).AirLoopNum && - !UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) { + !Util::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) { ShowSevereError(m_state, format(RoutineName) + CurrentModuleObject + " Invalid terminal type for a VAV system = " + DisSysCompTermUnitData(i).name); @@ -10686,7 +10679,7 @@ namespace AirflowNetwork { CurrentModuleObject = "AirflowNetwork:Distribution:Component:HeatExchanger"; for (int i = 1; i <= DisSysNumOfHXs; ++i) { { - auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(DisSysCompHXData(i).EPlusType)); + auto const SELECT_CASE_var(Util::makeUPPER(DisSysCompHXData(i).EPlusType)); if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:FLATPLATE") { ValidateComponent( @@ -11052,12 +11045,9 @@ namespace AirflowNetwork { NumOfFans = 0; FanNames = ""; for (int CompNum = 1; CompNum <= m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).TotalComponents; ++CompNum) { - if (UtilityRoutines::SameString(m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).Comp(CompNum).TypeOf, - "Fan:ConstantVolume") || - UtilityRoutines::SameString(m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).Comp(CompNum).TypeOf, - "Fan:OnOff") || - UtilityRoutines::SameString(m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).Comp(CompNum).TypeOf, - "Fan:VariableVolume")) { + if (Util::SameString(m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).Comp(CompNum).TypeOf, "Fan:ConstantVolume") || + Util::SameString(m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).Comp(CompNum).TypeOf, "Fan:OnOff") || + Util::SameString(m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).Comp(CompNum).TypeOf, "Fan:VariableVolume")) { NumOfFans++; if (NumOfFans > 1) { FanNames += m_state.dataAirSystemsData->PrimaryAirSystems(1).Branch(BranchNum).Comp(CompNum).Name; @@ -11173,7 +11163,7 @@ namespace AirflowNetwork { bool found = false; int j; for (j = 1; j <= AirflowNetworkNumOfSurfaces; ++j) { - if (UtilityRoutines::SameString(MultizoneSurfaceData(j).OpeningName, MultizoneCompExhaustFanData(i).name)) { + if (Util::SameString(MultizoneSurfaceData(j).OpeningName, MultizoneCompExhaustFanData(i).name)) { found = true; if (m_state.dataSurface->Surface(MultizoneSurfaceData(j).SurfNum).ExtBoundCond != ExternalEnvironment && !(m_state.dataSurface->Surface(MultizoneSurfaceData(i).SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt && @@ -11431,9 +11421,9 @@ namespace AirflowNetwork { for (SrfNum = 1; SrfNum <= AirflowNetworkNumOfSurfaces; ++SrfNum) { if (m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ExtBoundCond == ExternalEnvironment) { // check if outdoor boundary condition - MZDZoneNum = UtilityRoutines::FindItemInList(m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ZoneName, - MultizoneZoneData, - &MultizoneZoneProp::ZoneName); + MZDZoneNum = Util::FindItemInList(m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ZoneName, + MultizoneZoneData, + &MultizoneZoneProp::ZoneName); if (MZDZoneNum == AFNZnNum) { // This is terrible, should not do it this way auto afe = elements.find(MultizoneSurfaceData(SrfNum).OpeningName); @@ -11503,7 +11493,7 @@ namespace AirflowNetwork { // Recount the number of detailed and simple exterior openings in zones with "ADVANCED" single sided wind pressure coefficients AFNNumOfExtOpenings = 0; for (SrfNum = 1; SrfNum <= AirflowNetworkNumOfSurfaces; ++SrfNum) { - MZDZoneNum = UtilityRoutines::FindItemInList( + MZDZoneNum = Util::FindItemInList( m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ZoneName, MultizoneZoneData, &MultizoneZoneProp::ZoneName); if (MultizoneZoneData(MZDZoneNum).SingleSidedCpType == "ADVANCED") { if (m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ExtBoundCond == @@ -11527,9 +11517,9 @@ namespace AirflowNetwork { for (SrfNum = 1; SrfNum <= AirflowNetworkNumOfSurfaces; ++SrfNum) { if (m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ExtBoundCond == ExternalEnvironment) { if (AirflowNetworkNumOfDetOpenings > 0) { - DetOpenNum = UtilityRoutines::FindItemInList( + DetOpenNum = Util::FindItemInList( MultizoneSurfaceData(SrfNum).OpeningName, MultizoneCompDetOpeningData, &AirflowNetwork::DetailedOpening::name); - MZDZoneNum = UtilityRoutines::FindItemInList( + MZDZoneNum = Util::FindItemInList( m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ZoneName, MultizoneZoneData, &MultizoneZoneProp::ZoneName); if (MultizoneZoneData(MZDZoneNum).SingleSidedCpType == "ADVANCED") { if (DetOpenNum > 0) { @@ -11540,7 +11530,7 @@ namespace AirflowNetwork { AFNExtSurfaces(ExtOpenNum).ZoneNum = m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).Zone; AFNExtSurfaces(ExtOpenNum).ZoneName = m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ZoneName; AFNExtSurfaces(ExtOpenNum).MZDZoneNum = - UtilityRoutines::FindItemInList(AFNExtSurfaces(ExtOpenNum).ZoneName, MultizoneZoneData, &MultizoneZoneProp::ZoneName); + Util::FindItemInList(AFNExtSurfaces(ExtOpenNum).ZoneName, MultizoneZoneData, &MultizoneZoneProp::ZoneName); AFNExtSurfaces(ExtOpenNum).CompTypeNum = iComponentTypeNum::DOP; AFNExtSurfaces(ExtOpenNum).Height = MultizoneSurfaceData(SrfNum).Height; AFNExtSurfaces(ExtOpenNum).Width = MultizoneSurfaceData(SrfNum).Width; @@ -11556,7 +11546,7 @@ namespace AirflowNetwork { } } } else if (AirflowNetworkNumOfSimOpenings > 0) { - SimOpenNum = UtilityRoutines::FindItemInList( + SimOpenNum = Util::FindItemInList( MultizoneSurfaceData(SrfNum).OpeningName, MultizoneCompSimpleOpeningData, &AirflowNetwork::SimpleOpening::name); if (SimOpenNum > 0) { AFNExtSurfaces(ExtOpenNum).MSDNum = SrfNum; @@ -11565,7 +11555,7 @@ namespace AirflowNetwork { AFNExtSurfaces(ExtOpenNum).ZoneNum = m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).Zone; AFNExtSurfaces(ExtOpenNum).ZoneName = m_state.dataSurface->Surface(MultizoneSurfaceData(SrfNum).SurfNum).ZoneName; AFNExtSurfaces(ExtOpenNum).MZDZoneNum = - UtilityRoutines::FindItemInList(AFNExtSurfaces(ExtOpenNum).ZoneName, MultizoneZoneData, &MultizoneZoneProp::ZoneName); + Util::FindItemInList(AFNExtSurfaces(ExtOpenNum).ZoneName, MultizoneZoneData, &MultizoneZoneProp::ZoneName); AFNExtSurfaces(ExtOpenNum).CompTypeNum = iComponentTypeNum::SOP; AFNExtSurfaces(ExtOpenNum).Height = MultizoneSurfaceData(SrfNum).Height; AFNExtSurfaces(ExtOpenNum).Width = MultizoneSurfaceData(SrfNum).Width; @@ -11632,7 +11622,7 @@ namespace AirflowNetwork { Real64 WindAng = (windDirNum - 1) * 10.0; IncAng = std::abs(WindAng - ZoneAng(ZnNum)); if (std::abs(IncAng) > 180.0) IncAng -= 360.0; - if (UtilityRoutines::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { + if (Util::SameString(simulation_control.WPCCntr, "SurfaceAverageCalculation")) { if (std::abs(IncAng) <= 67.5) { PiFormula(windDirNum) = 0.44 * sign(std::sin(2.67 * std::abs(IncAng) * Constant::Pi / 180.0), IncAng); } else if (std::abs(IncAng) <= 180.0) { @@ -11983,7 +11973,7 @@ namespace AirflowNetwork { return AirLoopNum; } for (TUNum = 1; TUNum <= DisSysNumOfTermUnits; ++TUNum) { - if (UtilityRoutines::SameString(DisSysCompTermUnitData(TUNum).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) { + if (Util::SameString(DisSysCompTermUnitData(TUNum).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) { LocalError = false; GetHVACSingleDuctSysIndex(m_state, DisSysCompTermUnitData(TUNum).name, diff --git a/src/EnergyPlus/Autosizing/Base.cc b/src/EnergyPlus/Autosizing/Base.cc index 6a1d22d884d..b0efa813d25 100644 --- a/src/EnergyPlus/Autosizing/Base.cc +++ b/src/EnergyPlus/Autosizing/Base.cc @@ -344,7 +344,7 @@ void BaseSizer::selectSizerOutput(EnergyPlusData &state, bool &errorsFound) this->autoSizedValue = this->dataEMSOverride; this->reportSizerOutput( state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue); - } else if (this->hardSizeNoDesignRun && !this->wasAutoSized && UtilityRoutines::SameString(this->compType, "Fan:ZoneExhaust")) { + } else if (this->hardSizeNoDesignRun && !this->wasAutoSized && Util::SameString(this->compType, "Fan:ZoneExhaust")) { this->autoSizedValue = this->originalValue; } else if (this->wasAutoSized && this->dataFractionUsedForSizing > 0.0 && this->dataConstantUsedForSizing > 0.0) { this->autoSizedValue = this->dataFractionUsedForSizing * this->dataConstantUsedForSizing; @@ -353,7 +353,7 @@ void BaseSizer::selectSizerOutput(EnergyPlusData &state, bool &errorsFound) } else if (!this->wasAutoSized && (this->autoSizedValue == this->originalValue || this->autoSizedValue == 0.0)) { // no sizing run done or autosizes to 0 this->autoSizedValue = this->originalValue; - if (this->dataAutosizable || (!this->sizingDesRunThisZone && UtilityRoutines::SameString(this->compType, "Fan:ZoneExhaust"))) { + if (this->dataAutosizable || (!this->sizingDesRunThisZone && Util::SameString(this->compType, "Fan:ZoneExhaust"))) { this->reportSizerOutput( state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue); } @@ -441,7 +441,7 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro if (this->dataEMSOverrideON) { // EMS overrides value this->reportSizerOutput( state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue); - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs this->reportSizerOutput(state, this->compType, @@ -453,7 +453,7 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro this->autoSizedValue = this->originalValue; this->reportSizerOutput( state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue); - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs this->reportSizerOutput(state, this->compType, @@ -465,7 +465,7 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro this->autoSizedValue = this->originalValue; this->reportSizerOutput( state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue); - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs this->reportSizerOutput(state, this->compType, @@ -482,7 +482,7 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro } else { this->reportSizerOutput(state, this->compType, this->compName, "Design Size " + this->sizingString, this->autoSizedValue); } - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs this->reportSizerOutput( state, this->compType, this->compName, "Design Size " + this->sizingString + " ( non-bypassed )", this->autoSizedValue); @@ -496,7 +496,7 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro this->autoSizedValue, "User-Specified " + this->sizingStringScalable + this->sizingString, this->originalValue); - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs this->originalValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs this->reportSizerOutput(state, @@ -508,12 +508,12 @@ void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &erro this->originalValue); } } else { - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { this->autoSizedValue /= (1 - this->dataBypassFrac); // back out bypass fraction applied in GetInput } this->reportSizerOutput( state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->originalValue); - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs this->reportSizerOutput(state, this->compType, @@ -574,7 +574,7 @@ bool BaseSizer::isValidCoilType(std::string const &_compType) int coilNum = 0; for (auto const &coilType : DataHVACGlobals::cAllCoilTypes) { coilNum += 1; - if (UtilityRoutines::SameString(_compType, coilType)) { + if (Util::SameString(_compType, coilType)) { this->coilType_Num = coilNum; return true; } @@ -586,15 +586,15 @@ bool BaseSizer::isValidCoilType(std::string const &_compType) bool BaseSizer::isValidFanType(std::string const &_compType) { // if compType name is one of the fan objects, then return true - if (UtilityRoutines::SameString(_compType, "Fan:SystemModel")) { + if (Util::SameString(_compType, "Fan:SystemModel")) { return true; - } else if (UtilityRoutines::SameString(_compType, "Fan:ComponentModel")) { + } else if (Util::SameString(_compType, "Fan:ComponentModel")) { return true; - } else if (UtilityRoutines::SameString(_compType, "Fan:OnOff")) { + } else if (Util::SameString(_compType, "Fan:OnOff")) { return true; - } else if (UtilityRoutines::SameString(_compType, "Fan:ConstantVolume")) { + } else if (Util::SameString(_compType, "Fan:ConstantVolume")) { return true; - } else if (UtilityRoutines::SameString(_compType, "Fan:VariableVolume")) { + } else if (Util::SameString(_compType, "Fan:VariableVolume")) { return true; } else { return false; diff --git a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc index b44aefca408..e9136c89af3 100644 --- a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc @@ -73,7 +73,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b if (this->curZoneEqNum > 0) { if (!this->wasAutoSized && !this->sizingDesRunThisZone) { this->autoSizedValue = _originalValue; - if (UtilityRoutines::SameString(this->compType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { + if (Util::SameString(this->compType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { this->autoSizedValue /= (1.0 - this->dataBypassFrac); // back out bypass fraction applied in GetInput this->originalValue /= (1.0 - this->dataBypassFrac); // back out bypass fraction applied in GetInput } @@ -278,7 +278,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b } else if (this->curSysNum > 0) { if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) { this->autoSizedValue = _originalValue; - if (UtilityRoutines::SameString(this->compType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { + if (Util::SameString(this->compType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { this->autoSizedValue /= (1.0 - this->dataBypassFrac); // back out bypass fraction applied in GetInput this->originalValue /= (1.0 - this->dataBypassFrac); // back out bypass fraction applied in GetInput } @@ -334,7 +334,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b // override sizing string if (this->overrideSizeString) { - if (UtilityRoutines::SameString(this->compType, "ZoneHVAC:FourPipeFanCoil")) { + if (Util::SameString(this->compType, "ZoneHVAC:FourPipeFanCoil")) { this->sizingString = "Maximum Supply Air Flow Rate [m3/s]"; if (this->isEpJSON) this->sizingString = "maximum_supply_air_flow_rate [m3/s]"; } else if (this->coilType_Num == DataHVACGlobals::CoilDX_CoolingTwoSpeed) { @@ -390,20 +390,20 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b if (coolingFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (heatingFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } diff --git a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc index 324b0a7051b..09da95767c8 100644 --- a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc @@ -99,9 +99,9 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, FanCoolLoad = state.dataSize->DataCoilSizingFanCoolLoad; TotCapTempModFac = state.dataSize->DataCoilSizingCapFT; } else { - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER") || - UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || - UtilityRoutines::SameString(this->compType, "ZONEHVAC:IDEALLOADSAIRSYSTEM")) { + if (Util::SameString(this->compType, "COIL:COOLING:WATER") || + Util::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || + Util::SameString(this->compType, "ZONEHVAC:IDEALLOADSAIRSYSTEM")) { if (this->termUnitIU && (this->curTermUnitSizingNum > 0)) { this->autoSizedValue = this->termUnitSizing(this->curTermUnitSizingNum).DesCoolingLoad; } else if (this->zoneEqFanCoil) { @@ -229,9 +229,9 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, ShowContinueError(state, format("...Capacity passed by parent object to size child component = {:.2T} [W]", this->autoSizedValue)); } else { - if (UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER") || - UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || - UtilityRoutines::SameString(this->compType, "ZONEHVAC:IDEALLOADSAIRSYSTEM")) { + if (Util::SameString(this->compType, "COIL:COOLING:WATER") || + Util::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || + Util::SameString(this->compType, "ZONEHVAC:IDEALLOADSAIRSYSTEM")) { if (this->termUnitIU || this->zoneEqFanCoil) { ShowContinueError( state, format("...Capacity passed by parent object to size child component = {:.2T} [W]", this->autoSizedValue)); @@ -505,8 +505,8 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, // Note: the VolFlowPerRatedTotCap check is not applicable for VRF-FluidTCtrl coil model, which implements variable flow fans and // determines capacity using physical calculations instead of emperical curves bool FlagCheckVolFlowPerRatedTotCap = true; - if (UtilityRoutines::SameString(this->compType, "Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl") || - UtilityRoutines::SameString(this->compType, "Coil:Heating:DX:VariableRefrigerantFlow:FluidTemperatureControl")) + if (Util::SameString(this->compType, "Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl") || + Util::SameString(this->compType, "Coil:Heating:DX:VariableRefrigerantFlow:FluidTemperatureControl")) FlagCheckVolFlowPerRatedTotCap = false; if (this->dataIsDXCoil && FlagCheckVolFlowPerRatedTotCap) { diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc index a9b67e2edd0..3b679372927 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc @@ -96,8 +96,7 @@ Real64 CoolingWaterDesAirOutletHumRatSizer::size(EnergyPlusData &state, Real64 _ if (this->wasAutoSized) { if (this->autoSizedValue > this->dataDesInletAirHumRat && - (UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER") || - UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY"))) { + (Util::SameString(this->compType, "COIL:COOLING:WATER") || Util::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY"))) { std::string msg = this->callingRoutine + ":" + " Coil=\"" + this->compName + "\", Cooling Coil has leaving humidity ratio > entering humidity ratio."; this->addErrorMessage(msg); @@ -126,8 +125,7 @@ Real64 CoolingWaterDesAirOutletHumRatSizer::size(EnergyPlusData &state, Real64 _ Real64 desHumRatAtWaterInTemp = Psychrometrics::PsyWFnTdbH(state, this->dataDesInletWaterTemp, desSatEnthAtWaterInTemp, this->callingRoutine); if (this->autoSizedValue < this->dataDesInletAirHumRat && desHumRatAtWaterInTemp > this->dataDesInletAirHumRat) { if (this->autoSizedValue < this->dataDesInletAirHumRat && - (UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER") || - UtilityRoutines::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY"))) { + (Util::SameString(this->compType, "COIL:COOLING:WATER") || Util::SameString(this->compType, "COIL:COOLING:WATER:DETAILEDGEOMETRY"))) { std::string msg = this->callingRoutine + ":" + " Coil=\"" + this->compName + "\", Cooling Coil is running dry for sizing and has minimum humidity ratio at saturation for inlet chilled water " "temperature > design air entering humidity ratio."; diff --git a/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc b/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc index 4cba4ec8be3..2324b09f2c5 100644 --- a/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc @@ -212,7 +212,7 @@ Real64 HeatingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->autoSizedValue = this->unitarySysEqSizing(this->curSysNum).HeatingAirVolFlow; } else { if (this->curDuctType == DataHVACGlobals::AirDuctType::Main) { - if (UtilityRoutines::SameString(this->compType, "COIL:HEATING:WATER")) { + if (Util::SameString(this->compType, "COIL:HEATING:WATER")) { if (this->finalSysSizing(this->curSysNum).SysAirMinFlowRat > 0.0 && !this->dataDesicRegCoil) { this->autoSizedValue = this->finalSysSizing(this->curSysNum).SysAirMinFlowRat * this->finalSysSizing(this->curSysNum).DesMainVolFlow; @@ -223,7 +223,7 @@ Real64 HeatingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b this->autoSizedValue = this->finalSysSizing(this->curSysNum).DesMainVolFlow; } } else if (this->curDuctType == DataHVACGlobals::AirDuctType::Cooling) { - if (UtilityRoutines::SameString(this->compType, "COIL:HEATING:WATER")) { + if (Util::SameString(this->compType, "COIL:HEATING:WATER")) { if (this->finalSysSizing(this->curSysNum).SysAirMinFlowRat > 0.0 && !this->dataDesicRegCoil) { this->autoSizedValue = this->finalSysSizing(this->curSysNum).SysAirMinFlowRat * this->finalSysSizing(this->curSysNum).DesCoolVolFlow; diff --git a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc index 2b1422b689e..3be70d31aab 100644 --- a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc @@ -313,7 +313,7 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, // This method allows downstream heating coils to size individually.Probably should do this for all air loop equipment // ChangoverBypass model always sets AirLoopControlInfo%UnitarySys to FALSE so heating coil can individually size if (this->airLoopControlInfo(this->curSysNum).UnitarySysSimulating && - !UtilityRoutines::SameString(this->compType, "COIL:HEATING:WATER")) { + !Util::SameString(this->compType, "COIL:HEATING:WATER")) { NominalCapacityDes = this->unitaryHeatCap; } else { if (DesCoilLoad >= DataHVACGlobals::SmallLoad) { @@ -374,8 +374,8 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, // Note: the VolFlowPerRatedTotCap check is not applicable for VRF-FluidTCtrl coil model, which implements variable flow fans and // determines capacity using physical calculations instead of emperical curves bool FlagCheckVolFlowPerRatedTotCap = true; - if (UtilityRoutines::SameString(this->compType, "Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl") || - UtilityRoutines::SameString(this->compType, "Coil:Heating:DX:VariableRefrigerantFlow:FluidTemperatureControl")) { + if (Util::SameString(this->compType, "Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl") || + Util::SameString(this->compType, "Coil:Heating:DX:VariableRefrigerantFlow:FluidTemperatureControl")) { FlagCheckVolFlowPerRatedTotCap = false; } diff --git a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc index 82b73d63626..750df592dbc 100644 --- a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc @@ -86,22 +86,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -113,11 +113,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } @@ -125,11 +125,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -137,11 +137,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } @@ -149,11 +149,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -163,22 +163,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -189,22 +189,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -216,49 +216,45 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -268,11 +264,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } @@ -280,11 +276,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -297,11 +293,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedCoolingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } @@ -309,11 +305,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -324,49 +320,45 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -376,11 +368,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } @@ -388,11 +380,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -405,11 +397,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedCoolingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } @@ -417,11 +409,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -432,49 +424,45 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -482,22 +470,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -508,22 +496,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -534,49 +522,45 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -584,22 +568,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -610,22 +594,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -636,25 +620,23 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + dateTimeFanPeak = format("{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -662,22 +644,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -691,11 +673,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } @@ -703,11 +685,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -717,22 +699,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - DDNameFanPeak = state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; + DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; dateTimeFanPeak = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeatherManager->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } @@ -803,7 +785,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = std::max(unitarysysEqSizing.CoolingAirVolFlow, unitarysysEqSizing.HeatingAirVolFlow); if (this->autoSizedValue == unitarysysEqSizing.CoolingAirVolFlow) { if (sysSizPeakDDNum.CoolFlowPeakDD > 0 && sysSizPeakDDNum.CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); + auto &desDayInput = state.dataWeather->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); DDNameFanPeak = desDayInput.Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, @@ -815,7 +797,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo } else if (this->autoSizedValue == unitarysysEqSizing.HeatingAirVolFlow) { if (this->finalSysSizing(this->curSysNum).HeatDDNum > 0 && this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); + auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, @@ -827,8 +809,8 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo } else if (unitarysysEqSizing.CoolingAirFlow) { this->autoSizedValue = unitarysysEqSizing.CoolingAirVolFlow; if (sysSizPeakDDNum.CoolFlowPeakDD > 0 && sysSizPeakDDNum.CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); - DDNameFanPeak = state.dataWeatherManager->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD).Title; + auto &desDayInput = state.dataWeather->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); + DDNameFanPeak = state.dataWeather->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD).Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, @@ -839,7 +821,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->autoSizedValue = unitarysysEqSizing.HeatingAirVolFlow; if (this->finalSysSizing(this->curSysNum).HeatDDNum > 0 && this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); + auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, @@ -853,7 +835,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesHeatVolFlow) { if (this->finalSysSizing(this->curSysNum).HeatDDNum > 0 && this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); + auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, @@ -863,7 +845,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { if (sysSizPeakDDNum.CoolFlowPeakDD > 0 && sysSizPeakDDNum.CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); + auto &desDayInput = state.dataWeather->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); DDNameFanPeak = desDayInput.Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, @@ -878,7 +860,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesHeatVolFlow) { if (this->finalSysSizing(this->curSysNum).HeatDDNum > 0 && this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); + auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, @@ -888,7 +870,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { if (sysSizPeakDDNum.CoolFlowPeakDD > 0 && sysSizPeakDDNum.CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { - auto &desDayInput = state.dataWeatherManager->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); + auto &desDayInput = state.dataWeather->DesDayInput(sysSizPeakDDNum.CoolFlowPeakDD); DDNameFanPeak = desDayInput.Title; dateTimeFanPeak = format("{}/{} {}", desDayInput.Month, @@ -932,13 +914,13 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo // override sizing string if (this->overrideSizeString) { - if (UtilityRoutines::SameString(this->compType, "ZoneHVAC:FourPipeFanCoil")) { + if (Util::SameString(this->compType, "ZoneHVAC:FourPipeFanCoil")) { this->sizingString = "Maximum Supply Air Flow Rate [m3/s]"; if (this->isEpJSON) this->sizingString = "maximum_supply_air_flow_rate [m3/s]"; - } else if (UtilityRoutines::SameString(this->compType, "ZoneHVAC:UnitVentilator")) { + } else if (Util::SameString(this->compType, "ZoneHVAC:UnitVentilator")) { this->sizingString = "Maximum Supply Air Flow Rate [m3/s]"; if (this->isEpJSON) this->sizingString = "maximum_supply_air_flow_rate [m3/s]"; - } else if (UtilityRoutines::SameString(this->compType, "Fan:SystemModel")) { + } else if (Util::SameString(this->compType, "Fan:SystemModel")) { this->sizingString = "Design Maximum Air Flow Rate [m3/s]"; // if (this->isEpJSON) this->sizingString = "design_maximum_air_flow_rate [m3/s]"; } else { diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index af04ae276e2..8297d42a603 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -107,7 +107,7 @@ namespace BaseboardElectric { // Find the correct Baseboard Equipment if (CompIndex == 0) { - BaseboardNum = UtilityRoutines::FindItemInList(EquipName, baseboard->baseboards, &BaseboardParams::EquipName); + BaseboardNum = Util::FindItemInList(EquipName, baseboard->baseboards, &BaseboardParams::EquipName); if (BaseboardNum == 0) { ShowFatalError(state, format("SimElectricBaseboard: Unit not found={}", EquipName)); } @@ -215,8 +215,8 @@ namespace BaseboardElectric { ++BaseboardNum; auto &thisBaseboard = baseboard->baseboards(BaseboardNum); - thisBaseboard.EquipName = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard - thisBaseboard.EquipType = UtilityRoutines::makeUPPER(cCurrentModuleObject); // the type of baseboard-rename change + thisBaseboard.EquipName = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard + thisBaseboard.EquipType = Util::makeUPPER(cCurrentModuleObject); // the type of baseboard-rename change thisBaseboard.Schedule = state.dataIPShortCut->cAlphaArgs(2); if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { thisBaseboard.SchedPtr = ScheduleManager::ScheduleAlwaysOn; @@ -238,7 +238,7 @@ namespace BaseboardElectric { thisBaseboard.BaseboardEfficiency = state.dataIPShortCut->rNumericArgs(4); // Determine baseboard electric heating design capacity sizing method - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { thisBaseboard.HeatingCapMethod = HeatingDesignCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatDesignCapacityNumericNum)) { thisBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum); @@ -260,7 +260,7 @@ namespace BaseboardElectric { state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { thisBaseboard.HeatingCapMethod = CapacityPerFloorArea; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) { thisBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum); @@ -297,7 +297,7 @@ namespace BaseboardElectric { format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { thisBaseboard.HeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { thisBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 1590070af5f..fdc003c7fb8 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -124,7 +124,7 @@ namespace BaseboardRadiator { // Find the correct Baseboard Equipment if (CompIndex == 0) { - int BaseboardNum = UtilityRoutines::FindItemInList(EquipName, state.dataBaseboardRadiator->baseboards, &BaseboardParams::EquipID); + int BaseboardNum = Util::FindItemInList(EquipName, state.dataBaseboardRadiator->baseboards, &BaseboardParams::EquipID); if (BaseboardNum == 0) { ShowFatalError(state, format("SimBaseboard: Unit not found={}", EquipName)); } @@ -317,7 +317,7 @@ namespace BaseboardRadiator { "Hot Water Nodes"); // Determine steam baseboard radiator system heating design capacity sizing method - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { thisBaseboard.HeatingCapMethod = HeatingDesignCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatDesignCapacityNumericNum)) { thisBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum); @@ -339,7 +339,7 @@ namespace BaseboardRadiator { state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { thisBaseboard.HeatingCapMethod = CapacityPerFloorArea; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) { thisBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum); @@ -376,7 +376,7 @@ namespace BaseboardRadiator { format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { thisBaseboard.HeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { thisBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); diff --git a/src/EnergyPlus/BranchInputManager.cc b/src/EnergyPlus/BranchInputManager.cc index 0e71abed257..e73b79d2808 100644 --- a/src/EnergyPlus/BranchInputManager.cc +++ b/src/EnergyPlus/BranchInputManager.cc @@ -153,7 +153,7 @@ namespace BranchInputManager { } // Find this BranchList in the master BranchList Names - Found = UtilityRoutines::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); + Found = Util::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); if (Found == 0) { ShowFatalError(state, format("GetBranchList: BranchList Name not found={}", BranchListName)); } @@ -214,7 +214,7 @@ namespace BranchInputManager { } // Find this BranchList in the master BranchList Names - Found = UtilityRoutines::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); + Found = Util::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); if (Found == 0) { ShowFatalError(state, format("NumBranchesInBranchList: BranchList Name not found={}", BranchListName)); } @@ -307,7 +307,7 @@ namespace BranchInputManager { GetBranchInput(state); } - Found = UtilityRoutines::FindItemInList(BranchName, state.dataBranchInputManager->Branch); + Found = Util::FindItemInList(BranchName, state.dataBranchInputManager->Branch); if (Found == 0) { ShowSevereError(state, format("NumCompsInBranch: Branch not found={}", BranchName)); NumCompsInBranch = 0; @@ -351,8 +351,8 @@ namespace BranchInputManager { } else { for (BranchNum = 1; BranchNum <= NumBranches; ++BranchNum) { for (CompNum = 1; CompNum <= state.dataBranchInputManager->Branch(BranchNum).NumOfComponents; ++CompNum) { - if (UtilityRoutines::SameString(CompType, state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) && - UtilityRoutines::SameString(CompName, state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).Name)) { + if (Util::SameString(CompType, state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) && + Util::SameString(CompName, state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).Name)) { GetAirBranchIndex = BranchNum; goto BranchLoop_exit; } @@ -405,10 +405,10 @@ namespace BranchInputManager { } else { if (BranchNum > 0 && BranchNum <= NumBranches) { for (CompNum = 1; CompNum <= state.dataBranchInputManager->Branch(BranchNum).NumOfComponents; ++CompNum) { - if (UtilityRoutines::SameString("Fan:OnOff", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) || - UtilityRoutines::SameString("Fan:ConstantVolume", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) || - UtilityRoutines::SameString("Fan:VariableVolume", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType) || - UtilityRoutines::SameString("Fan:SystemModel", state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType)) { + 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)) { FanType = state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).CType; FanName = state.dataBranchInputManager->Branch(BranchNum).Component(CompNum).Name; break; @@ -452,7 +452,7 @@ namespace BranchInputManager { state.dataBranchInputManager->GetBranchInputFlag = false; } - Found = UtilityRoutines::FindItemInList(BranchName, state.dataBranchInputManager->Branch); + Found = Util::FindItemInList(BranchName, state.dataBranchInputManager->Branch); if (Found == 0) { ShowSevereError(state, format("GetInternalBranchData: Branch not found={}", BranchName)); ErrorsFound = true; @@ -508,7 +508,7 @@ namespace BranchInputManager { numSplitters = 0; numMixers = 0; - ConnNum = UtilityRoutines::FindItemInList(ConnectorListName, state.dataBranchInputManager->ConnectorLists); + ConnNum = Util::FindItemInList(ConnectorListName, state.dataBranchInputManager->ConnectorLists); if (ConnNum > 0) { numSplitters = state.dataBranchInputManager->ConnectorLists(ConnNum).NumOfSplitters; @@ -556,7 +556,7 @@ namespace BranchInputManager { } if (not_blank(ConnectorListName)) { - int Count = UtilityRoutines::FindItemInList(ConnectorListName, state.dataBranchInputManager->ConnectorLists); + int Count = Util::FindItemInList(ConnectorListName, state.dataBranchInputManager->ConnectorLists); if (Count == 0) { ShowFatalError(state, format("GetConnectorList: Connector List not found={}", ConnectorListName)); } @@ -616,14 +616,14 @@ namespace BranchInputManager { } GetConnectorList(state, ConnectorListName, Connectoid, ConnectorNumber); - if (UtilityRoutines::SameString(Connectoid.ConnectorType(1), cMIXER)) { - Count = UtilityRoutines::FindItemInList(Connectoid.ConnectorName(1), state.dataBranchInputManager->Mixers); + if (Util::SameString(Connectoid.ConnectorType(1), cMIXER)) { + Count = Util::FindItemInList(Connectoid.ConnectorName(1), state.dataBranchInputManager->Mixers); if (present(MixerNumber)) ++MixerNumber; if (Count == 0) { ShowFatalError(state, format("GetLoopMixer: No Mixer Found={}", Connectoid.ConnectorName(1))); } - } else if (UtilityRoutines::SameString(Connectoid.ConnectorType(2), cMIXER)) { - Count = UtilityRoutines::FindItemInList(Connectoid.ConnectorName(2), state.dataBranchInputManager->Mixers); + } else if (Util::SameString(Connectoid.ConnectorType(2), cMIXER)) { + Count = Util::FindItemInList(Connectoid.ConnectorName(2), state.dataBranchInputManager->Mixers); if (Count == 0) { ShowFatalError(state, format("GetLoopMixer: No Mixer Found={}", Connectoid.ConnectorName(2))); } @@ -769,14 +769,14 @@ namespace BranchInputManager { ShowFatalError(state, "Program terminates due to previous condition."); } GetConnectorList(state, ConnectorListName, Connectoid, ConnectorNumber); - if (UtilityRoutines::SameString(Connectoid.ConnectorType(1), cSPLITTER)) { - Count = UtilityRoutines::FindItemInList(Connectoid.ConnectorName(1), state.dataBranchInputManager->Splitters); + if (Util::SameString(Connectoid.ConnectorType(1), cSPLITTER)) { + Count = Util::FindItemInList(Connectoid.ConnectorName(1), state.dataBranchInputManager->Splitters); if (present(SplitterNumber)) ++SplitterNumber; if (Count == 0) { ShowFatalError(state, format("GetLoopSplitter: No Splitter Found={}", Connectoid.ConnectorName(1))); } - } else if (UtilityRoutines::SameString(Connectoid.ConnectorType(2), cSPLITTER)) { - Count = UtilityRoutines::FindItemInList(Connectoid.ConnectorName(2), state.dataBranchInputManager->Splitters); + } else if (Util::SameString(Connectoid.ConnectorType(2), cSPLITTER)) { + Count = Util::FindItemInList(Connectoid.ConnectorName(2), state.dataBranchInputManager->Splitters); if (Count == 0) { ShowFatalError(state, format("GetLoopSplitter: No Splitter Found={}", Connectoid.ConnectorName(2))); } @@ -900,13 +900,12 @@ namespace BranchInputManager { GetBranchListInput(state); } - int Found1 = UtilityRoutines::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); + int Found1 = Util::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); if (Found1 == 0) { ShowSevereError(state, format("GetFirstBranchInletNodeName: BranchList=\"{}\", not a valid BranchList Name", BranchListName)); InletNodeName = "Invalid Node Name"; } else { - int Found2 = UtilityRoutines::FindItemInList(state.dataBranchInputManager->BranchList(Found1).BranchNames(1), - state.dataBranchInputManager->Branch); + int Found2 = Util::FindItemInList(state.dataBranchInputManager->BranchList(Found1).BranchNames(1), state.dataBranchInputManager->Branch); if (Found2 == 0) { ShowSevereError(state, format("GetFirstBranchInletNodeName: BranchList=\"{}\", Branch=\"{}\" not a valid Branch Name", @@ -940,12 +939,12 @@ namespace BranchInputManager { GetBranchListInput(state); } - int Found1 = UtilityRoutines::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); + int Found1 = Util::FindItemInList(BranchListName, state.dataBranchInputManager->BranchList); if (Found1 == 0) { ShowSevereError(state, format("GetLastBranchOutletNodeName: BranchList=\"{}\", not a valid BranchList Name", BranchListName)); OutletNodeName = "Invalid Node Name"; } else { - int Found2 = UtilityRoutines::FindItemInList( + int Found2 = Util::FindItemInList( state.dataBranchInputManager->BranchList(Found1).BranchNames(state.dataBranchInputManager->BranchList(Found1).NumOfBranchNames), state.dataBranchInputManager->Branch); if (Found2 == 0) { @@ -1116,7 +1115,7 @@ namespace BranchInputManager { state.dataBranchInputManager->Branch(BCount).Component.allocate(state.dataBranchInputManager->Branch(BCount).NumOfComponents); Comp = 1; for (int Loop = 3; Loop <= NumAlphas; Loop += 4) { - if (UtilityRoutines::SameString(Alphas(Loop), cSPLITTER) || UtilityRoutines::SameString(Alphas(Loop), cMIXER)) { + if (Util::SameString(Alphas(Loop), cSPLITTER) || Util::SameString(Alphas(Loop), cMIXER)) { ShowSevereError(state, format("{}{}=\"{}\", invalid data.", RoutineName, CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Connector:Splitter/Connector:Mixer not allowed in object {}", CurrentModuleObject)); ErrFound = true; @@ -1335,8 +1334,8 @@ namespace BranchInputManager { GetBranchInput(state); } if (!state.dataBranchInputManager->BranchList(BCount).BranchNames(Loop).empty()) { - Found = UtilityRoutines::FindItemInList(state.dataBranchInputManager->BranchList(BCount).BranchNames(Loop), - state.dataBranchInputManager->Branch); + Found = Util::FindItemInList(state.dataBranchInputManager->BranchList(BCount).BranchNames(Loop), + state.dataBranchInputManager->Branch); if (Found == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid data.", @@ -1481,10 +1480,10 @@ namespace BranchInputManager { int CCount = 0; for (Arg = 2; Arg <= NumAlphas; Arg += 2) { ++CCount; - if (UtilityRoutines::SameString(Alphas(Arg), cSPLITTER)) { + if (Util::SameString(Alphas(Arg), cSPLITTER)) { state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(CCount) = Alphas(Arg).substr(0, 30); ++state.dataBranchInputManager->ConnectorLists(Count).NumOfSplitters; - } else if (UtilityRoutines::SameString(Alphas(Arg), cMIXER)) { + } else if (Util::SameString(Alphas(Arg), cMIXER)) { state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(CCount) = Alphas(Arg).substr(0, 30); ++state.dataBranchInputManager->ConnectorLists(Count).NumOfMixers; } else { @@ -1520,11 +1519,11 @@ namespace BranchInputManager { if (state.dataBranchInputManager->ConnectorLists(Count).NumOfConnectors > 2) continue; // Rules not clear for this case for (Loop = 1; Loop <= state.dataBranchInputManager->ConnectorLists(Count).NumOfConnectors; ++Loop) { if (state.dataBranchInputManager->ConnectorLists(Count).ConnectorMatchNo(Loop) != 0) continue; - if (UtilityRoutines::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop), cSPLITTER)) { + if (Util::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop), cSPLITTER)) { CurSplitter = true; CurMixer = false; - SplitNum = UtilityRoutines::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop), - state.dataBranchInputManager->Splitters); + SplitNum = Util::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop), + state.dataBranchInputManager->Splitters); // Following code sets up branch names to be matched from Splitter/Mixer data structure if (SplitNum == 0) { ShowSevereError(state, @@ -1537,11 +1536,11 @@ namespace BranchInputManager { } NumBranchNames = state.dataBranchInputManager->Splitters(SplitNum).NumOutletBranches; BranchNames = state.dataBranchInputManager->Splitters(SplitNum).OutletBranchNames; - } else if (UtilityRoutines::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop), cMIXER)) { + } else if (Util::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop), cMIXER)) { CurSplitter = true; CurMixer = false; - MixerNum = UtilityRoutines::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop), - state.dataBranchInputManager->Mixers); + MixerNum = Util::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop), + state.dataBranchInputManager->Mixers); if (MixerNum == 0) { ShowSevereError(state, format("Invalid Connector:Mixer(none)={}, referenced by {}={}", @@ -1558,21 +1557,19 @@ namespace BranchInputManager { } // Try to match mixer to splitter for (Loop1 = Loop + 1; Loop1 <= state.dataBranchInputManager->ConnectorLists(Count).NumOfConnectors; ++Loop1) { - if (CurMixer && !UtilityRoutines::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop1), cSPLITTER)) - continue; - if (CurSplitter && !UtilityRoutines::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop1), cMIXER)) - continue; + if (CurMixer && !Util::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop1), cSPLITTER)) continue; + if (CurSplitter && !Util::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop1), cMIXER)) continue; if (state.dataBranchInputManager->ConnectorLists(Count).ConnectorMatchNo(Loop1) != 0) continue; { if (CurSplitter) { // Current "item" is a splitter, candidate is a mixer. - MixerNum = UtilityRoutines::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop1), - state.dataBranchInputManager->Mixers); + MixerNum = Util::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop1), + state.dataBranchInputManager->Mixers); if (MixerNum == 0) continue; if (state.dataBranchInputManager->Mixers(MixerNum).NumInletBranches != NumBranchNames) continue; MatchFound = true; for (Loop2 = 1; Loop2 <= state.dataBranchInputManager->Mixers(MixerNum).NumInletBranches; ++Loop2) { - TestNum = UtilityRoutines::FindItemInList( + TestNum = Util::FindItemInList( state.dataBranchInputManager->Mixers(MixerNum).InletBranchNames(Loop2), BranchNames, NumBranchNames); if (TestNum == 0) { MatchFound = false; @@ -1585,13 +1582,13 @@ namespace BranchInputManager { } } else { // Current "item" is a splitter, candidate is a mixer. - SplitNum = UtilityRoutines::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop1), - state.dataBranchInputManager->Splitters); + SplitNum = Util::FindItemInList(state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop1), + state.dataBranchInputManager->Splitters); if (SplitNum == 0) continue; if (state.dataBranchInputManager->Splitters(SplitNum).NumOutletBranches != NumBranchNames) continue; MatchFound = true; for (Loop2 = 1; Loop2 <= state.dataBranchInputManager->Splitters(SplitNum).NumOutletBranches; ++Loop2) { - TestNum = UtilityRoutines::FindItemInList( + TestNum = Util::FindItemInList( state.dataBranchInputManager->Splitters(SplitNum).OutletBranchNames(Loop2), BranchNames, NumBranchNames); if (TestNum == 0) { MatchFound = false; @@ -1620,7 +1617,7 @@ namespace BranchInputManager { format("...Item={}, Type={} was not matched.", state.dataBranchInputManager->ConnectorLists(Count).ConnectorName(Loop), state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop))); - if (UtilityRoutines::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop), "Connector:Splitter")) { + if (Util::SameString(state.dataBranchInputManager->ConnectorLists(Count).ConnectorType(Loop), "Connector:Splitter")) { ShowContinueError( state, "The BranchList for this Connector:Splitter does not match the BranchList for its corresponding Connector:Mixer."); } else { @@ -1734,8 +1731,7 @@ namespace BranchInputManager { state.dataBranchInputManager->GetBranchInputFlag = false; } for (Count = 1; Count <= NumSplitters; ++Count) { - int Found = - UtilityRoutines::FindItemInList(state.dataBranchInputManager->Splitters(Count).InletBranchName, state.dataBranchInputManager->Branch); + int Found = Util::FindItemInList(state.dataBranchInputManager->Splitters(Count).InletBranchName, state.dataBranchInputManager->Branch); if (Found == 0) { ShowSevereError(state, format("GetSplitterInput: Invalid Branch={}, referenced as Inlet Branch to {}={}", @@ -1745,8 +1741,8 @@ namespace BranchInputManager { ErrorsFound = true; } for (Loop = 1; Loop <= state.dataBranchInputManager->Splitters(Count).NumOutletBranches; ++Loop) { - Found = UtilityRoutines::FindItemInList(state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop), - state.dataBranchInputManager->Branch); + Found = Util::FindItemInList(state.dataBranchInputManager->Splitters(Count).OutletBranchNames(Loop), + state.dataBranchInputManager->Branch); if (Found == 0) { ShowSevereError(state, fmt::format("GetSplitterInput: Invalid Branch={}, referenced as Outlet Branch # {} to {}={}", @@ -1983,8 +1979,7 @@ namespace BranchInputManager { state.dataBranchInputManager->GetBranchInputFlag = false; } for (Count = 1; Count <= NumMixers; ++Count) { - int Found = - UtilityRoutines::FindItemInList(state.dataBranchInputManager->Mixers(Count).OutletBranchName, state.dataBranchInputManager->Branch); + int Found = Util::FindItemInList(state.dataBranchInputManager->Mixers(Count).OutletBranchName, state.dataBranchInputManager->Branch); if (Found == 0) { ShowSevereError(state, format("GetMixerInput: Invalid Branch={}, referenced as Outlet Branch in {}={}", @@ -1994,8 +1989,8 @@ namespace BranchInputManager { ErrorsFound = true; } for (Loop = 1; Loop <= state.dataBranchInputManager->Mixers(Count).NumInletBranches; ++Loop) { - Found = UtilityRoutines::FindItemInList(state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop), - state.dataBranchInputManager->Branch); + Found = + Util::FindItemInList(state.dataBranchInputManager->Mixers(Count).InletBranchNames(Loop), state.dataBranchInputManager->Branch); if (Found == 0) { ShowSevereError(state, format("GetMixerInput: Invalid Branch={}, referenced as Inlet Branch # {} in {}={}", @@ -2396,17 +2391,17 @@ namespace BranchInputManager { std::string FoundBranchName = ""; if (present(CompType) && present(CompName)) { for (CpN = 1; CpN <= state.dataBranchInputManager->Branch(BrN).NumOfComponents; ++CpN) { - if (!UtilityRoutines::SameString(CompType(), state.dataBranchInputManager->Branch(BrN).Component(CpN).CType) || - !UtilityRoutines::SameString(CompName(), state.dataBranchInputManager->Branch(BrN).Component(CpN).Name)) + if (!Util::SameString(CompType(), state.dataBranchInputManager->Branch(BrN).Component(CpN).CType) || + !Util::SameString(CompName(), state.dataBranchInputManager->Branch(BrN).Component(CpN).Name)) continue; FoundBranchName = state.dataBranchInputManager->Branch(BrN).Name; NeverFound = false; } } for (BlNum = 1; BlNum <= (int)state.dataBranchInputManager->BranchList.size(); ++BlNum) { - Found = UtilityRoutines::FindItemInList(state.dataBranchInputManager->Branch(BrN).Name, - state.dataBranchInputManager->BranchList(BlNum).BranchNames, - state.dataBranchInputManager->BranchList(BlNum).NumOfBranchNames); + Found = Util::FindItemInList(state.dataBranchInputManager->Branch(BrN).Name, + state.dataBranchInputManager->BranchList(BlNum).BranchNames, + state.dataBranchInputManager->BranchList(BlNum).NumOfBranchNames); if (Found != 0) break; } if (Found != 0) continue; @@ -2520,8 +2515,8 @@ namespace BranchInputManager { BranchPtrs.allocate(state.dataBranchInputManager->BranchList(BCount).NumOfBranchNames + 2); BranchPtrs = 0; for (Count = 1; Count <= state.dataBranchInputManager->BranchList(BCount).NumOfBranchNames; ++Count) { - Found = UtilityRoutines::FindItemInList(state.dataBranchInputManager->BranchList(BCount).BranchNames(Count), - state.dataBranchInputManager->Branch); + Found = + Util::FindItemInList(state.dataBranchInputManager->BranchList(BCount).BranchNames(Count), state.dataBranchInputManager->Branch); if (Found > 0) { NumNodesOnBranchList += state.dataBranchInputManager->Branch(Found).NumOfComponents * 2; FoundBranches(Count) = Found; @@ -2665,13 +2660,13 @@ namespace BranchInputManager { BranchNodes(Count).UniqueNodeNames.allocate(state.dataBranchInputManager->Branch(Count).NumOfComponents * 2); int NodeNum = 0; for (Loop = 1; Loop <= state.dataBranchInputManager->Branch(Count).NumOfComponents; ++Loop) { - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataBranchInputManager->Branch(Count).Component(Loop).InletNodeName, BranchNodes(Count).UniqueNodeNames, NodeNum); if (Found == 0) { ++NodeNum; BranchNodes(Count).UniqueNodeNames(NodeNum) = state.dataBranchInputManager->Branch(Count).Component(Loop).InletNodeName; } - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataBranchInputManager->Branch(Count).Component(Loop).OutletNodeName, BranchNodes(Count).UniqueNodeNames, NodeNum); if (Found == 0) { ++NodeNum; @@ -2684,7 +2679,7 @@ namespace BranchInputManager { for (Count = 1; Count <= (int)state.dataBranchInputManager->Branch.size(); ++Count) { for (Loop = Count + 1; Loop <= (int)state.dataBranchInputManager->Branch.size(); ++Loop) { for (Loop2 = 1; Loop2 <= BranchNodes(Count).NumNodes; ++Loop2) { - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( BranchNodes(Count).UniqueNodeNames(Loop2), BranchNodes(Loop).UniqueNodeNames, BranchNodes(Loop).NumNodes); if (Found != 0) { ShowSevereError(state, format("Non-unique node name found, name={}", BranchNodes(Count).UniqueNodeNames(Loop2))); diff --git a/src/EnergyPlus/BranchNodeConnections.cc b/src/EnergyPlus/BranchNodeConnections.cc index 318e9113417..7ea51f218c6 100644 --- a/src/EnergyPlus/BranchNodeConnections.cc +++ b/src/EnergyPlus/BranchNodeConnections.cc @@ -685,7 +685,7 @@ void RegisterNodeConnection(EnergyPlusData &state, for (int Count = 1; Count <= state.dataBranchNodeConnections->NumOfNodeConnections; ++Count) { if (state.dataBranchNodeConnections->NodeConnections(Count).NodeNumber != NodeNumber) continue; if (state.dataBranchNodeConnections->NodeConnections(Count).ObjectType != ObjectType) continue; - if (!UtilityRoutines::SameString(state.dataBranchNodeConnections->NodeConnections(Count).ObjectName, ObjectName)) continue; + if (!Util::SameString(state.dataBranchNodeConnections->NodeConnections(Count).ObjectName, ObjectName)) continue; if (state.dataBranchNodeConnections->NodeConnections(Count).ConnectionType != ConnectionType) continue; if (state.dataBranchNodeConnections->NodeConnections(Count).FluidStream != FluidStream) continue; if ((state.dataBranchNodeConnections->NodeConnections(Count).ObjectIsParent && !IsParent) || @@ -730,10 +730,10 @@ void RegisterNodeConnection(EnergyPlusData &state, } // Check out AirTerminal inlet/outlet nodes - bool Found = UtilityRoutines::FindItemInList(NodeName, - state.dataBranchNodeConnections->AirTerminalNodeConnections, - &EqNodeConnectionDef::NodeName, - state.dataBranchNodeConnections->NumOfAirTerminalNodes - 1); + bool Found = Util::FindItemInList(NodeName, + state.dataBranchNodeConnections->AirTerminalNodeConnections, + &EqNodeConnectionDef::NodeName, + state.dataBranchNodeConnections->NumOfAirTerminalNodes - 1); if (Found != 0) { // Nodename already used ShowSevereError(state, fmt::format("{}{}=\"{}\" node name duplicated", RoutineName, ObjectType, ObjectName)); ShowContinueError(state, format("NodeName=\"{}\", entered as type={}", NodeName, conTypeStr)); @@ -809,7 +809,7 @@ void OverrideNodeConnectionType( for (int Count = 1; Count <= state.dataBranchNodeConnections->NumOfNodeConnections; ++Count) { if (state.dataBranchNodeConnections->NodeConnections(Count).NodeNumber != NodeNumber) continue; if (state.dataBranchNodeConnections->NodeConnections(Count).ObjectType != ObjectType) continue; - if (!UtilityRoutines::SameString(state.dataBranchNodeConnections->NodeConnections(Count).ObjectName, ObjectName)) continue; + if (!Util::SameString(state.dataBranchNodeConnections->NodeConnections(Count).ObjectName, ObjectName)) continue; if (state.dataBranchNodeConnections->NodeConnections(Count).FluidStream != FluidStream) continue; if ((state.dataBranchNodeConnections->NodeConnections(Count).ObjectIsParent != IsParent)) continue; Found = Count; @@ -1432,18 +1432,18 @@ void GetParentData(EnergyPlusData &state, InletNodeName = state.dataBranchNodeConnections->ParentNodeList(Which).InletNodeName; OutletNodeName = state.dataBranchNodeConnections->ParentNodeList(Which).OutletNodeName; // Get Node Numbers - InletNodeNum = UtilityRoutines::FindItemInList( - InletNodeName, state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), state.dataLoopNodes->NumOfNodes); - OutletNodeNum = UtilityRoutines::FindItemInList( - OutletNodeName, state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), state.dataLoopNodes->NumOfNodes); + InletNodeNum = + Util::FindItemInList(InletNodeName, state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), state.dataLoopNodes->NumOfNodes); + OutletNodeNum = + Util::FindItemInList(OutletNodeName, state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), state.dataLoopNodes->NumOfNodes); } else if (IsParentObjectCompSet(state, ComponentType, ComponentName)) { Which = WhichCompSet(state, ComponentType, ComponentName); if (Which != 0) { InletNodeName = state.dataBranchNodeConnections->CompSets(Which).InletNodeName; OutletNodeName = state.dataBranchNodeConnections->CompSets(Which).OutletNodeName; - InletNodeNum = UtilityRoutines::FindItemInList( + InletNodeNum = Util::FindItemInList( InletNodeName, state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), state.dataLoopNodes->NumOfNodes); - OutletNodeNum = UtilityRoutines::FindItemInList( + OutletNodeNum = Util::FindItemInList( OutletNodeName, state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), state.dataLoopNodes->NumOfNodes); } else { ErrInObject = true; @@ -1706,12 +1706,12 @@ void GetChildrenData(EnergyPlusData &state, ChildInNodeName(CountNum) = state.dataBranchNodeConnections->CompSets(Loop).InletNodeName; ChildOutNodeName(CountNum) = state.dataBranchNodeConnections->CompSets(Loop).OutletNodeName; // Get Node Numbers - ChildInNodeNum(CountNum) = UtilityRoutines::FindItemInList(ChildInNodeName(CountNum), - state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), - state.dataLoopNodes->NumOfNodes); - ChildOutNodeNum(CountNum) = UtilityRoutines::FindItemInList(ChildOutNodeName(CountNum), - state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), - state.dataLoopNodes->NumOfNodes); + ChildInNodeNum(CountNum) = Util::FindItemInList(ChildInNodeName(CountNum), + state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), + state.dataLoopNodes->NumOfNodes); + ChildOutNodeNum(CountNum) = Util::FindItemInList(ChildOutNodeName(CountNum), + state.dataLoopNodes->NodeID({1, state.dataLoopNodes->NumOfNodes}), + state.dataLoopNodes->NumOfNodes); } } if (CountNum != NumChildren) { @@ -1798,8 +1798,8 @@ void SetUpCompSets(EnergyPlusData &state, // inlet/outlet nodes have been input. This routine assumes that identical // "CompSets" cannot be used in multiple places and issues a warning if they are. - std::string ParentTypeUC = UtilityRoutines::makeUPPER(ParentType); - std::string CompTypeUC = UtilityRoutines::makeUPPER(CompType); + std::string ParentTypeUC = Util::makeUPPER(ParentType); + std::string CompTypeUC = Util::makeUPPER(CompType); // TODO: Refactor this away by passing in enums DataLoopNode::ConnectionObjectType ParentTypeEnum = static_cast(getEnumValue(ConnectionObjectTypeNamesUC, ParentTypeUC)); @@ -1965,9 +1965,11 @@ void SetUpCompSets(EnergyPlusData &state, state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).ComponentObjectType = ComponentTypeEnum; state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).CName = CompName; state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).InletNodeName = - UtilityRoutines::makeUPPER(InletNode); // TODO: Fix this.... + + Util::makeUPPER(InletNode); // TODO: Fix this.... state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).OutletNodeName = - UtilityRoutines::makeUPPER(OutletNode); // TODO: Fix this.... + Util::makeUPPER(OutletNode); // TODO: Fix this.... + if (!Description.empty()) { state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).Description = Description; } else { @@ -2100,7 +2102,8 @@ void TestCompSet(EnergyPlusData &state, // c) If not found, call SetUpCompSets (with parent type and name UNDEFINED) // to add a new item in the CompSets array - std::string CompTypeUC = UtilityRoutines::makeUPPER(CompType); + std::string CompTypeUC = Util::makeUPPER(CompType); + // TODO: Refactor this away by passing in enums DataLoopNode::ConnectionObjectType ComponentTypeEnum = static_cast(getEnumValue(ConnectionObjectTypeNamesUC, CompTypeUC)); diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 86d28d4de05..ba177fedbd5 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -130,10 +130,10 @@ void SimCoolingPanel( // Find the correct Baseboard Equipment if (CompIndex == 0) { - CoolingPanelNum = UtilityRoutines::FindItemInList(EquipName, - state.dataChilledCeilingPanelSimple->CoolingPanel, - &CoolingPanelParams::Name, - (int)state.dataChilledCeilingPanelSimple->CoolingPanel.size()); + CoolingPanelNum = Util::FindItemInList(EquipName, + state.dataChilledCeilingPanelSimple->CoolingPanel, + &CoolingPanelParams::Name, + (int)state.dataChilledCeilingPanelSimple->CoolingPanel.size()); if (CoolingPanelNum == 0) { ShowFatalError(state, format("SimCoolingPanelSimple: Unit not found={}", EquipName)); } @@ -385,7 +385,7 @@ void GetCoolingPanelInput(EnergyPlusData &state) thisCP.RatedWaterFlowRate = WaterMassFlowDefault; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "CoolingDesignCapacity")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "CoolingDesignCapacity")) { thisCP.CoolingCapMethod = DataSizing::CoolingDesignCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(4)) { thisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(4); @@ -404,7 +404,7 @@ void GetCoolingPanelInput(EnergyPlusData &state) ErrorsFound = true; } } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "CapacityPerFloorArea")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "CapacityPerFloorArea")) { thisCP.CoolingCapMethod = DataSizing::CapacityPerFloorArea; if (!state.dataIPShortCut->lNumericFieldBlanks(5)) { thisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(5); @@ -428,7 +428,7 @@ void GetCoolingPanelInput(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(5))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "FractionOfAutosizedCoolingCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "FractionOfAutosizedCoolingCapacity")) { thisCP.CoolingCapMethod = DataSizing::FractionOfAutosizedCoolingCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(6)) { thisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(6); @@ -472,19 +472,19 @@ void GetCoolingPanelInput(EnergyPlusData &state) } // Process the temperature control type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), MeanAirTemperature)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), MeanAirTemperature)) { thisCP.controlType = ClgPanelCtrlType::MAT; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), MeanRadiantTemperature)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), MeanRadiantTemperature)) { thisCP.controlType = ClgPanelCtrlType::MRT; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), OperativeTemperature)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), OperativeTemperature)) { thisCP.controlType = ClgPanelCtrlType::Operative; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), OutsideAirDryBulbTemperature)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), OutsideAirDryBulbTemperature)) { thisCP.controlType = ClgPanelCtrlType::ODB; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), OutsideAirWetBulbTemperature)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), OutsideAirWetBulbTemperature)) { thisCP.controlType = ClgPanelCtrlType::OWB; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), ZoneTotalLoad)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), ZoneTotalLoad)) { thisCP.controlType = ClgPanelCtrlType::ZoneTotalLoad; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), ZoneConvectiveLoad)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), ZoneConvectiveLoad)) { thisCP.controlType = ClgPanelCtrlType::ZoneConvectiveLoad; } else { ShowWarningError(state, format("Invalid {} ={}", state.dataIPShortCut->cAlphaFieldNames(6), state.dataIPShortCut->cAlphaArgs(6))); @@ -508,11 +508,11 @@ void GetCoolingPanelInput(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), Off)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), Off)) { thisCP.CondCtrlType = CondCtrl::NONE; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), SimpleOff)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), SimpleOff)) { thisCP.CondCtrlType = CondCtrl::SIMPLEOFF; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), VariableOff)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), VariableOff)) { thisCP.CondCtrlType = CondCtrl::VARIEDOFF; } else { thisCP.CondCtrlType = CondCtrl::SIMPLEOFF; diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 4f44a72f960..6ff850fe5d0 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -342,11 +342,10 @@ void GetBLASTAbsorberInput(EnergyPlusData &state) "Condenser (not tested) Nodes"); if (NumAlphas > 8) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "HotWater") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "HotWater")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "HotWater") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "HotWater")) { thisChiller.GenHeatSourceType = DataLoopNode::NodeFluidType::Water; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), fluidNameSteam) || - state.dataIPShortCut->cAlphaArgs(9).empty()) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), fluidNameSteam) || state.dataIPShortCut->cAlphaArgs(9).empty()) { thisChiller.GenHeatSourceType = DataLoopNode::NodeFluidType::Steam; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(9), state.dataIPShortCut->cAlphaArgs(9))); diff --git a/src/EnergyPlus/ChillerElectricASHRAE205.cc b/src/EnergyPlus/ChillerElectricASHRAE205.cc index fc85aff6e07..fa080a372c3 100644 --- a/src/EnergyPlus/ChillerElectricASHRAE205.cc +++ b/src/EnergyPlus/ChillerElectricASHRAE205.cc @@ -146,7 +146,8 @@ void getChillerASHRAE205Input(EnergyPlusData &state) ++ChillerNum; auto &thisChiller = state.dataChillerElectricASHRAE205->Electric205Chiller(ChillerNum); - thisChiller.Name = UtilityRoutines::makeUPPER(thisObjectName); + thisChiller.Name = Util::makeUPPER(thisObjectName); + ip->markObjectAsUsed(state.dataIPShortCut->cCurrentModuleObject, thisObjectName); std::string const rep_file_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "representation_file_name"); @@ -169,7 +170,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state) ErrorsFound = true; } thisChiller.InterpolationType = - InterpMethods[UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "performance_interpolation_method"))]; + InterpMethods[Util::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "performance_interpolation_method"))]; const auto &compressorSequence = thisChiller.Representation->performance.performance_map_cooling.grid_variables.compressor_sequence_number; // minmax_element is sound but perhaps overkill; as sequence numbers are required by A205 to be in ascending order @@ -294,8 +295,8 @@ void getChillerASHRAE205Input(EnergyPlusData &state) } } - thisChiller.AmbientTempType = static_cast(getEnumValue( - AmbientTempNamesUC, UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_indicator")))); + thisChiller.AmbientTempType = static_cast( + getEnumValue(AmbientTempNamesUC, Util::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_indicator")))); switch (thisChiller.AmbientTempType) { case AmbientTempIndicator::Schedule: { std::string const ambient_temp_schedule = ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_schedule"); @@ -313,7 +314,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state) } case AmbientTempIndicator::TempZone: { std::string const ambient_temp_zone_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_zone_name"); - thisChiller.AmbientTempZone = UtilityRoutines::FindItemInList(ambient_temp_zone_name, state.dataHeatBal->Zone); + thisChiller.AmbientTempZone = Util::FindItemInList(ambient_temp_zone_name, state.dataHeatBal->Zone); if (thisChiller.AmbientTempZone == 0) { ShowSevereError(state, format("{} = {}: Ambient Temperature Zone not found = {}", @@ -885,9 +886,9 @@ void ASHRAE205ChillerSpecs::size([[maybe_unused]] EnergyPlusData &state) // TODO: Determine actual rated flow rates instead of design flow rates this->RefCap = this->Representation->performance.performance_map_cooling .calculate_performance(this->EvapVolFlowRate, - this->TempRefEvapOut + Constant::KelvinConv, + this->TempRefEvapOut + Constant::Kelvin, this->CondVolFlowRate, - this->TempRefCondIn + Constant::KelvinConv, + this->TempRefCondIn + Constant::Kelvin, this->MaxSequenceNumber, this->InterpolationType) .net_evaporator_capacity; @@ -1424,17 +1425,17 @@ void ASHRAE205ChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, boo // Available chiller capacity is capacity at the highest sequence number; i.e. max chiller capacity const Real64 maximumChillerCap = this->Representation->performance.performance_map_cooling .calculate_performance(this->EvapVolFlowRate, - this->EvapOutletTemp + Constant::KelvinConv, + this->EvapOutletTemp + Constant::Kelvin, this->CondVolFlowRate, - this->CondInletTemp + Constant::KelvinConv, + this->CondInletTemp + Constant::Kelvin, this->MaxSequenceNumber, this->InterpolationType) .net_evaporator_capacity; const Real64 minimumChillerCap = this->Representation->performance.performance_map_cooling .calculate_performance(this->EvapVolFlowRate, - this->EvapOutletTemp + Constant::KelvinConv, + this->EvapOutletTemp + Constant::Kelvin, this->CondVolFlowRate, - this->CondInletTemp + Constant::KelvinConv, + this->CondInletTemp + Constant::Kelvin, this->MinSequenceNumber, this->InterpolationType) .net_evaporator_capacity; @@ -1458,9 +1459,9 @@ void ASHRAE205ChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, boo auto f = [MyLoad, this](Real64 partLoadSeqNum) { this->QEvaporator = this->Representation->performance.performance_map_cooling .calculate_performance(this->EvapVolFlowRate, - this->EvapOutletTemp + Constant::KelvinConv, + this->EvapOutletTemp + Constant::Kelvin, this->CondVolFlowRate, - this->CondInletTemp + Constant::KelvinConv, + this->CondInletTemp + Constant::Kelvin, partLoadSeqNum, this->InterpolationType) .net_evaporator_capacity; @@ -1482,9 +1483,9 @@ void ASHRAE205ChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, boo // Use performance map to get the rest of results at new sequence number auto lookupVariablesCooling = // This is a struct returned by value, relying on RVO (THIS_AUTO_OK) this->Representation->performance.performance_map_cooling.calculate_performance(this->EvapVolFlowRate, - this->EvapOutletTemp + Constant::KelvinConv, + this->EvapOutletTemp + Constant::Kelvin, this->CondVolFlowRate, - this->CondInletTemp + Constant::KelvinConv, + this->CondInletTemp + Constant::Kelvin, partLoadSeqNum, this->InterpolationType); this->QEvaporator = lookupVariablesCooling.net_evaporator_capacity * this->ChillerCyclingRatio; @@ -1662,9 +1663,9 @@ void ASHRAE205ChillerSpecs::getDesignCapacities( if (calledFromLocation.loopNum == this->CWPlantLoc.loopNum) { MinLoad = this->Representation->performance.performance_map_cooling .calculate_performance(this->EvapVolFlowRate, - this->TempRefEvapOut + Constant::KelvinConv, + this->TempRefEvapOut + Constant::Kelvin, this->CondVolFlowRate, - this->TempRefCondIn + Constant::KelvinConv, + this->TempRefCondIn + Constant::Kelvin, this->MinSequenceNumber, this->InterpolationType) .net_evaporator_capacity; diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 85ee7b6ab78..ba382b95d54 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -313,11 +313,11 @@ void GetElectricEIRChillerInput(EnergyPlusData &state) state.dataIPShortCut->cAlphaArgs(6), "Chilled Water Nodes"); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "WaterCooled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "WaterCooled")) { thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "AirCooled")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "AirCooled")) { thisChiller.CondenserType = DataPlant::CondenserType::AirCooled; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "EvaporativelyCooled")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "EvaporativelyCooled")) { thisChiller.CondenserType = DataPlant::CondenserType::EvapCooled; } else { ShowSevereError(state, format("{}{}: {}", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index f3c0d0b235e..fc1e6939d65 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -407,7 +407,7 @@ void GetExhaustAbsorberInput(EnergyPlusData &state) if (thisChiller.EvapVolFlowRate == DataSizing::AutoSize) { thisChiller.EvapVolFlowRateWasAutoSized = true; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { thisChiller.CondVolFlowRate = 0.0011; // Condenser flow rate not used for this cond type } else { thisChiller.CondVolFlowRate = state.dataIPShortCut->rNumericArgs(13); @@ -432,9 +432,9 @@ void GetExhaustAbsorberInput(EnergyPlusData &state) format("Errors found in processing curve input for {}={}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); Get_ErrorsFound = false; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(15), "LeavingCondenser")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(15), "LeavingCondenser")) { thisChiller.isEnterCondensTemp = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(15), "EnteringCondenser")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(15), "EnteringCondenser")) { thisChiller.isEnterCondensTemp = true; } else { thisChiller.isEnterCondensTemp = true; @@ -443,9 +443,9 @@ void GetExhaustAbsorberInput(EnergyPlusData &state) ShowContinueError(state, "resetting to ENTERING-CONDENSER, simulation continues"); } // Assign Other Paramters - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { thisChiller.isWaterCooled = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "WaterCooled")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "WaterCooled")) { thisChiller.isWaterCooled = true; } else { thisChiller.isWaterCooled = true; @@ -514,7 +514,7 @@ void GetExhaustAbsorberInput(EnergyPlusData &state) thisChiller.SizFac = state.dataIPShortCut->rNumericArgs(16); thisChiller.TypeOf = state.dataIPShortCut->cAlphaArgs(17); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(17), "Generator:MicroTurbine")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(17), "Generator:MicroTurbine")) { thisChiller.CompType_Num = GeneratorType::Microturbine; thisChiller.ExhaustSourceName = state.dataIPShortCut->cAlphaArgs(18); diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 07436bbe88e..550973c0fca 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -407,7 +407,7 @@ void GetGasAbsorberInput(EnergyPlusData &state) if (thisChiller.EvapVolFlowRate == DataSizing::AutoSize) { thisChiller.EvapVolFlowRateWasAutoSized = true; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { thisChiller.CondVolFlowRate = 0.0011; // Condenser flow rate not used for this cond type } else { thisChiller.CondVolFlowRate = state.dataIPShortCut->rNumericArgs(13); @@ -432,9 +432,9 @@ void GetGasAbsorberInput(EnergyPlusData &state) format("Errors found in processing curve input for {}={}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); Get_ErrorsFound = false; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(15), "LeavingCondenser")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(15), "LeavingCondenser")) { thisChiller.isEnterCondensTemp = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(15), "EnteringCondenser")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(15), "EnteringCondenser")) { thisChiller.isEnterCondensTemp = true; } else { thisChiller.isEnterCondensTemp = true; @@ -443,9 +443,9 @@ void GetGasAbsorberInput(EnergyPlusData &state) ShowContinueError(state, "resetting to EnteringCondenser, simulation continues"); } // Assign Other Parameters - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "AirCooled")) { thisChiller.isWaterCooled = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "WaterCooled")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "WaterCooled")) { thisChiller.isWaterCooled = true; } else { thisChiller.isWaterCooled = true; diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 7dbcc69c37c..cbc1c1edb50 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -350,12 +350,11 @@ void GetIndirectAbsorberInput(EnergyPlusData &state) } if (NumAlphas > 15) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "HotWater") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "HotWater")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "HotWater") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "HotWater")) { thisChiller.GenHeatSourceType = DataLoopNode::NodeFluidType::Water; // Default to Steam if left blank - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), fluidNameSteam) || - state.dataIPShortCut->cAlphaArgs(16).empty()) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), fluidNameSteam) || state.dataIPShortCut->cAlphaArgs(16).empty()) { thisChiller.GenHeatSourceType = DataLoopNode::NodeFluidType::Steam; } else { ShowWarningError(state, format("{}, Name={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 1805a34e231..774a7e74c01 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -299,11 +299,10 @@ void GetElecReformEIRChillerInput(EnergyPlusData &state) } // Check the type of part-load curves implemented: 1_LeavingCondenserWaterTemperature, 2_Lift - if (UtilityRoutines::SameString(PartLoadCurveType, "LeavingCondenserWaterTemperature") && + if (Util::SameString(PartLoadCurveType, "LeavingCondenserWaterTemperature") && state.dataCurveManager->PerfCurve(thisChiller.ChillerEIRFPLRIndex)->numDims == 2) { thisChiller.PartLoadCurveType = PLR::LeavingCondenserWaterTemperature; - } else if (UtilityRoutines::SameString(PartLoadCurveType, "Lift") && - state.dataCurveManager->PerfCurve(thisChiller.ChillerEIRFPLRIndex)->numDims == 3) { + } else if (Util::SameString(PartLoadCurveType, "Lift") && state.dataCurveManager->PerfCurve(thisChiller.ChillerEIRFPLRIndex)->numDims == 3) { thisChiller.PartLoadCurveType = PLR::Lift; } else { ShowSevereError(state, diff --git a/src/EnergyPlus/Coils/CoilCoolingDX.cc b/src/EnergyPlus/Coils/CoilCoolingDX.cc index e1c1f06d275..753cc507f88 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDX.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDX.cc @@ -82,9 +82,10 @@ int CoilCoolingDX::factory(EnergyPlus::EnergyPlusData &state, std::string const state.dataCoilCooingDX->coilCoolingDXGetInputFlag = false; } int handle = -1; + std::string coilNameUpper = Util::makeUPPER(coilName); for (auto const &thisCoil : state.dataCoilCooingDX->coilCoolingDXs) { handle++; - if (EnergyPlus::UtilityRoutines::makeUPPER(coilName) == EnergyPlus::UtilityRoutines::makeUPPER(thisCoil.name)) { + if (coilNameUpper == Util::makeUPPER(thisCoil.name)) { return handle; } } @@ -92,7 +93,7 @@ int CoilCoolingDX::factory(EnergyPlus::EnergyPlusData &state, std::string const return -1; } -void CoilCoolingDX::getInput(EnergyPlus::EnergyPlusData &state) +void CoilCoolingDX::getInput(EnergyPlusData &state) { int numCoolingCoilDXs = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataCoilCooingDX->coilCoolingDXObjectName); if (numCoolingCoilDXs <= 0) { @@ -127,7 +128,7 @@ void CoilCoolingDX::getInput(EnergyPlus::EnergyPlusData &state) } } -void CoilCoolingDX::instantiateFromInputSpec(EnergyPlus::EnergyPlusData &state, const CoilCoolingDXInputSpecification &input_data) +void CoilCoolingDX::instantiateFromInputSpec(EnergyPlusData &state, const CoilCoolingDXInputSpecification &input_data) { static constexpr std::string_view routineName("CoilCoolingDX::instantiateFromInputSpec: "); this->original_input_specs = input_data; @@ -237,7 +238,7 @@ void CoilCoolingDX::instantiateFromInputSpec(EnergyPlus::EnergyPlusData &state, } } -void CoilCoolingDX::oneTimeInit(EnergyPlus::EnergyPlusData &state) +void CoilCoolingDX::oneTimeInit(EnergyPlusData &state) { // setup output variables, needs to be done after object is instantiated and emplaced @@ -667,13 +668,13 @@ Real64 CoilCoolingDX::condMassFlowRate(bool const useAlternateMode) } } -void CoilCoolingDX::size(EnergyPlus::EnergyPlusData &state) +void CoilCoolingDX::size(EnergyPlusData &state) { this->performance.parentName = this->name; this->performance.size(state); } -void CoilCoolingDX::simulate(EnergyPlus::EnergyPlusData &state, +void CoilCoolingDX::simulate(EnergyPlusData &state, int useAlternateMode, Real64 PLR, int speedNum, @@ -721,7 +722,7 @@ void CoilCoolingDX::simulate(EnergyPlus::EnergyPlusData &state, condOutletNode, singleMode, LoadSHR); - EnergyPlus::CoilCoolingDX::passThroughNodeData(evapInletNode, evapOutletNode); + CoilCoolingDX::passThroughNodeData(evapInletNode, evapOutletNode); // calculate energy conversion factor Real64 reportingConstant = state.dataHVACGlobal->TimeStepSys * Constant::SecInHour; @@ -977,7 +978,7 @@ void CoilCoolingDX::setToHundredPercentDOAS() } } -void CoilCoolingDX::passThroughNodeData(EnergyPlus::DataLoopNode::NodeData &in, EnergyPlus::DataLoopNode::NodeData &out) +void CoilCoolingDX::passThroughNodeData(DataLoopNode::NodeData &in, DataLoopNode::NodeData &out) { // pass through all the other node variables that we don't update as a part of this model calculation out.MassFlowRate = in.MassFlowRate; @@ -989,7 +990,7 @@ void CoilCoolingDX::passThroughNodeData(EnergyPlus::DataLoopNode::NodeData &in, out.MassFlowRateMinAvail = in.MassFlowRateMinAvail; } -void CoilCoolingDX::reportAllStandardRatings(EnergyPlus::EnergyPlusData &state) +void CoilCoolingDX::reportAllStandardRatings(EnergyPlusData &state) { if (!state.dataCoilCooingDX->coilCoolingDXs.empty()) { Real64 constexpr ConvFromSIToIP(3.412141633); // Conversion from SI to IP [3.412 Btu/hr-W] diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc index 499e35ffe90..0261d690593 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc @@ -77,7 +77,7 @@ void CoilCoolingDXCurveFitOperatingMode::instantiateFromInputSpec(EnergyPlus::En this->evapRateRatio = input_data.ratio_of_initial_moisture_evaporation_rate_and_steady_state_latent_capacity; this->maxCyclingRate = input_data.maximum_cycling_rate; this->latentTimeConst = input_data.latent_capacity_time_constant; - if (UtilityRoutines::SameString(input_data.apply_latent_degradation_to_speeds_greater_than_1, "Yes")) { + if (Util::SameString(input_data.apply_latent_degradation_to_speeds_greater_than_1, "Yes")) { this->applyLatentDegradationAllSpeeds = true; } else { this->applyLatentDegradationAllSpeeds = false; @@ -96,9 +96,9 @@ void CoilCoolingDXCurveFitOperatingMode::instantiateFromInputSpec(EnergyPlus::En this->latentDegradationActive = true; } - if (UtilityRoutines::SameString(input_data.condenser_type, "AirCooled")) { + if (Util::SameString(input_data.condenser_type, "AirCooled")) { this->condenserType = CondenserType::AIRCOOLED; - } else if (UtilityRoutines::SameString(input_data.condenser_type, "EvaporativelyCooled")) { + } else if (Util::SameString(input_data.condenser_type, "EvaporativelyCooled")) { this->condenserType = CondenserType::EVAPCOOLED; } else { ShowSevereError(state, std::string{routineName} + this->object_name + "=\"" + this->name + "\", invalid"); @@ -138,7 +138,7 @@ CoilCoolingDXCurveFitOperatingMode::CoilCoolingDXCurveFitOperatingMode(EnergyPlu state.dataIPShortCut->rNumericArgs, NumNumbers, IOStatus); - if (!UtilityRoutines::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { + if (!Util::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { continue; } found_it = true; diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc index 7f36c2222b9..201b64503b8 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc @@ -76,9 +76,9 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener this->crankcaseHeaterCap = input_data.crankcase_heater_capacity; this->normalMode = CoilCoolingDXCurveFitOperatingMode(state, input_data.base_operating_mode_name); this->normalMode.oneTimeInit(state); // oneTimeInit does not need to be delayed in this use case - if (UtilityRoutines::SameString(input_data.capacity_control, "CONTINUOUS")) { + if (Util::SameString(input_data.capacity_control, "CONTINUOUS")) { this->capControlMethod = CapControlMethod::CONTINUOUS; - } else if (UtilityRoutines::SameString(input_data.capacity_control, "DISCRETE")) { + } else if (Util::SameString(input_data.capacity_control, "DISCRETE")) { this->capControlMethod = CapControlMethod::DISCRETE; } else { ShowSevereError(state, std::string{routineName} + this->object_name + "=\"" + this->name + "\", invalid"); @@ -106,8 +106,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, UtilityRoutines::makeUPPER(input_data.compressor_fuel_type))); + this->compressorFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(input_data.compressor_fuel_type))); if (this->compressorFuelType == Constant::eFuel::Invalid) { ShowSevereError(state, std::string{routineName} + this->object_name + "=\"" + this->name + "\", invalid"); ShowContinueError(state, "...Compressor Fuel Type=\"" + input_data.compressor_fuel_type + "\"."); @@ -162,7 +161,7 @@ CoilCoolingDXCurveFitPerformance::CoilCoolingDXCurveFitPerformance(EnergyPlus::E IOStatus, _, state.dataIPShortCut->lAlphaFieldBlanks); - if (!UtilityRoutines::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { + if (!Util::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { continue; } found_it = true; diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc index f56dbcbfb74..9d62b2a6762 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 (!UtilityRoutines::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { + if (!Util::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { continue; } found_it = true; diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index dd0901368bc..6e09afd313c 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -333,7 +333,7 @@ namespace CondenserLoopTowers { } tower.TowerFreeConvNomCapSizingFactor = NumArray(12); if (NumAlphas >= 4) { - tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, Util::makeUPPER(AlphArray(4)))); if (tower.PerformanceInputMethod_Num == PIM::Invalid) { ShowSevereError(state, format("{}={}", cCurrentModuleObject, AlphArray(1))); ShowContinueError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4))); @@ -404,7 +404,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(AlphArray(6)))); tower.UserEvapLossFactor = NumArray(19); // N11 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(20) / 100.0; // N12, \field Drift Loss Percent @@ -412,7 +412,7 @@ namespace CondenserLoopTowers { tower.SizFac = NumArray(25); // N17 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(7)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(8)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); @@ -457,7 +457,7 @@ namespace CondenserLoopTowers { if (state.dataIPShortCut->lAlphaFieldBlanks(11) || AlphArray(11).empty()) { tower.CapacityControl = CapacityCtrl::FanCycling; // FanCycling } else { - tower.CapacityControl = static_cast(getEnumValue(CapacityCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); + tower.CapacityControl = static_cast(getEnumValue(CapacityCtrlNamesUC, Util::makeUPPER(AlphArray(11)))); if (tower.CapacityControl == CapacityCtrl::Invalid) { tower.CapacityControl = CapacityCtrl::FanCycling; ShowWarningError(state, @@ -486,7 +486,7 @@ namespace CondenserLoopTowers { // cell control for single speed tower if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(12)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(12)))); } // High speed air flow rate must be greater than free convection air flow rate. @@ -645,7 +645,7 @@ namespace CondenserLoopTowers { BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); if (NumAlphas >= 4) { - tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, Util::makeUPPER(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; @@ -765,15 +765,14 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); - + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(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 tower.SizFac = NumArray(33); // N21 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(7)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(8)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); @@ -800,7 +799,7 @@ namespace CondenserLoopTowers { // cell control for two speed tower if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(11)))); } if (state.dataIPShortCut->lAlphaFieldBlanks(9)) { @@ -1042,8 +1041,7 @@ namespace CondenserLoopTowers { DataLoopNode::ObjectIsNotParent); BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); - if ((UtilityRoutines::SameString(AlphArray(4), "CoolToolsUserDefined") || - UtilityRoutines::SameString(AlphArray(4), "YorkCalcUserDefined")) && + if ((Util::SameString(AlphArray(4), "CoolToolsUserDefined") || Util::SameString(AlphArray(4), "YorkCalcUserDefined")) && state.dataIPShortCut->lAlphaFieldBlanks(5)) { ShowSevereError(state, format("{}, \"{}\" a {} must be specified when {} is specified as CoolToolsUserDefined or YorkCalcUserDefined", @@ -1052,7 +1050,7 @@ namespace CondenserLoopTowers { state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaFieldNames(4))); ErrorsFound = true; - } else if ((UtilityRoutines::SameString(AlphArray(4), "CoolToolsCrossFlow") || UtilityRoutines::SameString(AlphArray(4), "YorkCalc")) && + } else if ((Util::SameString(AlphArray(4), "CoolToolsCrossFlow") || Util::SameString(AlphArray(4), "YorkCalc")) && !state.dataIPShortCut->lAlphaFieldBlanks(5)) { ShowWarningError(state, format("{}, \"{}\" a Tower Model Coefficient Name is specified and the Tower Model Type is not specified as " @@ -1080,7 +1078,7 @@ namespace CondenserLoopTowers { auto &vstower = state.dataCondenserLoopTowers->towers(tower.VSTower); - if (UtilityRoutines::SameString(AlphArray(4), "CoolToolsCrossFlow")) { + if (Util::SameString(AlphArray(4), "CoolToolsCrossFlow")) { tower.TowerModelType = ModelType::CoolToolsXFModel; // set cross-flow model coefficients // Outputs approach in C @@ -1130,7 +1128,7 @@ namespace CondenserLoopTowers { vstower.MinWaterFlowRatio = 0.75; vstower.MaxWaterFlowRatio = 1.25; - } else if (UtilityRoutines::SameString(AlphArray(4), "YorkCalc")) { + } else if (Util::SameString(AlphArray(4), "YorkCalc")) { tower.TowerModelType = ModelType::YorkCalcModel; // set counter-flow model coefficients // Outputs approach in C @@ -1173,13 +1171,13 @@ namespace CondenserLoopTowers { vstower.MaxWaterFlowRatio = 1.25; vstower.MaxLiquidToGasRatio = 8.0; - } else if (UtilityRoutines::SameString(AlphArray(4), "CoolToolsUserDefined")) { + } else if (Util::SameString(AlphArray(4), "CoolToolsUserDefined")) { tower.TowerModelType = ModelType::CoolToolsUserDefined; // Nested Get-input routines below. Should pull out of here and read in beforehand. for (VSModelCoeffNum = 1; VSModelCoeffNum <= NumVSCoolToolsModelCoeffs; ++VSModelCoeffNum) { state.dataInputProcessing->inputProcessor->getObjectItem( state, "CoolingTowerPerformance:CoolTools", VSModelCoeffNum, AlphArray2, NumAlphas2, NumArray2, NumNums2, IOStat); - if (!UtilityRoutines::SameString(AlphArray2(1), tower.ModelCoeffObjectName)) continue; + if (!Util::SameString(AlphArray2(1), tower.ModelCoeffObjectName)) continue; vstower.FoundModelCoeff = true; // verify the correct number of coefficients for the CoolTools model if (NumNums2 != 43) { @@ -1214,13 +1212,13 @@ namespace CondenserLoopTowers { tower.ModelCoeffObjectName)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(AlphArray(4), "YorkCalcUserDefined")) { + } else if (Util::SameString(AlphArray(4), "YorkCalcUserDefined")) { tower.TowerModelType = ModelType::YorkCalcUserDefined; // Nested Get-input routines below. Should pull out of here and read in beforehand. for (VSModelCoeffNum = 1; VSModelCoeffNum <= NumVSYorkCalcModelCoeffs; ++VSModelCoeffNum) { state.dataInputProcessing->inputProcessor->getObjectItem( state, "CoolingTowerPerformance:YorkCalc", VSModelCoeffNum, AlphArray2, NumAlphas2, NumArray2, NumNums2, IOStat); - if (!UtilityRoutines::SameString(AlphArray2(1), tower.ModelCoeffObjectName)) continue; + if (!Util::SameString(AlphArray2(1), tower.ModelCoeffObjectName)) continue; vstower.FoundModelCoeff = true; // verify the correct number of coefficients for the YorkCalc model if (NumNums2 != 36) { @@ -1434,15 +1432,14 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(8)))); - + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(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 tower.SizFac = NumArray(17); // N14 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(9)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(9)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(10)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(10), AlphArray(10))); @@ -1469,7 +1466,7 @@ namespace CondenserLoopTowers { // cell control for variable speed tower if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(13)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(13)))); } if (state.dataIPShortCut->lAlphaFieldBlanks(11)) { @@ -1551,9 +1548,9 @@ namespace CondenserLoopTowers { DataLoopNode::ObjectIsNotParent); BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); - if (UtilityRoutines::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { + if (Util::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { tower.PerformanceInputMethod_Num = PIM::UFactor; - } else if (UtilityRoutines::SameString(AlphArray(4), "NominalCapacity")) { + } else if (Util::SameString(AlphArray(4), "NominalCapacity")) { tower.PerformanceInputMethod_Num = PIM::NominalCapacity; } else { ShowSevereError(state, format("{}={}", cCurrentModuleObject, AlphArray(1))); @@ -1694,15 +1691,14 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(10)))); - + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, Util::makeUPPER(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 tower.SizFac = NumArray(29); // N29 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, Util::makeUPPER(AlphArray(11)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(12)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(12), AlphArray(12))); @@ -1729,7 +1725,7 @@ namespace CondenserLoopTowers { tower.TowerMassFlowRateMultiplier = tower.MaxFracFlowRate; // cell control for variable speed Merkel tower if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(15)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, Util::makeUPPER(AlphArray(15)))); } if (state.dataIPShortCut->lAlphaFieldBlanks(13)) { @@ -2556,7 +2552,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 (UtilityRoutines::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:SingleSpeed")) { + if (Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:SingleSpeed")) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], @@ -2571,7 +2567,7 @@ namespace CondenserLoopTowers { "Initial Design Water Flow Rate based on tower nominal capacity [m3/s]", this->DesignWaterFlowRate); } - } else if (UtilityRoutines::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:TwoSpeed")) { + } else if (Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:TwoSpeed")) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], @@ -3096,7 +3092,7 @@ namespace CondenserLoopTowers { } if (this->PerformanceInputMethod_Num == PIM::NominalCapacity && - UtilityRoutines::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:TwoSpeed")) { + Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:TwoSpeed")) { if (this->DesignWaterFlowRate >= DataHVACGlobals::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 @@ -3277,7 +3273,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 (UtilityRoutines::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:VariableSpeed")) { + if (Util::SameString(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 @@ -5775,7 +5771,7 @@ namespace CondenserLoopTowers { DeltaTwb = std::abs(OutletAirWetBulb - InletAirWetBulb); // Add KelvinConv to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. // Wet bulb error units are delta K/K - WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + Constant::KelvinConv)); + WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + Constant::Kelvin)); } if (QactualLocal >= 0.0) { diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 7c83ff59252..2e0ab2be729 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -426,8 +426,8 @@ void InitExtConvCoeff(EnergyPlusData &state, state.dataConvect->GetUserSuppliedConvectionCoeffs = false; } - Real64 TAir = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::KelvinConv; - Real64 TSurf = TempExt + Constant::KelvinConv; + Real64 TAir = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::Kelvin; + Real64 TSurf = TempExt + Constant::Kelvin; Real64 TSky = state.dataEnvrn->SkyTempKelvin; Real64 TGround = TAir; HSrdSurf = 0.0; @@ -436,13 +436,13 @@ void InitExtConvCoeff(EnergyPlusData &state, int SrdSurfsNum = surface.SurfSurroundingSurfacesNum; if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum != 0) { TSky = ScheduleManager::GetCurrentScheduleValue(state, state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum) + - Constant::KelvinConv; + Constant::Kelvin; } HSrdSurf = SurroundingSurfacesRadCoeffAverage(state, SurfNum, TSurf, AbsExt); } if (surface.UseSurfPropertyGndSurfTemp) { int gndSurfsNum = surface.SurfPropertyGndSurfIndex; - TGround = state.dataSurface->GroundSurfsProperty(gndSurfsNum).SurfsTempAvg + Constant::KelvinConv; + TGround = state.dataSurface->GroundSurfsProperty(gndSurfsNum).SurfsTempAvg + Constant::Kelvin; } int BaseSurf = surface.BaseSurf; // If this is a base surface, BaseSurf = SurfNum @@ -855,7 +855,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) extConvUserCurve.Name = ipsc->cAlphaArgs(1); ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, extConvUserCurve.Name}; - extConvUserCurve.windSpeedType = static_cast(getEnumValue(RefWindNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + extConvUserCurve.windSpeedType = static_cast(getEnumValue(RefWindNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); if (extConvUserCurve.windSpeedType == RefWind::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1016,7 +1016,8 @@ void GetUserConvCoeffs(EnergyPlusData &state) ipsc->cNumericFieldNames); ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, ""}; - int surfNum = UtilityRoutines::FindItemInList(Alphas(1), Surface); + int surfNum = Util::FindItemInList(Alphas(1), Surface); + if (surfNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), Alphas(1)); ErrorsFound = true; @@ -1119,7 +1120,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) userExtConvModel.SurfaceName = Alphas(1); userExtConvModel.WhichSurface = surfNum; userExtConvModel.overrideType = OverrideType::UserCurve; - userExtConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcExtUserCurve); + userExtConvModel.UserCurveIndex = Util::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcExtUserCurve); if (userExtConvModel.UserCurveIndex == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)); ErrorsFound = true; @@ -1254,7 +1255,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) userIntConvModel.SurfaceName = Alphas(1); userIntConvModel.WhichSurface = surfNum; userIntConvModel.overrideType = OverrideType::UserCurve; - userIntConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcIntUserCurve); + userIntConvModel.UserCurveIndex = Util::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcIntUserCurve); if (userIntConvModel.UserCurveIndex == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)); ErrorsFound = true; @@ -1389,7 +1390,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) userExtConvModel.SurfaceName = Alphas(Ptr); userExtConvModel.WhichSurface = -999; userExtConvModel.overrideType = OverrideType::UserCurve; - userExtConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcExtUserCurve); + userExtConvModel.UserCurveIndex = Util::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcExtUserCurve); if (userExtConvModel.UserCurveIndex == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)); ErrorsFound = true; @@ -1506,7 +1507,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) userIntConvModel.SurfaceName = Alphas(Ptr); userIntConvModel.WhichSurface = -999; userIntConvModel.overrideType = OverrideType::UserCurve; - userIntConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcIntUserCurve); + userIntConvModel.UserCurveIndex = Util::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcIntUserCurve); if (userIntConvModel.UserCurveIndex == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)); ErrorsFound = true; @@ -1595,8 +1596,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(i), ipsc->cAlphaArgs(i)); ErrorsFound = true; } else if (intAlgo.intConvClassEqNums[iInConvClass] == HcInt::UserCurve) { - intAlgo.intConvClassUserCurveNums[iInConvClass] = - UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataConvect->hcIntUserCurve); + intAlgo.intConvClassUserCurveNums[iInConvClass] = Util::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataConvect->hcIntUserCurve); if (intAlgo.intConvClassUserCurveNums[iInConvClass] == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i + 1), ipsc->cAlphaArgs(i + 1)); ErrorsFound = true; @@ -1634,8 +1634,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) ErrorsFound = true; } else if (extAlgo.extConvClass2EqNums[iOutConvClass] == HcExt::UserCurve) { - extAlgo.extConvClass2UserCurveNums[iOutConvClass] = - UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataConvect->hcExtUserCurve); + extAlgo.extConvClass2UserCurveNums[iOutConvClass] = Util::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataConvect->hcExtUserCurve); if (extAlgo.extConvClass2UserCurveNums[iOutConvClass] == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i + 1), ipsc->cAlphaArgs(i + 1)); ErrorsFound = true; @@ -2364,11 +2363,11 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state, // NOTE: this is not ideal. could have circumstances that reverse this? Real64 Tso, Tsi; if (SurfaceTemperatures(Surf1) > SurfaceTemperatures(Surf2)) { - Tsi = SurfaceTemperatures(Surf1) + Constant::KelvinConv; - Tso = SurfaceTemperatures(Surf2) + Constant::KelvinConv; + Tsi = SurfaceTemperatures(Surf1) + Constant::Kelvin; + Tso = SurfaceTemperatures(Surf2) + Constant::Kelvin; } else { - Tso = SurfaceTemperatures(Surf1) + Constant::KelvinConv; - Tsi = SurfaceTemperatures(Surf2) + Constant::KelvinConv; + Tso = SurfaceTemperatures(Surf1) + Constant::Kelvin; + Tsi = SurfaceTemperatures(Surf2) + Constant::Kelvin; } Real64 beta = 2.0 / (Tso + Tsi); // volumetric thermal expansion coefficient @@ -2639,8 +2638,8 @@ Real64 CalcISO15099WindowIntConvCoeff(EnergyPlusData &state, Real64 constexpr g(9.81); // acceleration due to gravity [m/s2] Real64 Nuint(0.0); // Nusselt number for interior surface convection - Real64 SurfTempKelvin = SurfaceTemperature + Constant::KelvinConv; - Real64 AirTempKelvin = AirTemperature + Constant::KelvinConv; + Real64 SurfTempKelvin = SurfaceTemperature + Constant::Kelvin; + Real64 AirTempKelvin = AirTemperature + Constant::Kelvin; Real64 DeltaTemp = SurfaceTemperature - AirTemperature; // protect against wildly out of range temperatures @@ -3441,7 +3440,7 @@ Real64 EvaluateIntHcModels(EnergyPlusData &state, int const SurfNum, HcInt const HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcFohannoPolidoriVerticalWall(Tsurf - Tamb, WallHeight, - Tsurf - Constant::KelvinConv, // Kiva already uses Kelvin, but algorithm expects C + Tsurf - Constant::Kelvin, // Kiva already uses Kelvin, but algorithm expects C QdotConvection); }; } else { @@ -4179,7 +4178,7 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu } } GrH = (g * (Tmax - Tmin) * pow_3(zone.CeilingHeight)) / - ((state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT + Constant::KelvinConv) * pow_2(v)); + ((state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT + Constant::Kelvin) * pow_2(v)); // Reynolds number = Vdot supply / v * cube root of zone volume (Goldstein and Noveselac 2010) if (zoneNode.MassFlowRate > 0.0) { @@ -5656,7 +5655,7 @@ Real64 CalcFohannoPolidoriVerticalWall(Real64 const DeltaTemp, // [C] temperatur Real64 constexpr k = 0.0263; // thermal conductivity (W/m K) for air at 300 K Real64 constexpr Pr = 0.71; // Prandtl number for air at ? - Real64 BetaFilm = 1.0 / (Constant::KelvinConv + SurfTemp + 0.5 * DeltaTemp); // TODO check sign on DeltaTemp + Real64 BetaFilm = 1.0 / (Constant::Kelvin + SurfTemp + 0.5 * DeltaTemp); // TODO check sign on DeltaTemp Real64 RaH = (g * BetaFilm * QdotConv * pow_4(Height) * Pr) / (k * pow_2(v)); if (RaH <= 6.3e09) { @@ -6290,7 +6289,7 @@ Real64 CalcClearRoof(EnergyPlusData &state, Real64 Ln = (RoofPerimeter > 0.0) ? (RoofArea / RoofPerimeter) : std::sqrt(RoofArea); Real64 DeltaTemp = SurfTemp - AirTemp; - Real64 BetaFilm = 1.0 / (Constant::KelvinConv + SurfTemp + 0.5 * DeltaTemp); + Real64 BetaFilm = 1.0 / (Constant::Kelvin + SurfTemp + 0.5 * DeltaTemp); Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, AirTemp, state.dataEnvrn->OutHumRat); Real64 GrLn = g * pow_2(AirDensity) * pow_3(Ln) * std::abs(DeltaTemp) * BetaFilm / pow_2(v); @@ -6546,7 +6545,7 @@ Real64 SurroundingSurfacesRadCoeffAverage(EnergyPlusData &state, int const SurfN // the surface.SrdSurfTemp is weighed by surrounding surfaces view factor Real64 HSrdSurf = 0.0; auto &surface = state.dataSurface->Surface(SurfNum); - Real64 SrdSurfsTK = surface.SrdSurfTemp + Constant::KelvinConv; + Real64 SrdSurfsTK = surface.SrdSurfTemp + Constant::Kelvin; if (TSurfK != SrdSurfsTK) { HSrdSurf = Constant::StefanBoltzmann * AbsExt * surface.ViewFactorSrdSurfs * (pow_4(TSurfK) - pow_4(SrdSurfsTK)) / (TSurfK - SrdSurfsTK); } diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index efe6a09bb9a..3b5e4bb4c34 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -199,7 +199,7 @@ namespace CoolTower { } state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZoneName = state.dataIPShortCut->cAlphaArgs(3); // Name of zone where cooltower is serving - state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), Zone); + state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), Zone); if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr == 0) { if (lAlphaBlanks(3)) { ShowSevereError(state, diff --git a/src/EnergyPlus/CostEstimateManager.cc b/src/EnergyPlus/CostEstimateManager.cc index 17a6439640c..40b8e41d3c0 100644 --- a/src/EnergyPlus/CostEstimateManager.cc +++ b/src/EnergyPlus/CostEstimateManager.cc @@ -303,7 +303,7 @@ namespace CostEstimateManager { } ThisConstructStr = state.dataCostEstimateManager->CostLineItem(Item).ParentObjName; - ThisConstructID = UtilityRoutines::FindItem(ThisConstructStr, state.dataConstruction->Construct); + ThisConstructID = Util::FindItem(ThisConstructStr, state.dataConstruction->Construct); if (ThisConstructID == 0) { // do any surfaces have the specified construction? If not issue warning. ShowWarningError(state, format("ComponentCost:LineItem: \"{}\" Construction=\"{}\", no surfaces have the Construction specified", @@ -357,7 +357,7 @@ namespace CostEstimateManager { auto &parentObjName = state.dataCostEstimateManager->CostLineItem(Item).ParentObjName; if ((state.dataCostEstimateManager->CostLineItem(Item).ParentObjType == ParentObject::CoilDX) || (state.dataCostEstimateManager->CostLineItem(Item).ParentObjType == ParentObject::CoilCoolingDXSingleSpeed)) { - if (UtilityRoutines::FindItem(parentObjName, state.dataDXCoils->DXCoil) > 0) coilFound = true; + if (Util::FindItem(parentObjName, state.dataDXCoils->DXCoil) > 0) coilFound = true; } else if (state.dataCostEstimateManager->CostLineItem(Item).ParentObjType == ParentObject::CoilCoolingDX) { if (CoilCoolingDX::factory(state, parentObjName) != -1) { coilFound = true; @@ -408,8 +408,7 @@ namespace CostEstimateManager { ErrorsFound = true; } else { // assume name is probably useful - thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, - state.dataHeatingCoils->HeatingCoil); + thisCoil = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataHeatingCoils->HeatingCoil); if (thisCoil == 0) { ShowWarningError(state, format("ComponentCost:LineItem: \"{}\", Coil:Heating:Fuel, invalid coil specified", @@ -452,7 +451,7 @@ namespace CostEstimateManager { state.dataCostEstimateManager->CostLineItem(Item).LineName)); ErrorsFound = true; } else { - ThisZoneID = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); + ThisZoneID = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); if (ThisZoneID > 0) { state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataDaylightingData->ZoneDaylight(ThisZoneID).totRefPts; } else { @@ -466,10 +465,9 @@ namespace CostEstimateManager { } break; case ParentObject::ShadingZoneDetailed: { if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - ThisSurfID = - UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataSurface->Surface); + ThisSurfID = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataSurface->Surface); if (ThisSurfID > 0) { - ThisZoneID = UtilityRoutines::FindItem(state.dataSurface->Surface(ThisSurfID).ZoneName, Zone); + ThisZoneID = Util::FindItem(state.dataSurface->Surface(ThisSurfID).ZoneName, Zone); if (ThisZoneID == 0) { ShowSevereError(state, format("ComponentCost:LineItem: \"{}\", Shading:Zone:Detailed, need to specify a valid zone name", @@ -502,7 +500,7 @@ namespace CostEstimateManager { } if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap != 0.0) { if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - ThisZoneID = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); + ThisZoneID = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); if (ThisZoneID == 0) { ShowSevereError(state, format("ComponentCost:LineItem: \"{}\", Lights, need to specify a valid zone name", @@ -522,8 +520,7 @@ namespace CostEstimateManager { case ParentObject::GeneratorPhotovoltaic: { if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap != 0.0) { if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - thisPV = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, - state.dataPhotovoltaic->PVarray); + thisPV = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataPhotovoltaic->PVarray); if (thisPV > 0) { if (state.dataPhotovoltaic->PVarray(thisPV).PVModelType != DataPhotovoltaics::PVModel::Simple) { ShowSevereError(state, @@ -611,7 +608,7 @@ namespace CostEstimateManager { } break; case ParentObject::Construction: { ThisConstructStr = state.dataCostEstimateManager->CostLineItem(Item).ParentObjName; - ThisConstructID = UtilityRoutines::FindItem(ThisConstructStr, state.dataConstruction->Construct); + ThisConstructID = Util::FindItem(ThisConstructStr, state.dataConstruction->Construct); // need to determine unique surfaces... some surfaces are shared by zones and hence doubled uniqueSurfMask.dimension(state.dataSurface->TotSurfaces, true); // init to true and change duplicates to false SurfMultipleARR.dimension(state.dataSurface->TotSurfaces, 1.0); @@ -652,7 +649,7 @@ namespace CostEstimateManager { if (state.dataCostEstimateManager->CostLineItem(Item).ParentObjName == "*") { // wildcard, apply to all such components WildcardObjNames = true; } else if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataDXCoils->DXCoil); + thisCoil = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataDXCoils->DXCoil); } if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap > 0.0) { @@ -793,8 +790,7 @@ namespace CostEstimateManager { if (state.dataCostEstimateManager->CostLineItem(Item).ParentObjName == "*") { // wildcard, apply to all such components WildcardObjNames = true; } else if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - thisCoil = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, - state.dataHeatingCoils->HeatingCoil); + thisCoil = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataHeatingCoils->HeatingCoil); } if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap > 0.0) { @@ -886,7 +882,7 @@ namespace CostEstimateManager { state.dataCostEstimateManager->CostLineItem(Item).Qty = sum(state.dataDaylightingData->ZoneDaylight, &Dayltg::ZoneDaylightCalc::totRefPts); } else if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - ThisZoneID = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); + ThisZoneID = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); if (ThisZoneID > 0) { state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataDaylightingData->ZoneDaylight(ThisZoneID).totRefPts; } @@ -899,10 +895,9 @@ namespace CostEstimateManager { } break; case ParentObject::ShadingZoneDetailed: { if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - ThisSurfID = - UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataSurface->Surface); + ThisSurfID = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataSurface->Surface); if (ThisSurfID > 0) { - ThisZoneID = UtilityRoutines::FindItem(state.dataSurface->Surface(ThisSurfID).ZoneName, Zone); + ThisZoneID = Util::FindItem(state.dataSurface->Surface(ThisSurfID).ZoneName, Zone); if (ThisZoneID > 0) { state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataSurface->Surface(ThisSurfID).Area * Zone(ThisZoneID).Multiplier * Zone(ThisZoneID).ListMultiplier; @@ -926,7 +921,7 @@ namespace CostEstimateManager { if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap != 0.0) { if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - ThisZoneID = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); + ThisZoneID = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone); if (ThisZoneID > 0) { Real64 Qty(0.0); for (auto const &e : state.dataHeatBal->Lights) @@ -946,11 +941,10 @@ namespace CostEstimateManager { case ParentObject::GeneratorPhotovoltaic: { if (state.dataCostEstimateManager->CostLineItem(Item).PerKiloWattCap != 0.0) { if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) { - thisPV = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, - state.dataPhotovoltaic->PVarray); + thisPV = Util::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, state.dataPhotovoltaic->PVarray); if (thisPV > 0) { - ThisZoneID = UtilityRoutines::FindItem( - state.dataSurface->Surface(state.dataPhotovoltaic->PVarray(thisPV).SurfacePtr).ZoneName, Zone); + ThisZoneID = + Util::FindItem(state.dataSurface->Surface(state.dataPhotovoltaic->PVarray(thisPV).SurfacePtr).ZoneName, Zone); if (ThisZoneID == 0) { Multipliers = 1.0; } else { diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc index bec8f4694b1..f80a4140bc6 100644 --- a/src/EnergyPlus/CurveManager.cc +++ b/src/EnergyPlus/CurveManager.cc @@ -2196,7 +2196,7 @@ namespace Curve { ErrorsFound); // Ensure the CP array name should be the same as the name of AirflowNetwork:MultiZone:WindPressureCoefficientArray - if (!UtilityRoutines::SameString(Alphas(2), wpcName)) { + if (!Util::SameString(Alphas(2), wpcName)) { ShowSevereError(state, format("GetCurveInput: Invalid {} = {} in {} = ", state.dataIPShortCut->cAlphaFieldNames(2), @@ -2269,7 +2269,7 @@ namespace Curve { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); state.dataInputProcessing->inputProcessor->markObjectAsUsed("Table:IndependentVariable", thisObjectName); - state.dataCurveManager->btwxtManager.independentVarRefs.emplace(UtilityRoutines::makeUPPER(thisObjectName), fields); + state.dataCurveManager->btwxtManager.independentVarRefs.emplace(Util::makeUPPER(thisObjectName), fields); } } @@ -2285,13 +2285,13 @@ namespace Curve { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); state.dataInputProcessing->inputProcessor->markObjectAsUsed("Table:IndependentVariableList", thisObjectName); - std::string varListName = UtilityRoutines::makeUPPER(thisObjectName); + std::string varListName = Util::makeUPPER(thisObjectName); std::vector gridAxes; // Loop through independent variables in list and add them to the grid for (auto &indVar : fields.at("independent_variables")) { - std::string indVarName = UtilityRoutines::makeUPPER(indVar.at("independent_variable_name").get()); + std::string indVarName = Util::makeUPPER(indVar.at("independent_variable_name").get()); std::string contextString = format("Table:IndependentVariable \"{}\"", indVarName); std::pair callbackPair{&state, contextString}; Btwxt::setMessageCallback(BtwxtMessageCallback, &callbackPair); @@ -2404,7 +2404,7 @@ namespace Curve { } } // Add grid to btwxtManager - state.dataCurveManager->btwxtManager.addGrid(UtilityRoutines::makeUPPER(thisObjectName), Btwxt::GriddedData(gridAxes)); + state.dataCurveManager->btwxtManager.addGrid(Util::makeUPPER(thisObjectName), Btwxt::GriddedData(gridAxes)); } } @@ -2419,10 +2419,10 @@ namespace Curve { ++CurveNum; Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum); - thisCurve->Name = UtilityRoutines::makeUPPER(thisObjectName); + thisCurve->Name = Util::makeUPPER(thisObjectName); thisCurve->interpolationType = InterpType::BtwxtMethod; - std::string indVarListName = UtilityRoutines::makeUPPER(fields.at("independent_variable_list_name").get()); + std::string indVarListName = Util::makeUPPER(fields.at("independent_variable_list_name").get()); std::string contextString = format("Table:Lookup \"{}\"", thisCurve->Name); std::pair callbackPair{&state, contextString}; @@ -2491,9 +2491,9 @@ namespace Curve { }; NormalizationMethod normalizeMethod = NM_NONE; if (fields.count("normalization_method")) { - if (UtilityRoutines::SameString(fields.at("normalization_method").get(), "DIVISORONLY")) { + if (Util::SameString(fields.at("normalization_method").get(), "DIVISORONLY")) { normalizeMethod = NM_DIVISOR_ONLY; - } else if (UtilityRoutines::SameString(fields.at("normalization_method").get(), "AUTOMATICWITHDIVISOR")) { + } else if (Util::SameString(fields.at("normalization_method").get(), "AUTOMATICWITHDIVISOR")) { normalizeMethod = NM_AUTO_WITH_DIVISOR; } } @@ -2963,7 +2963,7 @@ namespace Curve { if (InInputType.empty()) { return true; // if not used it is valid } - CurveInputType found = static_cast(getEnumValue(inputTypes, UtilityRoutines::makeUPPER(InInputType))); + CurveInputType found = static_cast(getEnumValue(inputTypes, Util::makeUPPER(InInputType))); return found != CurveInputType::Invalid; } @@ -2991,7 +2991,7 @@ namespace Curve { }; constexpr std::array(CurveOutputType::Num)> outputTypes = { "DIMENSIONLESS", "PRESSURE", "TEMPERATURE", "CAPACITY", "POWER"}; - CurveOutputType found = static_cast(getEnumValue(outputTypes, UtilityRoutines::makeUPPER(InOutputType))); + CurveOutputType found = static_cast(getEnumValue(outputTypes, Util::makeUPPER(InOutputType))); return found != CurveOutputType::Invalid; } @@ -3062,7 +3062,7 @@ namespace Curve { // Given a curve name, returns the curve index // METHODOLOGY EMPLOYED: - // uses UtilityRoutines::FindItemInList( to search the curve array for the curve name + // uses Util::FindItemInList( to search the curve array for the curve name // First time GetCurveIndex is called, get the input for all the performance curves if (state.dataCurveManager->GetCurvesInputFlag) { @@ -3478,7 +3478,7 @@ namespace Curve { // Then try to retrieve a pressure curve object if (allocated(state.dataBranchAirLoopPlant->PressureCurve)) { if (size(state.dataBranchAirLoopPlant->PressureCurve) > 0) { - TempCurveIndex = UtilityRoutines::FindItemInList(PressureCurveName, state.dataBranchAirLoopPlant->PressureCurve); + TempCurveIndex = Util::FindItemInList(PressureCurveName, state.dataBranchAirLoopPlant->PressureCurve); } else { TempCurveIndex = 0; } diff --git a/src/EnergyPlus/DElightManagerF.cc b/src/EnergyPlus/DElightManagerF.cc index 3978c92e551..6074d11d40c 100644 --- a/src/EnergyPlus/DElightManagerF.cc +++ b/src/EnergyPlus/DElightManagerF.cc @@ -274,7 +274,7 @@ namespace DElightManagerF { for (auto &znDayl : state.dataDaylightingData->daylightControl) { if (znDayl.DaylightMethod == Dayltg::DaylightingMethod::DElight) { - int const izone = UtilityRoutines::FindItemInList(znDayl.ZoneName, state.dataHeatBal->Zone); + int const izone = Util::FindItemInList(znDayl.ZoneName, state.dataHeatBal->Zone); if (izone != 0) { rLightLevel = GetDesignLightingLevelForZone(state, izone); @@ -742,7 +742,7 @@ namespace DElightManagerF { cfs.Name = state.dataIPShortCut->cAlphaArgs(1); cfs.ComplexFeneType = state.dataIPShortCut->cAlphaArgs(2); cfs.surfName = state.dataIPShortCut->cAlphaArgs(3); - if (UtilityRoutines::FindItemInList(cfs.surfName, state.dataSurface->Surface) == 0) { + if (Util::FindItemInList(cfs.surfName, state.dataSurface->Surface) == 0) { ShowSevereError(state, format("{}{}", cCurrentModuleObject, @@ -750,7 +750,7 @@ namespace DElightManagerF { ErrorsFound = true; } cfs.wndwName = state.dataIPShortCut->cAlphaArgs(4); - if (UtilityRoutines::FindItemInList(cfs.surfName, state.dataSurface->Surface) == 0) { + if (Util::FindItemInList(cfs.surfName, state.dataSurface->Surface) == 0) { ShowSevereError(state, format("{}{}", cCurrentModuleObject, @@ -836,8 +836,6 @@ namespace DElightManagerF { // FUNCTION INFORMATION: // AUTHOR Robert J. Hitchcock // DATE WRITTEN August 2003 - // MODIFIED From UtilityRoutines::makeUPPER( function by Linda K. Lawrie - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This function returns a representation of the InputString with blanks replaced with underscores. diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 11ecc5d94d2..29be1fed671 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -166,7 +166,7 @@ void SimDXCoil(EnergyPlusData &state, } if (CompIndex == 0) { - DXCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataDXCoils->DXCoil); + DXCoilNum = Util::FindItemInList(CompName, state.dataDXCoils->DXCoil); if (DXCoilNum == 0) { ShowFatalError(state, format("DX Coil not found={}", CompName)); } @@ -294,7 +294,7 @@ void SimDXCoilMultiSpeed(EnergyPlusData &state, // find correct DX Coil if (CompIndex == 0) { - DXCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataDXCoils->DXCoil); + DXCoilNum = Util::FindItemInList(CompName, state.dataDXCoils->DXCoil); if (DXCoilNum == 0) { ShowFatalError(state, format("DX Coil not found={}", CompName)); } @@ -445,7 +445,7 @@ void SimDXCoilMultiMode(EnergyPlusData &state, // find correct DX Coil if (CompIndex == 0) { - DXCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataDXCoils->DXCoil); + DXCoilNum = Util::FindItemInList(CompName, state.dataDXCoils->DXCoil); if (DXCoilNum == 0) { ShowFatalError(state, format("DX Coil not found={}", CompName)); } @@ -1187,9 +1187,9 @@ void GetDXCoils(EnergyPlusData &state) } } - if ((UtilityRoutines::SameString(Alphas(11), "AirCooled")) || lAlphaBlanks(11)) { + if ((Util::SameString(Alphas(11), "AirCooled")) || lAlphaBlanks(11)) { thisDXCoil.CondenserType(1) = DataHeatBalance::RefrigCondenserType::Air; - } else if (UtilityRoutines::SameString(Alphas(11), "EvaporativelyCooled")) { + } else if (Util::SameString(Alphas(11), "EvaporativelyCooled")) { thisDXCoil.CondenserType(1) = DataHeatBalance::RefrigCondenserType::Evap; thisDXCoil.ReportEvapCondVars = true; } else { @@ -1361,7 +1361,8 @@ void GetDXCoils(EnergyPlusData &state) } // A19; \field Zone Name for Condenser Placement if (!lAlphaBlanks(19) && NumAlphas > 18) { - thisDXCoil.SecZonePtr = UtilityRoutines::FindItemInList(Alphas(19), state.dataHeatBal->Zone); + thisDXCoil.SecZonePtr = Util::FindItemInList(Alphas(19), state.dataHeatBal->Zone); + if (thisDXCoil.SecZonePtr > 0) { SetupZoneInternalGain(state, thisDXCoil.SecZonePtr, @@ -1507,7 +1508,7 @@ void GetDXCoils(EnergyPlusData &state) PerfObjectName = Alphas(AlphaIndex + 1); PerfModeNum = DehumidModeNum * 2 + CapacityStageNum; thisDXCoil.CoilPerformanceType(PerfModeNum) = PerfObjectType; - if (UtilityRoutines::SameString(PerfObjectType, "CoilPerformance:DX:Cooling")) { + if (Util::SameString(PerfObjectType, "CoilPerformance:DX:Cooling")) { thisDXCoil.CoilPerformanceType_Num(PerfModeNum) = CoilPerfDX_CoolBypassEmpirical; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -1756,7 +1757,7 @@ void GetDXCoils(EnergyPlusData &state) Alphas2(7), ErrorsFound, (DataLoopNode::ConnectionObjectType)getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, - UtilityRoutines::makeUPPER(PerfObjectType)), + Util::makeUPPER(PerfObjectType)), PerfObjectName, DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::OutsideAirReference, @@ -1771,9 +1772,9 @@ void GetDXCoils(EnergyPlusData &state) "simulation continues"); } } - if ((UtilityRoutines::SameString(Alphas2(8), "AirCooled")) || lAlphaBlanks2(8)) { + if ((Util::SameString(Alphas2(8), "AirCooled")) || lAlphaBlanks2(8)) { thisDXCoil.CondenserType(PerfModeNum) = DataHeatBalance::RefrigCondenserType::Air; - } else if (UtilityRoutines::SameString(Alphas2(8), "EvaporativelyCooled")) { + } else if (Util::SameString(Alphas2(8), "EvaporativelyCooled")) { thisDXCoil.CondenserType(PerfModeNum) = DataHeatBalance::RefrigCondenserType::Evap; thisDXCoil.ReportEvapCondVars = true; } else { @@ -2200,7 +2201,6 @@ void GetDXCoils(EnergyPlusData &state) // Only required for reverse cycle heat pumps thisDXCoil.DefrostEIRFT = GetCurveIndex(state, Alphas(10)); // convert curve name to number - // A11; \field Crankcase Heater Capacity Function of Outdoor Temperature Curve Name if (!lAlphaBlanks(11)) { thisDXCoil.CrankcaseHeaterCapacityCurveIndex = Curve::GetCurveIndex(state, Alphas(11)); @@ -2213,7 +2213,8 @@ void GetDXCoils(EnergyPlusData &state) cAlphaFields(11)); // Field Name } - if (UtilityRoutines::SameString(Alphas(12), "ReverseCycle")) { + if (Util::SameString(Alphas(12), "ReverseCycle")) { + if (thisDXCoil.DefrostEIRFT == 0) { if (lAlphaBlanks(10)) { ShowSevereError(state, format("{}{}=\"{}\", missing", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -2247,8 +2248,9 @@ void GetDXCoils(EnergyPlusData &state) } } - if (UtilityRoutines::SameString(Alphas(12), "ReverseCycle")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; - if (UtilityRoutines::SameString(Alphas(12), "Resistive")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; + if (Util::SameString(Alphas(12), "ReverseCycle")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; + if (Util::SameString(Alphas(12), "Resistive")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; + if (thisDXCoil.DefrostStrategy == StandardRatings::DefrostStrat::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format("...illegal {}=\"{}\".", cAlphaFields(12), Alphas(12))); @@ -2256,8 +2258,8 @@ void GetDXCoils(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(13), "Timed")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::Timed; - if (UtilityRoutines::SameString(Alphas(13), "OnDemand")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; + if (Util::SameString(Alphas(13), "Timed")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::Timed; + if (Util::SameString(Alphas(13), "OnDemand")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; if (thisDXCoil.DefrostControl == StandardRatings::HPdefrostControl::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format("...illegal {}=\"{}\".", cAlphaFields(13), Alphas(13))); @@ -2349,7 +2351,7 @@ void GetDXCoils(EnergyPlusData &state) // A14, \field Zone Name for Evaporator Placement if (!lAlphaBlanks(15) && NumAlphas > 14) { - thisDXCoil.SecZonePtr = UtilityRoutines::FindItemInList(Alphas(15), state.dataHeatBal->Zone); + thisDXCoil.SecZonePtr = Util::FindItemInList(Alphas(15), state.dataHeatBal->Zone); if (thisDXCoil.SecZonePtr > 0) { SetupZoneInternalGain(state, thisDXCoil.SecZonePtr, @@ -2762,9 +2764,9 @@ void GetDXCoils(EnergyPlusData &state) } } - if ((UtilityRoutines::SameString(Alphas(13), "AirCooled")) || lAlphaBlanks(13)) { + if ((Util::SameString(Alphas(13), "AirCooled")) || lAlphaBlanks(13)) { thisDXCoil.CondenserType(1) = DataHeatBalance::RefrigCondenserType::Air; - } else if (UtilityRoutines::SameString(Alphas(13), "EvaporativelyCooled")) { + } else if (Util::SameString(Alphas(13), "EvaporativelyCooled")) { thisDXCoil.CondenserType(1) = DataHeatBalance::RefrigCondenserType::Evap; thisDXCoil.ReportEvapCondVars = true; } else { @@ -2961,7 +2963,7 @@ void GetDXCoils(EnergyPlusData &state) } // A21; \field Zone Name for Condenser Placement if (!lAlphaBlanks(21) && NumAlphas > 20) { - thisDXCoil.SecZonePtr = UtilityRoutines::FindItemInList(Alphas(21), state.dataHeatBal->Zone); + thisDXCoil.SecZonePtr = Util::FindItemInList(Alphas(21), state.dataHeatBal->Zone); if (thisDXCoil.SecZonePtr > 0) { SetupZoneInternalGain(state, thisDXCoil.SecZonePtr, @@ -3089,9 +3091,9 @@ void GetDXCoils(EnergyPlusData &state) } } - if (UtilityRoutines::SameString(Alphas(2), "Yes") || UtilityRoutines::SameString(Alphas(2), "No")) { + if (Util::SameString(Alphas(2), "Yes") || Util::SameString(Alphas(2), "No")) { // initialized to TRUE on allocate - if (UtilityRoutines::SameString(Alphas(2), "No")) thisDXCoil.FanPowerIncludedInCOP = false; + if (Util::SameString(Alphas(2), "No")) thisDXCoil.FanPowerIncludedInCOP = false; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format(",,,invalid choice for {}. Entered choice = {}", cAlphaFields(2), Alphas(2))); @@ -3099,9 +3101,9 @@ void GetDXCoils(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(3), "Yes") || UtilityRoutines::SameString(Alphas(3), "No")) { + if (Util::SameString(Alphas(3), "Yes") || Util::SameString(Alphas(3), "No")) { // initialized to FALSE on allocate - if (UtilityRoutines::SameString(Alphas(3), "Yes")) thisDXCoil.CondPumpPowerInCOP = true; + if (Util::SameString(Alphas(3), "Yes")) thisDXCoil.CondPumpPowerInCOP = true; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format(",,,invalid choice for {}. Entered choice = {}", cAlphaFields(3), Alphas(3))); @@ -3109,9 +3111,9 @@ void GetDXCoils(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(4), "Yes") || UtilityRoutines::SameString(Alphas(4), "No")) { + if (Util::SameString(Alphas(4), "Yes") || Util::SameString(Alphas(4), "No")) { // initialized to FALSE on allocate - if (UtilityRoutines::SameString(Alphas(4), "Yes")) thisDXCoil.CondPumpHeatInCapacity = true; + if (Util::SameString(Alphas(4), "Yes")) thisDXCoil.CondPumpHeatInCapacity = true; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format(",,,invalid choice for {}. Entered choice = {}", cAlphaFields(4), Alphas(4))); @@ -3207,9 +3209,9 @@ void GetDXCoils(EnergyPlusData &state) cAlphaFields(9)); // Field Name } - if (UtilityRoutines::SameString(Alphas(10), "DryBulbTemperature")) { + if (Util::SameString(Alphas(10), "DryBulbTemperature")) { thisDXCoil.InletAirTemperatureType = DryBulbIndicator; - } else if (UtilityRoutines::SameString(Alphas(10), "WetBulbTemperature")) { + } else if (Util::SameString(Alphas(10), "WetBulbTemperature")) { thisDXCoil.InletAirTemperatureType = WetBulbIndicator; } else { // wrong temperature type selection @@ -3570,9 +3572,9 @@ void GetDXCoils(EnergyPlusData &state) } } - if (UtilityRoutines::SameString(Alphas(2), "Yes") || UtilityRoutines::SameString(Alphas(2), "No")) { + if (Util::SameString(Alphas(2), "Yes") || Util::SameString(Alphas(2), "No")) { // initialized to TRUE on allocate - if (UtilityRoutines::SameString(Alphas(2), "No")) thisDXCoil.FanPowerIncludedInCOP = false; + if (Util::SameString(Alphas(2), "No")) thisDXCoil.FanPowerIncludedInCOP = false; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format(",,,invalid choice for {}. Entered choice = {}", cAlphaFields(2), Alphas(2))); @@ -3656,9 +3658,9 @@ void GetDXCoils(EnergyPlusData &state) cAlphaFields(5)); // Field Name } - if (UtilityRoutines::SameString(Alphas(6), "DryBulbTemperature")) { + if (Util::SameString(Alphas(6), "DryBulbTemperature")) { thisDXCoil.InletAirTemperatureType = DryBulbIndicator; - } else if (UtilityRoutines::SameString(Alphas(6), "WetBulbTemperature")) { + } else if (Util::SameString(Alphas(6), "WetBulbTemperature")) { thisDXCoil.InletAirTemperatureType = WetBulbIndicator; } else { // wrong temperature type selection @@ -3967,9 +3969,9 @@ void GetDXCoils(EnergyPlusData &state) } } - if ((UtilityRoutines::SameString(Alphas(6), "AirCooled")) || lAlphaBlanks(6)) { + if ((Util::SameString(Alphas(6), "AirCooled")) || lAlphaBlanks(6)) { thisDXCoil.CondenserType(1) = DataHeatBalance::RefrigCondenserType::Air; - } else if (UtilityRoutines::SameString(Alphas(6), "EvaporativelyCooled")) { + } else if (Util::SameString(Alphas(6), "EvaporativelyCooled")) { thisDXCoil.CondenserType(1) = DataHeatBalance::RefrigCondenserType::Evap; thisDXCoil.ReportEvapCondVars = true; } else { @@ -4025,9 +4027,9 @@ void GetDXCoils(EnergyPlusData &state) // Set crankcase heater cutout temperature thisDXCoil.MaxOATCrankcaseHeater = Numbers(3); - if (UtilityRoutines::SameString(Alphas(9), "Yes")) { + if (Util::SameString(Alphas(9), "Yes")) { thisDXCoil.PLRImpact = true; - } else if (UtilityRoutines::SameString(Alphas(9), "No")) { + } else if (Util::SameString(Alphas(9), "No")) { thisDXCoil.PLRImpact = false; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -4036,9 +4038,9 @@ void GetDXCoils(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(10), "Yes")) { + if (Util::SameString(Alphas(10), "Yes")) { thisDXCoil.LatentImpact = true; - } else if (UtilityRoutines::SameString(Alphas(10), "No")) { + } else if (Util::SameString(Alphas(10), "No")) { thisDXCoil.LatentImpact = false; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -4406,7 +4408,7 @@ void GetDXCoils(EnergyPlusData &state) } // A38; \field Zone Name for Condenser Placement if (!lAlphaBlanks(38) && NumAlphas > 37) { - thisDXCoil.SecZonePtr = UtilityRoutines::FindItemInList(Alphas(38), state.dataHeatBal->Zone); + thisDXCoil.SecZonePtr = Util::FindItemInList(Alphas(38), state.dataHeatBal->Zone); if (thisDXCoil.SecZonePtr > 0) { SetupZoneInternalGain(state, thisDXCoil.SecZonePtr, @@ -4523,7 +4525,7 @@ void GetDXCoils(EnergyPlusData &state) // Only required for reverse cycle heat pumps thisDXCoil.DefrostEIRFT = GetCurveIndex(state, Alphas(6)); // convert curve name to number - if (UtilityRoutines::SameString(Alphas(7), "ReverseCycle")) { + if (Util::SameString(Alphas(7), "ReverseCycle")) { if (thisDXCoil.DefrostEIRFT == 0) { if (lAlphaBlanks(6)) { ShowSevereError(state, format("{}{}=\"{}\", missing", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -4556,8 +4558,8 @@ void GetDXCoils(EnergyPlusData &state) } } - if (UtilityRoutines::SameString(Alphas(7), "ReverseCycle")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; - if (UtilityRoutines::SameString(Alphas(7), "Resistive")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; + if (Util::SameString(Alphas(7), "ReverseCycle")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; + if (Util::SameString(Alphas(7), "Resistive")) thisDXCoil.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; if (thisDXCoil.DefrostStrategy == StandardRatings::DefrostStrat::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format("...illegal {}=\"{}\".", cAlphaFields(7), Alphas(7))); @@ -4565,8 +4567,8 @@ void GetDXCoils(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(8), "Timed")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::Timed; - if (UtilityRoutines::SameString(Alphas(8), "OnDemand")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; + if (Util::SameString(Alphas(8), "Timed")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::Timed; + if (Util::SameString(Alphas(8), "OnDemand")) thisDXCoil.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; if (thisDXCoil.DefrostControl == StandardRatings::HPdefrostControl::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); ShowContinueError(state, format("...illegal {}=\"{}\".", cAlphaFields(8), Alphas(8))); @@ -4591,9 +4593,9 @@ void GetDXCoils(EnergyPlusData &state) ShowContinueError(state, format("...{} = 0.0 for defrost strategy = RESISTIVE.", cNumericFields(7))); } - if (UtilityRoutines::SameString(Alphas(9), "Yes")) { + if (Util::SameString(Alphas(9), "Yes")) { thisDXCoil.PLRImpact = true; - } else if (UtilityRoutines::SameString(Alphas(9), "No")) { + } else if (Util::SameString(Alphas(9), "No")) { thisDXCoil.PLRImpact = false; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, thisDXCoil.Name)); @@ -4878,7 +4880,7 @@ void GetDXCoils(EnergyPlusData &state) } // A35; \field Zone Name for Condenser Placement if (!lAlphaBlanks(35) && NumAlphas > 34) { - thisDXCoil.SecZonePtr = UtilityRoutines::FindItemInList(Alphas(35), state.dataHeatBal->Zone); + thisDXCoil.SecZonePtr = Util::FindItemInList(Alphas(35), state.dataHeatBal->Zone); if (thisDXCoil.SecZonePtr > 0) { SetupZoneInternalGain(state, thisDXCoil.SecZonePtr, @@ -15070,8 +15072,8 @@ void GetFanIndexForTwoSpeedCoil( if (state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).CompType_Num == SimAirServingZones::CompType::DXSystem) { - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).Name, - state.dataDXCoils->DXCoil(CoolingCoilIndex).CoilSystemName)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).Name, + state.dataDXCoils->DXCoil(CoolingCoilIndex).CoilSystemName)) { FoundBranch = BranchNum; FoundAirSysNum = AirSysNum; break; @@ -15080,8 +15082,8 @@ void GetFanIndexForTwoSpeedCoil( } else if (state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).CompType_Num == SimAirServingZones::CompType::UnitarySystemModel) { - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).Name, - state.dataDXCoils->DXCoil(CoolingCoilIndex).CoilSystemName)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).Name, + state.dataDXCoils->DXCoil(CoolingCoilIndex).CoilSystemName)) { FoundBranch = BranchNum; FoundAirSysNum = AirSysNum; break; @@ -15138,7 +15140,7 @@ void GetDXCoilIndex(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - DXCoilIndex = UtilityRoutines::FindItemInList(DXCoilName, state.dataDXCoils->DXCoil); + DXCoilIndex = Util::FindItemInList(DXCoilName, state.dataDXCoils->DXCoil); if (DXCoilIndex == 0) { if (!SuppressWarning) { // No warning printed if only searching for the existence of a DX Coil @@ -15214,25 +15216,23 @@ Real64 GetCoilCapacity(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:DX:SingleSpeed") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:DX:SingleSpeed")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataDXCoils->DXCoil); + if (Util::SameString(CoilType, "Coil:Heating:DX:SingleSpeed") || Util::SameString(CoilType, "Coil:Cooling:DX:SingleSpeed")) { + WhichCoil = Util::FindItem(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { CoilCapacity = state.dataDXCoils->DXCoil(WhichCoil).RatedTotCap(1); } - } else if (UtilityRoutines::SameString(CoilType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataDXCoils->DXCoil); + } else if (Util::SameString(CoilType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { + WhichCoil = Util::FindItem(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { CoilCapacity = state.dataDXCoils->DXCoil(WhichCoil).RatedTotCap(state.dataDXCoils->DXCoil(WhichCoil).NumCapacityStages); } - } else if (UtilityRoutines::SameString(CoilType, "Coil:Cooling:DX:TwoSpeed")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataDXCoils->DXCoil); + } else if (Util::SameString(CoilType, "Coil:Cooling:DX:TwoSpeed")) { + WhichCoil = Util::FindItem(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { CoilCapacity = state.dataDXCoils->DXCoil(WhichCoil).RatedTotCap(1); } - } else if (UtilityRoutines::SameString(CoilType, "Coil:Cooling:DX:MultiSpeed") || - UtilityRoutines::SameString(CoilType, "Coil:Heating:DX:MultiSpeed")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataDXCoils->DXCoil); + } else if (Util::SameString(CoilType, "Coil:Cooling:DX:MultiSpeed") || Util::SameString(CoilType, "Coil:Heating:DX:MultiSpeed")) { + WhichCoil = Util::FindItem(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { CoilCapacity = state.dataDXCoils->DXCoil(WhichCoil).MSRatedTotCap(state.dataDXCoils->DXCoil(WhichCoil).NumOfSpeeds); } @@ -15339,7 +15339,7 @@ int GetCoilTypeNum(EnergyPlusData &state, PrintMessage = true; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { TypeNum = state.dataDXCoils->DXCoil(WhichCoil).DXCoilType_Num; } else { @@ -15403,7 +15403,7 @@ int GetCoilInletNode(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { NodeNumber = state.dataDXCoils->DXCoil(WhichCoil).AirInNode; } else { @@ -15468,7 +15468,7 @@ int GetCoilOutletNode(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { NodeNumber = state.dataDXCoils->DXCoil(WhichCoil).AirOutNode; } else { @@ -15534,7 +15534,7 @@ int GetCoilCondenserInletNode(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { CondNode = state.dataDXCoils->DXCoil(WhichCoil).CondenserInletNodeNum(1); } else { @@ -15574,7 +15574,7 @@ Real64 GetDXCoilBypassedFlowFrac(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { BypassFraction = state.dataDXCoils->DXCoil(WhichCoil).BypassedFlowFrac(1); } else { @@ -15611,14 +15611,14 @@ int GetHPCoolingCoilIndex(EnergyPlusData &state, DXCoolingCoilIndex = 0; DataLoopNode::ConnectionObjectType HeatingCoilTypeNum = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(HeatingCoilType))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(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 || - !UtilityRoutines::SameString(HeatingCoilName, state.dataBranchNodeConnections->CompSets(WhichComp).CName)) + !Util::SameString(HeatingCoilName, state.dataBranchNodeConnections->CompSets(WhichComp).CName)) continue; CompSetsParentType = state.dataBranchNodeConnections->CompSets(WhichComp).ParentObjectType; CompSetsParentName = state.dataBranchNodeConnections->CompSets(WhichComp).ParentCName; @@ -15629,28 +15629,27 @@ int GetHPCoolingCoilIndex(EnergyPlusData &state, (CompSetsParentType == DataLoopNode::ConnectionObjectType::AirLoopHVACUnitarySystem)) { // Search for DX cooling coils for (WhichCompanionComp = 1; WhichCompanionComp <= state.dataBranchNodeConnections->NumCompSets; ++WhichCompanionComp) { - if (!UtilityRoutines::SameString(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ParentCName, CompSetsParentName) || + if (!Util::SameString(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ParentCName, CompSetsParentName) || (state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ComponentObjectType != DataLoopNode::ConnectionObjectType::CoilCoolingDXSingleSpeed)) continue; DXCoolingCoilIndex = - UtilityRoutines::FindItemInList(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).CName, state.dataDXCoils->DXCoil); + Util::FindItemInList(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).CName, state.dataDXCoils->DXCoil); break; } for (WhichCompanionComp = 1; WhichCompanionComp <= state.dataBranchNodeConnections->NumCompSets; ++WhichCompanionComp) { - if (!UtilityRoutines::SameString(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ParentCName, CompSetsParentName) || + if (!Util::SameString(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ParentCName, CompSetsParentName) || (state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ComponentObjectType != DataLoopNode::ConnectionObjectType::CoilCoolingDXMultiSpeed)) continue; DXCoolingCoilIndex = - UtilityRoutines::FindItemInList(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).CName, state.dataDXCoils->DXCoil); + Util::FindItemInList(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).CName, state.dataDXCoils->DXCoil); break; } // Search for Heat Exchanger Assisted DX cooling coils if (DXCoolingCoilIndex == 0) { for (WhichHXAssistedComp = 1; WhichHXAssistedComp <= state.dataBranchNodeConnections->NumCompSets; ++WhichHXAssistedComp) { - if (!UtilityRoutines::SameString(state.dataBranchNodeConnections->CompSets(WhichHXAssistedComp).ParentCName, - CompSetsParentName) || + if (!Util::SameString(state.dataBranchNodeConnections->CompSets(WhichHXAssistedComp).ParentCName, CompSetsParentName) || (state.dataBranchNodeConnections->CompSets(WhichHXAssistedComp).ComponentObjectType != DataLoopNode::ConnectionObjectType::CoilSystemCoolingDXHeatExchangerAssisted)) continue; @@ -15658,13 +15657,12 @@ int GetHPCoolingCoilIndex(EnergyPlusData &state, HXCompSetsParentType = state.dataBranchNodeConnections->CompSets(WhichHXAssistedComp).ComponentObjectType; std::string const &HXCompSetsParentName = state.dataBranchNodeConnections->CompSets(WhichHXAssistedComp).CName; for (WhichCompanionComp = 1; WhichCompanionComp <= state.dataBranchNodeConnections->NumCompSets; ++WhichCompanionComp) { - if (!UtilityRoutines::SameString(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ParentCName, - HXCompSetsParentName) || + if (!Util::SameString(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ParentCName, HXCompSetsParentName) || (state.dataBranchNodeConnections->CompSets(WhichCompanionComp).ComponentObjectType != DataLoopNode::ConnectionObjectType::CoilCoolingDXSingleSpeed)) continue; - DXCoolingCoilIndex = UtilityRoutines::FindItemInList(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).CName, - state.dataDXCoils->DXCoil); + DXCoolingCoilIndex = + Util::FindItemInList(state.dataBranchNodeConnections->CompSets(WhichCompanionComp).CName, state.dataDXCoils->DXCoil); break; } break; @@ -15731,7 +15729,7 @@ int GetDXCoilNumberOfSpeeds(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { NumberOfSpeeds = state.dataDXCoils->DXCoil(WhichCoil).NumOfSpeeds; } else { @@ -15783,7 +15781,7 @@ int GetDXCoilAvailSchPtr(EnergyPlusData &state, WhichCoil = CoilIndex; } } else { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); } if (WhichCoil != 0) { SchPtr = state.dataDXCoils->DXCoil(WhichCoil).SchedPtr; @@ -15829,7 +15827,7 @@ Real64 GetDXCoilAirFlow(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { switch (state.dataDXCoils->DXCoil(WhichCoil).DXCoilType_Num) { case CoilDX_CoolingSingleSpeed: @@ -16103,7 +16101,7 @@ void SetCoilSystemHeatingDXFlag(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { state.dataDXCoils->DXCoil(WhichCoil).FindCompanionUpStreamCoil = false; } else { @@ -16131,7 +16129,7 @@ void SetCoilSystemCoolingData(EnergyPlusData &state, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { state.dataDXCoils->DXCoil(WhichCoil).CoilSystemName = CoilSystemName; } else { @@ -16219,7 +16217,7 @@ void SetDXCoilTypeData(EnergyPlusData &state, std::string const &CoilName) // mu state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { state.dataDXCoils->DXCoil(WhichCoil).ISHundredPercentDOASDXCoil = true; } else { @@ -17894,7 +17892,7 @@ void SetDXCoilAirLoopNumber(EnergyPlusData &state, std::string const &CoilName, state.dataDXCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataDXCoils->DXCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataDXCoils->DXCoil); if (WhichCoil != 0) { state.dataDXCoils->DXCoil(WhichCoil).AirLoopNum = AirLoopNum; } else { diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index b6402a9df35..7fb8cdc6072 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -286,7 +286,7 @@ EnergyPlusData::EnergyPlusData() this->dataWaterToAirHeatPump = std::make_unique(); this->dataWaterToAirHeatPumpSimple = std::make_unique(); this->dataWaterUse = std::make_unique(); - this->dataWeatherManager = std::make_unique(); + this->dataWeather = std::make_unique(); this->dataWindTurbine = std::make_unique(); this->dataWindowAC = std::make_unique(); this->dataWindowComplexManager = std::make_unique(); @@ -542,7 +542,7 @@ void EnergyPlusData::clear_state() this->dataWaterToAirHeatPump->clear_state(); this->dataWaterToAirHeatPumpSimple->clear_state(); this->dataWaterUse->clear_state(); - this->dataWeatherManager->clear_state(); + this->dataWeather->clear_state(); this->dataWindTurbine->clear_state(); this->dataWindowAC->clear_state(); this->dataWindowComplexManager->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index b13040e86fe..c56fcc619ee 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -555,7 +555,7 @@ struct EnergyPlusData : BaseGlobalStruct std::unique_ptr dataWaterToAirHeatPump; std::unique_ptr dataWaterToAirHeatPumpSimple; std::unique_ptr dataWaterUse; - std::unique_ptr dataWeatherManager; + std::unique_ptr dataWeather; std::unique_ptr dataWindTurbine; std::unique_ptr dataWindowAC; std::unique_ptr dataWindowComplexManager; diff --git a/src/EnergyPlus/DataEnvironment.cc b/src/EnergyPlus/DataEnvironment.cc index 096f3cfe370..abafad58b54 100644 --- a/src/EnergyPlus/DataEnvironment.cc +++ b/src/EnergyPlus/DataEnvironment.cc @@ -220,7 +220,7 @@ Real64 OutBaroPressAt(EnergyPlusData &state, Real64 const Z) // Height above gro // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 BaseTemp; // Base temperature at Z - BaseTemp = OutDryBulbTempAt(state, Z) + Constant::KelvinConv; + BaseTemp = OutDryBulbTempAt(state, Z) + Constant::Kelvin; if (Z <= 0.0) { LocalAirPressure = 0.0; diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index fb135398b7d..cb58fcdf3a2 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -473,8 +473,8 @@ namespace Constant { Real64 constexpr BigNumber = std::numeric_limits::max(); // Max Number real used for initializations Real64 constexpr rTinyValue = std::numeric_limits::epsilon(); // Tiny value to replace use of TINY(x) std::string::size_type constexpr MaxNameLength = - 100; // Maximum Name Length in Characters -- should be the same as MaxAlphaArgLength in InputProcessor module - Real64 constexpr KelvinConv = 273.15; // Conversion factor for C to K and K to C + 100; // Maximum Name Length in Characters -- should be the same as MaxAlphaArgLength in InputProcessor module + Real64 constexpr Kelvin = 273.15; // Conversion factor for C to K and K to C Real64 constexpr TriplePointOfWaterTempKelvin = 273.16; // The triple point of water, in Kelvin Real64 constexpr InitConvTemp = 5.05; // [deg C], standard init vol to mass flow conversion temp Real64 constexpr AutoCalculate = -99999.0; // automatically calculate some fields. diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index eddf4a5e2c4..0b0e3197b92 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -859,7 +859,7 @@ void AddVariableSlatBlind(EnergyPlusData &state, // maybe it's already there errFlag = false; - Found = UtilityRoutines::FindItemInList("~" + state.dataMaterial->Blind(inBlindNumber).Name, state.dataMaterial->Blind); + Found = Util::FindItemInList("~" + state.dataMaterial->Blind(inBlindNumber).Name, state.dataMaterial->Blind); if (Found == 0) { // Add a new blind state.dataHeatBal->TotBlinds += 1; diff --git a/src/EnergyPlus/DataOutputs.hh b/src/EnergyPlus/DataOutputs.hh index 6c08d10ea3f..e6462d161d8 100644 --- a/src/EnergyPlus/DataOutputs.hh +++ b/src/EnergyPlus/DataOutputs.hh @@ -106,10 +106,10 @@ struct OutputsData : BaseGlobalStruct std::map, - // UtilityRoutines::case_insensitive_hasher, - UtilityRoutines::case_insensitive_comparator> + // Util::case_insensitive_hasher, + Util::case_insensitive_comparator>, + // Util::case_insensitive_hasher, + Util::case_insensitive_comparator> OutputVariablesForSimulation; void clear_state() override diff --git a/src/EnergyPlus/DataRuntimeLanguage.hh b/src/EnergyPlus/DataRuntimeLanguage.hh index 131f8ec113e..63c509ce3ed 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.hh +++ b/src/EnergyPlus/DataRuntimeLanguage.hh @@ -446,18 +446,238 @@ namespace DataRuntimeLanguage { } }; - struct OperatorType + struct Operator { // Members // structure for operators and functions, used to look up information about each operator or function - std::string Symbol; // string representation of operator or function (for reporting) - ErlFunc Code; // integer code 1..64, identifies operator or function - int NumOperands; // count of operands or function arguments. + std::string_view symbol = ""; // string representation of operator or function (for reporting) + int numOperands = 0; // count of operands or function arguments. + }; - // Default Constructor - OperatorType() : Code(ErlFunc::Invalid), NumOperands(0) - { - } + static constexpr std::array ErlFuncNamesUC = { + "", // Null + "", // Literal + "-", // Negative + "/", // Divide + "*", // Multiply + "-", // Subtract + "+", // Add + "==", // Equal + "<>", // NotEqual + "<=", // LessOrEqual + ">=", // GreaterOrEqual + "<", // LessThan + ">", // GreaterThan + "^", // RaiseToPower + "&&", // LogicalAND + "||", // LogicalOR + // note there is an important check "> 15" to distinguish operators from functions + // so be careful if renumber these parameters. Binary operator additions should get inserted here rather than appended + + // parameters for built-in Erl functions, these are processed like operators and numbering + // must be sequential with the operators. + // math functions + "@ROUND", // Round + "@MOD", // Mod + "@SIN", // Sin + "@COS", // Cos + "@ARCSIN", // ArcSin + "@ARCCOS", // ArcCos + "@DEGTORAD", // DegToRad + "@RADTODEG", // RadToDeg + "@EXP", // Exp + "@LN", // Ln + "@MAX", // Max + "@MIN", // Min + "@ABS", // Abs + "@RANDOMUNIFORMU", // RandU + "@RANDOMGAUSSIAN", // RandG + "@SEEDRANDOM", // RandSeed + + // begin psychrometric routines + "@RHOAIRFNPBTDBW", // RhoAirFnPbTdbW + "@CPAIRFNW", // CpAirFnW + "@HFGAIRFNWTDB", // HfgAirFnWTdb + "@HGAIRFNWTDB", // HgAirFnWTdb + "@TDPFNTDBTWBPB", // TdpFnTdbTwbPb + "@TDPFNWPB", // TdpFnWPb + "@HFNTDBW", // HFnTdbW + "@HFNTDBRHPB", // HFnTdbRhPb + "@TDBFNHW", // TdbFnHW + "@RHOVFNTDBRH", // RhovFnTdbRh + "@RHOVFNTDBRHLBND0C", // RhovFnTdbRhLBnd0C + "@RHOVFNTDBWPB", // RhovFnTdbWPb + "@RHFNTDBRHOV", // RhFnTdbRhov + "@RHFNTDBRHOVBND0C", // RhFnTdbRhovLBnd0C + "@RHFNTDBWPB", // RhFnTdbWPb + "@TWBFNTDBWPB", // TwbFnTdbWPb + "@VFNTDBWPB", // VFnTdbWPb + "@WFNTDPPB", // WFnTdpPb + "@WFNTDBH", // WFnTdbH + "@WFNTDBTWBPB", // WFnTdbTwbPb + "@WFNTDBRHPB", // WFnTdbRhPb + "@PSATFNTEMP", // PsatFnTemp + "@TSATFNHPB", // TsatFnHPb + "@TSATFNPB", // TsatFnPb + "@CPCW", // CpCW + "@CPHW", // CpHW + "@RHOH2O", // RhoH2O + + // Simulation Management Functions + "@FATALHALTEP", // FatalHaltEp + "@SEVEREWARNEP", // SevereWarnEp + "@WARNEP", // WarnEp + + // Trend variable handling Functions + "@TRENDVALUE", // TrendValue + "@TRENDAVERAGE", // TrendAverage + "@TRENDMAX", // TrendMax + "@TRENDMIN", // TrendMin + "@TRENDDIRECTION", // TrendDirection + "@TRENDSUM", // TrendSum + + // Curve and Table access function + "@CURVEVALUE", // CurveValue + + // Weather data query functions + "@TODAYISRAIN", // TodayIsRain + "@TODAYISSNOW", // TodayIsSnow + "@TODAYOUTDRYBULBTEMP", // TodayOutDryBulbTemp + "@TODAYOUTDEWPOINTTEMP", // TodayOutDewPointTemp + "@TODAYOUTBAROPRESS", // TodayOutBaroPress + "@TODAYOUTRELHUM", // TodayOutRelHum + "@TODAYWINDSPEED", // TodayWindSpeed + "@TODAYWINDDIR", // TodayWindDir + "@TODAYSKYTEMP", // TodaySkyTemp + "@TODAYHORIZRSKY", // TodayHorizIRSky + "@TODAYBEAMSOLARRAD", // TodayBeamSolarRad + "@TODAYDIFSOLARRAD", // TodayDifSolarRad + "@TODAYALBEDO", // TodayAlbedo + "@TODAYLIQUIDPRECIP", // TodayLiquidPrecip + "@TOMORROWISRAIN", // TomorrowIsRain + "@TOMORROWISSNOW", // TomorrowIsSnow + "@TOMORROWOUTDRYBULBTEMP", // TomorrowOutDryBulbTemp + "@TOMORROWOUTDEWPOINTTEMP", // TomorrowOutDewPointTemp + "@TOMORROWOUTBAROPRESS", // TomorrowOutBaroPress + "@TOMORROWOUTRELHUM", // TomorrowOutRelHum + "@TOMORROWWINDSPEED", // TomorrowWindSpeed + "@TOMORROWWINDDIR", // TomorrowWindDir + "@TOMORROWSKYTEMP", // TomorrowSkyTemp + "@TOMORROWHORIZRSKY", // TomorrowHorizIRSky + "@TOMORROWBEAMSOLARRAD", // TomorrowBeamSolarRad + "@TOMORROWDIFSOLARRAD", // TomorrowDifSolarRad + "@TOMORROWALBEDO", // TomorrowAlbedo + "@TOMORROWLIQUIDPRECIP" // TomorrowLiquidPrecip + }; + + static constexpr std::array ErlFuncNumOperands = { + 0, // Null + 1, // Literal + 0, // Negative + 2, // Divide + 2, // Multiply + 2, // Subtract + 2, // Add + 2, // Equal + 2, // NotEqual + 2, // LessOrEqual + 2, // GreaterOrEqual + 2, // LessThan + 2, // GreaterThan + 2, // RaiseToPower + 2, // LogicalAND + 2, // LogicalOR + 1, // Round + 2, // Mod + 1, // Sin + 1, // Cos + 1, // ArcSin + 1, // ArcCos + 1, // DegToRad + 1, // RadToDeg + 1, // Exp + 1, // Ln + 2, // Max + 2, // Min + 1, // ABS + 2, // RandU + 4, // RandG + 1, // RandSeed + + // begin psychrometric routines + 3, // RhoAirFnPbTdbW + 1, // CpAirFnW + 2, // HfgAirFnWTdb + 2, // HgAirFnWTdb + 3, // TdpFnTdbTwbPb + 2, // TdpFnWPb + 2, // HFnTdbW + 3, // HFnTdbRhPb + 2, // TdbFnHW + 2, // RhovFnTdbRh + 2, // RhovFnTdbRhLBnd0C + 3, // RhovFnTdbWPb + 2, // RhFnTdbRhov + 2, // RhFnTdbRhovLBnd0C + 3, // RhFnTdbWPb + 3, // TwbFnTdbWPb + 3, // VFnTdbWPb + 2, // WFnTdpPb + 2, // WFnTdbH + 3, // WFnTdbTwbPb + 4, // WFnTdbRhPb + 1, // PsatFnTemp + 2, // TsatFnHPb + 1, // TsatFnPb + 1, // CpCW + 1, // CpHW + 1, // RhoH2O + + // Simulation Management Functions + 1, // FatalHaltEp + 1, // SevereWarnEp + 1, // WarnEp + + // Trend variable handling Functions + 2, // TrendValue + 2, // TrendAverage + 2, // TrendMax + 2, // TrendMin + 2, // TrendDirection + 2, // TrendSum + + // Curve and Table access function + 6, // CurveValue + + // Weather data query functions + 2, // TodayIsRain + 2, // TodayIsSnow + 2, // TodayOutDryBulbTemp + 2, // TodayOutDewPointTemp + 2, // TodayOutBaroPress + 2, // TodayOutRelHum + 2, // TodayWindSpeed + 2, // TodayWindDir + 2, // TodaySkyTemp + 2, // TodayHorizIRSky + 2, // TodayBeamSolarRad + 2, // TodayDifSolarRad + 2, // TodayAlbedo + 2, // TodayLiquidPrecip + 2, // TomorrowIsRain + 2, // TomorrowIsSnow + 2, // TomorrowOutDryBulbTemp + 2, // TomorrowOutDewPointTemp + 2, // TomorrowOutBaroPress + 2, // TomorrowOutRelHum + 2, // TomorrowWindSpeed + 2, // TomorrowWindDir + 2, // TomorrowSkyTemp + 2, // TomorrowHorizIRSky + 2, // TomorrowBeamSolarRad + 2, // TomorrowDifSolarRad + 2, // TomorrowAlbedo + 2 // TomorrowLiquidPrecip }; struct TrendVariableType @@ -567,7 +787,6 @@ struct RuntimeLanguageData : BaseGlobalStruct Array1D ErlVariable; // holds Erl variables in a structure array Array1D ErlStack; // holds Erl programs in separate "stacks" Array1D ErlExpression; // holds Erl expressions in structure array - Array1D PossibleOperators; // hard library of available operators and functions Array1D TrendVariable; // holds Erl trend variables in a structure array Array1D Sensor; // EMS:SENSOR objects used (from output variables) Array1D EMSActuatorAvailable; // actuators that could be used @@ -626,7 +845,6 @@ struct RuntimeLanguageData : BaseGlobalStruct this->ErlVariable.deallocate(); this->ErlStack.deallocate(); this->ErlExpression.deallocate(); - this->PossibleOperators.deallocate(); this->TrendVariable.deallocate(); this->Sensor.deallocate(); this->EMSActuatorAvailable.deallocate(); diff --git a/src/EnergyPlus/DataSizing.cc b/src/EnergyPlus/DataSizing.cc index dc58b076f87..14cfe97cf32 100644 --- a/src/EnergyPlus/DataSizing.cc +++ b/src/EnergyPlus/DataSizing.cc @@ -547,8 +547,7 @@ void GetCoilDesFlowT(EnergyPlusData &state, auto &sysSizPeakDDNum = state.dataSize->SysSizPeakDDNum(SysNum); auto &calcSysSizing = state.dataSize->CalcSysSizing(SysNum); - int sysSizIndex = - UtilityRoutines::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); + int sysSizIndex = Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (sysSizIndex == 0) sysSizIndex = 1; auto &sysSizInput = state.dataSize->SysSizInput(sysSizIndex); diff --git a/src/EnergyPlus/DataSurfaceColors.cc b/src/EnergyPlus/DataSurfaceColors.cc index 9cfa6c4733a..b3e009f57ef 100644 --- a/src/EnergyPlus/DataSurfaceColors.cc +++ b/src/EnergyPlus/DataSurfaceColors.cc @@ -101,7 +101,7 @@ bool MatchAndSetColorTextString(EnergyPlusData &state, if (ColorType != "DXF") return false; // try to find enum value - int foundIdx = getEnumValue(colorkeys, UtilityRoutines::makeUPPER(String)); + int foundIdx = getEnumValue(colorkeys, Util::makeUPPER(String)); if (foundIdx == -1) return false; // if we've made it here, we found the value diff --git a/src/EnergyPlus/DataSurfaceLists.cc b/src/EnergyPlus/DataSurfaceLists.cc index 1498b8e5091..6b31f7ad9fe 100644 --- a/src/EnergyPlus/DataSurfaceLists.cc +++ b/src/EnergyPlus/DataSurfaceLists.cc @@ -147,7 +147,7 @@ void GetSurfaceListsInputs(EnergyPlusData &state) SurfList(Item).Name = Alphas(1); SurfList(Item).NumOfSurfaces = NumAlphas - 1; - NameConflict = UtilityRoutines::FindItemInList(SurfList(Item).Name, state.dataSurface->Surface); + NameConflict = Util::FindItemInList(SurfList(Item).Name, state.dataSurface->Surface); if (NameConflict > 0) { // A surface list has the same name as a surface--not allowed ShowSevereError( state, @@ -169,7 +169,7 @@ void GetSurfaceListsInputs(EnergyPlusData &state) int ZoneForSurface = 0; // Zone number that first surface is attached to for (int SurfNum = 1; SurfNum <= SurfList(Item).NumOfSurfaces; ++SurfNum) { SurfList(Item).SurfName(SurfNum) = Alphas(SurfNum + 1); - SurfList(Item).SurfPtr(SurfNum) = UtilityRoutines::FindItemInList(Alphas(SurfNum + 1), state.dataSurface->Surface); + SurfList(Item).SurfPtr(SurfNum) = Util::FindItemInList(Alphas(SurfNum + 1), state.dataSurface->Surface); if (SurfList(Item).SurfPtr(SurfNum) == 0) { ShowSevereError( state, @@ -254,7 +254,7 @@ void GetSurfaceListsInputs(EnergyPlusData &state) SlabList(Item).Name = Alphas(1); SlabList(Item).NumOfSurfaces = ((NumAlphas - 1) / 4); - NameConflict = UtilityRoutines::FindItemInList(SlabList(Item).Name, state.dataSurface->Surface); + NameConflict = Util::FindItemInList(SlabList(Item).Name, state.dataSurface->Surface); if (NameConflict > 0) { // A surface list has the same name as a surface--not allowed ShowSevereError( state, format("{}{}", CurrentModuleObject2, " = " + SlabList(Item).Name + " has the same name as a slab; this is not allowed.")); @@ -280,7 +280,7 @@ void GetSurfaceListsInputs(EnergyPlusData &state) int NumArray = 1; for (int SurfNum = 1; SurfNum <= SlabList(Item).NumOfSurfaces; ++SurfNum) { SlabList(Item).ZoneName(SurfNum) = Alphas(AlphaArray); - SlabList(Item).ZonePtr = UtilityRoutines::FindItemInList(Alphas(AlphaArray), state.dataHeatBal->Zone); + SlabList(Item).ZonePtr = Util::FindItemInList(Alphas(AlphaArray), state.dataHeatBal->Zone); if (SlabList(Item).ZonePtr(SurfNum) == 0) { ShowSevereError( state, @@ -290,7 +290,7 @@ void GetSurfaceListsInputs(EnergyPlusData &state) } SlabList(Item).SurfName(SurfNum) = Alphas(AlphaArray + 1); - SlabList(Item).SurfPtr(SurfNum) = UtilityRoutines::FindItemInList(Alphas(AlphaArray + 1), state.dataSurface->Surface); + SlabList(Item).SurfPtr(SurfNum) = Util::FindItemInList(Alphas(AlphaArray + 1), state.dataSurface->Surface); if (SlabList(Item).SurfPtr(SurfNum) == 0) { ShowSevereError(state, fmt::format("{} in {} statement not found = {}", @@ -300,8 +300,8 @@ void GetSurfaceListsInputs(EnergyPlusData &state) ErrorsFound = true; } for (int SrfList = 1; SrfList <= NumOfSurfaceLists; ++SrfList) { - NameConflict = UtilityRoutines::FindItemInList( - SlabList(Item).SurfName(SurfNum), SurfList(SrfList).SurfName, SurfList(SrfList).NumOfSurfaces); + NameConflict = + Util::FindItemInList(SlabList(Item).SurfName(SurfNum), SurfList(SrfList).SurfName, SurfList(SrfList).NumOfSurfaces); if (NameConflict > 0) { // A slab list includes a surface on a surface list--not allowed ShowSevereError(state, format("{}{}", CurrentModuleObject2, "=\"" + SlabList(Item).Name + "\", invalid surface specified.")); ShowContinueError(state, format("Surface=\"{}\" is also on a Surface List.", SlabList(Item).SurfName(SurfNum))); diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index f506533f45f..591ef18772f 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -325,7 +325,7 @@ Real64 SurfaceData::getOutsideIR(EnergyPlusData &state, const int t_SurfNum) con if (ExtBoundCond > 0) { value = state.dataSurface->SurfWinIRfromParentZone(ExtBoundCond) + state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(ExtBoundCond); } else { - Real64 tout = getOutsideAirTemperature(state, t_SurfNum) + Constant::KelvinConv; + Real64 tout = getOutsideAirTemperature(state, t_SurfNum) + Constant::Kelvin; value = state.dataWindowManager->sigma * pow_4(tout); value = ViewFactorSkyIR * (state.dataSurface->SurfAirSkyRadSplit(t_SurfNum) * state.dataWindowManager->sigma * pow_4(state.dataEnvrn->SkyTempKelvin) + diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index 01af8179f1f..799718eb1cb 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -316,7 +316,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) cAlphaFields, cNumericFields); // Get Equipment | data for one zone - int zoneOrSpaceNum = UtilityRoutines::FindItemInList(AlphArray(1), state.dataHeatBal->Zone); + int zoneOrSpaceNum = Util::FindItemInList(AlphArray(1), state.dataHeatBal->Zone); std::string_view zsString = "Zone"; if (zoneOrSpaceNum == 0) { @@ -364,7 +364,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) cAlphaFields, cNumericFields); // Get Equipment | data for one zone - int zoneOrSpaceNum = UtilityRoutines::FindItemInList(AlphArray(1), state.dataHeatBal->space); + int zoneOrSpaceNum = Util::FindItemInList(AlphArray(1), state.dataHeatBal->space); std::string_view zsString = "Space"; if (zoneOrSpaceNum == 0) { @@ -473,7 +473,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) // map ZoneEquipConfig%EquipListIndex to ZoneEquipList%Name for (int ControlledZoneLoop = 1; ControlledZoneLoop <= state.dataGlobal->NumOfZones; ++ControlledZoneLoop) { - state.dataZoneEquip->GetZoneEquipmentDataFound = UtilityRoutines::FindItemInList( + state.dataZoneEquip->GetZoneEquipmentDataFound = Util::FindItemInList( state.dataZoneEquip->ZoneEquipList(ControlledZoneLoop).Name, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::EquipListName); if (state.dataZoneEquip->GetZoneEquipmentDataFound > 0) state.dataZoneEquip->ZoneEquipConfig(state.dataZoneEquip->GetZoneEquipmentDataFound).EquipListIndex = ControlledZoneLoop; @@ -495,12 +495,12 @@ void GetZoneEquipmentData(EnergyPlusData &state) ++zeqSplitterNum; auto const &objectFields = instance.value(); auto &thisZeqSplitter = state.dataZoneEquip->zoneEquipSplitter[zeqSplitterNum]; - thisZeqSplitter.Name = UtilityRoutines::makeUPPER(instance.key()); + thisZeqSplitter.Name = Util::makeUPPER(instance.key()); thisZeqSplitter.spaceEquipType = DataLoopNode::ConnectionObjectType::SpaceHVACZoneEquipmentSplitter; ip->markObjectAsUsed(CurrentModuleObject, instance.key()); std::string zoneName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_name"); - int zoneNum = UtilityRoutines::FindItemInList(zoneName, state.dataHeatBal->Zone); + int zoneNum = Util::FindItemInList(zoneName, state.dataHeatBal->Zone); if (zoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, CurrentModuleObject, thisZeqSplitter.Name)); ShowContinueError(state, format("..Zone Name={} not found, remaining items for this object not processed.", zoneName)); @@ -532,12 +532,12 @@ void GetZoneEquipmentData(EnergyPlusData &state) ++zeqMixerNum; auto const &objectFields = instance.value(); auto &thisZeqMixer = state.dataZoneEquip->zoneEquipMixer[zeqMixerNum]; - thisZeqMixer.Name = UtilityRoutines::makeUPPER(instance.key()); + thisZeqMixer.Name = Util::makeUPPER(instance.key()); thisZeqMixer.spaceEquipType = DataLoopNode::ConnectionObjectType::SpaceHVACZoneEquipmentMixer; ip->markObjectAsUsed(CurrentModuleObject, instance.key()); std::string zoneName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_name"); - int zoneNum = UtilityRoutines::FindItemInList(zoneName, state.dataHeatBal->Zone); + int zoneNum = Util::FindItemInList(zoneName, state.dataHeatBal->Zone); if (zoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, CurrentModuleObject, thisZeqMixer.Name)); ShowContinueError(state, format("..Zone Name={} not found, remaining items for this object not processed.", zoneName)); @@ -803,7 +803,7 @@ void processZoneEquipmentInput(EnergyPlusData &state, std::string loadDistName = ip->getAlphaFieldValue(epListFields, objectSchemaProps, "load_distribution_scheme"); thisZoneEquipList.LoadDistScheme = - static_cast(getEnumValue(DataZoneEquipment::LoadDistNamesUC, UtilityRoutines::makeUPPER(loadDistName))); + static_cast(getEnumValue(DataZoneEquipment::LoadDistNamesUC, Util::makeUPPER(loadDistName))); if (thisZoneEquipList.LoadDistScheme == DataZoneEquipment::LoadDist::Invalid) { ShowSevereError(state, format("{}{} = \"{}, Invalid choice\".", RoutineName, CurrentModuleObject, thisZoneEquipList.Name)); ShowContinueError(state, format("...load_distribution_scheme=\"{}\".", loadDistName)); @@ -938,7 +938,7 @@ void processZoneEquipmentInput(EnergyPlusData &state, } thisZoneEquipList.EquipType(ZoneEquipTypeNum) = static_cast( - getEnumValue(zoneEquipTypeNamesUC, UtilityRoutines::makeUPPER(thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum)))); + getEnumValue(zoneEquipTypeNamesUC, Util::makeUPPER(thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum)))); if (thisZoneEquipList.EquipType(ZoneEquipTypeNum) == ZoneEquipType::UnitarySystem || thisZoneEquipList.EquipType(ZoneEquipTypeNum) == ZoneEquipType::PackagedTerminalAirConditioner || @@ -1231,7 +1231,7 @@ void processZoneEquipSplitterInput(EnergyPlusData &state, getEnumValue(zoneEquipTstatControlNamesUC, 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 = UtilityRoutines::FindItemInList(spaceName, state.dataHeatBal->space); + thisZeqSplitter.controlSpaceIndex = Util::FindItemInList(spaceName, state.dataHeatBal->space); if (thisZeqSplitter.controlSpaceIndex == 0) { ShowSevereError(state, format("{}{}={}", RoutineName, zeqSplitterModuleObject, thisZeqSplitter.Name)); ShowContinueError(state, format("Space Name={} not found.", spaceName)); @@ -1252,7 +1252,7 @@ void processZoneEquipSplitterInput(EnergyPlusData &state, ++spaceCount; auto &thisZeqSpace = thisZeqSplitter.spaces[spaceCount]; std::string const spaceName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_name"); - thisZeqSpace.spaceIndex = UtilityRoutines::FindItemInList(spaceName, state.dataHeatBal->space); + thisZeqSpace.spaceIndex = Util::FindItemInList(spaceName, state.dataHeatBal->space); if (thisZeqSpace.spaceIndex == 0) { ShowSevereError(state, format("{}{}={}", RoutineName, zeqSplitterModuleObject, thisZeqSplitter.Name)); ShowContinueError(state, format("Space Name={} not found.", spaceName)); @@ -1329,7 +1329,7 @@ void processZoneEquipMixerInput(EnergyPlusData &state, ++spaceCount; auto &thisZeqSpace = thisZeqMixer.spaces[spaceCount]; std::string const spaceName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_name"); - thisZeqSpace.spaceIndex = UtilityRoutines::FindItemInList(spaceName, state.dataHeatBal->space); + thisZeqSpace.spaceIndex = Util::FindItemInList(spaceName, state.dataHeatBal->space); if (thisZeqSpace.spaceIndex == 0) { ShowSevereError(state, format("{}{}={}", RoutineName, zeqMixerModuleObject, thisZeqMixer.Name)); ShowContinueError(state, format("Space Name={} not found.", spaceName)); @@ -1395,13 +1395,14 @@ bool CheckZoneEquipmentList(EnergyPlusData &state, for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { // NumOfZoneEquipLists if (state.dataZoneEquip->ZoneEquipList(Loop).Name.empty()) continue; // dimensioned by NumOfZones. Only valid ones have names. for (ListLoop = 1; ListLoop <= state.dataZoneEquip->ZoneEquipList(Loop).NumOfEquipTypes; ++ListLoop) { - if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(Loop).EquipTypeName(ListLoop), ComponentType)) continue; + + if (!Util::SameString(state.dataZoneEquip->ZoneEquipList(Loop).EquipTypeName(ListLoop), ComponentType)) continue; if (ComponentName == "*") { IsOnList = true; CtrlZoneNumLocal = Loop; goto EquipList_exit; } - if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(Loop).EquipName(ListLoop), ComponentName)) continue; + if (!Util::SameString(state.dataZoneEquip->ZoneEquipList(Loop).EquipName(ListLoop), ComponentName)) continue; IsOnList = true; CtrlZoneNumLocal = Loop; goto EquipList_exit; @@ -1430,7 +1431,7 @@ int GetControlledZoneIndex(EnergyPlusData &state, std::string const &ZoneName) / state.dataZoneEquip->ZoneEquipInputsFilled = true; } - return UtilityRoutines::FindItemInList(ZoneName, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); + return Util::FindItemInList(ZoneName, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); } int FindControlledZoneIndexFromSystemNodeNumberForZone(EnergyPlusData &state, @@ -1662,7 +1663,7 @@ int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::Zone if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (int Num = 1; Num <= state.dataZoneEquip->ZoneEquipList(CtrlZone).NumOfEquipTypes; ++Num) { if (zoneEquipType == state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipType(Num) && - UtilityRoutines::SameString(EquipmentName, state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num))) { + Util::SameString(EquipmentName, state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num))) { return ControlZoneNum = CtrlZone; } } diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 93a71aeb779..b84417e16ee 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -462,7 +462,7 @@ namespace Dayltg { state.dataDaylightingDevicesData->TDDPipe(PipeNum).Name = state.dataIPShortCut->cAlphaArgs(1); // Get TDD:DOME object - int SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); + int SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, @@ -541,7 +541,7 @@ namespace Dayltg { } // Get TDD:DIFFUSER object - SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, @@ -655,7 +655,7 @@ namespace Dayltg { // Construction state.dataDaylightingDevicesData->TDDPipe(PipeNum).Construction = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataConstruction->Construct); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataConstruction->Construct); if (state.dataDaylightingDevicesData->TDDPipe(PipeNum).Construction == 0) { ShowSevereError(state, @@ -748,8 +748,7 @@ namespace Dayltg { for (int TZoneNum = 1; TZoneNum <= state.dataDaylightingDevicesData->TDDPipe(PipeNum).NumOfTZones; ++TZoneNum) { std::string const TZoneName = state.dataIPShortCut->cAlphaArgs(TZoneNum + 4); - state.dataDaylightingDevicesData->TDDPipe(PipeNum).TZone(TZoneNum) = - UtilityRoutines::FindItemInList(TZoneName, state.dataHeatBal->Zone); + state.dataDaylightingDevicesData->TDDPipe(PipeNum).TZone(TZoneNum) = Util::FindItemInList(TZoneName, state.dataHeatBal->Zone); if (state.dataDaylightingDevicesData->TDDPipe(PipeNum).TZone(TZoneNum) == 0) { ShowSevereError( state, @@ -827,7 +826,7 @@ namespace Dayltg { state.dataDaylightingDevicesData->Shelf(ShelfNum).Name = state.dataIPShortCut->cAlphaArgs(1); // Get window object - int SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); + int SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, @@ -896,7 +895,7 @@ namespace Dayltg { // Get inside shelf heat transfer surface (optional) if (state.dataIPShortCut->cAlphaArgs(3) != "") { - SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, @@ -932,7 +931,7 @@ namespace Dayltg { // Get outside shelf attached shading surface (optional) if (state.dataIPShortCut->cAlphaArgs(4) != "") { - SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataSurface->Surface); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, @@ -974,7 +973,7 @@ namespace Dayltg { int ConstrNum = 0; // Get outside shelf construction (required if outside shelf is specified) if (state.dataIPShortCut->cAlphaArgs(5) != "") { - ConstrNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataConstruction->Construct); + ConstrNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataConstruction->Construct); if (ConstrNum == 0) { ShowSevereError(state, diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 960af66392c..9d69df8020f 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -4224,7 +4224,7 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) auto &illumMap = state.dataDaylightingData->IllumMap(MapNum); illumMap.Name = ipsc->cAlphaArgs(1); - illumMap.zoneIndex = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), Zone); + illumMap.zoneIndex = Util::FindItemInList(ipsc->cAlphaArgs(2), Zone); if (illumMap.zoneIndex == 0) { ShowSevereError(state, @@ -4607,7 +4607,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) daylightControl.Name = ipsc->cAlphaArgs(1); // Is it a space or zone name? - int const spaceNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->space); + int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space); if (spaceNum > 0) { daylightControl.spaceIndex = spaceNum; daylightControl.zoneIndex = state.dataHeatBal->space(spaceNum).zoneNum; @@ -4624,7 +4624,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) continue; } } else { - int const zoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); + int const zoneNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (zoneNum == 0) { ShowSevereError(state, format("{}: invalid {}=\"{}\".", ipsc->cCurrentModuleObject, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2))); ErrorsFound = true; @@ -4669,7 +4669,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) daylightControl.DaylightMethod = DaylightingMethod::SplitFlux; } else { daylightControl.DaylightMethod = - static_cast(getEnumValue(DaylightingMethodNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(3)))); + static_cast(getEnumValue(DaylightingMethodNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(3)))); if (daylightControl.DaylightMethod == DaylightingMethod::Invalid) { daylightControl.DaylightMethod = DaylightingMethod::SplitFlux; @@ -4703,8 +4703,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) daylightControl.AvailSchedNum = ScheduleManager::ScheduleAlwaysOn; } - daylightControl.LightControlType = - static_cast(getEnumValue(LtgCtrlTypeNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(5)))); + daylightControl.LightControlType = static_cast(getEnumValue(LtgCtrlTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(5)))); if (daylightControl.LightControlType == LtgCtrlType::Invalid) { ShowWarningError(state, format("Invalid {} = {}, occurs in {}object for {}=\"{}", @@ -4723,10 +4722,9 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) ipsc->rNumericArgs(4); // Field: Probability Lighting will be Reset When Needed in Manual Stepped Control if (!ipsc->lAlphaFieldBlanks(6)) { // Field: Glare Calculation Daylighting Reference Point Name - daylightControl.glareRefPtNumber = - UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(6), - state.dataDaylightingData->DaylRefPt, - &RefPointData::Name); // Field: Glare Calculation Daylighting Reference Point Name + daylightControl.glareRefPtNumber = Util::FindItemInList(ipsc->cAlphaArgs(6), + state.dataDaylightingData->DaylRefPt, + &RefPointData::Name); // Field: Glare Calculation Daylighting Reference Point Name if (daylightControl.glareRefPtNumber == 0) { ShowSevereError(state, format("{}: invalid {}=\"{}\" for object named: {}", @@ -4796,9 +4794,9 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) int countRefPts = 0; for (int refPtNum = 1; refPtNum <= curTotalDaylRefPts; ++refPtNum) { - daylightControl.DaylRefPtNum(refPtNum) = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(6 + refPtNum), - state.dataDaylightingData->DaylRefPt, - &RefPointData::Name); // Field: Daylighting Reference Point Name + daylightControl.DaylRefPtNum(refPtNum) = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(6 + refPtNum), + state.dataDaylightingData->DaylRefPt, + &RefPointData::Name); // Field: Daylighting Reference Point Name if (daylightControl.DaylRefPtNum(refPtNum) == 0) { ShowSevereError(state, format("{}: invalid {}=\"{}\" for object named: {}", @@ -5075,9 +5073,9 @@ void GetInputDayliteRefPt(EnergyPlusData &state, bool &ErrorsFound) ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); pt.Name = ipsc->cAlphaArgs(1); - pt.ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); + pt.ZoneNum = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); if (pt.ZoneNum == 0) { - int spaceNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->space); + int spaceNum = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->space); if (spaceNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}\".", @@ -5168,8 +5166,8 @@ void AssociateWindowShadingControlWithDaylighting(EnergyPlusData &state) if (winShadeControl.DaylightingControlName.empty()) continue; int found = -1; for (int daylightCtrlNum = 1; daylightCtrlNum <= (int)state.dataDaylightingData->daylightControl.size(); ++daylightCtrlNum) { - if (UtilityRoutines::SameString(winShadeControl.DaylightingControlName, - state.dataDaylightingData->daylightControl(daylightCtrlNum).Name)) { + if (Util::SameString(state.dataSurface->WindowShadingControl(iShadeCtrl).DaylightingControlName, + state.dataDaylightingData->daylightControl(daylightCtrlNum).Name)) { found = daylightCtrlNum; break; } @@ -5236,7 +5234,7 @@ void GetLightWellData(EnergyPlusData &state, bool &ErrorsFound) // If errors fou ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - int SurfNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataSurface->Surface); + int SurfNum = Util::FindItemInList(ipsc->cAlphaArgs(1), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, format("{}: invalid {}=\"{}\" not found.", ipsc->cCurrentModuleObject, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1))); diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index 1014a5bf22e..06f35413e2b 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -427,7 +427,7 @@ void GetDemandManagerListInput(EnergyPlusData &state) // Validate Demand Manager Priority thisDemandMgrList.ManagerPriority = - static_cast(getEnumValue(ManagePriorityNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + static_cast(getEnumValue(ManagePriorityNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); ErrorsFound = ErrorsFound || (thisDemandMgrList.ManagerPriority == ManagePriorityType::Invalid); // Get DEMAND MANAGER Type and Name pairs @@ -439,11 +439,10 @@ void GetDemandManagerListInput(EnergyPlusData &state) auto &thisManager = thisDemandMgrList.Manager(MgrNum); // Validate DEMAND MANAGER Type - ManagerType MgrType = static_cast( - getEnumValue(ManagerNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(MgrNum * 2 + 5)))); + ManagerType MgrType = + static_cast(getEnumValue(ManagerNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(MgrNum * 2 + 5)))); if (MgrType != ManagerType::Invalid) { - thisManager = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(MgrNum * 2 + 6), state.dataDemandManager->DemandMgr); + thisManager = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(MgrNum * 2 + 6), state.dataDemandManager->DemandMgr); if (thisManager == 0) { ShowSevereError(state, format("{} = \"{}\" invalid {} = \"{}\" not found.", @@ -676,7 +675,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -687,8 +686,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(2); // Validate Selection Control - demandMgr.SelectionControl = - static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) @@ -702,7 +700,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.Load.allocate(demandMgr.NumOfLoads); for (int LoadNum = 1; LoadNum <= demandMgr.NumOfLoads; ++LoadNum) { - int LoadPtr = UtilityRoutines::FindItemInList(AlphArray(LoadNum + 4), state.dataExteriorEnergyUse->ExteriorLights); + int LoadPtr = Util::FindItemInList(AlphArray(LoadNum + 4), state.dataExteriorEnergyUse->ExteriorLights); if (LoadPtr > 0) { demandMgr.Load(LoadNum) = LoadPtr; @@ -774,7 +772,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -785,8 +783,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(2); // Validate Selection Control - demandMgr.SelectionControl = - static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) @@ -797,11 +794,11 @@ void GetDemandManagerInput(EnergyPlusData &state) // Count actual pointers to controlled zones demandMgr.NumOfLoads = 0; for (int LoadNum = 1; LoadNum <= NumAlphas - 4; ++LoadNum) { - int LoadPtr = UtilityRoutines::FindItemInList(AlphArray(LoadNum + 4), state.dataInternalHeatGains->lightsObjects); + int LoadPtr = Util::FindItemInList(AlphArray(LoadNum + 4), state.dataInternalHeatGains->lightsObjects); if (LoadPtr > 0) { demandMgr.NumOfLoads += state.dataInternalHeatGains->lightsObjects(LoadPtr).numOfSpaces; } else { - LoadPtr = UtilityRoutines::FindItemInList(AlphArray(LoadNum + 4), state.dataHeatBal->Lights); + LoadPtr = Util::FindItemInList(AlphArray(LoadNum + 4), state.dataHeatBal->Lights); if (LoadPtr > 0) { ++demandMgr.NumOfLoads; } else { @@ -822,14 +819,14 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.Load.allocate(demandMgr.NumOfLoads); int LoadNum = 0; for (int Item = 1; Item <= NumAlphas - 4; ++Item) { - int LoadPtr = UtilityRoutines::FindItemInList(AlphArray(Item + 4), state.dataInternalHeatGains->lightsObjects); + int LoadPtr = Util::FindItemInList(AlphArray(Item + 4), state.dataInternalHeatGains->lightsObjects); if (LoadPtr > 0) { for (int Item1 = 1; Item1 <= state.dataInternalHeatGains->lightsObjects(LoadPtr).numOfSpaces; ++Item1) { ++LoadNum; demandMgr.Load(LoadNum) = state.dataInternalHeatGains->lightsObjects(LoadPtr).spaceStartPtr + Item1 - 1; } } else { - LoadPtr = UtilityRoutines::FindItemInList(AlphArray(Item + 4), state.dataHeatBal->Lights); + LoadPtr = Util::FindItemInList(AlphArray(Item + 4), state.dataHeatBal->Lights); if (LoadPtr > 0) { ++LoadNum; demandMgr.Load(LoadNum) = LoadPtr; @@ -893,7 +890,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -904,8 +901,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(2); // Validate Selection Control - demandMgr.SelectionControl = - static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) @@ -916,11 +912,11 @@ void GetDemandManagerInput(EnergyPlusData &state) // Count actual pointers to controlled zones demandMgr.NumOfLoads = 0; for (int LoadNum = 1; LoadNum <= NumAlphas - 4; ++LoadNum) { - int LoadPtr = UtilityRoutines::FindItemInList(AlphArray(LoadNum + 4), state.dataInternalHeatGains->zoneElectricObjects); + int LoadPtr = Util::FindItemInList(AlphArray(LoadNum + 4), state.dataInternalHeatGains->zoneElectricObjects); if (LoadPtr > 0) { demandMgr.NumOfLoads += state.dataInternalHeatGains->zoneElectricObjects(LoadPtr).numOfSpaces; } else { - LoadPtr = UtilityRoutines::FindItemInList(AlphArray(LoadNum + 4), state.dataHeatBal->ZoneElectric); + LoadPtr = Util::FindItemInList(AlphArray(LoadNum + 4), state.dataHeatBal->ZoneElectric); if (LoadPtr > 0) { ++demandMgr.NumOfLoads; } else { @@ -941,14 +937,14 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.Load.allocate(demandMgr.NumOfLoads); int LoadNum = 0; for (int Item = 1; Item <= NumAlphas - 4; ++Item) { - int LoadPtr = UtilityRoutines::FindItemInList(AlphArray(Item + 4), state.dataInternalHeatGains->zoneElectricObjects); + int LoadPtr = Util::FindItemInList(AlphArray(Item + 4), state.dataInternalHeatGains->zoneElectricObjects); if (LoadPtr > 0) { for (int Item1 = 1; Item1 <= state.dataInternalHeatGains->zoneElectricObjects(LoadPtr).numOfSpaces; ++Item1) { ++LoadNum; demandMgr.Load(LoadNum) = state.dataInternalHeatGains->zoneElectricObjects(LoadPtr).spaceStartPtr + Item1 - 1; } } else { - LoadPtr = UtilityRoutines::FindItemInList(AlphArray(Item + 4), state.dataHeatBal->ZoneElectric); + LoadPtr = Util::FindItemInList(AlphArray(Item + 4), state.dataHeatBal->ZoneElectric); if (LoadPtr > 0) { ++LoadNum; demandMgr.Load(LoadNum) = LoadPtr; @@ -1013,7 +1009,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, Util::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -1039,8 +1035,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Selection Control - demandMgr.SelectionControl = - static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(5) == 0.0) @@ -1051,11 +1046,11 @@ void GetDemandManagerInput(EnergyPlusData &state) // Count actual pointers to controlled zones demandMgr.NumOfLoads = 0; for (int LoadNum = 1; LoadNum <= NumAlphas - 4; ++LoadNum) { - int LoadPtr = UtilityRoutines::FindItemInList(AlphArray(LoadNum + 4), state.dataZoneCtrls->TStatObjects); + int LoadPtr = Util::FindItemInList(AlphArray(LoadNum + 4), state.dataZoneCtrls->TStatObjects); if (LoadPtr > 0) { demandMgr.NumOfLoads += state.dataZoneCtrls->TStatObjects(LoadPtr).NumOfZones; } else { - LoadPtr = UtilityRoutines::FindItemInList(AlphArray(LoadNum + 4), state.dataZoneCtrls->TempControlledZone); + LoadPtr = Util::FindItemInList(AlphArray(LoadNum + 4), state.dataZoneCtrls->TempControlledZone); if (LoadPtr > 0) { ++demandMgr.NumOfLoads; } else { @@ -1074,14 +1069,14 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.Load.allocate(demandMgr.NumOfLoads); int LoadNum = 0; for (int Item = 1; Item <= NumAlphas - 4; ++Item) { - int LoadPtr = UtilityRoutines::FindItemInList(AlphArray(Item + 4), state.dataZoneCtrls->TStatObjects); + int LoadPtr = Util::FindItemInList(AlphArray(Item + 4), state.dataZoneCtrls->TStatObjects); if (LoadPtr > 0) { for (int Item1 = 1; Item1 <= state.dataZoneCtrls->TStatObjects(LoadPtr).NumOfZones; ++Item1) { ++LoadNum; demandMgr.Load(LoadNum) = state.dataZoneCtrls->TStatObjects(LoadPtr).TempControlledZoneStartPtr + Item1 - 1; } } else { - LoadPtr = UtilityRoutines::FindItemInList(AlphArray(Item + 4), state.dataZoneCtrls->TempControlledZone); + LoadPtr = Util::FindItemInList(AlphArray(Item + 4), state.dataZoneCtrls->TempControlledZone); if (LoadPtr > 0) { ++LoadNum; demandMgr.Load(LoadNum) = LoadPtr; @@ -1145,7 +1140,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitVentNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitVentNamesUC, Util::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -1159,8 +1154,7 @@ void GetDemandManagerInput(EnergyPlusData &state) demandMgr.LowerLimit = NumArray(4); // Validate Selection Control - demandMgr.SelectionControl = - static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + demandMgr.SelectionControl = static_cast(getEnumValue(ManagerSelectionNamesUC, Util::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(5) == 0.0) diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index f6788190521..4c713588b72 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -151,7 +151,7 @@ namespace DesiccantDehumidifiers { // Get the desiccant dehumidifier unit index if (CompIndex == 0) { - DesicDehumNum = UtilityRoutines::FindItemInList(CompName, state.dataDesiccantDehumidifiers->DesicDehum); + DesicDehumNum = Util::FindItemInList(CompName, state.dataDesiccantDehumidifiers->DesicDehum); if (DesicDehumNum == 0) { ShowFatalError(state, format("SimDesiccantDehumidifier: Unit not found={}", CompName)); } @@ -358,16 +358,14 @@ namespace DesiccantDehumidifiers { NodeInputManager::CompFluidStream::Secondary, DataLoopNode::ObjectIsParent); - if (UtilityRoutines::SameString(Alphas(7), "LEAVING HUMRAT:BYPASS")) { + if (Util::SameString(Alphas(7), "LEAVING HUMRAT:BYPASS")) { ShowWarningError(state, format("{}{} = {}", RoutineName, CurrentModuleObject, desicDehum.Name)); ShowContinueError(state, format("Obsolete {} = {}", cAlphaFields(7), Alphas(7))); ShowContinueError(state, "setting to LeavingMaximumHumidityRatioSetpoint"); desicDehum.controlType = DesicDehumCtrlType::FixedHumratBypass; } - if (UtilityRoutines::SameString(Alphas(7), "LeavingMaximumHumidityRatioSetpoint")) - desicDehum.controlType = DesicDehumCtrlType::FixedHumratBypass; - if (UtilityRoutines::SameString(Alphas(7), "SystemNodeMaximumHumidityRatioSetpoint")) - desicDehum.controlType = DesicDehumCtrlType::NodeHumratBypass; + if (Util::SameString(Alphas(7), "LeavingMaximumHumidityRatioSetpoint")) desicDehum.controlType = DesicDehumCtrlType::FixedHumratBypass; + if (Util::SameString(Alphas(7), "SystemNodeMaximumHumidityRatioSetpoint")) desicDehum.controlType = DesicDehumCtrlType::NodeHumratBypass; if (desicDehum.controlType == DesicDehumCtrlType::Invalid) { ShowWarningError(state, format("{}{} = {}", RoutineName, CurrentModuleObject, desicDehum.Name)); ShowContinueError(state, format("Invalid {} = {}", cAlphaFields(7), Alphas(7))); @@ -383,18 +381,18 @@ namespace DesiccantDehumidifiers { RegenCoilType = Alphas(8); RegenCoilName = Alphas(9); - if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric") || - UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) { - if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric")) + if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric") || + Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) { + if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric")) desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingElectric; - if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) + if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingGasOrOtherFuel; ValidateComponent(state, desicDehum.RegenCoilType, desicDehum.RegenCoilName, ErrorsFound2, CurrentModuleObject + '=' + Alphas(1)); if (ErrorsFound2) ErrorsFound = true; HeatingCoils::GetCoilIndex(state, desicDehum.RegenCoilName, desicDehum.RegenCoilIndex, ErrorsFound2); if (ErrorsFound2) ErrorsFound = true; - } else if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Water")) { + } else if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Water")) { desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, RegenCoilType, RegenCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -443,7 +441,7 @@ namespace DesiccantDehumidifiers { ErrorsFound = true; } } - } else if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Steam")) { desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, Alphas(8), RegenCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -512,13 +510,13 @@ namespace DesiccantDehumidifiers { // Set up component set for regen fan BranchNodeConnections::SetUpCompSets(state, desicDehum.DehumType, desicDehum.Name, Alphas(10), Alphas(11), Alphas(6), "UNDEFINED"); - if ((!UtilityRoutines::SameString(Alphas(12), "Default")) && (UtilityRoutines::SameString(Alphas(12), "UserCurves"))) { + if ((!Util::SameString(Alphas(12), "Default")) && (Util::SameString(Alphas(12), "UserCurves"))) { ShowWarningError(state, format("{}{}: Invalid{} = {}", RoutineName, CurrentModuleObject, cAlphaFields(12), Alphas(12))); ShowContinueError(state, "resetting to Default"); desicDehum.PerformanceModel_Num = PerformanceModel::Default; } - if (UtilityRoutines::SameString(Alphas(12), "UserCurves")) { + if (Util::SameString(Alphas(12), "UserCurves")) { desicDehum.PerformanceModel_Num = PerformanceModel::UserCurves; desicDehum.ProcDryBulbCurvefTW = Curve::GetCurveIndex(state, Alphas(13)); if (desicDehum.ProcDryBulbCurvefTW == 0) { @@ -567,9 +565,9 @@ namespace DesiccantDehumidifiers { } desicDehum.NomRegenTemp = Numbers(5); // Validate regen fan type, for user defined curves, can be constant or variable volume - if ((UtilityRoutines::SameString(desicDehum.RegenFanType, "FAN:CONSTANTVOLUME")) || - (UtilityRoutines::SameString(desicDehum.RegenFanType, "FAN:VARIABLEVOLUME") || - UtilityRoutines::SameString(desicDehum.RegenFanType, "FAN:SYSTEMMODEL"))) { + if ((Util::SameString(desicDehum.RegenFanType, "FAN:CONSTANTVOLUME")) || + (Util::SameString(desicDehum.RegenFanType, "FAN:VARIABLEVOLUME") || + Util::SameString(desicDehum.RegenFanType, "FAN:SYSTEMMODEL"))) { ValidateComponent(state, desicDehum.RegenFanType, desicDehum.RegenFanName, ErrorsFound2, CurrentModuleObject + " = " + Alphas(1)); if (ErrorsFound2) ErrorsFound = true; } else { @@ -618,7 +616,7 @@ namespace DesiccantDehumidifiers { } // process regen fan ErrorsFound2 = false; - if (UtilityRoutines::SameString(desicDehum.RegenFanType, "Fan:SystemModel")) { + if (Util::SameString(desicDehum.RegenFanType, "Fan:SystemModel")) { desicDehum.regenFanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, desicDehum.RegenFanName)); // call constructor desicDehum.RegenFanIndex = HVACFan::getFanObjectVectorIndex(state, desicDehum.RegenFanName); @@ -696,7 +694,7 @@ namespace DesiccantDehumidifiers { desicDehum.HXType = Alphas(3); desicDehum.HXName = Alphas(4); - if (!UtilityRoutines::SameString(desicDehum.HXType, "HeatExchanger:Desiccant:BalancedFlow")) { + if (!Util::SameString(desicDehum.HXType, "HeatExchanger:Desiccant:BalancedFlow")) { ShowWarningError(state, format("{} = \"{}\"", desicDehum.DehumType, desicDehum.Name)); ShowContinueError(state, format("Invalid {} = {}", cAlphaFields(3), desicDehum.HXType)); ErrorsFoundGeneric = true; @@ -781,9 +779,8 @@ namespace DesiccantDehumidifiers { desicDehum.RegenFanType = Alphas(6); desicDehum.RegenFanName = Alphas(7); - if (UtilityRoutines::SameString(desicDehum.RegenFanType, "Fan:OnOff") || - UtilityRoutines::SameString(desicDehum.RegenFanType, "Fan:ConstantVolume") || - UtilityRoutines::SameString(desicDehum.RegenFanType, "Fan:SystemModel")) { + if (Util::SameString(desicDehum.RegenFanType, "Fan:OnOff") || Util::SameString(desicDehum.RegenFanType, "Fan:ConstantVolume") || + Util::SameString(desicDehum.RegenFanType, "Fan:SystemModel")) { ErrorsFound2 = false; ValidateComponent( state, desicDehum.RegenFanType, desicDehum.RegenFanName, ErrorsFound2, desicDehum.DehumType + " \"" + desicDehum.Name + "\""); @@ -794,9 +791,9 @@ namespace DesiccantDehumidifiers { ErrorsFoundGeneric = true; } - if (UtilityRoutines::SameString(Alphas(8), "DrawThrough")) { + if (Util::SameString(Alphas(8), "DrawThrough")) { desicDehum.RegenFanPlacement = DataHVACGlobals::DrawThru; - } else if (UtilityRoutines::SameString(Alphas(8), "BlowThrough")) { + } else if (Util::SameString(Alphas(8), "BlowThrough")) { desicDehum.RegenFanPlacement = DataHVACGlobals::BlowThru; } else { ShowWarningError(state, format("{} \"{}\"", desicDehum.DehumType, desicDehum.Name)); @@ -806,7 +803,7 @@ namespace DesiccantDehumidifiers { } ErrorsFound2 = false; - if (UtilityRoutines::SameString(desicDehum.RegenFanType, "Fan:SystemModel")) { + if (Util::SameString(desicDehum.RegenFanType, "Fan:SystemModel")) { desicDehum.regenFanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, desicDehum.RegenFanName)); // call constructor desicDehum.RegenFanIndex = HVACFan::getFanObjectVectorIndex(state, desicDehum.RegenFanName); @@ -836,11 +833,11 @@ namespace DesiccantDehumidifiers { desicDehum.RegenSetPointTemp = Numbers(1); if (!lAlphaBlanks(10)) { - if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric") || - UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) { - if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric")) + if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric") || + Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) { + if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Electric")) desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingElectric; - if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) + if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Fuel")) desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingGasOrOtherFuel; ErrorsFound2 = false; ValidateComponent(state, RegenCoilType, RegenCoilName, ErrorsFound2, desicDehum.DehumType + " \"" + desicDehum.Name + "\""); @@ -900,7 +897,7 @@ namespace DesiccantDehumidifiers { ErrorsFoundGeneric = true; } - } else if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Water")) { + } else if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Water")) { desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, RegenCoilType, RegenCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -962,7 +959,7 @@ namespace DesiccantDehumidifiers { ErrorsFoundGeneric = true; } } - } else if (UtilityRoutines::SameString(desicDehum.RegenCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(desicDehum.RegenCoilType, "Coil:Heating:Steam")) { desicDehum.RegenCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, RegenCoilType, RegenCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -1190,9 +1187,9 @@ namespace DesiccantDehumidifiers { desicDehum.CoolingCoilName = Alphas(12); if (!lAlphaBlanks(12)) { - if ((UtilityRoutines::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:SINGLESPEED")) || - (UtilityRoutines::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) || - (UtilityRoutines::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED"))) { + if ((Util::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:SINGLESPEED")) || + (Util::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) || + (Util::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED"))) { ErrorsFound2 = false; ValidateComponent(state, desicDehum.CoolingCoilType, @@ -1201,11 +1198,11 @@ namespace DesiccantDehumidifiers { desicDehum.DehumType + " \"" + desicDehum.Name + "\""); if (ErrorsFound2) ErrorsFoundGeneric = true; - if ((UtilityRoutines::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:SINGLESPEED"))) { + if ((Util::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:SINGLESPEED"))) { desicDehum.coolingCoil_TypeNum = DataHVACGlobals::CoilDX_CoolingSingleSpeed; - } else if ((UtilityRoutines::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE"))) { + } else if ((Util::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE"))) { desicDehum.coolingCoil_TypeNum = DataHVACGlobals::CoilDX_CoolingTwoStageWHumControl; - } else if ((UtilityRoutines::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED"))) { + } else if ((Util::SameString(desicDehum.CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED"))) { desicDehum.coolingCoil_TypeNum = DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed; } @@ -1243,11 +1240,11 @@ namespace DesiccantDehumidifiers { } // (desicDehum%CoolingCoilName /= Blank)THEN - if (UtilityRoutines::SameString(Alphas(13), "Yes")) { + if (Util::SameString(Alphas(13), "Yes")) { desicDehum.CoilUpstreamOfProcessSide = Selection::Yes; } else if (lAlphaBlanks(13)) { desicDehum.CoilUpstreamOfProcessSide = Selection::No; - } else if (UtilityRoutines::SameString(Alphas(13), "No")) { + } else if (Util::SameString(Alphas(13), "No")) { desicDehum.CoilUpstreamOfProcessSide = Selection::No; } else { ShowWarningError(state, format("{} \"{}\"", desicDehum.DehumType, desicDehum.Name)); @@ -1256,9 +1253,9 @@ namespace DesiccantDehumidifiers { desicDehum.CoilUpstreamOfProcessSide = Selection::No; } - if (UtilityRoutines::SameString(Alphas(14), "Yes")) { + if (Util::SameString(Alphas(14), "Yes")) { desicDehum.Preheat = Selection::Yes; - } else if (UtilityRoutines::SameString(Alphas(14), "No")) { + } else if (Util::SameString(Alphas(14), "No")) { desicDehum.Preheat = Selection::No; } else if (lAlphaBlanks(14)) { desicDehum.Preheat = Selection::No; @@ -3120,7 +3117,7 @@ namespace DesiccantDehumidifiers { state.dataDesiccantDehumidifiers->GetInputDesiccantDehumidifier = false; } - int WhichDesicDehum = UtilityRoutines::FindItemInList(DesicDehumName, state.dataDesiccantDehumidifiers->DesicDehum); + int WhichDesicDehum = Util::FindItemInList(DesicDehumName, state.dataDesiccantDehumidifiers->DesicDehum); if (WhichDesicDehum != 0) { return state.dataDesiccantDehumidifiers->DesicDehum(WhichDesicDehum).ProcAirInNode; } else { @@ -3146,7 +3143,7 @@ namespace DesiccantDehumidifiers { state.dataDesiccantDehumidifiers->GetInputDesiccantDehumidifier = false; } - int WhichDesicDehum = UtilityRoutines::FindItemInList(DesicDehumName, state.dataDesiccantDehumidifiers->DesicDehum); + int WhichDesicDehum = Util::FindItemInList(DesicDehumName, state.dataDesiccantDehumidifiers->DesicDehum); if (WhichDesicDehum != 0) { return state.dataDesiccantDehumidifiers->DesicDehum(WhichDesicDehum).ProcAirOutNode; } else { diff --git a/src/EnergyPlus/DualDuct.cc b/src/EnergyPlus/DualDuct.cc index 67aa57ce4a1..bbb6bd73993 100644 --- a/src/EnergyPlus/DualDuct.cc +++ b/src/EnergyPlus/DualDuct.cc @@ -128,7 +128,7 @@ namespace DualDuct { // Find the correct DDNumber with the AirLoop & CompNum from AirLoop Derived Type if (CompIndex == 0) { - DDNum = UtilityRoutines::FindItemInList(CompName, state.dataDualDuct->dd_airterminal, &DualDuctAirTerminal::Name); + DDNum = Util::FindItemInList(CompName, state.dataDualDuct->dd_airterminal, &DualDuctAirTerminal::Name); if (DDNum == 0) { ShowFatalError(state, format("SimulateDualDuct: Damper not found={}", CompName)); } @@ -475,7 +475,7 @@ namespace DualDuct { } } if (!lAlphaBlanks(6)) { - thisDD.OARequirementsPtr = UtilityRoutines::FindItemInList(AlphArray(6), state.dataSize->OARequirements); + thisDD.OARequirementsPtr = Util::FindItemInList(AlphArray(6), state.dataSize->OARequirements); if (thisDD.OARequirementsPtr == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(6), AlphArray(6))); ShowContinueError(state, format("Occurs in {} = {}", cCMO_DDVariableVolume, thisDD.Name)); @@ -653,7 +653,7 @@ namespace DualDuct { } } } - thisDD.OARequirementsPtr = UtilityRoutines::FindItemInList(AlphArray(6), state.dataSize->OARequirements); + thisDD.OARequirementsPtr = Util::FindItemInList(AlphArray(6), state.dataSize->OARequirements); if (thisDD.OARequirementsPtr == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(6), AlphArray(6))); ShowContinueError(state, format("Occurs in {} = {}", cCMO_DDVarVolOA, thisDD.Name)); @@ -2019,7 +2019,7 @@ namespace DualDuct { state.dataDualDuct->GetDualDuctOutdoorAirRecircUseFirstTimeOnly = false; } - int DamperIndex = UtilityRoutines::FindItemInList(CompName, state.dataDualDuct->DamperNamesARR, state.dataDualDuct->NumDualDuctVarVolOA); + int DamperIndex = Util::FindItemInList(CompName, state.dataDualDuct->DamperNamesARR, state.dataDualDuct->NumDualDuctVarVolOA); if (DamperIndex > 0) { RecircIsUsed = state.dataDualDuct->RecircIsUsedARR(DamperIndex); } diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index c89233ef4ec..edabad5bab3 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -740,12 +740,9 @@ namespace EMSManager { int ActuatorVariableNum; bool FoundActuatorName = false; for (ActuatorVariableNum = 1; ActuatorVariableNum <= state.dataRuntimeLang->numEMSActuatorsAvailable; ++ActuatorVariableNum) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ComponentTypeName, - cAlphaArgs(3))) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).UniqueIDName, - cAlphaArgs(2))) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ControlTypeName, - cAlphaArgs(4))) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ComponentTypeName, cAlphaArgs(3))) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).UniqueIDName, cAlphaArgs(2))) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ControlTypeName, cAlphaArgs(4))) { FoundActuatorName = true; break; } @@ -813,10 +810,8 @@ namespace EMSManager { bool FoundObjectName = false; int InternalVarAvailNum; // do loop counter for internal variables available (inner) for (InternalVarAvailNum = 1; InternalVarAvailNum <= state.dataRuntimeLang->numEMSInternalVarsAvailable; ++InternalVarAvailNum) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName, - cAlphaArgs(3))) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName, - cAlphaArgs(2))) { + if (Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName, cAlphaArgs(3))) { + if (Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName, cAlphaArgs(2))) { FoundObjectName = true; break; // InternalVarAvailNum now holds needed index pointer } @@ -856,7 +851,8 @@ namespace EMSManager { state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).Name = cAlphaArgs(1); state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).CallingPoint = - static_cast(getEnumValue(EMSCallFromNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(2)))); + static_cast(getEnumValue(EMSCallFromNamesUC, Util::makeUPPER(cAlphaArgs(2)))); + ErrorsFound = ErrorsFound || (state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).CallingPoint == EMSCallFrom::Invalid); int NumErlProgramsThisManager = NumAlphas - 2; // temporary size of Erl programs in EMSProgramCallManager @@ -872,7 +868,7 @@ namespace EMSManager { ErrorsFound = true; } - int StackNum = UtilityRoutines::FindItemInList(cAlphaArgs(AlphaNum), state.dataRuntimeLang->ErlStack); + int StackNum = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataRuntimeLang->ErlStack); if (StackNum > 0) { // found it // check for duplicate and warn. @@ -988,7 +984,7 @@ namespace EMSManager { state.dataRuntimeLang->Sensor(SensorNum).Index = VarIndex; state.dataRuntimeLang->Sensor(SensorNum).CheckedOkay = true; // If variable is Schedule Value, then get the schedule id to register it as being used - if (UtilityRoutines::SameString(state.dataRuntimeLang->Sensor(SensorNum).OutputVarName, "Schedule Value")) { + if (Util::SameString(state.dataRuntimeLang->Sensor(SensorNum).OutputVarName, "Schedule Value")) { state.dataRuntimeLang->Sensor(SensorNum).SchedNum = ScheduleManager::GetScheduleIndex(state, state.dataRuntimeLang->Sensor(SensorNum).UniqueKeyName); if (state.dataRuntimeLang->Sensor(SensorNum).SchedNum == 0) { @@ -1037,14 +1033,14 @@ namespace EMSManager { FoundObjectName = false; FoundActuatorName = false; for (ActuatorVariableNum = 1; ActuatorVariableNum <= state.dataRuntimeLang->numEMSActuatorsAvailable; ++ActuatorVariableNum) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ComponentTypeName, - state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).ComponentTypeName)) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ComponentTypeName, + state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).ComponentTypeName)) { FoundObjectType = true; - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).UniqueIDName, - state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).UniqueIDName)) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).UniqueIDName, + state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).UniqueIDName)) { FoundObjectName = true; - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ControlTypeName, - state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).ControlTypeName)) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).ControlTypeName, + state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).ControlTypeName)) { FoundActuatorName = true; break; } @@ -1116,10 +1112,9 @@ namespace EMSManager { ++state.dataRuntimeLang->EMSActuatorAvailable(ActuatorVariableNum).handleCount; // Warn if actuator applied to an air boundary surface - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).ComponentTypeName, - "AIRFLOW NETWORK WINDOW/DOOR OPENING")) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).ComponentTypeName, "AIRFLOW NETWORK WINDOW/DOOR OPENING")) { int actuatedSurfNum = - UtilityRoutines::FindItemInList(state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).UniqueIDName, state.dataSurface->Surface); + Util::FindItemInList(state.dataRuntimeLang->EMSActuatorUsed(ActuatorNum).UniqueIDName, state.dataSurface->Surface); if (actuatedSurfNum > 0) { if (state.dataSurface->Surface(actuatedSurfNum).IsAirBoundarySurf) { ShowWarningError( @@ -1138,11 +1133,11 @@ namespace EMSManager { FoundObjectType = false; FoundObjectName = false; for (InternalVarAvailNum = 1; InternalVarAvailNum <= state.dataRuntimeLang->numEMSInternalVarsAvailable; ++InternalVarAvailNum) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName, - state.dataRuntimeLang->EMSInternalVarsUsed(InternVarNum).InternalDataTypeName)) { + if (Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName, + state.dataRuntimeLang->EMSInternalVarsUsed(InternVarNum).InternalDataTypeName)) { FoundObjectType = true; - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName, - state.dataRuntimeLang->EMSInternalVarsUsed(InternVarNum).UniqueIDName)) { + if (Util::SameString(state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName, + state.dataRuntimeLang->EMSInternalVarsUsed(InternVarNum).UniqueIDName)) { FoundObjectName = true; break; // InternalVarAvailNum now holds needed index pointer } @@ -1274,12 +1269,12 @@ namespace EMSManager { int FoundControlType; for (int ActuatorLoop = 1; ActuatorLoop <= state.dataRuntimeLang->numEMSActuatorsAvailable; ++ActuatorLoop) { if (ActuatorLoop + 1 <= state.dataRuntimeLang->numEMSActuatorsAvailable) { - FoundTypeName = UtilityRoutines::FindItemInList( + FoundTypeName = Util::FindItemInList( state.dataRuntimeLang->EMSActuatorAvailable(ActuatorLoop).ComponentTypeName, state.dataRuntimeLang->EMSActuatorAvailable({ActuatorLoop + 1, state.dataRuntimeLang->numEMSActuatorsAvailable}), &DataRuntimeLanguage::EMSActuatorAvailableType::ComponentTypeName, state.dataRuntimeLang->numEMSActuatorsAvailable - (ActuatorLoop + 1)); - FoundControlType = UtilityRoutines::FindItemInList( + FoundControlType = Util::FindItemInList( state.dataRuntimeLang->EMSActuatorAvailable(ActuatorLoop).ControlTypeName, state.dataRuntimeLang->EMSActuatorAvailable({ActuatorLoop + 1, state.dataRuntimeLang->numEMSActuatorsAvailable}), &DataRuntimeLanguage::EMSActuatorAvailableType::ControlTypeName, @@ -1328,7 +1323,7 @@ namespace EMSManager { for (int InternalDataLoop = 1; InternalDataLoop <= state.dataRuntimeLang->numEMSInternalVarsAvailable; ++InternalDataLoop) { int Found(0); if (InternalDataLoop + 1 <= state.dataRuntimeLang->numEMSInternalVarsAvailable) { - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataRuntimeLang->EMSInternalVarsAvailable(InternalDataLoop).DataTypeName, state.dataRuntimeLang->EMSInternalVarsAvailable({InternalDataLoop + 1, state.dataRuntimeLang->numEMSInternalVarsAvailable}), &DataRuntimeLanguage::InternalVarsAvailableType::DataTypeName, @@ -1464,10 +1459,9 @@ namespace EMSManager { state.dataLoopNodes->Node(NodeNum).EMSOverrideOutAirWindDir, state.dataLoopNodes->Node(NodeNum).EMSValueForOutAirWindDir); for (int ActuatorUsedLoop = 1; ActuatorUsedLoop <= state.dataRuntimeLang->numActuatorsUsed; ActuatorUsedLoop++) { - if (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(ActuatorUsedLoop).ComponentTypeName, - "Outdoor Air System Node") && - UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(ActuatorUsedLoop).UniqueIDName, - state.dataLoopNodes->NodeID(NodeNum))) { + if (Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(ActuatorUsedLoop).ComponentTypeName, "Outdoor Air System Node") && + Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(ActuatorUsedLoop).UniqueIDName, + state.dataLoopNodes->NodeID(NodeNum))) { state.dataLoopNodes->Node(NodeNum).IsLocalNode = true; break; } @@ -1530,9 +1524,9 @@ namespace EMSManager { if (byHandle) { for (int Loop = 1; Loop <= state.dataRuntimeLang->numEMSActuatorsAvailable; ++Loop) { if ((state.dataRuntimeLang->EMSActuatorAvailable(Loop).handleCount > 0) && - (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(Loop).ComponentTypeName, cComponentTypeName)) && - (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(Loop).UniqueIDName, cNodeName)) && - (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorAvailable(Loop).ControlTypeName, cControlTypeName))) { + (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(Loop).ComponentTypeName, cComponentTypeName)) && + (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(Loop).UniqueIDName, cNodeName)) && + (Util::SameString(state.dataRuntimeLang->EMSActuatorAvailable(Loop).ControlTypeName, cControlTypeName))) { FoundControl = true; break; } @@ -1545,9 +1539,9 @@ namespace EMSManager { } } else { for (int Loop = 1; Loop <= state.dataRuntimeLang->numActuatorsUsed + state.dataRuntimeLang->NumExternalInterfaceActuatorsUsed; ++Loop) { - if ((UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).ComponentTypeName, cComponentTypeName)) && - (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).UniqueIDName, cNodeName)) && - (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).ControlTypeName, cControlTypeName))) { + if ((Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).ComponentTypeName, cComponentTypeName)) && + (Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).UniqueIDName, cNodeName)) && + (Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).ControlTypeName, cControlTypeName))) { FoundControl = true; break; } @@ -1627,8 +1621,8 @@ namespace EMSManager { std::string_view cSchedName = state.dataScheduleMgr->Schedule(scheduleNum).Name; for (int Loop = 1; Loop <= state.dataRuntimeLang->numActuatorsUsed + state.dataRuntimeLang->NumExternalInterfaceActuatorsUsed; ++Loop) { - if ((UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).UniqueIDName, cSchedName)) && - (UtilityRoutines::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).ControlTypeName, cControlTypeName))) { + if ((Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).UniqueIDName, cSchedName)) && + (Util::SameString(state.dataRuntimeLang->EMSActuatorUsed(Loop).ControlTypeName, cControlTypeName))) { return true; } } @@ -1710,7 +1704,7 @@ namespace EMSManager { bool returnValue = false; for (int loop = 1; loop <= state.dataRuntimeLang->NumSensors; ++loop) { if (state.dataRuntimeLang->Sensor(loop).UniqueKeyName == state.dataLoopNodes->NodeID(nodeNum) && - UtilityRoutines::SameString(state.dataRuntimeLang->Sensor(loop).OutputVarName, varName)) { + Util::SameString(state.dataRuntimeLang->Sensor(loop).OutputVarName, varName)) { returnValue = true; } } @@ -2100,9 +2094,9 @@ void SetupEMSActuator(EnergyPlusData &state, // push size of ActuatorVariable and add a new one. // check for duplicates. - std::string const UpperCaseObjectType(UtilityRoutines::makeUPPER(cComponentTypeName)); - std::string const UpperCaseObjectName(UtilityRoutines::makeUPPER(cUniqueIDName)); - std::string const UpperCaseActuatorName(UtilityRoutines::makeUPPER(cControlTypeName)); + std::string const UpperCaseObjectType(Util::makeUPPER(cComponentTypeName)); + std::string const UpperCaseObjectName(Util::makeUPPER(cUniqueIDName)); + std::string const UpperCaseActuatorName(Util::makeUPPER(cControlTypeName)); DataRuntimeLanguage::EMSActuatorKey const key(UpperCaseObjectType, UpperCaseObjectName, UpperCaseActuatorName); @@ -2151,9 +2145,9 @@ void SetupEMSActuator(EnergyPlusData &state, // push size of ActuatorVariable and add a new one. // check for duplicates. - std::string const UpperCaseObjectType(UtilityRoutines::makeUPPER(cComponentTypeName)); - std::string const UpperCaseObjectName(UtilityRoutines::makeUPPER(cUniqueIDName)); - std::string const UpperCaseActuatorName(UtilityRoutines::makeUPPER(cControlTypeName)); + std::string const UpperCaseObjectType(Util::makeUPPER(cComponentTypeName)); + std::string const UpperCaseObjectName(Util::makeUPPER(cUniqueIDName)); + std::string const UpperCaseActuatorName(Util::makeUPPER(cControlTypeName)); DataRuntimeLanguage::EMSActuatorKey const key(UpperCaseObjectType, UpperCaseObjectName, UpperCaseActuatorName); @@ -2202,9 +2196,9 @@ void SetupEMSActuator(EnergyPlusData &state, // push size of ActuatorVariable and add a new one. // check for duplicates. - std::string const UpperCaseObjectType(UtilityRoutines::makeUPPER(cComponentTypeName)); - std::string const UpperCaseObjectName(UtilityRoutines::makeUPPER(cUniqueIDName)); - std::string const UpperCaseActuatorName(UtilityRoutines::makeUPPER(cControlTypeName)); + std::string const UpperCaseObjectType(Util::makeUPPER(cComponentTypeName)); + std::string const UpperCaseObjectName(Util::makeUPPER(cUniqueIDName)); + std::string const UpperCaseActuatorName(Util::makeUPPER(cControlTypeName)); DataRuntimeLanguage::EMSActuatorKey const key(UpperCaseObjectType, UpperCaseObjectName, UpperCaseActuatorName); @@ -2247,8 +2241,8 @@ void SetupEMSInternalVariable( bool FoundDuplicate = false; for (int InternalVarAvailNum = 1; InternalVarAvailNum <= state.dataRuntimeLang->numEMSInternalVarsAvailable; ++InternalVarAvailNum) { - if ((UtilityRoutines::SameString(cDataTypeName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName)) && - (UtilityRoutines::SameString(cUniqueIDName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName))) { + if ((Util::SameString(cDataTypeName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName)) && + (Util::SameString(cUniqueIDName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName))) { FoundDuplicate = true; break; } @@ -2296,8 +2290,8 @@ void SetupEMSInternalVariable( bool FoundDuplicate = false; for (int InternalVarAvailNum = 1; InternalVarAvailNum <= state.dataRuntimeLang->numEMSInternalVarsAvailable; ++InternalVarAvailNum) { - if ((UtilityRoutines::SameString(cDataTypeName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName)) && - (UtilityRoutines::SameString(cUniqueIDName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName))) { + if ((Util::SameString(cDataTypeName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).DataTypeName)) && + (Util::SameString(cUniqueIDName, state.dataRuntimeLang->EMSInternalVarsAvailable(InternalVarAvailNum).UniqueIDName))) { FoundDuplicate = true; break; } diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index bc000b42e08..daa8b6ae370 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -180,7 +180,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i thisEarthTubePars.nameParameters = state.dataIPShortCut->cAlphaArgs(1); // Check to make sure name is unique for (int otherParams = 1; otherParams < Loop; ++otherParams) { - if (UtilityRoutines::SameString(thisEarthTubePars.nameParameters, state.dataEarthTube->EarthTubePars(otherParams).nameParameters)) { + if (Util::SameString(thisEarthTubePars.nameParameters, state.dataEarthTube->EarthTubePars(otherParams).nameParameters)) { ShowSevereError(state, format("{}: {} = {} is not a unique name.", cCurrentModuleObject, @@ -219,7 +219,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i state.dataIPShortCut->cNumericFieldNames); // First Alpha is Zone Name - thisEarthTube.ZonePtr = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBal->Zone); + thisEarthTube.ZonePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBal->Zone); if (thisEarthTube.ZonePtr == 0) { ShowSevereError( state, @@ -453,7 +453,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i // Process the parameters based on the name (link via index) thisEarthTube.vertParametersPtr = 0; for (int parIndex = 1; parIndex <= totEarthTubePars; ++parIndex) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), state.dataEarthTube->EarthTubePars(parIndex).nameParameters)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), state.dataEarthTube->EarthTubePars(parIndex).nameParameters)) { thisEarthTube.vertParametersPtr = parIndex; break; } diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index 13b2fd3fb1c..74f2d64bd57 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -266,8 +266,8 @@ namespace EcoRoofManager { Qsoilpart2 = thisConstruct.CTFOutside[0] - F1temp * thisConstruct.CTFCross[0]; state.dataEcoRoofMgr->Pa = state.dataEnvrn->StdBaroPress; // standard atmospheric pressure (apparently in Pascals) - Tgk = state.dataEcoRoofMgr->Tg + Constant::KelvinConv; - Tak = Ta + Constant::KelvinConv; + Tgk = state.dataEcoRoofMgr->Tg + Constant::Kelvin; + Tak = Ta + Constant::Kelvin; sigmaf = 0.9 - 0.7 * std::exp(-0.75 * state.dataEcoRoofMgr->LAI); // Fractional veg cover based on (2) from FASST TR-04-25 // Formula for grasses modified to incorporate limits from @@ -283,9 +283,9 @@ namespace EcoRoofManager { // Air Temperature within the canopy is given as // (Deardorff (1987)). Kelvin. based of the previous temperatures - Tafk = (1.0 - sigmaf) * Tak + sigmaf * (0.3 * Tak + 0.6 * (Tif + Constant::KelvinConv) + 0.1 * Tgk); + Tafk = (1.0 - sigmaf) * Tak + sigmaf * (0.3 * Tak + 0.6 * (Tif + Constant::Kelvin) + 0.1 * Tgk); - Taf = Tafk - Constant::KelvinConv; // Air Temperature within canopy in Celcius (C). + Taf = Tafk - Constant::Kelvin; // Air Temperature within canopy in Celcius (C). Rhof = state.dataEcoRoofMgr->Pa / (Rair * Tafk); // Density of air at the leaf temperature Rhoaf = (Rhoa + Rhof) / 2.0; // Average of air density Zd = 0.701 * std::pow(state.dataEcoRoofMgr->Zf, 0.979); // Zero displacement height @@ -307,9 +307,9 @@ namespace EcoRoofManager { // These parameters were taken from "The Atm Boundary Layer", By J.R. Garratt // NOTE the Garratt eqn. (A21) gives esf in units of hPA so we have multiplied // the constant 6.112 by a factor of 100. - esf = 611.2 * std::exp(17.67 * Tif / (Tif + Constant::KelvinConv - 29.65)); + esf = 611.2 * std::exp(17.67 * Tif / (Tif + Constant::Kelvin - 29.65)); - // From Garratt - eqn. A21, p284. Note that Tif and Tif+Constant::KelvinConv() usage is correct. + // From Garratt - eqn. A21, p284. Note that Tif and Tif+Constant::Kelvin() usage is correct. // Saturation specific humidity at leaf temperature again based on previous temperatures qsf = 0.622 * esf / (state.dataEcoRoofMgr->Pa - 1.000 * esf); // "The Atm Boundary Layer", J.R Garrat for Saturation mixing ratio @@ -344,21 +344,21 @@ namespace EcoRoofManager { // Latent heat of vaporation at leaf surface temperature. The source of this // equation is Henderson-Sellers (1984) - Lef = 1.91846e6 * pow_2((Tif + Constant::KelvinConv) / (Tif + Constant::KelvinConv - 33.91)); + Lef = 1.91846e6 * pow_2((Tif + Constant::Kelvin) / (Tif + Constant::Kelvin - 33.91)); // Check to see if ice is sublimating or frost is forming. if (state.dataEcoRoofMgr->Tfold < 0.0) Lef = 2.838e6; // per FASST documentation p.15 after eqn. 37. // Derivative of Saturation vapor pressure, which is used in the calculation of // derivative of saturation specific humidity. - Desf = 611.2 * std::exp(17.67 * (state.dataEcoRoofMgr->Tf / (state.dataEcoRoofMgr->Tf + Constant::KelvinConv - 29.65))) * - (17.67 * state.dataEcoRoofMgr->Tf * (-1.0) * std::pow(state.dataEcoRoofMgr->Tf + Constant::KelvinConv - 29.65, -2) + - 17.67 / (Constant::KelvinConv - 29.65 + state.dataEcoRoofMgr->Tf)); + Desf = 611.2 * std::exp(17.67 * (state.dataEcoRoofMgr->Tf / (state.dataEcoRoofMgr->Tf + Constant::Kelvin - 29.65))) * + (17.67 * state.dataEcoRoofMgr->Tf * (-1.0) * std::pow(state.dataEcoRoofMgr->Tf + Constant::Kelvin - 29.65, -2) + + 17.67 / (Constant::Kelvin - 29.65 + state.dataEcoRoofMgr->Tf)); dqf = ((0.622 * state.dataEcoRoofMgr->Pa) / pow_2(state.dataEcoRoofMgr->Pa - esf)) * Desf; // Derivative of saturation specific humidity esg = 611.2 * std::exp(17.67 * (state.dataEcoRoofMgr->Tg / - ((state.dataEcoRoofMgr->Tg + Constant::KelvinConv) - 29.65))); // Pa saturation vapor pressure + ((state.dataEcoRoofMgr->Tg + Constant::Kelvin) - 29.65))); // Pa saturation vapor pressure // From Garratt - eqn. A21, p284. - // Note that Tg and Tg+Constant::KelvinConv() usage is correct. + // Note that Tg and Tg+Constant::Kelvin() usage is correct. qsg = 0.622 * esg / (state.dataEcoRoofMgr->Pa - esg); // Saturation mixing ratio at ground surface temperature. // Latent heat vaporization at the ground temperature @@ -366,9 +366,9 @@ namespace EcoRoofManager { // Check to see if ice is sublimating or frost is forming. if (state.dataEcoRoofMgr->Tgold < 0.0) Leg = 2.838e6; // per FASST documentation p.15 after eqn. 37. - Desg = 611.2 * std::exp(17.67 * (state.dataEcoRoofMgr->Tg / (state.dataEcoRoofMgr->Tg + Constant::KelvinConv - 29.65))) * - (17.67 * state.dataEcoRoofMgr->Tg * (-1.0) * std::pow(state.dataEcoRoofMgr->Tg + Constant::KelvinConv - 29.65, -2) + - 17.67 / (Constant::KelvinConv - 29.65 + state.dataEcoRoofMgr->Tg)); + Desg = 611.2 * std::exp(17.67 * (state.dataEcoRoofMgr->Tg / (state.dataEcoRoofMgr->Tg + Constant::Kelvin - 29.65))) * + (17.67 * state.dataEcoRoofMgr->Tg * (-1.0) * std::pow(state.dataEcoRoofMgr->Tg + Constant::Kelvin - 29.65, -2) + + 17.67 / (Constant::Kelvin - 29.65 + state.dataEcoRoofMgr->Tg)); dqg = (0.622 * state.dataEcoRoofMgr->Pa / pow_2(state.dataEcoRoofMgr->Pa - esg)) * Desg; // Final Ground Atmosphere Energy Balance @@ -433,8 +433,8 @@ namespace EcoRoofManager { // revisit this issue later. // Implement an iterative solution scheme to solve the simultaneous equations for Leaf and Soil temperature. // Prior experience suggests that no more than 3 iterations are likely needed - LeafTK = state.dataEcoRoofMgr->Tf + Constant::KelvinConv; - SoilTK = state.dataEcoRoofMgr->Tg + Constant::KelvinConv; + LeafTK = state.dataEcoRoofMgr->Tf + Constant::Kelvin; + SoilTK = state.dataEcoRoofMgr->Tg + Constant::Kelvin; for (int EcoLoop = 1; EcoLoop <= 3; ++EcoLoop) { P1 = sigmaf * (RS * (1.0 - state.dataEcoRoofMgr->Alphaf) + state.dataEcoRoofMgr->epsilonf * Latm) - @@ -443,7 +443,7 @@ namespace EcoRoofManager { (-sigmaf * state.dataEcoRoofMgr->epsilonf * Sigma - sigmaf * state.dataEcoRoofMgr->epsilonf * state.dataEcoRoofMgr->epsilong * Sigma / EpsilonOne) * pow_4(LeafTK) + - state.dataEcoRoofMgr->sheatf * (1.0 - 0.7 * sigmaf) * (Ta + Constant::KelvinConv) + + state.dataEcoRoofMgr->sheatf * (1.0 - 0.7 * sigmaf) * (Ta + Constant::Kelvin) + state.dataEcoRoofMgr->LAI * Rhoaf * Cf * Lef * Waf * rn * ((1.0 - 0.7 * sigmaf) / dOne) * qa + state.dataEcoRoofMgr->LAI * Rhoaf * Cf * Lef * Waf * rn * (((0.6 * sigmaf * rn) / dOne) - 1.0) * (qsf - LeafTK * dqf) + state.dataEcoRoofMgr->LAI * Rhoaf * Cf * Lef * Waf * rn * ((0.1 * sigmaf * Mg) / dOne) * (qsg - SoilTK * dqg); @@ -468,11 +468,11 @@ namespace EcoRoofManager { (-(1.0 - sigmaf) * state.dataEcoRoofMgr->epsilong * Sigma - sigmaf * state.dataEcoRoofMgr->epsilonf * state.dataEcoRoofMgr->epsilong * Sigma / EpsilonOne) * pow_4(SoilTK) + - state.dataEcoRoofMgr->sheatg * (1.0 - 0.7 * sigmaf) * (Ta + Constant::KelvinConv) + + state.dataEcoRoofMgr->sheatg * (1.0 - 0.7 * sigmaf) * (Ta + Constant::Kelvin) + Rhoag * Ce * Leg * Waf * Mg * ((1.0 - 0.7 * sigmaf) / dOne) * qa + Rhoag * Ce * Leg * Waf * Mg * (0.1 * sigmaf * Mg / dOne - Mg) * (qsg - SoilTK * dqg) + Rhoag * Ce * Leg * Waf * Mg * (0.6 * sigmaf * rn / dOne) * (qsf - LeafTK * dqf) + Qsoilpart1 + - Qsoilpart2 * (Constant::KelvinConv); // finished by T1G + Qsoilpart2 * (Constant::Kelvin); // finished by T1G T2G = 4.0 * (-(1.0 - sigmaf) * state.dataEcoRoofMgr->epsilong * Sigma - @@ -494,10 +494,9 @@ namespace EcoRoofManager { // difference scheme this loop structure should be removed. } // This loop does an iterative solution of the simultaneous equations - state.dataEcoRoofMgr->Qsoil = - -1.0 * (Qsoilpart1 - Qsoilpart2 * (SoilTK - Constant::KelvinConv)); // This is heat flux INTO top of the soil - state.dataEcoRoofMgr->Tfold = LeafTK - Constant::KelvinConv; - state.dataEcoRoofMgr->Tgold = SoilTK - Constant::KelvinConv; + state.dataEcoRoofMgr->Qsoil = -1.0 * (Qsoilpart1 - Qsoilpart2 * (SoilTK - Constant::Kelvin)); // This is heat flux INTO top of the soil + state.dataEcoRoofMgr->Tfold = LeafTK - Constant::Kelvin; + state.dataEcoRoofMgr->Tgold = SoilTK - Constant::Kelvin; } // if firstecosurface (if not we do NOT need to recalculate ecoroof energybalance as all ecoroof surfaces MUST be the same // this endif was moved here from the if statement regarding whether we are looking at the first ecoroof surface or not. diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index 51b17d8b883..9059324cf66 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, UtilityRoutines::makeUPPER(AlphaArray(2)))); + elcc->discountConvention = static_cast(getEnumValue(DiscConvNamesUC, Util::makeUPPER(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, UtilityRoutines::makeUPPER(AlphaArray(3)))); + elcc->inflationApproach = static_cast(getEnumValue(InflApprNamesUC, Util::makeUPPER(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(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER(AlphaArray(4))); + elcc->baseDateMonth = getEnumValue(Util::MonthNamesUC, Util::makeUPPER(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(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER(AlphaArray(5))); + elcc->serviceDateMonth = getEnumValue(Util::MonthNamesUC, Util::makeUPPER(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, UtilityRoutines::makeUPPER(AlphaArray(6)))); + elcc->depreciationMethod = static_cast(getEnumValue(DeprMethodNamesUC, Util::makeUPPER(AlphaArray(6)))); if (elcc->depreciationMethod == DeprMethod::Invalid) { elcc->depreciationMethod = DeprMethod::None; if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { @@ -496,8 +496,7 @@ void GetInputLifeCycleCostRecurringCosts(EnergyPlusData &state) // \key MajorOverhaul // \key OtherOperational // \default Maintenance - elcc->RecurringCosts[iInObj].category = - static_cast(getEnumValue(CostCategoryNamesUCNoSpace, UtilityRoutines::makeUPPER(AlphaArray(2)))); + elcc->RecurringCosts[iInObj].category = static_cast(getEnumValue(CostCategoryNamesUCNoSpace, Util::makeUPPER(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 && @@ -520,8 +519,7 @@ void GetInputLifeCycleCostRecurringCosts(EnergyPlusData &state) // \key ServicePeriod // \key BasePeriod // \default ServicePeriod - elcc->RecurringCosts[iInObj].startOfCosts = - static_cast(getEnumValue(StartCostNamesUC, UtilityRoutines::makeUPPER(AlphaArray(3)))); + elcc->RecurringCosts[iInObj].startOfCosts = static_cast(getEnumValue(StartCostNamesUC, Util::makeUPPER(AlphaArray(3)))); if (elcc->RecurringCosts[iInObj].startOfCosts == StartCosts::Invalid) { elcc->RecurringCosts[iInObj].startOfCosts = StartCosts::ServicePeriod; ShowWarningError(state, @@ -707,8 +705,7 @@ void GetInputLifeCycleCostNonrecurringCost(EnergyPlusData &state) // \key Salvage // \key OtherCapital // \default Construction - elcc->NonrecurringCost[iInObj].category = - static_cast(getEnumValue(CostCategoryNamesUCNoSpace, UtilityRoutines::makeUPPER(AlphaArray(2)))); + elcc->NonrecurringCost[iInObj].category = static_cast(getEnumValue(CostCategoryNamesUCNoSpace, Util::makeUPPER(AlphaArray(2)))); bool isNotNonRecurringCost = (elcc->NonrecurringCost[iInObj].category != CostCategory::Construction && elcc->NonrecurringCost[iInObj].category != CostCategory::Salvage && elcc->NonrecurringCost[iInObj].category != CostCategory::OtherCapital); @@ -728,8 +725,7 @@ void GetInputLifeCycleCostNonrecurringCost(EnergyPlusData &state) // \key ServicePeriod // \key BasePeriod // \default ServicePeriod - elcc->NonrecurringCost[iInObj].startOfCosts = - static_cast(getEnumValue(StartCostNamesUC, UtilityRoutines::makeUPPER(AlphaArray(3)))); + elcc->NonrecurringCost[iInObj].startOfCosts = static_cast(getEnumValue(StartCostNamesUC, Util::makeUPPER(AlphaArray(3)))); if (elcc->NonrecurringCost[iInObj].startOfCosts == StartCosts::Invalid) { elcc->NonrecurringCost[iInObj].startOfCosts = StartCosts::ServicePeriod; ShowWarningError(state, @@ -893,8 +889,7 @@ void GetInputLifeCycleCostUsePriceEscalation(EnergyPlusData &state) // \key November // \key December // \default January - elcc->UsePriceEscalation(iInObj).escalationStartMonth = - getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER(AlphaArray(3))); + elcc->UsePriceEscalation(iInObj).escalationStartMonth = getEnumValue(Util::MonthNamesUC, Util::makeUPPER(AlphaArray(3))); if (elcc->UsePriceEscalation(iInObj).escalationStartMonth == -1) { elcc->UsePriceEscalation(iInObj).escalationStartMonth = 0; ShowWarningError(state, @@ -1713,8 +1708,8 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) } else { tableBody(1, 6) = "-- N/A --"; } - tableBody(1, 7) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear); - tableBody(1, 8) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->serviceDateMonth)], elcc->serviceDateYear); + tableBody(1, 7) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear); + tableBody(1, 8) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->serviceDateMonth)], elcc->serviceDateYear); tableBody(1, 9) = fmt::to_string(elcc->lengthStudyYears); tableBody(1, 10) = OutputReportTabular::RealToStr(elcc->taxRate, 4); tableBody(1, 11) = DeprMethodNames[static_cast(elcc->depreciationMethod)]; @@ -1752,7 +1747,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) columnHead(jObj) = elcc->UsePriceEscalation(jObj).name; tableBody(jObj, 1) = Constant::eResourceNames[static_cast(elcc->UsePriceEscalation(jObj).resource)]; tableBody(jObj, 2) = format("{} {}", - UtilityRoutines::MonthNamesCC[static_cast(elcc->UsePriceEscalation(jObj).escalationStartMonth)], + Util::MonthNamesCC[static_cast(elcc->UsePriceEscalation(jObj).escalationStartMonth)], elcc->UsePriceEscalation(jObj).escalationStartYear); } for (int jObj = 1; jObj <= elcc->numUsePriceEscalation; ++jObj) { @@ -1786,8 +1781,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) columnHead = "none"; rowHead(1) = ""; for (int iYear = 1; iYear <= numYears; ++iYear) { - rowHead(iYear + 1) = - format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->serviceDateMonth)], elcc->serviceDateYear + iYear - 1); + rowHead(iYear + 1) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->serviceDateMonth)], elcc->serviceDateYear + iYear - 1); } for (int jObj = 1; jObj <= elcc->numUseAdjustment; ++jObj) { // loop through objects not columns to add names columnHead(jObj) = elcc->UseAdjustment(jObj).name; @@ -1822,8 +1816,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) tableBody = ""; rowHead(1) = ""; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear + 1) = - format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear + 1) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); } for (int jObj = 0; jObj < (elcc->numRecurringCosts + elcc->numNonrecurringCost); ++jObj) { int curCashFlow = CostCategory::Num + jObj; @@ -1866,7 +1859,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) tableBody.allocate(numColumns, elcc->lengthStudyYears); tableBody = ""; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); } for (int jObj = 0; jObj < elcc->numResourcesUsed; ++jObj) { int curCashFlow = CostCategory::Num + elcc->numRecurringCosts + elcc->numNonrecurringCost + jObj; @@ -1902,7 +1895,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) tableBody.allocate(numColumns, elcc->lengthStudyYears); tableBody = ""; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); } for (int jObj = 0; jObj < elcc->numResourcesUsed; ++jObj) { int curCashFlow = CostCategory::Num + elcc->numRecurringCosts + elcc->numNonrecurringCost + jObj; @@ -1951,7 +1944,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) } columnHead(4) = Total; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); for (int CostCategory = CostCategory::Construction, tableColumnIndex = 1; CostCategory <= CostCategory::TotCaptl; ++tableColumnIndex, ++CostCategory) { tableBody(tableColumnIndex, iYear) = OutputReportTabular::RealToStr(elcc->CashFlow[CostCategory].yrAmount(iYear), 2); @@ -1985,7 +1978,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) columnHead(10) = Total; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); for (int CashFlowCostCategory = CostCategory::Maintenance; CashFlowCostCategory <= CostCategory::TotOper; ++CashFlowCostCategory) { tableBody(CashFlowCostCategory + 1, iYear) = OutputReportTabular::RealToStr(elcc->CashFlow[CashFlowCostCategory].yrAmount(iYear), 2); } @@ -2018,7 +2011,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) columnHead(10) = Total; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); for (int CashFlowCostCategory = CostCategory::Maintenance; CashFlowCostCategory <= CostCategory::Water; ++CashFlowCostCategory) { tableBody(CashFlowCostCategory + 1, iYear) = OutputReportTabular::RealToStr(elcc->CashFlow[CashFlowCostCategory].yrAmount(iYear), 2); } @@ -2070,7 +2063,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) // } // for (int kMonth = 1; kMonth <= elcc->lengthStudyTotalMonths; ++kMonth) { // rowHead(kMonth) = format("{} {}", - // UtilityRoutines::MonthNamesCC[static_cast(1 + (kMonth + elcc->baseDateMonth - 2) % 12) - 1], + // Util::MonthNamesCC[static_cast(1 + (kMonth + elcc->baseDateMonth - 2) % 12) - 1], // elcc->baseDateYear + int((kMonth - 1) / 12)); // for (int jObj = 0; jObj < elcc->numCashFlow; ++jObj) { // tableBody(jObj + 1, kMonth) = OutputReportTabular::RealToStr(elcc->CashFlow[jObj].mnAmount(kMonth), 2); @@ -2099,7 +2092,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) tableBody.allocate(12, elcc->lengthStudyYears); tableBody = ""; for (int kMonth = 1; kMonth <= 12; ++kMonth) { - columnHead(kMonth) = UtilityRoutines::MonthNamesCC[static_cast(kMonth - 1)]; + columnHead(kMonth) = Util::MonthNamesCC[static_cast(kMonth - 1)]; } for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { rowHead(iYear) = fmt::to_string(elcc->baseDateYear + iYear - 1); @@ -2257,7 +2250,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) totalPV = 0.0; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear) = format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); tableBody(1, iYear) = OutputReportTabular::RealToStr(elcc->CashFlow[CostCategory::TotGrand].yrAmount(iYear), 2); // adjust for escalated energy costs Real64 yearly_total_cost = elcc->CashFlow[CostCategory::TotGrand].yrAmount(iYear) + elcc->EscalatedTotEnergy(iYear) - @@ -2300,8 +2293,7 @@ void WriteTabularLifeCycleCostReport(EnergyPlusData &state) totalPV = 0.0; for (int iYear = 1; iYear <= elcc->lengthStudyYears; ++iYear) { - rowHead(iYear) = - format("{} {}", UtilityRoutines::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); + rowHead(iYear) = format("{} {}", Util::MonthNamesCC[static_cast(elcc->baseDateMonth)], elcc->baseDateYear + iYear - 1); tableBody(1, iYear) = OutputReportTabular::RealToStr(elcc->DepreciatedCapital(iYear), 2); tableBody(2, iYear) = OutputReportTabular::RealToStr(elcc->TaxableIncome(iYear), 2); tableBody(3, iYear) = OutputReportTabular::RealToStr(elcc->Taxes(iYear), 2); diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 47ca4123cfa..f10310c1b5b 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -226,8 +226,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // Determine whether this meter is related to electricity, or water, or gas if (tariff(iInObj).reportMeterIndx != 0) { - std::string const &SELECT_CASE_var( - UtilityRoutines::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType)); + std::string const &SELECT_CASE_var(Util::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType)); // Various types of electricity meters if (SELECT_CASE_var == "ELECTRICITY") { @@ -259,23 +258,23 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // We set demandConv to something analogous to m3/h if (tariff(iInObj).kindWaterMtr == kindMeterWater) { // conversion factor - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { tariff(iInObj).convChoice = EconConv::USERDEF; tariff(iInObj).energyConv = state.dataIPShortCut->rNumericArgs(1); // energy conversion factor tariff(iInObj).demandConv = state.dataIPShortCut->rNumericArgs(2); // demand conversion factor - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "M3")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "M3")) { tariff(iInObj).convChoice = EconConv::M3; tariff(iInObj).energyConv = 1.0; tariff(iInObj).demandConv = 3600.0; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "CCF")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "CCF")) { tariff(iInObj).convChoice = EconConv::CCF; tariff(iInObj).energyConv = 0.35314666721488586; tariff(iInObj).demandConv = 0.35314666721488586 * 3600; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "GAL")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "GAL")) { tariff(iInObj).convChoice = EconConv::GAL; tariff(iInObj).energyConv = 264.1720523602524; tariff(iInObj).demandConv = 264.1720523602524 * 3600; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "KGAL")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "KGAL")) { tariff(iInObj).convChoice = EconConv::KGAL; tariff(iInObj).energyConv = 0.2641720523602524; tariff(iInObj).demandConv = 0.2641720523602524 * 3600; @@ -295,29 +294,29 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // Volumetric units such as MCF or CCF doesn't make sense IMHO (JM) // THERM is strange for an electric meter but currently I accept but issue a warning } else if (tariff(iInObj).kindElectricMtr != kindMeterNotElectric) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { tariff(iInObj).convChoice = EconConv::USERDEF; tariff(iInObj).energyConv = state.dataIPShortCut->rNumericArgs(1); // energy conversion factor tariff(iInObj).demandConv = state.dataIPShortCut->rNumericArgs(2); // demand conversion factor - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "KWH")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "KWH")) { tariff(iInObj).convChoice = EconConv::KWH; tariff(iInObj).energyConv = 0.0000002778; tariff(iInObj).demandConv = 0.001; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MJ")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "MJ")) { tariff(iInObj).convChoice = EconConv::MJ; tariff(iInObj).energyConv = 0.000001; tariff(iInObj).demandConv = 0.0036; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MMBTU")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "MMBTU")) { tariff(iInObj).convChoice = EconConv::MMBTU; tariff(iInObj).energyConv = 9.4781712e-10; tariff(iInObj).demandConv = 0.000003412; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "KBTU")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "KBTU")) { tariff(iInObj).convChoice = EconConv::KBTU; tariff(iInObj).energyConv = 9.4781712e-7; tariff(iInObj).demandConv = 0.003412; // We accept the following choices, but issue a warning - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "THERM")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "THERM")) { tariff(iInObj).convChoice = EconConv::THERM; tariff(iInObj).energyConv = 9.4781712e-9; tariff(iInObj).demandConv = 0.00003412; @@ -342,42 +341,42 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // If it's a gas meter } else if (tariff(iInObj).kindGasMtr == kindMeterGas) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { tariff(iInObj).convChoice = EconConv::USERDEF; tariff(iInObj).energyConv = state.dataIPShortCut->rNumericArgs(1); // energy conversion factor tariff(iInObj).demandConv = state.dataIPShortCut->rNumericArgs(2); // demand conversion factor - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "KWH")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "KWH")) { tariff(iInObj).convChoice = EconConv::KWH; tariff(iInObj).energyConv = 0.0000002778; tariff(iInObj).demandConv = 0.001; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "THERM")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "THERM")) { tariff(iInObj).convChoice = EconConv::THERM; tariff(iInObj).energyConv = 9.4781712e-9; tariff(iInObj).demandConv = 0.00003412; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MMBTU")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "MMBTU")) { tariff(iInObj).convChoice = EconConv::MMBTU; tariff(iInObj).energyConv = 9.4781712e-10; tariff(iInObj).demandConv = 0.000003412; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MJ")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "MJ")) { tariff(iInObj).convChoice = EconConv::MJ; tariff(iInObj).energyConv = 0.000001; tariff(iInObj).demandConv = 0.0036; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "KBTU")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "KBTU")) { tariff(iInObj).convChoice = EconConv::KBTU; tariff(iInObj).energyConv = 9.4781712e-7; tariff(iInObj).demandConv = 0.003412; // Volumetric units for natural gas // Actually assuming 1 therm = 1 CCF (= 100 ft^3) - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MCF")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "MCF")) { tariff(iInObj).convChoice = EconConv::MCF; tariff(iInObj).energyConv = 9.4781712e-10; tariff(iInObj).demandConv = 0.000003412; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "CCF")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "CCF")) { tariff(iInObj).convChoice = EconConv::CCF; tariff(iInObj).energyConv = 9.4781712e-9; tariff(iInObj).demandConv = 0.00003412; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "M3")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "M3")) { // Obtained from converting CCF above to m^3 so the same heat content of natural gas is used (1 therm = 1 CCF) tariff(iInObj).convChoice = EconConv::M3; tariff(iInObj).energyConv = 2.6839192e-10; @@ -396,27 +395,27 @@ 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 } else { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "USERDEFINED")) { tariff(iInObj).convChoice = EconConv::USERDEF; tariff(iInObj).energyConv = state.dataIPShortCut->rNumericArgs(1); // energy conversion factor tariff(iInObj).demandConv = state.dataIPShortCut->rNumericArgs(2); // demand conversion factor - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "KWH")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "KWH")) { tariff(iInObj).convChoice = EconConv::KWH; tariff(iInObj).energyConv = 0.0000002778; tariff(iInObj).demandConv = 0.001; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "THERM")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "THERM")) { tariff(iInObj).convChoice = EconConv::THERM; tariff(iInObj).energyConv = 9.4781712e-9; tariff(iInObj).demandConv = 0.00003412; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MMBTU")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "MMBTU")) { tariff(iInObj).convChoice = EconConv::MMBTU; tariff(iInObj).energyConv = 9.4781712e-10; tariff(iInObj).demandConv = 0.000003412; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MJ")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "MJ")) { tariff(iInObj).convChoice = EconConv::MJ; tariff(iInObj).energyConv = 0.000001; tariff(iInObj).demandConv = 0.0036; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "KBTU")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "KBTU")) { tariff(iInObj).convChoice = EconConv::KBTU; tariff(iInObj).energyConv = 9.4781712e-7; tariff(iInObj).demandConv = 0.003412; @@ -476,7 +475,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i tariff(iInObj).monthSchIndex = 0; // flag value for no schedule used } // type of demand window - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "QuarterHour")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "QuarterHour")) { // check to make sure that the demand window and the TIMESTEP IN HOUR are consistant. { switch (state.dataGlobal->NumOfTimeStepInHour) { @@ -518,7 +517,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i } break; } } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "HalfHour")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "HalfHour")) { { switch (state.dataGlobal->NumOfTimeStepInHour) { case 1: @@ -550,13 +549,13 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i } break; } } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "FullHour")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "FullHour")) { tariff(iInObj).demandWindow = DemandWindow::Hour; tariff(iInObj).demWinTime = 1.00; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "Day")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "Day")) { tariff(iInObj).demandWindow = DemandWindow::Day; tariff(iInObj).demWinTime = 24.00; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "Week")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "Week")) { tariff(iInObj).demandWindow = DemandWindow::Week; tariff(iInObj).demWinTime = 24.0 * 7.0; } else { @@ -591,12 +590,12 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i } } // monthly charge - tariff(iInObj).monthChgVal = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(8), isNotNumeric); + tariff(iInObj).monthChgVal = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(8), isNotNumeric); tariff(iInObj).monthChgPt = AssignVariablePt(state, state.dataIPShortCut->cAlphaArgs(8), isNotNumeric, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, iInObj); // minimum monthly charge if (len(state.dataIPShortCut->cAlphaArgs(9)) > 0) { - tariff(iInObj).minMonthChgVal = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(9), isNotNumeric); + tariff(iInObj).minMonthChgVal = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(9), isNotNumeric); } else { tariff(iInObj).minMonthChgVal = -HUGE_(-1.0); // set to a very negative value } @@ -610,24 +609,23 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // group name for separate distribution and transmission rates tariff(iInObj).groupName = state.dataIPShortCut->cAlphaArgs(12); // buy or sell option - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(13), "BuyFromUtility")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(13), "BuyFromUtility")) { tariff(iInObj).buyOrSell = buyFromUtility; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(13), "SellToUtility")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(13), "SellToUtility")) { tariff(iInObj).buyOrSell = sellToUtility; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(13), "NetMetering")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(13), "NetMetering")) { tariff(iInObj).buyOrSell = netMetering; } else { tariff(iInObj).buyOrSell = buyFromUtility; } // check if meter is consistent with buy or sell option - if ((tariff(iInObj).buyOrSell == sellToUtility) && - (!UtilityRoutines::SameString(tariff(iInObj).reportMeter, "ELECTRICITYSURPLUSSOLD:FACILITY"))) { + if ((tariff(iInObj).buyOrSell == sellToUtility) && (!Util::SameString(tariff(iInObj).reportMeter, "ELECTRICITYSURPLUSSOLD:FACILITY"))) { ShowWarningError(state, format("{}{}=\"{}\" atypical meter", RoutineName, CurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("The meter chosen \"{}\" is not typically used with the sellToUtility option.", tariff(iInObj).reportMeter)); ShowContinueError(state, "Usually the ElectricitySurplusSold:Facility meter is selected when the sellToUtility option is used."); } - if ((tariff(iInObj).buyOrSell == netMetering) && (!UtilityRoutines::SameString(tariff(iInObj).reportMeter, "ELECTRICITYNET:FACILITY"))) { + if ((tariff(iInObj).buyOrSell == netMetering) && (!Util::SameString(tariff(iInObj).reportMeter, "ELECTRICITYNET:FACILITY"))) { ShowWarningError(state, format("{}{}=\"{}\" atypical meter", RoutineName, CurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("The meter chosen \"{}\" is not typically used with the netMetering option.", tariff(iInObj).reportMeter)); @@ -636,8 +634,8 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i // also test the buy option for electricity if (tariff(iInObj).buyOrSell == buyFromUtility) { if (hasi(tariff(iInObj).reportMeter, "Elec")) { // test if electric meter - if (!(UtilityRoutines::SameString(tariff(iInObj).reportMeter, "Electricity:Facility") || - UtilityRoutines::SameString(tariff(iInObj).reportMeter, "ElectricityPurchased:Facility"))) { + if (!(Util::SameString(tariff(iInObj).reportMeter, "Electricity:Facility") || + Util::SameString(tariff(iInObj).reportMeter, "ElectricityPurchased:Facility"))) { ShowWarningError(state, format("{}{}=\"{}\" atypical meter", RoutineName, CurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError( @@ -664,9 +662,8 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i } // associate the resource number with each tariff if (tariff(iInObj).reportMeterIndx >= 1) { - tariff(iInObj).resource = static_cast( - getEnumValue(Constant::eResourceNamesUC, - UtilityRoutines::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType))); + tariff(iInObj).resource = static_cast(getEnumValue( + Constant::eResourceNamesUC, Util::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType))); } } } @@ -722,9 +719,9 @@ void GetInputEconomicsQualify(EnergyPlusData &state, bool &ErrorsFound) // true qualify(iInObj).sourcePt = AssignVariablePt( state, state.dataIPShortCut->cAlphaArgs(3), true, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, qualify(iInObj).tariffIndx); // indicator if maximum test otherwise minimum - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "Minimum")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "Minimum")) { qualify(iInObj).isMaximum = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "Maximum")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "Maximum")) { qualify(iInObj).isMaximum = true; } else { ShowSevereError(state, format("{}{}=\"{}\" invalid data", RoutineName, CurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -733,7 +730,7 @@ void GetInputEconomicsQualify(EnergyPlusData &state, bool &ErrorsFound) // true qualify(iInObj).isMaximum = true; } // value of the threshold - qualify(iInObj).thresholdVal = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(5), isNotNumeric); + qualify(iInObj).thresholdVal = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(5), isNotNumeric); qualify(iInObj).thresholdPt = AssignVariablePt(state, state.dataIPShortCut->cAlphaArgs(5), isNotNumeric, @@ -745,9 +742,9 @@ void GetInputEconomicsQualify(EnergyPlusData &state, bool &ErrorsFound) // true // enumerated list of the kind of season qualify(iInObj).season = LookUpSeason(state, state.dataIPShortCut->cAlphaArgs(6), state.dataIPShortCut->cAlphaArgs(1)); // indicator if consecutive months otherwise count - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "Count")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "Count")) { qualify(iInObj).isConsecutive = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "Consecutive")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "Consecutive")) { qualify(iInObj).isConsecutive = true; } else { ShowWarningError(state, format("{}{}=\"{}\" invalid data", RoutineName, CurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -830,7 +827,7 @@ void GetInputEconomicsChargeSimple(EnergyPlusData &state, bool &ErrorsFound) // chargeSimple.categoryPt = AssignVariablePt( state, state.dataIPShortCut->cAlphaArgs(5), true, varIsAssigned, varNotYetDefined, ObjType::Category, iInObj, chargeSimple.tariffIndx); // cost per unit value or variable - chargeSimple.costPerVal = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(6), isNotNumeric); + chargeSimple.costPerVal = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(6), isNotNumeric); chargeSimple.costPerPt = AssignVariablePt( state, state.dataIPShortCut->cAlphaArgs(6), isNotNumeric, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, chargeSimple.tariffIndx); } @@ -911,7 +908,7 @@ void GetInputEconomicsChargeBlock(EnergyPlusData &state, bool &ErrorsFound) // t chargeBlock.blkSzMultVal = 1.0; // default is 1 if left blank chargeBlock.blkSzMultPt = 0; } else { - chargeBlock.blkSzMultVal = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(7), isNotNumeric); + chargeBlock.blkSzMultVal = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(7), isNotNumeric); chargeBlock.blkSzMultPt = AssignVariablePt(state, state.dataIPShortCut->cAlphaArgs(7), isNotNumeric, @@ -926,12 +923,12 @@ void GetInputEconomicsChargeBlock(EnergyPlusData &state, bool &ErrorsFound) // t for (int jBlk = 1; jBlk <= chargeBlock.numBlk; ++jBlk) { alphaOffset = 7 + (jBlk - 1) * 2; // catch the "remaining" code word for the block size - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(alphaOffset + 1), "REMAINING")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(alphaOffset + 1), "REMAINING")) { chargeBlock.blkSzVal(jBlk) = hugeNumber / 1000000; // using small portion of largest possible value to prevent overflow chargeBlock.blkSzPt(jBlk) = 0; } else { // array of block size - chargeBlock.blkSzVal(jBlk) = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(alphaOffset + 1), isNotNumeric); + chargeBlock.blkSzVal(jBlk) = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(alphaOffset + 1), isNotNumeric); chargeBlock.blkSzPt(jBlk) = AssignVariablePt(state, state.dataIPShortCut->cAlphaArgs(alphaOffset + 1), @@ -943,7 +940,7 @@ void GetInputEconomicsChargeBlock(EnergyPlusData &state, bool &ErrorsFound) // t chargeBlock.tariffIndx); } // array of block cost - chargeBlock.blkCostVal(jBlk) = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(alphaOffset + 2), isNotNumeric); + chargeBlock.blkCostVal(jBlk) = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(alphaOffset + 2), isNotNumeric); chargeBlock.blkCostPt(jBlk) = AssignVariablePt(state, state.dataIPShortCut->cAlphaArgs(alphaOffset + 2), isNotNumeric, @@ -1010,11 +1007,11 @@ void GetInputEconomicsRatchet(EnergyPlusData &state, bool &ErrorsFound) // true ratchet.seasonFrom = LookUpSeason(state, state.dataIPShortCut->cAlphaArgs(5), state.dataIPShortCut->cAlphaArgs(1)); ratchet.seasonTo = LookUpSeason(state, state.dataIPShortCut->cAlphaArgs(6), state.dataIPShortCut->cAlphaArgs(1)); // ratchet multiplier - ratchet.multiplierVal = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(7), isNotNumeric); + ratchet.multiplierVal = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(7), isNotNumeric); ratchet.multiplierPt = AssignVariablePt( state, state.dataIPShortCut->cAlphaArgs(7), isNotNumeric, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, ratchet.tariffIndx); // ratchet offset - ratchet.offsetVal = UtilityRoutines::ProcessNumber(state.dataIPShortCut->cAlphaArgs(8), isNotNumeric); + ratchet.offsetVal = Util::ProcessNumber(state.dataIPShortCut->cAlphaArgs(8), isNotNumeric); ratchet.offsetPt = AssignVariablePt( state, state.dataIPShortCut->cAlphaArgs(8), isNotNumeric, varIsArgument, varNotYetDefined, ObjType::Invalid, 0, ratchet.tariffIndx); } @@ -1063,13 +1060,13 @@ void GetInputEconomicsVariable(EnergyPlusData &state, bool &ErrorsFound) // true auto &econVar = state.dataEconTariff->econVar(variablePt); // validate the kind of variable - not used internally except for validation - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "ENERGY")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "ENERGY")) { econVar.varUnitType = varUnitTypeEnergy; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "DEMAND")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "DEMAND")) { econVar.varUnitType = varUnitTypeDemand; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "DIMENSIONLESS")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "DIMENSIONLESS")) { econVar.varUnitType = varUnitTypeDimensionless; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "CURRENCY")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "CURRENCY")) { econVar.varUnitType = varUnitTypeCurrency; } else { econVar.varUnitType = varUnitTypeDimensionless; @@ -1205,7 +1202,7 @@ void GetInputEconomicsCurrencyType(EnergyPlusData &state, bool &ErrorsFound) // state.dataIPShortCut->cNumericFieldNames); // Monetary Unit for (i = 1; i <= (int)state.dataCostEstimateManager->monetaryUnit.size(); ++i) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), state.dataCostEstimateManager->monetaryUnit(i).code)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), state.dataCostEstimateManager->monetaryUnit(i).code)) { state.dataCostEstimateManager->selectedMonetaryUnit = i; break; } @@ -1691,15 +1688,15 @@ int LookUpSeason(EnergyPlusData &state, std::string const &nameOfSeason, std::st int LookUpSeason; - if (UtilityRoutines::SameString(nameOfSeason, "Summer")) { + if (Util::SameString(nameOfSeason, "Summer")) { LookUpSeason = seasonSummer; - } else if (UtilityRoutines::SameString(nameOfSeason, "Winter")) { + } else if (Util::SameString(nameOfSeason, "Winter")) { LookUpSeason = seasonWinter; - } else if (UtilityRoutines::SameString(nameOfSeason, "Spring")) { + } else if (Util::SameString(nameOfSeason, "Spring")) { LookUpSeason = seasonSpring; - } else if (UtilityRoutines::SameString(nameOfSeason, "Fall")) { + } else if (Util::SameString(nameOfSeason, "Fall")) { LookUpSeason = seasonFall; - } else if (UtilityRoutines::SameString(nameOfSeason, "Annual")) { + } else if (Util::SameString(nameOfSeason, "Annual")) { LookUpSeason = seasonAnnual; } else { ShowWarningError(state, format("UtilityCost: Invalid season name {} in: {}", nameOfSeason, nameOfReferingObj)); @@ -1722,7 +1719,7 @@ int FindTariffIndex( int found = 0; for (int iTariff = 1; iTariff <= state.dataEconTariff->numTariff; ++iTariff) { - if (UtilityRoutines::SameString(nameOfTariff, state.dataEconTariff->tariff(iTariff).tariffName)) { + if (Util::SameString(nameOfTariff, state.dataEconTariff->tariff(iTariff).tariffName)) { found = iTariff; break; } @@ -1748,52 +1745,52 @@ void warnIfNativeVarname( // one of the names of native variables bool throwError = false; - if (UtilityRoutines::SameString(objName, "TotalEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "TotalDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "ShoulderEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "ShoulderDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "OffPeakEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "OffPeakDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "MidPeakEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "MidPeakDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakExceedsOffPeak")) throwError = true; - if (UtilityRoutines::SameString(objName, "OffPeakExceedsPeak")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakExceedsMidPeak")) throwError = true; - if (UtilityRoutines::SameString(objName, "MidPeakExceedsPeak")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakExceedsShoulder")) throwError = true; - if (UtilityRoutines::SameString(objName, "ShoulderExceedsPeak")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsWinter")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsNotWinter")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsSpring")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsNotSpring")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsSummer")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsNotSummer")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsAutumn")) throwError = true; - if (UtilityRoutines::SameString(objName, "IsNotAutumn")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakAndShoulderEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakAndShoulderDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakAndMidPeakEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakAndMidPeakDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "ShoulderAndOffPeakEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "ShoulderAndOffPeakDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakAndOffPeakEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "PeakAndOffPeakDemand")) throwError = true; - if (UtilityRoutines::SameString(objName, "RealTimePriceCosts")) throwError = true; - if (UtilityRoutines::SameString(objName, "AboveCustomerBaseCosts")) throwError = true; - if (UtilityRoutines::SameString(objName, "BelowCustomerBaseCosts")) throwError = true; - if (UtilityRoutines::SameString(objName, "AboveCustomerBaseEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "BelowCustomerBaseEnergy")) throwError = true; - if (UtilityRoutines::SameString(objName, "EnergyCharges")) throwError = true; - if (UtilityRoutines::SameString(objName, "DemandCharges")) throwError = true; - if (UtilityRoutines::SameString(objName, "ServiceCharges")) throwError = true; - if (UtilityRoutines::SameString(objName, "Basis")) throwError = true; - if (UtilityRoutines::SameString(objName, "Surcharges")) throwError = true; - if (UtilityRoutines::SameString(objName, "Adjustments")) throwError = true; - if (UtilityRoutines::SameString(objName, "Subtotal")) throwError = true; - if (UtilityRoutines::SameString(objName, "Taxes")) throwError = true; - if (UtilityRoutines::SameString(objName, "Total")) throwError = true; + if (Util::SameString(objName, "TotalEnergy")) throwError = true; + if (Util::SameString(objName, "TotalDemand")) throwError = true; + if (Util::SameString(objName, "PeakEnergy")) throwError = true; + if (Util::SameString(objName, "PeakDemand")) throwError = true; + if (Util::SameString(objName, "ShoulderEnergy")) throwError = true; + if (Util::SameString(objName, "ShoulderDemand")) throwError = true; + if (Util::SameString(objName, "OffPeakEnergy")) throwError = true; + if (Util::SameString(objName, "OffPeakDemand")) throwError = true; + if (Util::SameString(objName, "MidPeakEnergy")) throwError = true; + if (Util::SameString(objName, "MidPeakDemand")) throwError = true; + if (Util::SameString(objName, "PeakExceedsOffPeak")) throwError = true; + if (Util::SameString(objName, "OffPeakExceedsPeak")) throwError = true; + if (Util::SameString(objName, "PeakExceedsMidPeak")) throwError = true; + if (Util::SameString(objName, "MidPeakExceedsPeak")) throwError = true; + if (Util::SameString(objName, "PeakExceedsShoulder")) throwError = true; + if (Util::SameString(objName, "ShoulderExceedsPeak")) throwError = true; + if (Util::SameString(objName, "IsWinter")) throwError = true; + if (Util::SameString(objName, "IsNotWinter")) throwError = true; + if (Util::SameString(objName, "IsSpring")) throwError = true; + if (Util::SameString(objName, "IsNotSpring")) throwError = true; + if (Util::SameString(objName, "IsSummer")) throwError = true; + if (Util::SameString(objName, "IsNotSummer")) throwError = true; + if (Util::SameString(objName, "IsAutumn")) throwError = true; + if (Util::SameString(objName, "IsNotAutumn")) throwError = true; + if (Util::SameString(objName, "PeakAndShoulderEnergy")) throwError = true; + if (Util::SameString(objName, "PeakAndShoulderDemand")) throwError = true; + if (Util::SameString(objName, "PeakAndMidPeakEnergy")) throwError = true; + if (Util::SameString(objName, "PeakAndMidPeakDemand")) throwError = true; + if (Util::SameString(objName, "ShoulderAndOffPeakEnergy")) throwError = true; + if (Util::SameString(objName, "ShoulderAndOffPeakDemand")) throwError = true; + if (Util::SameString(objName, "PeakAndOffPeakEnergy")) throwError = true; + if (Util::SameString(objName, "PeakAndOffPeakDemand")) throwError = true; + if (Util::SameString(objName, "RealTimePriceCosts")) throwError = true; + if (Util::SameString(objName, "AboveCustomerBaseCosts")) throwError = true; + if (Util::SameString(objName, "BelowCustomerBaseCosts")) throwError = true; + if (Util::SameString(objName, "AboveCustomerBaseEnergy")) throwError = true; + if (Util::SameString(objName, "BelowCustomerBaseEnergy")) throwError = true; + if (Util::SameString(objName, "EnergyCharges")) throwError = true; + if (Util::SameString(objName, "DemandCharges")) throwError = true; + if (Util::SameString(objName, "ServiceCharges")) throwError = true; + if (Util::SameString(objName, "Basis")) throwError = true; + if (Util::SameString(objName, "Surcharges")) throwError = true; + if (Util::SameString(objName, "Adjustments")) throwError = true; + if (Util::SameString(objName, "Subtotal")) throwError = true; + if (Util::SameString(objName, "Taxes")) throwError = true; + if (Util::SameString(objName, "Total")) throwError = true; if (throwError) { ErrorsFound = true; if (curTariffIndex >= 1 && curTariffIndex <= state.dataEconTariff->numTariff) { @@ -1832,7 +1829,7 @@ int AssignVariablePt(EnergyPlusData &state, if (allocated(econVar)) { for (int iVar = 1; iVar <= state.dataEconTariff->numEconVar; ++iVar) { if (econVar(iVar).tariffIndx == tariffPt) { - if (UtilityRoutines::SameString(econVar(iVar).name, inNoSpaces)) { + if (Util::SameString(econVar(iVar).name, inNoSpaces)) { found = iVar; break; } @@ -2057,109 +2054,109 @@ int lookupOperator(std::string const &opString) int lookupOperator; - if (UtilityRoutines::SameString(opString, "Sum")) { + if (Util::SameString(opString, "Sum")) { lookupOperator = opSUM; - } else if (UtilityRoutines::SameString(opString, "MULTIPLY")) { + } else if (Util::SameString(opString, "MULTIPLY")) { lookupOperator = opMULTIPLY; - } else if (UtilityRoutines::SameString(opString, "MULT")) { + } else if (Util::SameString(opString, "MULT")) { lookupOperator = opMULTIPLY; - } else if (UtilityRoutines::SameString(opString, "SUBTRACT")) { + } else if (Util::SameString(opString, "SUBTRACT")) { lookupOperator = opSUBTRACT; - } else if (UtilityRoutines::SameString(opString, "SUBT")) { + } else if (Util::SameString(opString, "SUBT")) { lookupOperator = opSUBTRACT; - } else if (UtilityRoutines::SameString(opString, "DIVIDE")) { + } else if (Util::SameString(opString, "DIVIDE")) { lookupOperator = opDIVIDE; - } else if (UtilityRoutines::SameString(opString, "DIV")) { + } else if (Util::SameString(opString, "DIV")) { lookupOperator = opDIVIDE; - } else if (UtilityRoutines::SameString(opString, "ABSOLUTE")) { + } else if (Util::SameString(opString, "ABSOLUTE")) { lookupOperator = opABSOLUTE; - } else if (UtilityRoutines::SameString(opString, "ABS")) { + } else if (Util::SameString(opString, "ABS")) { lookupOperator = opABSOLUTE; - } else if (UtilityRoutines::SameString(opString, "INTEGER")) { + } else if (Util::SameString(opString, "INTEGER")) { lookupOperator = opINTEGER; - } else if (UtilityRoutines::SameString(opString, "INT")) { + } else if (Util::SameString(opString, "INT")) { lookupOperator = opINTEGER; - } else if (UtilityRoutines::SameString(opString, "SIGN")) { + } else if (Util::SameString(opString, "SIGN")) { lookupOperator = opSIGN; - } else if (UtilityRoutines::SameString(opString, "ROUND")) { + } else if (Util::SameString(opString, "ROUND")) { lookupOperator = opROUND; - } else if (UtilityRoutines::SameString(opString, "Maximum")) { + } else if (Util::SameString(opString, "Maximum")) { lookupOperator = opMAXIMUM; - } else if (UtilityRoutines::SameString(opString, "MAX")) { + } else if (Util::SameString(opString, "MAX")) { lookupOperator = opMAXIMUM; - } else if (UtilityRoutines::SameString(opString, "MINIMUM")) { + } else if (Util::SameString(opString, "MINIMUM")) { lookupOperator = opMINIMUM; - } else if (UtilityRoutines::SameString(opString, "MIN")) { + } else if (Util::SameString(opString, "MIN")) { lookupOperator = opMINIMUM; - } else if (UtilityRoutines::SameString(opString, "EXCEEDS")) { + } else if (Util::SameString(opString, "EXCEEDS")) { lookupOperator = opEXCEEDS; - } else if (UtilityRoutines::SameString(opString, "ANNUALMINIMUM")) { + } else if (Util::SameString(opString, "ANNUALMINIMUM")) { lookupOperator = opANNUALMINIMUM; - } else if (UtilityRoutines::SameString(opString, "ANMIN")) { + } else if (Util::SameString(opString, "ANMIN")) { lookupOperator = opANNUALMINIMUM; - } else if (UtilityRoutines::SameString(opString, "ANNUALMAXIMUM")) { + } else if (Util::SameString(opString, "ANNUALMAXIMUM")) { lookupOperator = opANNUALMAXIMUM; - } else if (UtilityRoutines::SameString(opString, "ANMAX")) { + } else if (Util::SameString(opString, "ANMAX")) { lookupOperator = opANNUALMAXIMUM; - } else if (UtilityRoutines::SameString(opString, "ANNUALSUM")) { + } else if (Util::SameString(opString, "ANNUALSUM")) { lookupOperator = opANNUALSUM; - } else if (UtilityRoutines::SameString(opString, "ANSUM")) { + } else if (Util::SameString(opString, "ANSUM")) { lookupOperator = opANNUALSUM; - } else if (UtilityRoutines::SameString(opString, "ANNUALAVERAGE")) { + } else if (Util::SameString(opString, "ANNUALAVERAGE")) { lookupOperator = opANNUALAVERAGE; - } else if (UtilityRoutines::SameString(opString, "ANAVG")) { + } else if (Util::SameString(opString, "ANAVG")) { lookupOperator = opANNUALAVERAGE; - } else if (UtilityRoutines::SameString(opString, "ANNUALOR")) { + } else if (Util::SameString(opString, "ANNUALOR")) { lookupOperator = opANNUALOR; - } else if (UtilityRoutines::SameString(opString, "ANOR")) { + } else if (Util::SameString(opString, "ANOR")) { lookupOperator = opANNUALOR; - } else if (UtilityRoutines::SameString(opString, "ANNUALAND")) { + } else if (Util::SameString(opString, "ANNUALAND")) { lookupOperator = opANNUALAND; - } else if (UtilityRoutines::SameString(opString, "ANAND")) { + } else if (Util::SameString(opString, "ANAND")) { lookupOperator = opANNUALAND; - } else if (UtilityRoutines::SameString(opString, "ANNUALMAXIMUMZERO")) { + } else if (Util::SameString(opString, "ANNUALMAXIMUMZERO")) { lookupOperator = opANNUALMAXIMUMZERO; - } else if (UtilityRoutines::SameString(opString, "ANMAXZ")) { + } else if (Util::SameString(opString, "ANMAXZ")) { lookupOperator = opANNUALMAXIMUMZERO; - } else if (UtilityRoutines::SameString(opString, "ANNUALMINIMUMZERO")) { + } else if (Util::SameString(opString, "ANNUALMINIMUMZERO")) { lookupOperator = opANNUALMINIMUMZERO; - } else if (UtilityRoutines::SameString(opString, "ANMINZ")) { + } else if (Util::SameString(opString, "ANMINZ")) { lookupOperator = opANNUALMINIMUMZERO; - } else if (UtilityRoutines::SameString(opString, "IF")) { + } else if (Util::SameString(opString, "IF")) { lookupOperator = opIF; - } else if (UtilityRoutines::SameString(opString, "GREATERTHAN")) { + } else if (Util::SameString(opString, "GREATERTHAN")) { lookupOperator = opGREATERTHAN; - } else if (UtilityRoutines::SameString(opString, "GT")) { + } else if (Util::SameString(opString, "GT")) { lookupOperator = opGREATERTHAN; - } else if (UtilityRoutines::SameString(opString, "GREATEREQUAL")) { + } else if (Util::SameString(opString, "GREATEREQUAL")) { lookupOperator = opGREATEREQUAL; - } else if (UtilityRoutines::SameString(opString, "GE")) { + } else if (Util::SameString(opString, "GE")) { lookupOperator = opGREATEREQUAL; - } else if (UtilityRoutines::SameString(opString, "LESSTHAN")) { + } else if (Util::SameString(opString, "LESSTHAN")) { lookupOperator = opLESSTHAN; - } else if (UtilityRoutines::SameString(opString, "LT")) { + } else if (Util::SameString(opString, "LT")) { lookupOperator = opLESSTHAN; - } else if (UtilityRoutines::SameString(opString, "LESSEQUAL")) { + } else if (Util::SameString(opString, "LESSEQUAL")) { lookupOperator = opLESSEQUAL; - } else if (UtilityRoutines::SameString(opString, "LE")) { + } else if (Util::SameString(opString, "LE")) { lookupOperator = opLESSEQUAL; - } else if (UtilityRoutines::SameString(opString, "EQUAL")) { + } else if (Util::SameString(opString, "EQUAL")) { lookupOperator = opEQUAL; - } else if (UtilityRoutines::SameString(opString, "EQ")) { + } else if (Util::SameString(opString, "EQ")) { lookupOperator = opEQUAL; - } else if (UtilityRoutines::SameString(opString, "NOTEQUAL")) { + } else if (Util::SameString(opString, "NOTEQUAL")) { lookupOperator = opNOTEQUAL; - } else if (UtilityRoutines::SameString(opString, "NE")) { + } else if (Util::SameString(opString, "NE")) { lookupOperator = opNOTEQUAL; - } else if (UtilityRoutines::SameString(opString, "AND")) { + } else if (Util::SameString(opString, "AND")) { lookupOperator = opAND; - } else if (UtilityRoutines::SameString(opString, "OR")) { + } else if (Util::SameString(opString, "OR")) { lookupOperator = opOR; - } else if (UtilityRoutines::SameString(opString, "NOT")) { + } else if (Util::SameString(opString, "NOT")) { lookupOperator = opNOT; - } else if (UtilityRoutines::SameString(opString, "FROM")) { + } else if (Util::SameString(opString, "FROM")) { lookupOperator = opNOOP; - } else if (UtilityRoutines::SameString(opString, "ADD")) { + } else if (Util::SameString(opString, "ADD")) { lookupOperator = opADD; } else { lookupOperator = 0; @@ -4777,7 +4774,7 @@ void selectTariff(EnergyPlusData &state) groupIndex(iTariff) = groupCount; // set all remaining matching items to the same index for (int kTariff = iTariff + 1; kTariff <= state.dataEconTariff->numTariff; ++kTariff) { - if (UtilityRoutines::SameString(state.dataEconTariff->tariff(kTariff).groupName, tariff.groupName)) { + if (Util::SameString(state.dataEconTariff->tariff(kTariff).groupName, tariff.groupName)) { groupIndex(kTariff) = groupCount; } } diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index 93ee897c2e9..67703ca644b 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -122,7 +122,7 @@ namespace ElectricBaseboardRadiator { // Find the correct Baseboard Equipment if (CompIndex == 0) { - BaseboardNum = UtilityRoutines::FindItemInList(EquipName, state.dataElectBaseboardRad->ElecBaseboard, &ElecBaseboardParams::EquipName); + BaseboardNum = Util::FindItemInList(EquipName, state.dataElectBaseboardRad->ElecBaseboard, &ElecBaseboardParams::EquipName); if (BaseboardNum == 0) { ShowFatalError(state, "SimElectricBaseboard: Unit not found=" + EquipName); } @@ -239,7 +239,7 @@ namespace ElectricBaseboardRadiator { } // Determine HW radiant baseboard heating design capacity sizing method - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { elecBaseboard.HeatingCapMethod = DataSizing::HeatingDesignCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatDesignCapacityNumericNum)) { @@ -261,7 +261,7 @@ namespace ElectricBaseboardRadiator { "Blank field not allowed for " + state.dataIPShortCut->cNumericFieldNames(iHeatDesignCapacityNumericNum)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { elecBaseboard.HeatingCapMethod = DataSizing::CapacityPerFloorArea; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) { elecBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum); @@ -293,7 +293,7 @@ namespace ElectricBaseboardRadiator { "Blank field not allowed for " + state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { elecBaseboard.HeatingCapMethod = DataSizing::FractionOfAutosizedHeatingCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { elecBaseboard.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 2e1bf462967..1e031e8257b 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -275,7 +275,7 @@ void ElectricPowerServiceManager::getPowerManagerInput(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerInFromGrid")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerInFromGrid")) { if (!foundInFromGridTransformer) { foundInFromGridTransformer = true; facilityPowerInTransformerName_ = state.dataIPShortCut->cAlphaArgs(1); @@ -293,7 +293,7 @@ void ElectricPowerServiceManager::getPowerManagerInput(EnergyPlusData &state) "Only one transformer with Usage PowerInFromGrid can be used, first one in input file will be used and the " "simulation continues..."); } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerOutToGrid")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerOutToGrid")) { if (powerOutTransformerObj_ == nullptr) { ++numPowerOutTransformers_; powerOutTransformerName_ = state.dataIPShortCut->cAlphaArgs(1); @@ -734,19 +734,19 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { // Load the Generator Control Operation Scheme - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "Baseload")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "Baseload")) { genOperationScheme_ = GeneratorOpScheme::BaseLoad; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "DemandLimit")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "DemandLimit")) { genOperationScheme_ = GeneratorOpScheme::DemandLimit; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "TrackElectrical")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "TrackElectrical")) { genOperationScheme_ = GeneratorOpScheme::TrackElectrical; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "TrackSchedule")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "TrackSchedule")) { genOperationScheme_ = GeneratorOpScheme::TrackSchedule; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "TrackMeter")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "TrackMeter")) { genOperationScheme_ = GeneratorOpScheme::TrackMeter; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "FollowThermal")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "FollowThermal")) { genOperationScheme_ = GeneratorOpScheme::ThermalFollow; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "FollowThermalLimitElectrical")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "FollowThermalLimitElectrical")) { genOperationScheme_ = GeneratorOpScheme::ThermalFollowLimitElectrical; } else { ShowSevereError( @@ -779,26 +779,26 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje errorsFound = true; } - demandMeterName_ = UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)); + demandMeterName_ = Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)); // meters may not be "loaded" yet, defered check to later subroutine - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "AlternatingCurrent")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "AlternatingCurrent")) { bussType = ElectricBussType::ACBuss; state.dataIPShortCut->cAlphaArgs(6) = "AlternatingCurrent"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "DirectCurrentWithInverter")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "DirectCurrentWithInverter")) { bussType = ElectricBussType::DCBussInverter; inverterPresent = true; state.dataIPShortCut->cAlphaArgs(6) = "DirectCurrentWithInverter"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "AlternatingCurrentWithStorage")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "AlternatingCurrentWithStorage")) { bussType = ElectricBussType::ACBussStorage; storagePresent_ = true; state.dataIPShortCut->cAlphaArgs(6) = "AlternatingCurrentWithStorage"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "DirectCurrentWithInverterDCStorage")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "DirectCurrentWithInverterDCStorage")) { bussType = ElectricBussType::DCBussInverterDCStorage; inverterPresent = true; storagePresent_ = true; state.dataIPShortCut->cAlphaArgs(6) = "DirectCurrentWithInverterDCStorage"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "DirectCurrentWithInverterACStorage")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "DirectCurrentWithInverterACStorage")) { bussType = ElectricBussType::DCBussInverterACStorage; inverterPresent = true; storagePresent_ = true; @@ -851,13 +851,13 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje // Begin new content for grid supply and more control over storage // user selected storage operation scheme if (!state.dataIPShortCut->lAlphaFieldBlanks(10)) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "TrackFacilityElectricDemandStoreExcessOnSite")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "TrackFacilityElectricDemandStoreExcessOnSite")) { storageScheme_ = StorageOpScheme::FacilityDemandStoreExcessOnSite; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "TrackMeterDemandStoreExcessOnSite")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "TrackMeterDemandStoreExcessOnSite")) { storageScheme_ = StorageOpScheme::MeterDemandStoreExcessOnSite; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "TrackChargeDischargeSchedules")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "TrackChargeDischargeSchedules")) { storageScheme_ = StorageOpScheme::ChargeDischargeSchedules; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "FacilityDemandLeveling")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "FacilityDemandLeveling")) { storageScheme_ = StorageOpScheme::FacilityDemandLeveling; } else { ShowSevereError( @@ -1106,8 +1106,8 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), - "LoadCenterPowerConditioning")) { // this is the right kind of transformer + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), + "LoadCenterPowerConditioning")) { // this is the right kind of transformer transformerObj = std::make_unique(state, transformerName_); } else { ShowWarningError( @@ -2182,7 +2182,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, name = objectName; - generatorType = static_cast(getEnumValue(GeneratorTypeNamesUC, UtilityRoutines::makeUPPER(objectType))); + generatorType = static_cast(getEnumValue(GeneratorTypeNamesUC, Util::makeUPPER(objectType))); switch (generatorType) { case GeneratorType::ICEngine: { compPlantType = DataPlant::PlantEquipmentType::Generator_ICEngine; @@ -2207,7 +2207,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, case GeneratorType::PVWatts: { compPlantType = DataPlant::PlantEquipmentType::Invalid; - int ObjNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Generator:PVWatts", UtilityRoutines::makeUPPER(objectName)); + int ObjNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Generator:PVWatts", Util::makeUPPER(objectName)); assert(ObjNum >= 0); if (ObjNum == 0) { ShowFatalError(state, format("Cannot find Generator:PVWatts {}", objectName)); @@ -2262,14 +2262,14 @@ GeneratorController::GeneratorController(EnergyPlusData &state, // Except you need GetPVInput to have run already etc // Note: you can't use state.dataIPShortCut->cAlphaArgs etc or it'll override what will still need to be processed in // ElectPowerLoadCenter::ElectPowerLoadCenter after this function is called - int PVNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, objectType, UtilityRoutines::makeUPPER(objectName)); + int PVNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, objectType, Util::makeUPPER(objectName)); int NumAlphas; // Number of PV Array parameter alpha names being passed int NumNums; // Number of PV Array numeric parameters are being passed int IOStat; Array1D_string Alphas(5); // Alpha items for object Array1D Numbers(2); // Numeric items for object state.dataInputProcessing->inputProcessor->getObjectItem(state, objectType, PVNum, Alphas, NumAlphas, Numbers, NumNums, IOStat); - if (UtilityRoutines::SameString(Alphas(3), "PhotovoltaicPerformance:Simple")) { + if (Util::SameString(Alphas(3), "PhotovoltaicPerformance:Simple")) { ShowWarningError(state, format("{}{}, Availability Schedule for Generator:Photovoltaics '{}' of Type PhotovoltaicPerformance:Simple " "will be be ignored (runs all the time).", @@ -2549,7 +2549,7 @@ DCtoACInverter::DCtoACInverter(EnergyPlusData &state, std::string const &objectN } } - zoneNum_ = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); + zoneNum_ = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); if (zoneNum_ > 0) heatLossesDestination_ = ThermalLossDestination::ZoneGains; if (zoneNum_ == 0) { if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { @@ -3022,9 +3022,9 @@ ACtoDCConverter::ACtoDCConverter(EnergyPlusData &state, std::string const &objec } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "SimpleFixed")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "SimpleFixed")) { modelType_ = ConverterModelType::SimpleConstantEff; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "FunctionOfPower")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "FunctionOfPower")) { modelType_ = ConverterModelType::CurveFuncOfPower; } else { ShowSevereError( @@ -3064,7 +3064,7 @@ ACtoDCConverter::ACtoDCConverter(EnergyPlusData &state, std::string const &objec standbyPower_ = state.dataIPShortCut->rNumericArgs(3); - zoneNum_ = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataHeatBal->Zone); + zoneNum_ = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataHeatBal->Zone); if (zoneNum_ > 0) heatLossesDestination_ = ThermalLossDestination::ZoneGains; if (zoneNum_ == 0) { if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { @@ -3367,7 +3367,7 @@ ElectricStorage::ElectricStorage( // main constructor } } - zoneNum_ = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); + zoneNum_ = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); if (zoneNum_ > 0) heatLossesDestination_ = ThermalLossDestination::ZoneGains; if (zoneNum_ == 0) { if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { @@ -3454,9 +3454,9 @@ ElectricStorage::ElectricStorage( // main constructor state.dataIPShortCut->cAlphaFieldNames(5)); // Field Name } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "Yes")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "Yes")) { lifeCalculation_ = BatteryDegradationModelType::LifeCalculationYes; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "No")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "No")) { lifeCalculation_ = BatteryDegradationModelType::LifeCalculationNo; } else { ShowWarningError( @@ -3531,7 +3531,7 @@ ElectricStorage::ElectricStorage( // main constructor break; } case StorageModelType::LiIonNmcBattery: { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "KandlerSmith") || state.dataIPShortCut->lAlphaFieldBlanks(4)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "KandlerSmith") || state.dataIPShortCut->lAlphaFieldBlanks(4)) { lifeCalculation_ = BatteryDegradationModelType::LifeCalculationYes; } else { lifeCalculation_ = BatteryDegradationModelType::LifeCalculationNo; @@ -3818,7 +3818,7 @@ Real64 checkUserEfficiencyInput(EnergyPlusData &state, Real64 userInputValue, st Real64 constexpr minDischargeEfficiency = 0.001; // Fix for Defect #8867. Do not allow either efficiency to be zero as it will lead to a divide by zero (NaN). - if (UtilityRoutines::SameString(whichType, "CHARGING")) { + if (Util::SameString(whichType, "CHARGING")) { if (userInputValue < minChargeEfficiency) { ShowSevereError(state, format("ElectricStorage charge efficiency was too low. This occurred for electric storage unit named {}", deviceName)); @@ -3828,7 +3828,7 @@ Real64 checkUserEfficiencyInput(EnergyPlusData &state, Real64 userInputValue, st } else { return userInputValue; } - } else if (UtilityRoutines::SameString(whichType, "DISCHARGING")) { + } else if (Util::SameString(whichType, "DISCHARGING")) { if (userInputValue < minDischargeEfficiency) { ShowSevereError( state, format("ElectricStorage discharge efficiency was too low. This occurred for electric storage unit named {}", deviceName)); @@ -4732,11 +4732,11 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { usageMode_ = TransformerUse::PowerInFromGrid; // default - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerInFromGrid")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerInFromGrid")) { usageMode_ = TransformerUse::PowerInFromGrid; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerOutToGrid")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "PowerOutToGrid")) { usageMode_ = TransformerUse::PowerOutFromBldgToGrid; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "LoadCenterPowerConditioning")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "LoadCenterPowerConditioning")) { usageMode_ = TransformerUse::PowerBetweenLoadCenterAndBldg; } else { @@ -4747,7 +4747,7 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons errorsFound = true; } - zoneNum_ = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->Zone); + zoneNum_ = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->Zone); if (zoneNum_ > 0) heatLossesDestination_ = ThermalLossDestination::ZoneGains; if (zoneNum_ == 0) { if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { @@ -4767,9 +4767,9 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons ratedCapacity_ = state.dataIPShortCut->rNumericArgs(2); phase_ = state.dataIPShortCut->rNumericArgs(3); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "Copper")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "Copper")) { factorTempCoeff_ = 234.5; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "Aluminum")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "Aluminum")) { factorTempCoeff_ = 225.0; } else { ShowSevereError( @@ -4781,9 +4781,9 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons tempRise_ = state.dataIPShortCut->rNumericArgs(4); eddyFrac_ = state.dataIPShortCut->rNumericArgs(5); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "RatedLosses")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "RatedLosses")) { performanceInputMode_ = TransformerPerformanceInput::LossesMethod; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "NominalEfficiency")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "NominalEfficiency")) { performanceInputMode_ = TransformerPerformanceInput::EfficiencyMethod; } else { ShowSevereError( @@ -4823,9 +4823,9 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons errorsFound = true; } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "Yes")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "Yes")) { considerLosses_ = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "No")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "No")) { considerLosses_ = false; } else { if (usageMode_ == TransformerUse::PowerInFromGrid) { @@ -4855,10 +4855,10 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons // Meter check deferred because they may have not been "loaded" yet, for (int loopCount = 0; loopCount < numWiredMeters; ++loopCount) { - wiredMeterNames_[loopCount] = UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(loopCount + numAlphaBeforeMeter + 1)); + wiredMeterNames_[loopCount] = Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(loopCount + numAlphaBeforeMeter + 1)); // Assign SpecialMeter as TRUE if the meter name is Electricity:Facility or Electricity:HVAC - if (UtilityRoutines::SameString(wiredMeterNames_[loopCount], "Electricity:Facility") || - UtilityRoutines::SameString(wiredMeterNames_[loopCount], "Electricity:HVAC")) { + if (Util::SameString(wiredMeterNames_[loopCount], "Electricity:Facility") || + Util::SameString(wiredMeterNames_[loopCount], "Electricity:HVAC")) { specialMeter_[loopCount] = true; } else { specialMeter_[loopCount] = false; diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index 5679aa44559..9332979998a 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -144,7 +144,7 @@ void SimEvapCooler(EnergyPlusData &state, std::string_view CompName, int &CompIn // Find the correct EvapCoolNumber if (CompIndex == 0) { - EvapCoolNum = UtilityRoutines::FindItemInList(CompName, EvapCond, &EvapConditions::Name); + EvapCoolNum = Util::FindItemInList(CompName, EvapCond, &EvapConditions::Name); if (EvapCoolNum == 0) { ShowFatalError(state, format("SimEvapCooler: Unit not found={}", CompName)); } @@ -1228,8 +1228,8 @@ void SizeEvapCooler(EnergyPlusData &state, int const EvapCoolNum) for (int BranchComp = 1; BranchComp <= state.dataAirSystemsData->PrimaryAirSystems(CurSysNum).Branch(AirSysBranchLoop).TotalComponents; ++BranchComp) { - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(CurSysNum).Branch(AirSysBranchLoop).Comp(BranchComp).Name, - thisEvapCond.Name)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(CurSysNum).Branch(AirSysBranchLoop).Comp(BranchComp).Name, + thisEvapCond.Name)) { CoolerOnMainAirLoop = true; } } @@ -1540,9 +1540,8 @@ void SizeEvapCooler(EnergyPlusData &state, int const EvapCoolNum) for (int BranchComp = 1; BranchComp <= state.dataAirSystemsData->PrimaryAirSystems(CurSysNum).Branch(AirSysBranchLoop).TotalComponents; ++BranchComp) { - if (UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(CurSysNum).Branch(AirSysBranchLoop).Comp(BranchComp).Name, - thisEvapCond.Name)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(CurSysNum).Branch(AirSysBranchLoop).Comp(BranchComp).Name, + thisEvapCond.Name)) { CoolerOnMainAirLoop = true; } } @@ -3325,7 +3324,7 @@ void SimZoneEvaporativeCoolerUnit(EnergyPlusData &state, // Find the correct Equipment if (CompIndex == 0) { - CompNum = UtilityRoutines::FindItemInList(CompName, ZoneEvapUnit); + CompNum = Util::FindItemInList(CompName, ZoneEvapUnit); if (CompNum == 0) { ShowFatalError(state, "SimZoneEvaporativeCoolerUnit: Zone evaporative cooler unit not found."); } @@ -3481,7 +3480,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) thisZoneEvapUnit.FanObjectClassName = Alphas(7); thisZoneEvapUnit.FanName = Alphas(8); bool errFlag = false; - if (!UtilityRoutines::SameString(thisZoneEvapUnit.FanObjectClassName, "Fan:SystemModel")) { + if (!Util::SameString(thisZoneEvapUnit.FanObjectClassName, "Fan:SystemModel")) { Fans::GetFanType(state, thisZoneEvapUnit.FanName, thisZoneEvapUnit.FanType_Num, errFlag, CurrentModuleObject, thisZoneEvapUnit.Name); Fans::GetFanIndex(state, thisZoneEvapUnit.FanName, thisZoneEvapUnit.FanIndex, errFlag, CurrentModuleObject); thisZoneEvapUnit.FanInletNodeNum = @@ -3497,7 +3496,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) ShowContinueError(state, format("...specified in {} = {}", CurrentModuleObject, thisZoneEvapUnit.Name)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(thisZoneEvapUnit.FanObjectClassName, "Fan:SystemModel")) { + } else if (Util::SameString(thisZoneEvapUnit.FanObjectClassName, "Fan:SystemModel")) { thisZoneEvapUnit.FanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, thisZoneEvapUnit.FanName)); // call constructor @@ -3561,7 +3560,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) } thisZoneEvapUnit.EvapCooler_1_Name = Alphas(12); - thisZoneEvapUnit.EvapCooler_1_Index = UtilityRoutines::FindItemInList(Alphas(12), state.dataEvapCoolers->EvapCond, &EvapConditions::Name); + thisZoneEvapUnit.EvapCooler_1_Index = Util::FindItemInList(Alphas(12), state.dataEvapCoolers->EvapCond, &EvapConditions::Name); if (thisZoneEvapUnit.EvapCooler_1_Index == 0) { ShowSevereError(state, format("{}=\"{}\" invalid data.", CurrentModuleObject, thisZoneEvapUnit.Name)); ShowContinueError(state, format("invalid, not found {}=\"{}\".", cAlphaFields(12), Alphas(12))); @@ -3580,8 +3579,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) if (!lAlphaBlanks(14)) { thisZoneEvapUnit.EvapCooler_2_Name = Alphas(14); - thisZoneEvapUnit.EvapCooler_2_Index = - UtilityRoutines::FindItemInList(Alphas(14), state.dataEvapCoolers->EvapCond, &EvapConditions::Name); + thisZoneEvapUnit.EvapCooler_2_Index = Util::FindItemInList(Alphas(14), state.dataEvapCoolers->EvapCond, &EvapConditions::Name); if (thisZoneEvapUnit.EvapCooler_2_Index == 0) { ShowSevereError(state, format("{}=\"{}\" invalid data.", CurrentModuleObject, thisZoneEvapUnit.Name)); ShowContinueError(state, format("invalid, not found {}=\"{}\".", cAlphaFields(14), Alphas(14))); @@ -3596,7 +3594,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) thisZoneEvapUnit.HVACSizingIndex = 0; if (!lAlphaBlanks(15)) { - thisZoneEvapUnit.HVACSizingIndex = UtilityRoutines::FindItemInList(Alphas(15), state.dataSize->ZoneHVACSizing); + thisZoneEvapUnit.HVACSizingIndex = Util::FindItemInList(Alphas(15), state.dataSize->ZoneHVACSizing); if (thisZoneEvapUnit.HVACSizingIndex == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(15), Alphas(15))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisZoneEvapUnit.Name)); @@ -4490,7 +4488,7 @@ int GetInletNodeNum(EnergyPlusData &state, std::string const &EvapCondName, bool } int WhichEvapCond = - UtilityRoutines::FindItemInList(EvapCondName, state.dataEvapCoolers->EvapCond, &EvapConditions::Name, state.dataEvapCoolers->NumEvapCool); + Util::FindItemInList(EvapCondName, state.dataEvapCoolers->EvapCond, &EvapConditions::Name, state.dataEvapCoolers->NumEvapCool); if (WhichEvapCond != 0) { return state.dataEvapCoolers->EvapCond(WhichEvapCond).InletNode; } else { @@ -4515,7 +4513,7 @@ int GetOutletNodeNum(EnergyPlusData &state, std::string const &EvapCondName, boo state.dataEvapCoolers->GetInputEvapComponentsFlag = false; } int WhichEvapCond = - UtilityRoutines::FindItemInList(EvapCondName, state.dataEvapCoolers->EvapCond, &EvapConditions::Name, state.dataEvapCoolers->NumEvapCool); + Util::FindItemInList(EvapCondName, state.dataEvapCoolers->EvapCond, &EvapConditions::Name, state.dataEvapCoolers->NumEvapCool); if (WhichEvapCond != 0) { return state.dataEvapCoolers->EvapCond(WhichEvapCond).OutletNode; } else { diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index a65e1fe157b..ac01a6ad906 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -276,7 +276,7 @@ namespace EvaporativeFluidCoolers { if (state.dataIPShortCut->lAlphaFieldBlanks(6) || AlphArray(6).empty()) { thisEFC.capacityControl = CapacityControl::FanCycling; // FanCycling } else { - thisEFC.capacityControl = static_cast(getEnumValue(controlNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); + thisEFC.capacityControl = static_cast(getEnumValue(controlNamesUC, Util::makeUPPER(AlphArray(6)))); if (thisEFC.capacityControl == CapacityControl::Invalid) { thisEFC.capacityControl = CapacityControl::FanCycling; ShowWarningError(state, @@ -292,7 +292,7 @@ namespace EvaporativeFluidCoolers { if (AlphArray(7).empty()) { thisEFC.EvapLossMode = EvapLoss::ByMoistTheory; } else { - thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); + thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, Util::makeUPPER(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))); @@ -327,7 +327,7 @@ namespace EvaporativeFluidCoolers { thisEFC.ConcentrationRatio = 3.0; } } else { - thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(8)))); + thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, Util::makeUPPER(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))); @@ -386,7 +386,7 @@ namespace EvaporativeFluidCoolers { ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(4), "UFACTORTIMESAREAANDDESIGNWATERFLOWRATE")) { + if (Util::SameString(AlphArray(4), "UFACTORTIMESAREAANDDESIGNWATERFLOWRATE")) { thisEFC.PerformanceInputMethod_Num = PIM::UFactor; if (thisEFC.HighSpeedEvapFluidCoolerUA <= 0.0 && thisEFC.HighSpeedEvapFluidCoolerUA != DataSizing::AutoSize) { ShowSevereError(state, @@ -408,7 +408,7 @@ namespace EvaporativeFluidCoolers { AlphArray(4))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(AlphArray(4), "STANDARDDESIGNCAPACITY")) { + } else if (Util::SameString(AlphArray(4), "STANDARDDESIGNCAPACITY")) { thisEFC.PerformanceInputMethod_Num = PIM::StandardDesignCapacity; if (thisEFC.HighSpeedStandardDesignCapacity <= 0.0) { ShowSevereError(state, @@ -420,7 +420,7 @@ namespace EvaporativeFluidCoolers { AlphArray(4))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(AlphArray(4), "USERSPECIFIEDDESIGNCAPACITY")) { + } else if (Util::SameString(AlphArray(4), "USERSPECIFIEDDESIGNCAPACITY")) { thisEFC.PerformanceInputMethod_Num = PIM::UserSpecifiedDesignCapacity; if (thisEFC.DesignWaterFlowRate <= 0.0 && thisEFC.DesignWaterFlowRate != DataSizing::AutoSize) { ShowSevereError(state, @@ -633,7 +633,7 @@ namespace EvaporativeFluidCoolers { if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { thisEFC.EvapLossMode = EvapLoss::ByMoistTheory; } else { - thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); + thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, Util::makeUPPER(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))); @@ -667,7 +667,7 @@ namespace EvaporativeFluidCoolers { thisEFC.ConcentrationRatio = 3.0; } } else { - thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); + thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, Util::makeUPPER(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))); @@ -760,7 +760,7 @@ namespace EvaporativeFluidCoolers { ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(4), "UFACTORTIMESAREAANDDESIGNWATERFLOWRATE")) { + if (Util::SameString(AlphArray(4), "UFACTORTIMESAREAANDDESIGNWATERFLOWRATE")) { thisEFC.PerformanceInputMethod_Num = PIM::UFactor; if (thisEFC.HighSpeedEvapFluidCoolerUA <= 0.0 && thisEFC.HighSpeedEvapFluidCoolerUA != DataSizing::AutoSize) { ShowSevereError(state, @@ -801,7 +801,7 @@ namespace EvaporativeFluidCoolers { AlphArray(4))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(AlphArray(4), "STANDARDDESIGNCAPACITY")) { + } else if (Util::SameString(AlphArray(4), "STANDARDDESIGNCAPACITY")) { thisEFC.PerformanceInputMethod_Num = PIM::StandardDesignCapacity; if (thisEFC.HighSpeedStandardDesignCapacity <= 0.0) { ShowSevereError(state, @@ -831,7 +831,7 @@ namespace EvaporativeFluidCoolers { thisEFC.Name)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(AlphArray(4), "USERSPECIFIEDDESIGNCAPACITY")) { + } else if (Util::SameString(AlphArray(4), "USERSPECIFIEDDESIGNCAPACITY")) { thisEFC.PerformanceInputMethod_Num = PIM::UserSpecifiedDesignCapacity; if (thisEFC.DesignWaterFlowRate <= 0.0 && thisEFC.DesignWaterFlowRate != DataSizing::AutoSize) { ShowSevereError(state, @@ -2510,9 +2510,9 @@ namespace EvaporativeFluidCoolers { OutletAirWetBulb = InletAirWetBulb + qActual / AirCapacity; // Check error tolerance and exit if satisfied DeltaTwb = std::abs(OutletAirWetBulb - InletAirWetBulb); - // Add Constant::KelvinConv() to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. + // Add Constant::Kelvin() to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. // Wet bulb error units are delta K/K - WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + Constant::KelvinConv)); + WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + Constant::Kelvin)); } if (qActual >= 0.0) { @@ -2776,7 +2776,7 @@ namespace EvaporativeFluidCoolers { this->FluidIndex = state.dataPlnt->PlantLoop(state.dataSize->CurLoopNum).FluidIndex; std::string FluidName = FluidProperties::GetGlycolNameByIndex(state, this->FluidIndex); - if (UtilityRoutines::SameString(this->PerformanceInputMethod, "STANDARDDESIGNCAPACITY")) { + if (Util::SameString(this->PerformanceInputMethod, "STANDARDDESIGNCAPACITY")) { this->PerformanceInputMethod_Num = PIM::StandardDesignCapacity; if (FluidName != "WATER") { ShowSevereError(state, diff --git a/src/EnergyPlus/ExhaustAirSystemManager.cc b/src/EnergyPlus/ExhaustAirSystemManager.cc index 6d17a69adca..c61e5370ac6 100644 --- a/src/EnergyPlus/ExhaustAirSystemManager.cc +++ b/src/EnergyPlus/ExhaustAirSystemManager.cc @@ -124,7 +124,7 @@ namespace ExhaustAirSystemManager { ++exhSysNum; auto const &objectFields = instance.value(); auto &thisExhSys = state.dataZoneEquip->ExhaustAirSystem(exhSysNum); - thisExhSys.Name = UtilityRoutines::makeUPPER(instance.key()); + thisExhSys.Name = Util::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); std::string zoneMixerName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_mixer_name"); @@ -158,9 +158,9 @@ namespace ExhaustAirSystemManager { int centralFanTypeNum = 0; // getEnumValue()? - if (UtilityRoutines::SameString(centralFanType, "Fan:SystemModel")) { + if (Util::SameString(centralFanType, "Fan:SystemModel")) { centralFanTypeNum = DataHVACGlobals::FanType_SystemModelObject; - } else if (UtilityRoutines::SameString(centralFanType, "Fan:ComponentModel")) { + } else if (Util::SameString(centralFanType, "Fan:ComponentModel")) { centralFanTypeNum = DataHVACGlobals::FanType_ComponentModel; } else { ShowSevereError(state, format("{}{}={}", RoutineName, cCurrentModuleObject, thisExhSys.Name)); @@ -474,7 +474,7 @@ namespace ExhaustAirSystemManager { ++exhCtrlNum; auto const &objectFields = instance.value(); auto &thisExhCtrl = state.dataZoneEquip->ZoneExhaustControlSystem(exhCtrlNum); - thisExhCtrl.Name = UtilityRoutines::makeUPPER(instance.key()); + thisExhCtrl.Name = Util::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); std::string availSchName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "availability_schedule_name"); @@ -494,10 +494,10 @@ namespace ExhaustAirSystemManager { std::string zoneName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_name"); thisExhCtrl.ZoneName = zoneName; - int zoneNum = UtilityRoutines::FindItemInList(zoneName, state.dataHeatBal->Zone); + int zoneNum = Util::FindItemInList(zoneName, state.dataHeatBal->Zone); thisExhCtrl.ZoneNum = zoneNum; - thisExhCtrl.ControlledZoneNum = UtilityRoutines::FindItemInList(zoneName, state.dataHeatBal->Zone); + thisExhCtrl.ControlledZoneNum = Util::FindItemInList(zoneName, state.dataHeatBal->Zone); // These two nodes are required inputs: std::string inletNodeName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "inlet_node_name"); @@ -532,9 +532,8 @@ namespace ExhaustAirSystemManager { Real64 designExhaustFlowRate = ip->getRealFieldValue(objectFields, objectSchemaProps, "design_exhaust_flow_rate"); thisExhCtrl.DesignExhaustFlowRate = designExhaustFlowRate; - std::string flowControlTypeName = - UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "flow_control_type")); - // std::string flowControlTypeName = UtilityRoutines::makeUPPER(fields.at("flow_control_type").get()); + std::string flowControlTypeName = Util::makeUPPER(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "flow_control_type")); + // std::string flowControlTypeName = Util::makeUPPER(fields.at("flow_control_type").get()); thisExhCtrl.FlowControlOption = static_cast(getEnumValue(flowControlTypeNamesUC, flowControlTypeName)); @@ -922,7 +921,7 @@ namespace ExhaustAirSystemManager { } return // ( state.dataZoneEquip->NumExhaustAirSystems > 0) && - (UtilityRoutines::FindItemInList(CompName, state.dataZoneEquip->ExhaustAirSystem, &ExhaustAir::ZoneMixerName) > 0); + (Util::FindItemInList(CompName, state.dataZoneEquip->ExhaustAirSystem, &ExhaustAir::ZoneMixerName) > 0); } } // namespace ExhaustAirSystemManager diff --git a/src/EnergyPlus/ExteriorEnergyUse.cc b/src/EnergyPlus/ExteriorEnergyUse.cc index 40e4ba54548..f5293f07e66 100644 --- a/src/EnergyPlus/ExteriorEnergyUse.cc +++ b/src/EnergyPlus/ExteriorEnergyUse.cc @@ -207,9 +207,9 @@ namespace ExteriorEnergyUse { } if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode = ExteriorEnergyUse::LightControlType::ScheduleOnly; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "ScheduleNameOnly")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "ScheduleNameOnly")) { state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode = ExteriorEnergyUse::LightControlType::ScheduleOnly; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "AstronomicalClock")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "AstronomicalClock")) { state.dataExteriorEnergyUse->ExteriorLights(Item).ControlMode = ExteriorEnergyUse::LightControlType::AstroClockOverride; } else { ShowSevereError(state, diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index af16e54fde7..3068eebf8e1 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -173,13 +173,13 @@ void GetExternalInterfaceInput(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), "PtolemyServer")) { // The BCVTB interface is activated. + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), "PtolemyServer")) { // The BCVTB interface is activated. ++state.dataExternalInterface->NumExternalInterfacesBCVTB; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), - "FunctionalMockupUnitImport")) { // The functional mock up unit import interface is activated. + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), + "FunctionalMockupUnitImport")) { // The functional mock up unit import interface is activated. ++state.dataExternalInterface->NumExternalInterfacesFMUImport; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), - "FunctionalMockupUnitExport")) { // The functional mock up unit export interface is activated. + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), + "FunctionalMockupUnitExport")) { // The functional mock up unit export interface is activated. ++state.dataExternalInterface->NumExternalInterfacesFMUExport; } } @@ -363,7 +363,7 @@ void ParseString(std::string const &str, // The string, with all elements separa } else { // Use rest of string iEnd = lenStr; } - ele(i) = UtilityRoutines::makeUPPER(str.substr(iSta, iEnd - iSta - 1)); + ele(i) = Util::makeUPPER(str.substr(iSta, iEnd - iSta - 1)); } } @@ -1039,9 +1039,9 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) // So this check that if I entered two different things and get the same end filename, then it's wrong? for (int j = 1; j <= state.dataExternalInterface->NumFMUObjects; ++j) { for (int k = 2; k <= state.dataExternalInterface->NumFMUObjects; ++k) { - if (!UtilityRoutines::SameString(strippedFileName(j), strippedFileName(k))) continue; + if (!Util::SameString(strippedFileName(j), strippedFileName(k))) continue; // base file names are the same - if (UtilityRoutines::SameString(fullFileName(j), fullFileName(k))) continue; + if (Util::SameString(fullFileName(j), fullFileName(k))) continue; ShowSevereError(state, "ExternalInterface/InitExternalInterfaceFMUImport:"); ShowContinueError(state, "duplicate file names (but not same file) entered."); ShowContinueError(state, format("...entered file name=\"{}\"", state.dataExternalInterface->FMU(j).Name)); @@ -1083,10 +1083,10 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name)) { std::string Name_NEW = state.dataIPShortCut->cAlphaArgs(4); - if (!UtilityRoutines::SameString(Name_OLD, Name_NEW)) { - int FOUND = UtilityRoutines::FindItem(Name_NEW, state.dataExternalInterface->checkInstanceName); + if (!Util::SameString(Name_OLD, Name_NEW)) { + int FOUND = Util::FindItem(Name_NEW, state.dataExternalInterface->checkInstanceName); if (FOUND == 0) { state.dataExternalInterface->checkInstanceName(l).Name = Name_NEW; state.dataExternalInterface->FMU(i).NumInstances = j; @@ -1289,8 +1289,8 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name) && - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), state.dataExternalInterface->FMU(i).Instance(j).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name) && + Util::SameString(state.dataIPShortCut->cAlphaArgs(4), state.dataExternalInterface->FMU(i).Instance(j).Name)) { state.dataExternalInterface->FMU(i).Instance(j).fmuInputVariable(k).Name = state.dataIPShortCut->cAlphaArgs(5); state.dataExternalInterface->FMU(i).Instance(j).eplusOutputVariable(k).VarKey = state.dataIPShortCut->cAlphaArgs(1); state.dataExternalInterface->FMU(i).Instance(j).eplusOutputVariable(k).Name = state.dataIPShortCut->cAlphaArgs(2); @@ -1301,7 +1301,7 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) cCurrentModuleObject, state.dataExternalInterface->FMU(i).Instance(j).Name, state.dataExternalInterface->ErrorsFound); - // UtilityRoutines::VerifyName( state.dataExternalInterface->FMU( i ).Instance( j + // Util::VerifyName( state.dataExternalInterface->FMU( i ).Instance( j // ).fmuInputVariable( // k //).Name, state.dataExternalInterface->FMU( @@ -1443,7 +1443,7 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name)) { state.dataExternalInterface->FMU(i).TotNumOutputVariablesSchedule = j; ++j; } @@ -1468,8 +1468,8 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name) && - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), state.dataExternalInterface->FMU(i).Instance(j).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Name) && + Util::SameString(state.dataIPShortCut->cAlphaArgs(4), state.dataExternalInterface->FMU(i).Instance(j).Name)) { state.dataExternalInterface->FMU(i).Instance(j).fmuOutputVariableSchedule(k).Name = state.dataIPShortCut->cAlphaArgs(5); state.dataExternalInterface->FMU(i).Instance(j).eplusInputVariableSchedule(k).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataExternalInterface->FMU(i).Instance(j).eplusInputVariableSchedule(k).InitialValue = @@ -1559,7 +1559,7 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), state.dataExternalInterface->FMU(i).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), state.dataExternalInterface->FMU(i).Name)) { state.dataExternalInterface->FMU(i).TotNumOutputVariablesVariable = j; ++j; } @@ -1584,8 +1584,8 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), state.dataExternalInterface->FMU(i).Name) && - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Instance(j).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), state.dataExternalInterface->FMU(i).Name) && + Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataExternalInterface->FMU(i).Instance(j).Name)) { state.dataExternalInterface->FMU(i).Instance(j).fmuOutputVariableVariable(k).Name = state.dataIPShortCut->cAlphaArgs(4); state.dataExternalInterface->FMU(i).Instance(j).eplusInputVariableVariable(k).Name = state.dataIPShortCut->cAlphaArgs(1); @@ -1672,7 +1672,7 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), state.dataExternalInterface->FMU(i).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), state.dataExternalInterface->FMU(i).Name)) { state.dataExternalInterface->FMU(i).TotNumOutputVariablesActuator = j; ++j; } @@ -1697,8 +1697,8 @@ void InitExternalInterfaceFMUImport(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), state.dataExternalInterface->FMU(i).Name) && - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), state.dataExternalInterface->FMU(i).Instance(j).Name)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), state.dataExternalInterface->FMU(i).Name) && + Util::SameString(state.dataIPShortCut->cAlphaArgs(6), state.dataExternalInterface->FMU(i).Instance(j).Name)) { state.dataExternalInterface->FMU(i).Instance(j).fmuOutputVariableActuator(k).Name = state.dataIPShortCut->cAlphaArgs(7); state.dataExternalInterface->FMU(i).Instance(j).eplusInputVariableActuator(k).Name = state.dataIPShortCut->cAlphaArgs(1); @@ -2483,9 +2483,9 @@ void VerifyExternalInterfaceObject(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if ((!UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), "PtolemyServer")) && - (!UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), "FunctionalMockupUnitImport")) && - (!UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), "FunctionalMockupUnitExport"))) { + if ((!Util::SameString(state.dataIPShortCut->cAlphaArgs(1), "PtolemyServer")) && + (!Util::SameString(state.dataIPShortCut->cAlphaArgs(1), "FunctionalMockupUnitImport")) && + (!Util::SameString(state.dataIPShortCut->cAlphaArgs(1), "FunctionalMockupUnitExport"))) { ShowSevereError(state, format("VerifyExternalInterfaceObject: {}, invalid {}=\"{}\".", cCurrentModuleObject, diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 31245c64a5b..f8b2fa0207c 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -146,7 +146,7 @@ namespace FanCoilUnits { // Find the correct Fan Coil Equipment if (CompIndex == 0) { - FanCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataFanCoilUnits->FanCoil); + FanCoilNum = Util::FindItemInList(CompName, state.dataFanCoilUnits->FanCoil); if (FanCoilNum == 0) { ShowFatalError(state, format("SimFanCoil: Unit not found={}", CompName)); } @@ -373,28 +373,27 @@ namespace FanCoilUnits { fanCoil.MinHotWaterVolFlow = Numbers(9); fanCoil.HotControlOffset = Numbers(10); - if (UtilityRoutines::SameString(Alphas(11), "Coil:Cooling:Water") || - UtilityRoutines::SameString(Alphas(11), "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(Alphas(11), "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + if (Util::SameString(Alphas(11), "Coil:Cooling:Water") || Util::SameString(Alphas(11), "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(Alphas(11), "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { fanCoil.CCoilType = Alphas(11); - if (UtilityRoutines::SameString(Alphas(11), "Coil:Cooling:Water")) { + if (Util::SameString(Alphas(11), "Coil:Cooling:Water")) { fanCoil.CCoilType_Num = CCoil::Water; fanCoil.CCoilPlantName = fanCoil.CCoilName; fanCoil.CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterCooling; } - if (UtilityRoutines::SameString(Alphas(11), "Coil:Cooling:Water:DetailedGeometry")) { + if (Util::SameString(Alphas(11), "Coil:Cooling:Water:DetailedGeometry")) { fanCoil.CCoilType_Num = CCoil::Detailed; fanCoil.CCoilPlantName = fanCoil.CCoilName; fanCoil.CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } std::string CCoilType; - if (UtilityRoutines::SameString(Alphas(11), "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + if (Util::SameString(Alphas(11), "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { fanCoil.CCoilType_Num = CCoil::HXAssist; HVACHXAssistedCoolingCoil::GetHXCoilTypeAndName( state, fanCoil.CCoilType, fanCoil.CCoilName, ErrorsFound, CCoilType, fanCoil.CCoilPlantName); - if (UtilityRoutines::SameString(CCoilType, "Coil:Cooling:Water")) { + if (Util::SameString(CCoilType, "Coil:Cooling:Water")) { fanCoil.CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterCooling; - } else if (UtilityRoutines::SameString(CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { + } else if (Util::SameString(CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { fanCoil.CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, fanCoil.Name)); @@ -442,7 +441,7 @@ namespace FanCoilUnits { ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(13), "Coil:Heating:Water")) { + if (Util::SameString(Alphas(13), "Coil:Heating:Water")) { fanCoil.HCoilType_Num = HCoil::Water; fanCoil.HCoilPlantTypeOf = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; IsNotOK = false; @@ -462,7 +461,7 @@ namespace FanCoilUnits { fanCoil.HeatCoilOutletNodeNum = state.dataWaterCoils->WaterCoil(coilIndex).AirOutletNodeNum; } } - } else if (UtilityRoutines::SameString(Alphas(13), "Coil:Heating:Electric")) { + } else if (Util::SameString(Alphas(13), "Coil:Heating:Electric")) { fanCoil.HCoilType_Num = HCoil::Electric; IsNotOK = false; ValidateComponent(state, fanCoil.HCoilType, fanCoil.HCoilName, IsNotOK, CurrentModuleObject); @@ -496,7 +495,7 @@ namespace FanCoilUnits { fanCoil.HVACSizingIndex = 0; if (!lAlphaBlanks(16)) { - fanCoil.HVACSizingIndex = UtilityRoutines::FindItemInList(Alphas(16), state.dataSize->ZoneHVACSizing); + fanCoil.HVACSizingIndex = Util::FindItemInList(Alphas(16), state.dataSize->ZoneHVACSizing); if (fanCoil.HVACSizingIndex == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(16), Alphas(16))); ShowContinueError(state, format("Occurs in {} = {}", state.dataFanCoilUnits->cMO_FanCoil, fanCoil.Name)); @@ -510,7 +509,7 @@ namespace FanCoilUnits { ShowContinueError(state, format("specified in {} = \"{}\".", CurrentModuleObject, fanCoil.Name)); ErrorsFound = true; } else { - if (!UtilityRoutines::SameString(fanCoil.FanType, "Fan:SystemModel")) { + if (!Util::SameString(fanCoil.FanType, "Fan:SystemModel")) { Fans::GetFanType(state, fanCoil.FanName, fanCoil.FanType_Num, errFlag, CurrentModuleObject, fanCoil.Name); // need to grab fan index here // Fans::GetFanIndex(state, fanCoil.FanName, fanCoil.FanIndex, errFlag, fanCoil.FanType); @@ -560,7 +559,7 @@ namespace FanCoilUnits { ErrorsFound = true; } break; } - } else if (UtilityRoutines::SameString(fanCoil.FanType, "Fan:SystemModel")) { + } else if (Util::SameString(fanCoil.FanType, "Fan:SystemModel")) { fanCoil.FanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, fanCoil.FanName)); // call constructor fanCoil.FanIndex = HVACFan::getFanObjectVectorIndex(state, fanCoil.FanName); // zero-based @@ -1745,7 +1744,7 @@ namespace FanCoilUnits { state, fanCoil.UnitType, fanCoil.Name, "User-Specified Maximum Cold Water Flow [m3/s]", fanCoil.MaxColdWaterVolFlow); } } else { - if (UtilityRoutines::SameString(fanCoil.CCoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + if (Util::SameString(fanCoil.CCoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { CoolingCoilName = HVACHXAssistedCoolingCoil::GetHXDXCoilName(state, fanCoil.CCoilType, fanCoil.CCoilName, ErrorsFound); CoolingCoilType = HVACHXAssistedCoolingCoil::GetHXCoilType(state, fanCoil.CCoilType, fanCoil.CCoilName, ErrorsFound); } else { @@ -1970,7 +1969,7 @@ namespace FanCoilUnits { } // if ( CurZoneEqNum > 0 ) // set the design air flow rates for the heating and cooling coils - if (UtilityRoutines::SameString(fanCoil.CCoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + if (Util::SameString(fanCoil.CCoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { CoolingCoilName = HVACHXAssistedCoolingCoil::GetHXDXCoilName(state, fanCoil.CCoilType, fanCoil.CCoilName, ErrorsFound); CoolingCoilType = HVACHXAssistedCoolingCoil::GetHXCoilType(state, fanCoil.CCoilType, fanCoil.CCoilName, ErrorsFound); } else { diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 3e8009f839f..62745e042e2 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -121,7 +121,7 @@ void SimulateFanComponents(EnergyPlusData &state, } if (CompIndex == 0) { - FanNum = UtilityRoutines::FindItemInList(CompName, state.dataFans->Fan, &FanEquipConditions::FanName); + FanNum = Util::FindItemInList(CompName, state.dataFans->Fan, &FanEquipConditions::FanName); if (FanNum == 0) { ShowFatalError(state, format("SimulateFanComponents: Fan not found={}", CompName)); } @@ -406,9 +406,9 @@ void GetFanInput(EnergyPlusData &state) thisFan.FanName)); } thisFan.MaxAirFlowRateIsAutosizable = true; - if (UtilityRoutines::SameString(cAlphaArgs(3), "Fraction")) { + if (Util::SameString(cAlphaArgs(3), "Fraction")) { thisFan.FanMinAirFracMethod = DataHVACGlobals::MinFrac; - } else if (UtilityRoutines::SameString(cAlphaArgs(3), "FixedFlowRate")) { + } else if (Util::SameString(cAlphaArgs(3), "FixedFlowRate")) { thisFan.FanMinAirFracMethod = DataHVACGlobals::FixedMin; } thisFan.FanMinFrac = rNumericArgs(4); @@ -1069,7 +1069,7 @@ void InitFan(EnergyPlusData &state, if (!state.dataFans->ZoneEquipmentListChecked && state.dataZoneEquip->ZoneEquipInputsFilled) { state.dataFans->ZoneEquipmentListChecked = true; for (int Loop = 1; Loop <= state.dataFans->NumFans; ++Loop) { - if (!UtilityRoutines::SameString(state.dataFans->Fan(Loop).FanType, "Fan:ZoneExhaust")) continue; + if (!Util::SameString(state.dataFans->Fan(Loop).FanType, "Fan:ZoneExhaust")) continue; if (DataZoneEquipment::CheckZoneEquipmentList(state, state.dataFans->Fan(Loop).FanType, state.dataFans->Fan(Loop).FanName)) continue; ShowSevereError(state, format("InitFans: Fan=[{},{}] is not on any ZoneHVAC:EquipmentList. It will not be simulated.", @@ -1226,7 +1226,7 @@ void SizeFan(EnergyPlusData &state, int const FanNum) // StdRhoAir=PsyRhoAirFnPbTdbW(StdBaroPress,20,0) // From PsychRoutines: // w=MAX(dw,1.0d-5) - // rhoair = pb/(287.d0*(tdb+Constant::KelvinConv())*(1.0d0+1.6077687d0*w)) + // rhoair = pb/(287.d0*(tdb+Constant::Kelvin())*(1.0d0+1.6077687d0*w)) Real64 RhoAir = state.dataEnvrn->StdRhoAir; // Adjust max fan volumetric airflow using fan sizing factor @@ -2103,7 +2103,7 @@ void SimComponentModelFan(EnergyPlusData &state, int const FanNum) // StdRhoAir=PsyRhoAirFnPbTdbW(StdBaroPress,20,0) // From PsychRoutines: // w=MAX(dw,1.0d-5) - // rhoair = pb/(287.d0*(tdb+Constant::KelvinConv())*(1.0d0+1.6077687d0*w)) + // rhoair = pb/(287.d0*(tdb+Constant::Kelvin())*(1.0d0+1.6077687d0*w)) Real64 RhoAir = fan.RhoAirStdInit; Real64 MassFlow = min(fan.InletAirMassFlowRate, fan.MaxAirMassFlowRate); @@ -2350,7 +2350,7 @@ void GetFanIndex(EnergyPlusData &state, std::string const &FanName, int &FanInde state.dataFans->GetFanInputFlag = false; } - FanIndex = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + FanIndex = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); if (FanIndex == 0) { if (!ThisObjectType.empty()) { ShowSevereError(state, fmt::format("{}, GetFanIndex: Fan not found={}", ThisObjectType, FanName)); @@ -2420,7 +2420,7 @@ void GetFanType(EnergyPlusData &state, state.dataFans->GetFanInputFlag = false; } - int FanIndex = UtilityRoutines::FindItemInList(FanName, Fan, &FanEquipConditions::FanName); + int FanIndex = Util::FindItemInList(FanName, Fan, &FanEquipConditions::FanName); if (FanIndex == 0) { if ((!ThisObjectType.empty()) && (!ThisObjectName.empty())) { ShowSevereError(state, fmt::format("GetFanType: {}=\"{}\", invalid Fan specified=\"{}\".", ThisObjectType, ThisObjectName, FanName)); @@ -2463,7 +2463,7 @@ Real64 GetFanDesignVolumeFlowRate(EnergyPlusData &state, if (present(FanIndex)) { return state.dataFans->Fan(FanIndex).MaxAirFlowRate; } else { - int WhichFan = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + int WhichFan = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); if (WhichFan != 0) { return state.dataFans->Fan(WhichFan).MaxAirFlowRate; } else { @@ -2497,7 +2497,7 @@ int GetFanInletNode(EnergyPlusData &state, state.dataFans->GetFanInputFlag = false; } - int WhichFan = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + int WhichFan = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); if (WhichFan != 0) { return state.dataFans->Fan(WhichFan).InletNodeNum; } else { @@ -2529,7 +2529,7 @@ int GetFanOutletNode(EnergyPlusData &state, state.dataFans->GetFanInputFlag = false; } - int WhichFan = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + int WhichFan = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); if (WhichFan != 0) { return state.dataFans->Fan(WhichFan).OutletNodeNum; } else { @@ -2561,7 +2561,7 @@ int GetFanAvailSchPtr(EnergyPlusData &state, state.dataFans->GetFanInputFlag = false; } - int WhichFan = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + int WhichFan = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); if (WhichFan != 0) { return state.dataFans->Fan(WhichFan).AvailSchedPtrNum; } else { @@ -2602,11 +2602,11 @@ int GetFanSpeedRatioCurveIndex(EnergyPlusData &state, FanType = state.dataFans->Fan(WhichFan).FanType; FanName = state.dataFans->Fan(WhichFan).FanName; } else { - WhichFan = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + WhichFan = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); IndexIn = WhichFan; } } else { - WhichFan = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + WhichFan = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); } if (WhichFan != 0) { @@ -2645,7 +2645,7 @@ void SetFanData(EnergyPlusData &state, } if (FanNum == 0) { - WhichFan = UtilityRoutines::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); + WhichFan = Util::FindItemInList(FanName, state.dataFans->Fan, &FanEquipConditions::FanName); } else { WhichFan = FanNum; } diff --git a/src/EnergyPlus/FaultsManager.cc b/src/EnergyPlus/FaultsManager.cc index c2fec6464c3..bb232f21803 100644 --- a/src/EnergyPlus/FaultsManager.cc +++ b/src/EnergyPlus/FaultsManager.cc @@ -390,7 +390,7 @@ namespace FaultsManager { } // Evaporative cooler check - if (UtilityRoutines::SameString(faultsECFouling.EvapCoolerType, "EvaporativeCooler:Indirect:WetCoil")) { + if (Util::SameString(faultsECFouling.EvapCoolerType, "EvaporativeCooler:Indirect:WetCoil")) { // Read in evaporative cooler is not done yet if (state.dataEvapCoolers->GetInputEvapComponentsFlag) { EvaporativeCoolers::GetEvapInput(state); @@ -398,8 +398,8 @@ namespace FaultsManager { } // Check whether the evaporative cooler name and type match each other; - int EvapCoolerNum = UtilityRoutines::FindItemInList( - faultsECFouling.EvapCoolerName, state.dataEvapCoolers->EvapCond, &EvaporativeCoolers::EvapConditions::Name); + int EvapCoolerNum = + Util::FindItemInList(faultsECFouling.EvapCoolerName, state.dataEvapCoolers->EvapCond, &EvaporativeCoolers::EvapConditions::Name); if (EvapCoolerNum <= 0) { ShowSevereError( state, @@ -485,7 +485,7 @@ namespace FaultsManager { // Chiller check int ChillerNum; ChillerType ChillerTypeCheck = - static_cast(getEnumValue(ChillerTypeNamesUC, UtilityRoutines::makeUPPER(faultsChillerFouling.ChillerType))); + static_cast(getEnumValue(ChillerTypeNamesUC, Util::makeUPPER(faultsChillerFouling.ChillerType))); switch (ChillerTypeCheck) { case ChillerType::ChillerElectric: { // Check whether the chiller name and chiller type match each other @@ -529,7 +529,7 @@ namespace FaultsManager { } // Check whether the chiller name and chiller type match each other - ChillerNum = UtilityRoutines::FindItemInList(faultsChillerFouling.ChillerName, state.dataChillerElectricEIR->ElectricEIRChiller); + ChillerNum = Util::FindItemInList(faultsChillerFouling.ChillerName, state.dataChillerElectricEIR->ElectricEIRChiller); if (ChillerNum <= 0) { ShowSevereError( state, @@ -562,8 +562,7 @@ namespace FaultsManager { } // Check whether the chiller name and chiller type match each other - ChillerNum = - UtilityRoutines::FindItemInList(faultsChillerFouling.ChillerName, state.dataChillerReformulatedEIR->ElecReformEIRChiller); + ChillerNum = Util::FindItemInList(faultsChillerFouling.ChillerName, state.dataChillerReformulatedEIR->ElecReformEIRChiller); if (ChillerNum <= 0) { ShowSevereError( state, @@ -770,7 +769,7 @@ namespace FaultsManager { state.dataBoilers->getBoilerInputFlag = false; } // Check the boiler name and boiler type - int BoilerNum = UtilityRoutines::FindItemInList(faultsBoilerFouling.BoilerName, state.dataBoilers->Boiler); + int BoilerNum = Util::FindItemInList(faultsBoilerFouling.BoilerName, state.dataBoilers->Boiler); if (BoilerNum <= 0) { ShowSevereError( state, @@ -854,7 +853,7 @@ namespace FaultsManager { } // Coil check and link - CoilType CoilTypeCheck = static_cast(getEnumValue(CoilTypeNamesUC, UtilityRoutines::makeUPPER(faultsCoilSATFouling.CoilType))); + CoilType CoilTypeCheck = static_cast(getEnumValue(CoilTypeNamesUC, Util::makeUPPER(faultsCoilSATFouling.CoilType))); switch (CoilTypeCheck) { case CoilType::CoilHeatingElectric: case CoilType::CoilHeatingFuel: @@ -865,7 +864,7 @@ namespace FaultsManager { state.dataHeatingCoils->GetCoilsInputFlag = false; } // Check the coil name and coil type - int CoilNum = UtilityRoutines::FindItemInList(faultsCoilSATFouling.CoilName, state.dataHeatingCoils->HeatingCoil); + int CoilNum = Util::FindItemInList(faultsCoilSATFouling.CoilName, state.dataHeatingCoils->HeatingCoil); if (CoilNum <= 0) { ShowSevereError( state, @@ -884,7 +883,7 @@ namespace FaultsManager { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } // Check the coil name and coil type - int CoilNum = UtilityRoutines::FindItemInList(faultsCoilSATFouling.CoilName, state.dataSteamCoils->SteamCoil); + int CoilNum = Util::FindItemInList(faultsCoilSATFouling.CoilName, state.dataSteamCoils->SteamCoil); if (CoilNum <= 0) { ShowSevereError( state, @@ -917,7 +916,7 @@ namespace FaultsManager { state.dataWaterCoils->GetWaterCoilsInputFlag = false; } // Check the coil name and coil type - int CoilNum = UtilityRoutines::FindItemInList(faultsCoilSATFouling.CoilName, state.dataWaterCoils->WaterCoil); + int CoilNum = Util::FindItemInList(faultsCoilSATFouling.CoilName, state.dataWaterCoils->WaterCoil); if (CoilNum <= 0) { ShowSevereError( state, @@ -939,9 +938,9 @@ namespace FaultsManager { state.dataHVACControllers->GetControllerInputFlag = false; } // Check the controller name - int ControlNum = UtilityRoutines::FindItemInList(faultsCoilSATFouling.WaterCoilControllerName, - state.dataHVACControllers->ControllerProps, - &HVACControllers::ControllerPropsType::ControllerName); + int ControlNum = Util::FindItemInList(faultsCoilSATFouling.WaterCoilControllerName, + state.dataHVACControllers->ControllerProps, + &HVACControllers::ControllerPropsType::ControllerName); if (ControlNum <= 0) { ShowSevereError( state, @@ -977,7 +976,7 @@ namespace FaultsManager { //} //// Check the coil name and coil type - // int CoilSysNum = UtilityRoutines::FindItemInList(faultsCoilSATFouling.CoilName, + // int CoilSysNum = Util::FindItemInList(faultsCoilSATFouling.CoilName, // state.dataHVACDXSys->DXCoolingSystem); // if (CoilSysNum <= 0) { // ShowSevereError(state, format("{}{} = \"{}\" invalid {} = \"{}{}\" not found.", //, cFaultCurrentObject, cAlphaArgs(1), @@ -996,7 +995,7 @@ namespace FaultsManager { } // Check the coil name and coil type - int CoilSysNum = UtilityRoutines::FindItemInList(faultsCoilSATFouling.CoilName, state.dataHVACDXHeatPumpSys->DXHeatPumpSystem); + int CoilSysNum = Util::FindItemInList(faultsCoilSATFouling.CoilName, state.dataHVACDXHeatPumpSys->DXHeatPumpSystem); if (CoilSysNum <= 0) { ShowSevereError( state, @@ -1093,7 +1092,7 @@ namespace FaultsManager { state.dataCondenserLoopTowers->GetInput = false; } // Check the tower name and tower type - int TowerNum = UtilityRoutines::FindItemInList(faultsTowerFouling.TowerName, state.dataCondenserLoopTowers->towers); + int TowerNum = Util::FindItemInList(faultsTowerFouling.TowerName, state.dataCondenserLoopTowers->towers); if (TowerNum <= 0) { ShowSevereError( state, @@ -1105,9 +1104,8 @@ namespace FaultsManager { state.dataCondenserLoopTowers->towers(TowerNum).FaultyTowerFoulingIndex = jFault_TowerFouling; // Check the faulty tower type - if (!UtilityRoutines::SameString( - DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], - faultsTowerFouling.TowerType)) { + if (!Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + faultsTowerFouling.TowerType)) { ShowWarningError( state, format("{} = \"{}\" invalid {} = \"{}\" not match the type of {}. Tower type in the fault model is updated. ", @@ -1214,7 +1212,7 @@ namespace FaultsManager { state.dataCondenserLoopTowers->GetInput = false; } // Check the tower name and tower type - int TowerNum = UtilityRoutines::FindItemInList(faultsCondSWTFouling.TowerName, state.dataCondenserLoopTowers->towers); + int TowerNum = Util::FindItemInList(faultsCondSWTFouling.TowerName, state.dataCondenserLoopTowers->towers); if (TowerNum <= 0) { ShowSevereError( state, @@ -1226,9 +1224,8 @@ namespace FaultsManager { state.dataCondenserLoopTowers->towers(TowerNum).FaultyCondenserSWTIndex = jFault_CondenserSWT; // Check the faulty tower type - if (!UtilityRoutines::SameString( - DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], - faultsCondSWTFouling.TowerType)) { + if (!Util::SameString(DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + faultsCondSWTFouling.TowerType)) { ShowWarningError(state, format("{} = \"{}\" invalid {} = \"{}\" not match the type of {}. Tower type is updated. ", cFaultCurrentObject, @@ -1314,8 +1311,7 @@ namespace FaultsManager { // Chiller check int ChillerNum; - ChillerType ChillerTypeCheck = - static_cast(getEnumValue(ChillerTypeNamesUC, UtilityRoutines::makeUPPER(faultsChillerSWT.ChillerType))); + ChillerType ChillerTypeCheck = static_cast(getEnumValue(ChillerTypeNamesUC, Util::makeUPPER(faultsChillerSWT.ChillerType))); switch (ChillerTypeCheck) { case ChillerType::ChillerElectric: { // Check whether the chiller name and chiller type match each other @@ -1345,7 +1341,7 @@ namespace FaultsManager { state.dataChillerElectricEIR->getInputFlag = false; } // Check whether the chiller name and chiller type match each other - ChillerNum = UtilityRoutines::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerElectricEIR->ElectricEIRChiller); + ChillerNum = Util::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerElectricEIR->ElectricEIRChiller); if (ChillerNum <= 0) { ShowSevereError( state, @@ -1364,7 +1360,7 @@ namespace FaultsManager { state.dataChillerReformulatedEIR->GetInputREIR = false; } // Check whether the chiller name and chiller type match each other - ChillerNum = UtilityRoutines::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerReformulatedEIR->ElecReformEIRChiller); + ChillerNum = Util::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerReformulatedEIR->ElecReformEIRChiller); if (ChillerNum <= 0) { ShowSevereError( state, @@ -1444,7 +1440,7 @@ namespace FaultsManager { state.dataChillerAbsorber->getInput = false; } // Check whether the chiller name and chiller type match each other - ChillerNum = UtilityRoutines::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerAbsorber->absorptionChillers); + ChillerNum = Util::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerAbsorber->absorptionChillers); if (ChillerNum <= 0) { ShowSevereError( state, @@ -1463,7 +1459,7 @@ namespace FaultsManager { state.dataChillerIndirectAbsorption->GetInput = false; } // Check whether the chiller name and chiller type match each other - ChillerNum = UtilityRoutines::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerIndirectAbsorption->IndirectAbsorber); + ChillerNum = Util::FindItemInList(faultsChillerSWT.ChillerName, state.dataChillerIndirectAbsorption->IndirectAbsorber); if (ChillerNum <= 0) { ShowSevereError( state, @@ -1511,7 +1507,7 @@ namespace FaultsManager { faultsAirFilter.FaultyAirFilterFanName = cAlphaArgs(3); // Check whether the specified fan exists in the fan list - if (UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataFans->Fan, &Fans::FanEquipConditions::FanName) <= 0) { + if (Util::FindItemInList(cAlphaArgs(3), state.dataFans->Fan, &Fans::FanEquipConditions::FanName) <= 0) { ShowSevereError( state, format("{} = \"{}\" invalid {} = \"{}\" not found.", cFaultCurrentObject, cAlphaArgs(1), cAlphaFieldNames(3), cAlphaArgs(3))); @@ -1520,7 +1516,7 @@ namespace FaultsManager { // Assign fault index to the fan object for (int FanNum = 1; FanNum <= state.dataFans->NumFans; ++FanNum) { - if (UtilityRoutines::SameString(state.dataFans->Fan(FanNum).FanName, cAlphaArgs(3))) { + if (Util::SameString(state.dataFans->Fan(FanNum).FanName, cAlphaArgs(3))) { state.dataFans->Fan(FanNum).FaultyFilterFlag = true; state.dataFans->Fan(FanNum).FaultyFilterIndex = jFault_AirFilter; break; @@ -1594,7 +1590,7 @@ namespace FaultsManager { faultsHStat.FaultyHumidistatName = cAlphaArgs(2); faultsHStat.FaultyHumidistatType = cAlphaArgs(3); - if (UtilityRoutines::SameString(faultsHStat.FaultyHumidistatType, "ThermostatOffsetDependent")) { + if (Util::SameString(faultsHStat.FaultyHumidistatType, "ThermostatOffsetDependent")) { // For Humidistat Offset Type: ThermostatOffsetDependent // Related Thermostat Offset Fault Name is required for Humidistat Offset Type: ThermostatOffsetDependent @@ -1771,7 +1767,7 @@ namespace FaultsManager { } } - faultsFoulCoil.FoulingInputMethod = static_cast(getEnumValue(FouledCoilNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); + faultsFoulCoil.FoulingInputMethod = static_cast(getEnumValue(FouledCoilNamesUC, Util::makeUPPER(cAlphaArgs(5)))); if (faultsFoulCoil.FoulingInputMethod == FouledCoil::Invalid) { faultsFoulCoil.FoulingInputMethod = FouledCoil::UARated; } @@ -1791,7 +1787,7 @@ namespace FaultsManager { } // Check the coil name and type - int CoilNum = UtilityRoutines::FindItemInList(faultsFoulCoil.FouledCoilName, state.dataWaterCoils->WaterCoil); + int CoilNum = Util::FindItemInList(faultsFoulCoil.FouledCoilName, state.dataWaterCoils->WaterCoil); if (CoilNum <= 0) { ShowSevereError(state, format("{} = \"{}\". Referenced Coil named \"{}\" was not found.", @@ -1956,7 +1952,7 @@ namespace FaultsManager { format("{} = \"{}\" invalid {} = \"{}\" blank.", cFaultCurrentObject, cAlphaArgs(1), cAlphaFieldNames(4), cAlphaArgs(4))); state.dataFaultsMgr->ErrorsFound = true; } else { - if (UtilityRoutines::makeUPPER(cAlphaArgs(4)) == "CONTROLLER:OUTDOORAIR") { + if (Util::makeUPPER(cAlphaArgs(4)) == "CONTROLLER:OUTDOORAIR") { state.dataFaultsMgr->FaultsEconomizer(j).ControllerTypeEnum = iController_AirEconomizer; // CASE ... @@ -2183,7 +2179,7 @@ namespace FaultsManager { FanFound = false; for (int FanNum = 1; FanNum <= state.dataFans->NumFans; ++FanNum) { - if (UtilityRoutines::SameString(state.dataFans->Fan(FanNum).FanName, FanName)) { + if (Util::SameString(state.dataFans->Fan(FanNum).FanName, FanName)) { FanMaxAirFlowRate = state.dataFans->Fan(FanNum).MaxAirFlowRate; FanDeltaPress = state.dataFans->Fan(FanNum).DeltaPress; FanFound = true; @@ -2208,8 +2204,8 @@ namespace FaultsManager { FaultyCoilSATIndex = 0; if (state.dataFaultsMgr->NumFaultyCoilSATSensor == 0) return; for (int jFault_CoilSAT = 1; jFault_CoilSAT <= state.dataFaultsMgr->NumFaultyCoilSATSensor; ++jFault_CoilSAT) { - if (UtilityRoutines::SameString(state.dataFaultsMgr->FaultsCoilSATSensor(jFault_CoilSAT).CoilType, CompType) && - UtilityRoutines::SameString(state.dataFaultsMgr->FaultsCoilSATSensor(jFault_CoilSAT).CoilName, CompName)) { + if (Util::SameString(state.dataFaultsMgr->FaultsCoilSATSensor(jFault_CoilSAT).CoilType, CompType) && + Util::SameString(state.dataFaultsMgr->FaultsCoilSATSensor(jFault_CoilSAT).CoilName, CompName)) { FaultyCoilSATFlag = true; FaultyCoilSATIndex = jFault_CoilSAT; break; diff --git a/src/EnergyPlus/FileSystem.cc b/src/EnergyPlus/FileSystem.cc index 6ea9c7c4474..1ed21def7b4 100644 --- a/src/EnergyPlus/FileSystem.cc +++ b/src/EnergyPlus/FileSystem.cc @@ -235,7 +235,7 @@ namespace FileSystem { extension.remove_prefix(extension.find_last_of('.') + 1); std::string stringExtension = std::string(extension); - return static_cast(getEnumValue(FileTypesExtUC, UtilityRoutines::makeUPPER(stringExtension))); + return static_cast(getEnumValue(FileTypesExtUC, Util::makeUPPER(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 32c630f61bc..4584432efa6 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -563,7 +563,7 @@ bool FluidCoolerspecs::validateSingleSpeedInputs(EnergyPlusData &state, } // Check various inputs for both the performance input methods - if (UtilityRoutines::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { + if (Util::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { this->PerformanceInputMethod_Num = PerfInputMethod::U_FACTOR; if (this->HighSpeedFluidCoolerUA <= 0.0 && this->HighSpeedFluidCoolerUA != DataSizing::AutoSize) { ShowSevereError(state, @@ -575,7 +575,7 @@ bool FluidCoolerspecs::validateSingleSpeedInputs(EnergyPlusData &state, AlphArray(4))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(AlphArray(4), "NominalCapacity")) { + } else if (Util::SameString(AlphArray(4), "NominalCapacity")) { this->PerformanceInputMethod_Num = PerfInputMethod::NOMINAL_CAPACITY; if (this->FluidCoolerNominalCapacity <= 0.0) { ShowSevereError(state, @@ -738,7 +738,7 @@ bool FluidCoolerspecs::validateTwoSpeedInputs(EnergyPlusData &state, ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { + if (Util::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { this->PerformanceInputMethod_Num = PerfInputMethod::U_FACTOR; if (this->HighSpeedFluidCoolerUA <= 0.0 && !this->HighSpeedFluidCoolerUAWasAutoSized) { ShowSevereError(state, @@ -767,7 +767,7 @@ bool FluidCoolerspecs::validateTwoSpeedInputs(EnergyPlusData &state, this->Name)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(AlphArray(4), "NominalCapacity")) { + } else if (Util::SameString(AlphArray(4), "NominalCapacity")) { this->PerformanceInputMethod_Num = PerfInputMethod::NOMINAL_CAPACITY; if (this->FluidCoolerNominalCapacity <= 0.0) { ShowSevereError(state, diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index dda61c497d1..9b19cd717c5 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -685,10 +685,10 @@ namespace FluidProperties { cNumericFieldNames); ++FluidNum; FluidNames(FluidNum).Name = Alphas(1); - if (UtilityRoutines::SameString(Alphas(2), Refrig)) { + if (Util::SameString(Alphas(2), Refrig)) { ++state.dataFluidProps->NumOfRefrigerants; FluidNames(FluidNum).IsGlycol = false; - } else if (UtilityRoutines::SameString(Alphas(2), Glycol)) { + } else if (Util::SameString(Alphas(2), Glycol)) { ++state.dataFluidProps->NumOfGlycols; FluidNames(FluidNum).IsGlycol = true; } else { @@ -844,12 +844,12 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Pressure)) && (UtilityRoutines::SameString(Alphas(3), GasFluid))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Pressure)) && + (Util::SameString(Alphas(3), GasFluid))) { for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { + if (Util::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { TempsName = FluidTemps(TempLoop).Name; // At this point, we have found the correct input line and found a match // for the temperature array. It's time to load up the local derived type. @@ -926,12 +926,12 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Enthalpy)) && (UtilityRoutines::SameString(Alphas(3), Fluid))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Enthalpy)) && + (Util::SameString(Alphas(3), Fluid))) { for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { + if (Util::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { TempsName = FluidTemps(TempLoop).Name; // At this point, we have found the correct input line and found a match // for the temperature array. It's time to load up the local derived type. @@ -1006,13 +1006,13 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Enthalpy)) && (UtilityRoutines::SameString(Alphas(3), GasFluid))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Enthalpy)) && + (Util::SameString(Alphas(3), GasFluid))) { for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { - if (!UtilityRoutines::SameString(FluidTemps(TempLoop).Name, TempsName)) { + if (Util::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { + if (!Util::SameString(FluidTemps(TempLoop).Name, TempsName)) { ShowSevereError( state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); ShowContinueError(state, "Temperatures for enthalpy fluid and gas/fluid points are not the same"); @@ -1092,12 +1092,12 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), SpecificHeat)) && (UtilityRoutines::SameString(Alphas(3), Fluid))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), SpecificHeat)) && + (Util::SameString(Alphas(3), Fluid))) { for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { + if (Util::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { TempsName = FluidTemps(TempLoop).Name; // At this point, we have found the correct input line and found a match // for the temperature array. It's time to load up the local derived type. @@ -1173,13 +1173,13 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), SpecificHeat)) && (UtilityRoutines::SameString(Alphas(3), GasFluid))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), SpecificHeat)) && + (Util::SameString(Alphas(3), GasFluid))) { for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { - if (!UtilityRoutines::SameString(FluidTemps(TempLoop).Name, TempsName)) { + if (Util::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { + if (!Util::SameString(FluidTemps(TempLoop).Name, TempsName)) { ShowSevereError( state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); ShowContinueError(state, "Temperatures for specific heat fluid and gas/fluid points are not the same"); @@ -1261,12 +1261,12 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Density)) && (UtilityRoutines::SameString(Alphas(3), Fluid))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Density)) && + (Util::SameString(Alphas(3), Fluid))) { for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { + if (Util::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { TempsName = FluidTemps(TempLoop).Name; // At this point, we have found the correct input line and found a match // for the temperature array. It's time to load up the local derived type. @@ -1341,13 +1341,13 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Density)) && (UtilityRoutines::SameString(Alphas(3), GasFluid))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Density)) && + (Util::SameString(Alphas(3), GasFluid))) { for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { - if (!UtilityRoutines::SameString(FluidTemps(TempLoop).Name, TempsName)) { + if (Util::SameString(Alphas(4), FluidTemps(TempLoop).Name)) { + if (!Util::SameString(FluidTemps(TempLoop).Name, TempsName)) { ShowSevereError( state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); ShowContinueError(state, "Temperatures for density fluid and gas/fluid points are not the same"); @@ -1449,9 +1449,9 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if (UtilityRoutines::SameString(Alphas(3), Fluid)) { - if (!UtilityRoutines::SameString(Alphas(2), Enthalpy) && !UtilityRoutines::SameString(Alphas(2), SpecificHeat) && - !UtilityRoutines::SameString(Alphas(2), Density)) { + if (Util::SameString(Alphas(3), Fluid)) { + if (!Util::SameString(Alphas(2), Enthalpy) && !Util::SameString(Alphas(2), SpecificHeat) && + !Util::SameString(Alphas(2), Density)) { if (iTemp == 0) { ShowWarningError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); @@ -1464,9 +1464,9 @@ namespace FluidProperties { } ++iTemp; } - } else if (UtilityRoutines::SameString(Alphas(3), GasFluid)) { - if (!UtilityRoutines::SameString(Alphas(2), Pressure) && !UtilityRoutines::SameString(Alphas(2), Enthalpy) && - !UtilityRoutines::SameString(Alphas(2), SpecificHeat) && !UtilityRoutines::SameString(Alphas(2), Density)) { + } else if (Util::SameString(Alphas(3), GasFluid)) { + if (!Util::SameString(Alphas(2), Pressure) && !Util::SameString(Alphas(2), Enthalpy) && + !Util::SameString(Alphas(2), SpecificHeat) && !Util::SameString(Alphas(2), Density)) { if (iTemp == 0) { ShowWarningError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); @@ -1518,14 +1518,13 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Enthalpy))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Enthalpy))) { ++NumOfPressPts; if (FirstSHMatch) { TempsName = Alphas(3); FirstSHMatch = false; } else { - if (!UtilityRoutines::SameString(TempsName, Alphas(3))) { + if (!Util::SameString(TempsName, Alphas(3))) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); ShowContinueError(state, "All superheated data for the same property must use the same temperature list"); @@ -1544,7 +1543,7 @@ namespace FluidProperties { // Now allocate the arrays and read the data into the proper place // First, allocate the temperature array and transfer the data from the FluidTemp array for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(TempsName, FluidTemps(TempLoop).Name)) { + if (Util::SameString(TempsName, FluidTemps(TempLoop).Name)) { state.dataFluidProps->RefrigData(Loop).NumSuperTempPts = FluidTemps(TempLoop).NumOfTemps; state.dataFluidProps->RefrigData(Loop).SHTemps.allocate(state.dataFluidProps->RefrigData(Loop).NumSuperTempPts); state.dataFluidProps->RefrigData(Loop).SHTemps = FluidTemps(TempLoop).Temps; @@ -1582,8 +1581,7 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Enthalpy))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Enthalpy))) { ++NumOfPressPts; if (Numbers(1) <= 0.0) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); @@ -1674,8 +1672,7 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Density))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->RefrigData(Loop).Name)) && (Util::SameString(Alphas(2), Density))) { ++NumOfPressPts; if (Numbers(1) <= 0.0) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); @@ -1721,7 +1718,7 @@ namespace FluidProperties { ShowContinueError(state, "All superheated data for the same refrigerant must use the same pressure data"); ErrorsFound = true; } - if (!UtilityRoutines::SameString(TempsName, Alphas(3))) { + if (!Util::SameString(TempsName, Alphas(3))) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); ShowContinueError(state, "All superheated data for the same property must use the same temperature list"); ErrorsFound = true; @@ -1755,7 +1752,7 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if (!UtilityRoutines::SameString(Alphas(2), Enthalpy) && !UtilityRoutines::SameString(Alphas(2), Density)) { + if (!Util::SameString(Alphas(2), Enthalpy) && !Util::SameString(Alphas(2), Density)) { if (iTemp == 0) { ShowWarningError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); @@ -1812,14 +1809,13 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), SpecificHeat))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), SpecificHeat))) { ++NumOfConcPts; if (FirstSHMatch) { TempsName = Alphas(3); FirstSHMatch = false; } else { - if (!UtilityRoutines::SameString(TempsName, Alphas(3))) { + if (!Util::SameString(TempsName, Alphas(3))) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->GlyRawData(Loop).Name)); ShowContinueError(state, "All glycol specific heat data for the same glycol must use the same temperature list"); @@ -1834,7 +1830,7 @@ namespace FluidProperties { // First, allocate the temperature array and transfer the data from the FluidTemp array state.dataFluidProps->GlyRawData(Loop).CpDataPresent = true; for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(TempsName, FluidTemps(TempLoop).Name)) { + if (Util::SameString(TempsName, FluidTemps(TempLoop).Name)) { state.dataFluidProps->GlyRawData(Loop).NumCpTempPts = FluidTemps(TempLoop).NumOfTemps; state.dataFluidProps->GlyRawData(Loop).CpTemps.allocate(state.dataFluidProps->GlyRawData(Loop).NumCpTempPts); state.dataFluidProps->GlyRawData(Loop).CpTemps = FluidTemps(TempLoop).Temps; @@ -1869,8 +1865,7 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), SpecificHeat))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), SpecificHeat))) { ++NumOfConcPts; state.dataFluidProps->GlyRawData(Loop).CpConcs(NumOfConcPts) = Numbers(1); // a little error trapping @@ -1923,14 +1918,13 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Density))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), Density))) { ++NumOfConcPts; if (FirstSHMatch) { TempsName = Alphas(3); FirstSHMatch = false; } else { - if (!UtilityRoutines::SameString(TempsName, Alphas(3))) { + if (!Util::SameString(TempsName, Alphas(3))) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->GlyRawData(Loop).Name)); ShowContinueError(state, "All glycol density data for the same glycol must use the same temperature list"); @@ -1945,7 +1939,7 @@ namespace FluidProperties { // First, allocate the temperature array and transfer the data from the FluidTemp array state.dataFluidProps->GlyRawData(Loop).RhoDataPresent = true; for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(TempsName, FluidTemps(TempLoop).Name)) { + if (Util::SameString(TempsName, FluidTemps(TempLoop).Name)) { state.dataFluidProps->GlyRawData(Loop).NumRhoTempPts = FluidTemps(TempLoop).NumOfTemps; state.dataFluidProps->GlyRawData(Loop).RhoTemps.allocate(state.dataFluidProps->GlyRawData(Loop).NumRhoTempPts); state.dataFluidProps->GlyRawData(Loop).RhoTemps = FluidTemps(TempLoop).Temps; @@ -1980,8 +1974,7 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Density))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), Density))) { ++NumOfConcPts; state.dataFluidProps->GlyRawData(Loop).RhoConcs(NumOfConcPts) = Numbers(1); // a little error trapping @@ -2034,14 +2027,13 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Conductivity))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), Conductivity))) { ++NumOfConcPts; if (FirstSHMatch) { TempsName = Alphas(3); FirstSHMatch = false; } else { - if (!UtilityRoutines::SameString(TempsName, Alphas(3))) { + if (!Util::SameString(TempsName, Alphas(3))) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->GlyRawData(Loop).Name)); ShowContinueError(state, "All glycol conductivity data for the same glycol must use the same temperature list"); @@ -2056,7 +2048,7 @@ namespace FluidProperties { // First, allocate the temperature array and transfer the data from the FluidTemp array state.dataFluidProps->GlyRawData(Loop).CondDataPresent = true; for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(TempsName, FluidTemps(TempLoop).Name)) { + if (Util::SameString(TempsName, FluidTemps(TempLoop).Name)) { state.dataFluidProps->GlyRawData(Loop).NumCondTempPts = FluidTemps(TempLoop).NumOfTemps; state.dataFluidProps->GlyRawData(Loop).CondTemps.allocate(state.dataFluidProps->GlyRawData(Loop).NumCondTempPts); state.dataFluidProps->GlyRawData(Loop).CondTemps = FluidTemps(TempLoop).Temps; @@ -2091,8 +2083,7 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Conductivity))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), Conductivity))) { ++NumOfConcPts; state.dataFluidProps->GlyRawData(Loop).CondConcs(NumOfConcPts) = Numbers(1); // a little error trapping @@ -2145,14 +2136,13 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Viscosity))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), Viscosity))) { ++NumOfConcPts; if (FirstSHMatch) { TempsName = Alphas(3); FirstSHMatch = false; } else { - if (!UtilityRoutines::SameString(TempsName, Alphas(3))) { + if (!Util::SameString(TempsName, Alphas(3))) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->GlyRawData(Loop).Name)); ShowContinueError(state, "All glycol viscosity data for the same glycol must use the same temperature list"); @@ -2167,7 +2157,7 @@ namespace FluidProperties { // Now allocate the arrays and read the data into the proper place // First, allocate the temperature array and transfer the data from the FluidTemp array for (int TempLoop = 1; TempLoop <= NumOfFluidTempArrays; ++TempLoop) { - if (UtilityRoutines::SameString(TempsName, FluidTemps(TempLoop).Name)) { + if (Util::SameString(TempsName, FluidTemps(TempLoop).Name)) { state.dataFluidProps->GlyRawData(Loop).NumViscTempPts = FluidTemps(TempLoop).NumOfTemps; state.dataFluidProps->GlyRawData(Loop).ViscTemps.allocate(state.dataFluidProps->GlyRawData(Loop).NumViscTempPts); state.dataFluidProps->GlyRawData(Loop).ViscTemps = FluidTemps(TempLoop).Temps; @@ -2202,8 +2192,7 @@ namespace FluidProperties { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if ((UtilityRoutines::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && - (UtilityRoutines::SameString(Alphas(2), Viscosity))) { + if ((Util::SameString(Alphas(1), state.dataFluidProps->GlyRawData(Loop).Name)) && (Util::SameString(Alphas(2), Viscosity))) { ++NumOfConcPts; state.dataFluidProps->GlyRawData(Loop).ViscConcs(NumOfConcPts) = Numbers(1); // a little error trapping @@ -2320,19 +2309,19 @@ namespace FluidProperties { cAlphaFieldNames, cNumericFieldNames); bool GlycolFound = false; - if (UtilityRoutines::SameString(Alphas(2), EthyleneGlycol)) { + if (Util::SameString(Alphas(2), EthyleneGlycol)) { GlycolFound = true; ++NumOfGlyConcs; state.dataFluidProps->GlycolData(NumOfGlyConcs).Name = Alphas(1); state.dataFluidProps->GlycolData(NumOfGlyConcs).GlycolName = Alphas(2); - } else if (UtilityRoutines::SameString(Alphas(2), PropyleneGlycol)) { + } else if (Util::SameString(Alphas(2), PropyleneGlycol)) { GlycolFound = true; ++NumOfGlyConcs; state.dataFluidProps->GlycolData(NumOfGlyConcs).Name = Alphas(1); state.dataFluidProps->GlycolData(NumOfGlyConcs).GlycolName = Alphas(2); - } else if (UtilityRoutines::SameString(Alphas(2), "UserDefinedGlycolType")) { + } else if (Util::SameString(Alphas(2), "UserDefinedGlycolType")) { for (InData = 1; InData <= state.dataFluidProps->NumOfGlycols; ++InData) { - if (UtilityRoutines::SameString(Alphas(3), state.dataFluidProps->GlyRawData(InData).Name)) { + if (Util::SameString(Alphas(3), state.dataFluidProps->GlyRawData(InData).Name)) { GlycolFound = true; break; // DO LOOP through user defined glycols } @@ -2359,14 +2348,13 @@ namespace FluidProperties { // Now initialize the rest of the data for the glycols for (int Loop = 2; Loop <= NumOfGlyConcs; ++Loop) { // Check to see if glycol name is one of the defaults or is listed in the Fluid Name list - if (UtilityRoutines::SameString(state.dataFluidProps->GlycolData(Loop).GlycolName, EthyleneGlycol)) { + if (Util::SameString(state.dataFluidProps->GlycolData(Loop).GlycolName, EthyleneGlycol)) { state.dataFluidProps->GlycolData(Loop).GlycolIndex = EthyleneGlycolIndex; - } else if (UtilityRoutines::SameString(state.dataFluidProps->GlycolData(Loop).GlycolName, PropyleneGlycol)) { + } else if (Util::SameString(state.dataFluidProps->GlycolData(Loop).GlycolName, PropyleneGlycol)) { state.dataFluidProps->GlycolData(Loop).GlycolIndex = PropyleneGlycolIndex; } else { for (InData = 1; InData <= state.dataFluidProps->NumOfGlycols; ++InData) { - if (UtilityRoutines::SameString(state.dataFluidProps->GlycolData(Loop).GlycolName, - state.dataFluidProps->GlyRawData(InData).Name)) { + if (Util::SameString(state.dataFluidProps->GlycolData(Loop).GlycolName, state.dataFluidProps->GlyRawData(InData).Name)) { state.dataFluidProps->GlycolData(Loop).GlycolIndex = InData; break; // DO LOOP through user defined glycols } @@ -7746,7 +7734,7 @@ namespace FluidProperties { } // Check to see if this glycol shows up in the glycol data - int Found = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER(Refrigerant), state.dataFluidProps->RefrigData); + int Found = Util::FindItemInList(Util::makeUPPER(Refrigerant), state.dataFluidProps->RefrigData); if (Found > 0) { FindRefrigerant = Found; @@ -7788,9 +7776,9 @@ namespace FluidProperties { } // Check to see if this glycol shows up in the glycol data - int Found = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER(Glycol), - state.dataFluidProps->GlycolData, - state.dataFluidProps->NumOfGlycols); // GlycolData is allocated to NumOfGlyConcs + int Found = Util::FindItemInList(Util::makeUPPER(Glycol), + state.dataFluidProps->GlycolData, + state.dataFluidProps->NumOfGlycols); // GlycolData is allocated to NumOfGlyConcs if (Found > 0) { FindGlycol = Found; @@ -8044,11 +8032,11 @@ namespace FluidProperties { // Item must be either in Refrigerant or Glycol list int Found = 0; if (state.dataFluidProps->NumOfRefrigerants > 0) { - Found = UtilityRoutines::FindItemInList(NameToCheck, state.dataFluidProps->RefrigData); + Found = Util::FindItemInList(NameToCheck, state.dataFluidProps->RefrigData); } if (Found == 0) { if (state.dataFluidProps->NumOfGlycols > 0) { - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( NameToCheck, state.dataFluidProps->GlycolData, state.dataFluidProps->NumOfGlycols); // GlycolData is allocated to NumOfGlyConcs } } @@ -8074,7 +8062,7 @@ namespace FluidProperties { for (int Item = 1; Item <= state.dataFluidProps->NumOfRefrigerants; ++Item) { if (state.dataFluidProps->RefrigUsed(Item)) continue; - if (UtilityRoutines::SameString(state.dataFluidProps->RefrigData(Item).Name, Steam)) continue; + if (Util::SameString(state.dataFluidProps->RefrigData(Item).Name, Steam)) continue; if (NeedOrphanMessage && state.dataGlobal->DisplayUnusedObjects) { ShowWarningError(state, "The following fluid names are \"Unused Fluids\". These fluids are in the idf"); ShowContinueError(state, " file but are never obtained by the simulation and therefore are NOT used."); @@ -8091,9 +8079,9 @@ namespace FluidProperties { for (int Item = 1; Item <= state.dataFluidProps->NumOfGlycols; ++Item) { if (state.dataFluidProps->GlycolUsed(Item)) continue; - if (UtilityRoutines::SameString(state.dataFluidProps->GlycolData(Item).Name, Water)) continue; - if (UtilityRoutines::SameString(state.dataFluidProps->GlycolData(Item).Name, EthyleneGlycol)) continue; - if (UtilityRoutines::SameString(state.dataFluidProps->GlycolData(Item).Name, PropyleneGlycol)) continue; + if (Util::SameString(state.dataFluidProps->GlycolData(Item).Name, Water)) continue; + if (Util::SameString(state.dataFluidProps->GlycolData(Item).Name, EthyleneGlycol)) continue; + if (Util::SameString(state.dataFluidProps->GlycolData(Item).Name, PropyleneGlycol)) continue; if (NeedOrphanMessage && state.dataGlobal->DisplayUnusedObjects) { ShowWarningError(state, "The following fluid names are \"Unused Fluids\". These fluids are in the idf"); ShowContinueError(state, " file but are never obtained by the simulation and therefore are NOT used."); @@ -8232,7 +8220,7 @@ namespace FluidProperties { GlycolAPI::GlycolAPI(EnergyPlusData &state, std::string const &glycolName) { - this->glycolName = EnergyPlus::UtilityRoutines::makeUPPER(glycolName); + this->glycolName = EnergyPlus::Util::makeUPPER(glycolName); this->glycolIndex = 0; this->cf = "GlycolAPI:Instance"; if (this->glycolName != "WATER") { @@ -8258,7 +8246,7 @@ namespace FluidProperties { RefrigerantAPI::RefrigerantAPI(EnergyPlusData &state, std::string const &refrigName) { - this->rName = EnergyPlus::UtilityRoutines::makeUPPER(refrigName); + this->rName = EnergyPlus::Util::makeUPPER(refrigName); this->rIndex = 0; this->cf = "RefrigerantAPI:Instance"; if (this->rName != "STEAM") { diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index d0fecd04c3b..ab2d04705fb 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -127,7 +127,7 @@ namespace FuelCellElectricGenerator { // Now look for this object for (auto &thisFC : state.dataFuelCellElectGen->FuelCell) { - if (UtilityRoutines::makeUPPER(thisFC.NameExhaustHX) == UtilityRoutines::makeUPPER(objectName)) { + if (Util::makeUPPER(thisFC.NameExhaustHX) == Util::makeUPPER(objectName)) { return &thisFC; } } @@ -240,13 +240,13 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCPM); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCPM); if (thisFuelCell > 0) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.Name = AlphArray(1); - if (UtilityRoutines::SameString(AlphArray(2), "ANNEX42")) + if (Util::SameString(AlphArray(2), "ANNEX42")) state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.EffMode = DataGenerators::CurveMode::Direct; - if (UtilityRoutines::SameString(AlphArray(2), "NORMALIZED")) + if (Util::SameString(AlphArray(2), "NORMALIZED")) state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.EffMode = DataGenerators::CurveMode::Normalized; if (state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.EffMode == DataGenerators::CurveMode::Invalid) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), AlphArray(2))); @@ -282,11 +282,11 @@ namespace FuelCellElectricGenerator { state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ShutDownElectConsum = NumArray(16); state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ANC0 = NumArray(17); state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ANC1 = NumArray(18); - if (UtilityRoutines::SameString(AlphArray(4), "ConstantRate")) + if (Util::SameString(AlphArray(4), "ConstantRate")) state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.SkinLossMode = DataGenerators::SkinLoss::ConstantRate; - if (UtilityRoutines::SameString(AlphArray(4), "UAForProcessGasTemperature")) + if (Util::SameString(AlphArray(4), "UAForProcessGasTemperature")) state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.SkinLossMode = DataGenerators::SkinLoss::UADT; - if (UtilityRoutines::SameString(AlphArray(4), "QUADRATIC FUNCTION OF FUEL RATE")) + if (Util::SameString(AlphArray(4), "QUADRATIC FUNCTION OF FUEL RATE")) state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.SkinLossMode = DataGenerators::SkinLoss::QuadraticFuelNdot; if (state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.SkinLossMode == DataGenerators::SkinLoss::Invalid) { // throw error @@ -296,7 +296,7 @@ namespace FuelCellElectricGenerator { } state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ZoneName = AlphArray(5); state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ZoneID = - UtilityRoutines::FindItemInList(state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ZoneName, state.dataHeatBal->Zone); + Util::FindItemInList(state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ZoneName, state.dataHeatBal->Zone); if (state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.ZoneID == 0 && !lAlphaBlanks(5)) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), AlphArray(5))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -347,8 +347,8 @@ namespace FuelCellElectricGenerator { // check for other FuelCell using the same power module and fill for (int otherFuelCell = thisFuelCell + 1; otherFuelCell <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++otherFuelCell) { - if (UtilityRoutines::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).FCPM.Name, - state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.Name)) { + if (Util::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).FCPM.Name, + state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM.Name)) { state.dataFuelCellElectGen->FuelCell(otherFuelCell).FCPM = state.dataFuelCellElectGen->FuelCell(thisFuelCell).FCPM; } } @@ -367,7 +367,7 @@ namespace FuelCellElectricGenerator { // set fuel supply ID in Fuel cell structure for (int GeneratorNum = 1; GeneratorNum <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++GeneratorNum) { - state.dataFuelCellElectGen->FuelCell(GeneratorNum).FuelSupNum = UtilityRoutines::FindItemInList( + state.dataFuelCellElectGen->FuelCell(GeneratorNum).FuelSupNum = Util::FindItemInList( state.dataFuelCellElectGen->FuelCell(GeneratorNum).NameFCFuelSup, state.dataGenerator->FuelSupply); // Fuel Supply ID if (state.dataFuelCellElectGen->FuelCell(GeneratorNum).FuelSupNum == 0) { ShowSevereError(state, @@ -400,7 +400,7 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCAirSup); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCAirSup); if (thisFuelCell > 0) { @@ -428,11 +428,11 @@ namespace FuelCellElectricGenerator { } state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.BlowerHeatLossFactor = NumArray(1); - if (UtilityRoutines::SameString(AlphArray(4), "AirRatiobyStoics")) { + if (Util::SameString(AlphArray(4), "AirRatiobyStoics")) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.AirSupRateMode = DataGenerators::AirSupRateMode::ConstantStoicsAirRat; - } else if (UtilityRoutines::SameString(AlphArray(4), "QuadraticFunctionofElectricPower")) { + } else if (Util::SameString(AlphArray(4), "QuadraticFunctionofElectricPower")) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.AirSupRateMode = DataGenerators::AirSupRateMode::QuadraticFuncofPel; - } else if (UtilityRoutines::SameString(AlphArray(4), "QUADRATIC FUNCTION OF FUEL RATE")) { + } else if (Util::SameString(AlphArray(4), "QUADRATIC FUNCTION OF FUEL RATE")) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.AirSupRateMode = DataGenerators::AirSupRateMode::QuadraticFuncofNdot; } else { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4))); @@ -464,18 +464,18 @@ namespace FuelCellElectricGenerator { ErrorsFound = true; } - if (UtilityRoutines::SameString("RecoverBurnerInverterStorage", AlphArray(7))) { + if (Util::SameString("RecoverBurnerInverterStorage", AlphArray(7))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.IntakeRecoveryMode = DataGenerators::RecoverMode::RecoverBurnInvertBatt; - } else if (UtilityRoutines::SameString("RecoverAuxiliaryBurner", AlphArray(7))) { + } else if (Util::SameString("RecoverAuxiliaryBurner", AlphArray(7))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.IntakeRecoveryMode = DataGenerators::RecoverMode::RecoverAuxiliaryBurner; - } else if (UtilityRoutines::SameString("RecoverInverterandStorage", AlphArray(7))) { + } else if (Util::SameString("RecoverInverterandStorage", AlphArray(7))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.IntakeRecoveryMode = DataGenerators::RecoverMode::RecoverInverterBatt; - } else if (UtilityRoutines::SameString("RecoverInverter", AlphArray(7))) { + } else if (Util::SameString("RecoverInverter", AlphArray(7))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.IntakeRecoveryMode = DataGenerators::RecoverMode::RecoverInverter; - } else if (UtilityRoutines::SameString("RecoverElectricalStorage", AlphArray(7))) { + } else if (Util::SameString("RecoverElectricalStorage", AlphArray(7))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.IntakeRecoveryMode = DataGenerators::RecoverMode::RecoverBattery; - } else if (UtilityRoutines::SameString("NoRecovery", AlphArray(7))) { + } else if (Util::SameString("NoRecovery", AlphArray(7))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.IntakeRecoveryMode = DataGenerators::RecoverMode::NoRecoveryOnAirIntake; } else { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(7), AlphArray(7))); @@ -483,9 +483,9 @@ namespace FuelCellElectricGenerator { ErrorsFound = true; } - if (UtilityRoutines::SameString("AmbientAir", AlphArray(8))) { + if (Util::SameString("AmbientAir", AlphArray(8))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.ConstituentMode = DataGenerators::ConstituentMode::RegularAir; - } else if (UtilityRoutines::SameString("UserDefinedConstituents", AlphArray(8))) { + } else if (Util::SameString("UserDefinedConstituents", AlphArray(8))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.ConstituentMode = DataGenerators::ConstituentMode::UserDefinedConstituents; } else { @@ -546,8 +546,8 @@ namespace FuelCellElectricGenerator { // check for other FuelCell using the same Air Supply module and fill for (int otherFuelCell = thisFuelCell + 1; otherFuelCell <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++otherFuelCell) { - if (UtilityRoutines::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).AirSup.Name, - state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.Name)) { + if (Util::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).AirSup.Name, + state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup.Name)) { state.dataFuelCellElectGen->FuelCell(otherFuelCell).AirSup = state.dataFuelCellElectGen->FuelCell(thisFuelCell).AirSup; } } @@ -560,9 +560,9 @@ namespace FuelCellElectricGenerator { for (int GeneratorNum = 1; GeneratorNum <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++GeneratorNum) { // find molar fraction of oxygen in air supply - int thisConstituent = UtilityRoutines::FindItem("Oxygen", - state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.ConstitName, - state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.NumConstituents); + int thisConstituent = Util::FindItem("Oxygen", + state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.ConstitName, + state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.NumConstituents); if (thisConstituent > 0) state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.O2fraction = state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.ConstitMolalFract(thisConstituent); @@ -572,7 +572,7 @@ namespace FuelCellElectricGenerator { std::string thisName = state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.ConstitName(i); - int thisGasID = UtilityRoutines::FindItem( + int thisGasID = Util::FindItem( thisName, state.dataGenerator->GasPhaseThermoChemistryData, &DataGenerators::GasPropertyDataStruct::ConstituentName); state.dataFuelCellElectGen->FuelCell(GeneratorNum).AirSup.GasLibID(i) = static_cast(thisGasID); @@ -608,7 +608,7 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCWaterSup); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCWaterSup); if (thisFuelCell > 0) { // this is only the first instance of a FuelCell generator using this type of Water supply module @@ -629,7 +629,7 @@ namespace FuelCellElectricGenerator { } state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup.PmpPowerLossFactor = NumArray(1); - if (UtilityRoutines::SameString("TemperatureFromAirNode", AlphArray(4))) { + if (Util::SameString("TemperatureFromAirNode", AlphArray(4))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup.WaterTempMode = DataGenerators::WaterTemperatureMode::WaterInReformAirNode; @@ -645,7 +645,7 @@ namespace FuelCellElectricGenerator { NodeInputManager::CompFluidStream::Primary, DataLoopNode::ObjectIsNotParent); - } else if (UtilityRoutines::SameString("TemperatureFromWaterNode", AlphArray(4))) { + } else if (Util::SameString("TemperatureFromWaterNode", AlphArray(4))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup.WaterTempMode = DataGenerators::WaterTemperatureMode::WaterInReformWaterNode; @@ -661,11 +661,11 @@ namespace FuelCellElectricGenerator { NodeInputManager::CompFluidStream::Primary, DataLoopNode::ObjectIsNotParent); - } else if (UtilityRoutines::SameString("MainsWaterTemperature", AlphArray(4))) { + } else if (Util::SameString("MainsWaterTemperature", AlphArray(4))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup.WaterTempMode = DataGenerators::WaterTemperatureMode::WaterInReformMains; - } else if (UtilityRoutines::SameString("TemperatureFromSchedule", AlphArray(4))) { + } else if (Util::SameString("TemperatureFromSchedule", AlphArray(4))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup.WaterTempMode = DataGenerators::WaterTemperatureMode::WaterInReformSchedule; } else { @@ -686,8 +686,8 @@ namespace FuelCellElectricGenerator { // check for other FuelCell using the same Water Supply module and fill for (int otherFuelCell = thisFuelCell + 1; otherFuelCell <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++otherFuelCell) { - if (UtilityRoutines::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).WaterSup.Name, - state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup.Name)) { + if (Util::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).WaterSup.Name, + state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup.Name)) { state.dataFuelCellElectGen->FuelCell(otherFuelCell).WaterSup = state.dataFuelCellElectGen->FuelCell(thisFuelCell).WaterSup; } } @@ -721,7 +721,7 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCAuxilHeat); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameFCAuxilHeat); if (thisFuelCell > 0) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.Name = AlphArray(1); @@ -731,10 +731,10 @@ namespace FuelCellElectricGenerator { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.ANC1 = NumArray(3); state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.UASkin = NumArray(4); - if (UtilityRoutines::SameString("SurroundingZone", AlphArray(2))) { + if (Util::SameString("SurroundingZone", AlphArray(2))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.SkinLossDestination = DataGenerators::LossDestination::SurroundingZone; - } else if (UtilityRoutines::SameString("AirInletForFuelCell", AlphArray(2))) { + } else if (Util::SameString("AirInletForFuelCell", AlphArray(2))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.SkinLossDestination = DataGenerators::LossDestination::AirInletForFC; } else { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), AlphArray(2))); @@ -743,8 +743,7 @@ namespace FuelCellElectricGenerator { } state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.ZoneName = AlphArray(3); - state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.ZoneID = - UtilityRoutines::FindItemInList(AlphArray(3), state.dataHeatBal->Zone); + state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.ZoneID = Util::FindItemInList(AlphArray(3), state.dataHeatBal->Zone); if ((state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.ZoneID == 0) && (state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.SkinLossDestination == DataGenerators::LossDestination::SurroundingZone)) { @@ -762,8 +761,8 @@ namespace FuelCellElectricGenerator { // check for other FuelCell using the same Auxiliary Heating module and fill for (int otherFuelCell = thisFuelCell + 1; otherFuelCell <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++otherFuelCell) { - if (UtilityRoutines::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).AuxilHeat.Name, - state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.Name)) { + if (Util::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).AuxilHeat.Name, + state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat.Name)) { state.dataFuelCellElectGen->FuelCell(otherFuelCell).AuxilHeat = state.dataFuelCellElectGen->FuelCell(thisFuelCell).AuxilHeat; } } @@ -797,7 +796,7 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameExhaustHX); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameExhaustHX); if (thisFuelCell > 0) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).Type = DataPlant::PlantEquipmentType::Generator_FCExhaust; @@ -840,13 +839,13 @@ namespace FuelCellElectricGenerator { NodeInputManager::CompFluidStream::Secondary, DataLoopNode::ObjectIsNotParent); - if (UtilityRoutines::SameString("FixedEffectiveness", AlphArray(5))) { + if (Util::SameString("FixedEffectiveness", AlphArray(5))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).ExhaustHX.HXmodelMode = DataGenerators::ExhaustGasHX::FixedEffectiveness; - } else if (UtilityRoutines::SameString("EmpiricalUAeff", AlphArray(5))) { + } else if (Util::SameString("EmpiricalUAeff", AlphArray(5))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).ExhaustHX.HXmodelMode = DataGenerators::ExhaustGasHX::LMTDempiricalUAeff; - } else if (UtilityRoutines::SameString("FundementalUAeff", AlphArray(5))) { + } else if (Util::SameString("FundementalUAeff", AlphArray(5))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).ExhaustHX.HXmodelMode = DataGenerators::ExhaustGasHX::LMTDfundementalUAeff; - } else if (UtilityRoutines::SameString("CONDENSING", AlphArray(5))) { + } else if (Util::SameString("CONDENSING", AlphArray(5))) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).ExhaustHX.HXmodelMode = DataGenerators::ExhaustGasHX::Condensing; } else { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), AlphArray(5))); @@ -907,12 +906,12 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameElecStorage); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameElecStorage); if (thisFuelCell > 0) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).ElecStorage.Name = AlphArray(1); - if (UtilityRoutines::SameString(AlphArray(2), "SimpleEfficiencyWithConstraints")) { + if (Util::SameString(AlphArray(2), "SimpleEfficiencyWithConstraints")) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).ElecStorage.StorageModelMode = DataGenerators::ElectricalStorage::SimpleEffConstraints; } else { @@ -929,8 +928,8 @@ namespace FuelCellElectricGenerator { // check for other FuelCell using the same Electrical Storage and fill for (int otherFuelCell = thisFuelCell + 1; otherFuelCell <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++otherFuelCell) { - if (UtilityRoutines::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).ElecStorage.Name, - state.dataFuelCellElectGen->FuelCell(thisFuelCell).ElecStorage.Name)) { + if (Util::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).ElecStorage.Name, + state.dataFuelCellElectGen->FuelCell(thisFuelCell).ElecStorage.Name)) { state.dataFuelCellElectGen->FuelCell(otherFuelCell).ElecStorage = state.dataFuelCellElectGen->FuelCell(thisFuelCell).ElecStorage; } @@ -966,14 +965,14 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameInverter); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameInverter); if (thisFuelCell > 0) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).Inverter.Name = AlphArray(1); - if (UtilityRoutines::SameString(AlphArray(2), "QUADRATIC")) + if (Util::SameString(AlphArray(2), "QUADRATIC")) state.dataFuelCellElectGen->FuelCell(thisFuelCell).Inverter.EffMode = DataGenerators::InverterEfficiencyMode::Quadratic; - if (UtilityRoutines::SameString(AlphArray(2), "Constant")) + if (Util::SameString(AlphArray(2), "Constant")) state.dataFuelCellElectGen->FuelCell(thisFuelCell).Inverter.EffMode = DataGenerators::InverterEfficiencyMode::Constant; if (state.dataFuelCellElectGen->FuelCell(thisFuelCell).Inverter.EffMode == DataGenerators::InverterEfficiencyMode::Invalid) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), AlphArray(2))); @@ -994,8 +993,8 @@ namespace FuelCellElectricGenerator { // check for other FuelCell using the same Inverter and fill for (int otherFuelCell = thisFuelCell + 1; otherFuelCell <= state.dataFuelCellElectGen->NumFuelCellGenerators; ++otherFuelCell) { - if (UtilityRoutines::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).Inverter.Name, - state.dataFuelCellElectGen->FuelCell(thisFuelCell).Inverter.Name)) { + if (Util::SameString(state.dataFuelCellElectGen->FuelCell(otherFuelCell).Inverter.Name, + state.dataFuelCellElectGen->FuelCell(thisFuelCell).Inverter.Name)) { state.dataFuelCellElectGen->FuelCell(otherFuelCell).Inverter = state.dataFuelCellElectGen->FuelCell(thisFuelCell).Inverter; } } @@ -1024,8 +1023,7 @@ namespace FuelCellElectricGenerator { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int thisFuelCell = - UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameStackCooler); + int thisFuelCell = Util::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameStackCooler); if (thisFuelCell > 0) { state.dataFuelCellElectGen->FuelCell(thisFuelCell).Type = DataPlant::PlantEquipmentType::Generator_FCStackCooler; @@ -2351,8 +2349,8 @@ namespace FuelCellElectricGenerator { Real64 tempCp = 0.0; - Real64 const Tkel = (FluidTemp + Constant::KelvinConv); // temp for NASA eq. in Kelvin - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + Constant::Kelvin); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) Real64 const pow_2_Tsho(pow_2(Tsho)); Real64 const pow_3_Tsho(pow_3(Tsho)); @@ -2422,8 +2420,8 @@ namespace FuelCellElectricGenerator { Real64 A5; // NASA poly coeff Real64 A6; // NASA poly coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + Constant::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + Constant::Kelvin); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2500,8 +2498,8 @@ namespace FuelCellElectricGenerator { Real64 A4; // NASA poly coeff Real64 A5; // NASA poly coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + Constant::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + Constant::Kelvin); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2575,8 +2573,8 @@ namespace FuelCellElectricGenerator { Real64 A5; // NASA poly coeff Real64 A6; // NASA poly coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + Constant::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + Constant::Kelvin); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2656,8 +2654,8 @@ namespace FuelCellElectricGenerator { Real64 A5; // NASA poly coeff Real64 A6; // NASA poly coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + Constant::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + Constant::Kelvin); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2723,8 +2721,8 @@ namespace FuelCellElectricGenerator { Real64 A4; // NASA poly coeff Real64 A5; // NASA poly coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) - Real64 const Tkel = (FluidTemp + Constant::KelvinConv); // temp for NASA eq. in Kelvin + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tkel = (FluidTemp + Constant::Kelvin); // temp for NASA eq. in Kelvin // loop through fuel constituents and sum up Cp @@ -2782,13 +2780,13 @@ namespace FuelCellElectricGenerator { // REFERENCES: // NIST Webbook on gas phase thermochemistry - Real64 constexpr A = 29.0373; // shomate coeff - Real64 constexpr B = 10.2573; // shomate coeff - Real64 constexpr C = 2.81048; // shomate coeff - Real64 constexpr D = -0.95914; // shomate coeff - Real64 constexpr E = 0.11725; // shomate coeff - Real64 constexpr F = -250.569; // shomate coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 constexpr A = 29.0373; // shomate coeff + Real64 constexpr B = 10.2573; // shomate coeff + Real64 constexpr C = 2.81048; // shomate coeff + Real64 constexpr D = -0.95914; // shomate coeff + Real64 constexpr E = 0.11725; // shomate coeff + Real64 constexpr F = -250.569; // shomate coeff + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) HGasWater = A * Tsho + B * pow_2(Tsho) / 2.0 + C * pow_3(Tsho) / 3.0 + D * pow_4(Tsho) / 4.0 - E / Tsho + F; //- H } @@ -2816,7 +2814,7 @@ namespace FuelCellElectricGenerator { Real64 constexpr E = 3.85533; // shomate coeff Real64 constexpr F = -256.5478; // shomate coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; // temp for Shomate eq in (Kelvin/1000) + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; // temp for Shomate eq in (Kelvin/1000) HLiqWater = A * Tsho + B * pow_2(Tsho) / 2.0 + C * pow_3(Tsho) / 3.0 + D * pow_4(Tsho) / 4.0 - E / Tsho + F; //- H } @@ -2838,7 +2836,7 @@ namespace FuelCellElectricGenerator { Real64 constexpr C = -3196.413; // shomate coeff Real64 constexpr D = 2474.455; // shomate coeff Real64 constexpr E = 3.85533; // shomate coeff - Real64 const Tsho = (FluidTemp + Constant::KelvinConv) / 1000.0; + Real64 const Tsho = (FluidTemp + Constant::Kelvin) / 1000.0; Cp = A + B * Tsho + C * pow_2(Tsho) + D * pow_3(Tsho) + E / pow_2(Tsho); } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 5576aae6870..888941cb16d 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -213,7 +213,7 @@ namespace Furnaces { // Find the correct Furnace if (CompIndex == 0) { - FurnaceNum = UtilityRoutines::FindItemInList(FurnaceName, state.dataFurnaces->Furnace); + FurnaceNum = Util::FindItemInList(FurnaceName, state.dataFurnaces->Furnace); if (FurnaceNum == 0) { ShowFatalError(state, format("SimFurnace: Unit not found={}", FurnaceName)); } @@ -894,7 +894,7 @@ namespace Furnaces { // Get the Controlling Zone or Location of the Furnace Thermostat - thisFurnace.ControlZoneNum = UtilityRoutines::FindItemInList(Alphas(6), state.dataHeatBal->Zone); + thisFurnace.ControlZoneNum = Util::FindItemInList(Alphas(6), state.dataHeatBal->Zone); if (thisFurnace.ControlZoneNum == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(6), Alphas(6))); @@ -916,10 +916,9 @@ namespace Furnaces { for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, - thisFurnace.Name) || - !UtilityRoutines::SameString( + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, + thisFurnace.Name) || + !Util::SameString( state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).TypeOf, CurrentModuleObject)) continue; @@ -1041,8 +1040,8 @@ namespace Furnaces { ErrorsFound = true; } // IF (furnace%FanType_Num == FanType_SimpleOnOff .OR. & - if (UtilityRoutines::SameString(Alphas(9), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; - if (UtilityRoutines::SameString(Alphas(9), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; + if (Util::SameString(Alphas(9), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; + if (Util::SameString(Alphas(9), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; if (thisFurnace.FanPlace == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(9), Alphas(9))); @@ -1054,8 +1053,7 @@ namespace Furnaces { HeatingCoilName = Alphas(11); thisFurnace.HeatingCoilType = HeatingCoilType; thisFurnace.HeatingCoilName = HeatingCoilName; - if (UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Electric")) { + if (Util::SameString(HeatingCoilType, "Coil:Heating:Fuel") || Util::SameString(HeatingCoilType, "Coil:Heating:Electric")) { errFlag = false; thisFurnace.HeatingCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { @@ -1105,7 +1103,7 @@ namespace Furnaces { } // IF (IsNotOK) THEN } - } else if (UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Water")) { + } else if (Util::SameString(HeatingCoilType, "Coil:Heating:Water")) { thisFurnace.HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, HeatingCoilType, HeatingCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -1159,7 +1157,7 @@ namespace Furnaces { } } - } else if (UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(HeatingCoilType, "Coil:Heating:Steam")) { thisFurnace.HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, HeatingCoilType, HeatingCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -1477,7 +1475,7 @@ namespace Furnaces { } // Get the Controlling Zone or Location of the Furnace Thermostat - thisFurnace.ControlZoneNum = UtilityRoutines::FindItemInList(Alphas(6), state.dataHeatBal->Zone); + thisFurnace.ControlZoneNum = Util::FindItemInList(Alphas(6), state.dataHeatBal->Zone); if (thisFurnace.ControlZoneNum == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(6), Alphas(6))); @@ -1499,9 +1497,9 @@ namespace Furnaces { for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, Alphas(1)) || - !UtilityRoutines::SameString( + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, + Alphas(1)) || + !Util::SameString( state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).TypeOf, CurrentModuleObject)) continue; @@ -1623,8 +1621,8 @@ namespace Furnaces { ErrorsFound = true; } // IF (TFurnace(FurnaceNum)%FanType_Num == FanType_SimpleOnOff .OR. &, etc. - if (UtilityRoutines::SameString(Alphas(9), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; - if (UtilityRoutines::SameString(Alphas(9), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; + if (Util::SameString(Alphas(9), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; + if (Util::SameString(Alphas(9), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; if (thisFurnace.FanPlace == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(9), Alphas(9))); @@ -1637,8 +1635,7 @@ namespace Furnaces { HeatingCoilPLFCurveIndex = 0; thisFurnace.HeatingCoilType = HeatingCoilType; thisFurnace.HeatingCoilName = HeatingCoilName; - if (UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Electric")) { + if (Util::SameString(HeatingCoilType, "Coil:Heating:Fuel") || Util::SameString(HeatingCoilType, "Coil:Heating:Electric")) { errFlag = false; thisFurnace.HeatingCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, HeatingCoilType, HeatingCoilName, errFlag); if (errFlag) { @@ -1696,7 +1693,7 @@ namespace Furnaces { } // IF (IsNotOK) THEN } - } else if (UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Water")) { + } else if (Util::SameString(HeatingCoilType, "Coil:Heating:Water")) { thisFurnace.HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, HeatingCoilType, HeatingCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -1750,7 +1747,7 @@ namespace Furnaces { } } - } else if (UtilityRoutines::SameString(HeatingCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(HeatingCoilType, "Coil:Heating:Steam")) { thisFurnace.HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, HeatingCoilType, HeatingCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -1815,10 +1812,10 @@ namespace Furnaces { errFlag = false; PrintMessage = false; - if (UtilityRoutines::SameString(CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED") || - UtilityRoutines::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) { + if (Util::SameString(CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED") || + Util::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) { thisFurnace.CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed; - if (UtilityRoutines::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; + if (Util::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; } else { thisFurnace.CoolingCoilType_Num = DXCoils::GetCoilTypeNum(state, CoolingCoilType, CoolingCoilName, errFlag, PrintMessage); } @@ -1929,7 +1926,7 @@ namespace Furnaces { } // if (thisFurnace.CoolingCoilType_Num == CoilDX_CoolingHXAssisted) { - if (UtilityRoutines::SameString(ChildCoolingCoilType, "COIL:COOLING:DX")) { + if (Util::SameString(ChildCoolingCoilType, "COIL:COOLING:DX")) { int childCCIndex = CoilCoolingDX::factory(state, ChildCoolingCoilName); if (childCCIndex < 0) { @@ -1943,7 +1940,7 @@ namespace Furnaces { } // else if (thisFurnace.CoolingCoilType_Num == Coil_CoolingAirToAirVariableSpeed) { - else if (UtilityRoutines::SameString(ChildCoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { + else if (Util::SameString(ChildCoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { if (thisFurnace.bIsIHP) { IHPCoilIndex = IntegratedHeatPump::GetCoilIndexIHP(state, CoolingCoilType, CoolingCoilName, errFlag); IHPCoilName = state.dataIntegratedHP->IntegratedHeatPumps(IHPCoilIndex).SCCoilName; @@ -1982,7 +1979,7 @@ namespace Furnaces { // BOS ADDED, AUG/2012, VARIIABLE SPEED DX COOLING COIL // Furnace(FurnaceNum)%DXCoolCoilType = 'COIL:COOLING:DX:VARIABLESPEED' // Furnace(FurnaceNum)%DXCoolCoilName = CoolingCoilName - if (UtilityRoutines::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; + if (Util::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; ValidateComponent(state, CoolingCoilType, CoolingCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -2027,10 +2024,9 @@ namespace Furnaces { ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(14), "None") || UtilityRoutines::SameString(Alphas(14), "Multimode") || - UtilityRoutines::SameString(Alphas(14), "CoolReheat")) { + if (Util::SameString(Alphas(14), "None") || Util::SameString(Alphas(14), "Multimode") || Util::SameString(Alphas(14), "CoolReheat")) { AirNodeFound = false; - if (UtilityRoutines::SameString(Alphas(14), "Multimode")) { + if (Util::SameString(Alphas(14), "Multimode")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::Multimode; thisFurnace.Humidistat = true; if (thisFurnace.CoolingCoilType_Num != DataHVACGlobals::CoilDX_CoolingHXAssisted) { @@ -2049,7 +2045,7 @@ namespace Furnaces { } } } - if (UtilityRoutines::SameString(Alphas(14), "CoolReheat")) { + if (Util::SameString(Alphas(14), "CoolReheat")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::CoolReheat; thisFurnace.Humidistat = true; if (lAlphaBlanks(15)) { @@ -2061,7 +2057,7 @@ namespace Furnaces { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::None; } } - if (UtilityRoutines::SameString(Alphas(14), "None")) { + if (Util::SameString(Alphas(14), "None")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::None; thisFurnace.Humidistat = false; } @@ -2102,9 +2098,8 @@ namespace Furnaces { thisFurnace.SuppHeatCoilName = ReheatingCoilName; errFlag = false; if (!lAlphaBlanks(15)) { - if (UtilityRoutines::SameString(ReheatingCoilType, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(ReheatingCoilType, "Coil:Heating:Electric") || - UtilityRoutines::SameString(ReheatingCoilType, "Coil:Heating:Desuperheater")) { + if (Util::SameString(ReheatingCoilType, "Coil:Heating:Fuel") || Util::SameString(ReheatingCoilType, "Coil:Heating:Electric") || + Util::SameString(ReheatingCoilType, "Coil:Heating:Desuperheater")) { thisFurnace.SuppHeatCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, ReheatingCoilType, ReheatingCoilName, errFlag); if (errFlag) { @@ -2154,7 +2149,7 @@ namespace Furnaces { } // IF (IsNotOK) THEN } - } else if (UtilityRoutines::SameString(ReheatingCoilType, "Coil:Heating:Water")) { + } else if (Util::SameString(ReheatingCoilType, "Coil:Heating:Water")) { thisFurnace.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, ReheatingCoilType, ReheatingCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -2209,7 +2204,7 @@ namespace Furnaces { } } - } else if (UtilityRoutines::SameString(ReheatingCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(ReheatingCoilType, "Coil:Heating:Steam")) { thisFurnace.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, ReheatingCoilType, ReheatingCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -2808,7 +2803,7 @@ namespace Furnaces { BranchNodeConnections::TestCompSet(state, CurrentModuleObject, Alphas(1), Alphas(3), Alphas(4), "Air Nodes"); // Get the Controlling Zone or Location of the Furnace Thermostat - thisFurnace.ControlZoneNum = UtilityRoutines::FindItemInList(Alphas(5), state.dataHeatBal->Zone); + thisFurnace.ControlZoneNum = Util::FindItemInList(Alphas(5), state.dataHeatBal->Zone); if (thisFurnace.ControlZoneNum == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(5), Alphas(5))); @@ -2830,9 +2825,9 @@ namespace Furnaces { for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, Alphas(1)) || - !UtilityRoutines::SameString( + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, + Alphas(1)) || + !Util::SameString( state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).TypeOf, CurrentModuleObject)) continue; @@ -2943,10 +2938,10 @@ namespace Furnaces { errFlag = false; - if (UtilityRoutines::SameString(HeatingCoilType, "COIL:HEATING:DX:VARIABLESPEED") || - UtilityRoutines::SameString(HeatingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) { + if (Util::SameString(HeatingCoilType, "COIL:HEATING:DX:VARIABLESPEED") || + Util::SameString(HeatingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) { thisFurnace.HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingAirToAirVariableSpeed; - if (UtilityRoutines::SameString(HeatingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; + if (Util::SameString(HeatingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; } else { thisFurnace.HeatingCoilType_Num = DXCoils::GetCoilTypeNum(state, HeatingCoilType, HeatingCoilName, errFlag); } @@ -3019,10 +3014,10 @@ namespace Furnaces { CoolingCoilType = Alphas(10); CoolingCoilName = Alphas(11); - if (UtilityRoutines::SameString(CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED") || - UtilityRoutines::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) { + if (Util::SameString(CoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED") || + Util::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) { thisFurnace.CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed; - if (UtilityRoutines::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; + if (Util::SameString(CoolingCoilType, "COILSYSTEM:INTEGRATEDHEATPUMP:AIRSOURCE")) thisFurnace.bIsIHP = true; } ValidateComponent(state, CoolingCoilType, CoolingCoilName, IsNotOK, CurrentModuleObject); @@ -3162,8 +3157,7 @@ namespace Furnaces { thisFurnace.SuppHeatCoilType = SuppHeatCoilType; thisFurnace.SuppHeatCoilName = SuppHeatCoilName; errFlag = false; - if (UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Electric")) { + if (Util::SameString(SuppHeatCoilType, "Coil:Heating:Fuel") || Util::SameString(SuppHeatCoilType, "Coil:Heating:Electric")) { thisFurnace.SuppHeatCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { @@ -3211,7 +3205,7 @@ namespace Furnaces { } // IF (IsNotOK) THEN } - } else if (UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Water")) { + } else if (Util::SameString(SuppHeatCoilType, "Coil:Heating:Water")) { thisFurnace.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, SuppHeatCoilType, SuppHeatCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -3263,7 +3257,7 @@ namespace Furnaces { } } - } else if (UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(SuppHeatCoilType, "Coil:Heating:Steam")) { thisFurnace.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, SuppHeatCoilType, SuppHeatCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -3322,8 +3316,8 @@ namespace Furnaces { ErrorsFound = true; } // IF (Furnace(FurnaceNum)%HeatingCoilType_Num == Coil_HeatingGasOrOtherFuel .OR. &, etc. - if (UtilityRoutines::SameString(Alphas(14), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; - if (UtilityRoutines::SameString(Alphas(14), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; + if (Util::SameString(Alphas(14), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; + if (Util::SameString(Alphas(14), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; if (thisFurnace.FanPlace == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(14), Alphas(14))); @@ -3359,10 +3353,9 @@ namespace Furnaces { } // Dehumidification Control Type - if (UtilityRoutines::SameString(Alphas(16), "None") || UtilityRoutines::SameString(Alphas(16), "Multimode") || - UtilityRoutines::SameString(Alphas(16), "CoolReheat")) { + if (Util::SameString(Alphas(16), "None") || Util::SameString(Alphas(16), "Multimode") || Util::SameString(Alphas(16), "CoolReheat")) { AirNodeFound = false; - if (UtilityRoutines::SameString(Alphas(16), "Multimode")) { + if (Util::SameString(Alphas(16), "Multimode")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::Multimode; thisFurnace.Humidistat = true; if (thisFurnace.CoolingCoilType_Num != DataHVACGlobals::CoilDX_CoolingHXAssisted) { @@ -3372,11 +3365,11 @@ namespace Furnaces { ErrorsFound = true; } } - if (UtilityRoutines::SameString(Alphas(16), "CoolReheat")) { + if (Util::SameString(Alphas(16), "CoolReheat")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::CoolReheat; thisFurnace.Humidistat = true; } - if (UtilityRoutines::SameString(Alphas(16), "None")) { + if (Util::SameString(Alphas(16), "None")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::None; thisFurnace.Humidistat = false; } @@ -3778,7 +3771,7 @@ namespace Furnaces { BranchNodeConnections::TestCompSet(state, CurrentModuleObject, Alphas(1), Alphas(3), Alphas(4), "Air Nodes"); // Get the Controlling Zone or Location of the Furnace Thermostat - thisFurnace.ControlZoneNum = UtilityRoutines::FindItemInList(Alphas(5), state.dataHeatBal->Zone); + thisFurnace.ControlZoneNum = Util::FindItemInList(Alphas(5), state.dataHeatBal->Zone); if (thisFurnace.ControlZoneNum == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(5), Alphas(5))); @@ -3800,9 +3793,9 @@ namespace Furnaces { for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, Alphas(1)) || - !UtilityRoutines::SameString( + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, + Alphas(1)) || + !Util::SameString( state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).TypeOf, CurrentModuleObject)) continue; @@ -3979,10 +3972,9 @@ namespace Furnaces { if (NumAlphas >= 18) { // get water flow mode info before CALL SetSimpleWSHPData - if (UtilityRoutines::SameString(Alphas(18), "Constant")) thisFurnace.WaterCyclingMode = DataHVACGlobals::WaterConstant; - if (UtilityRoutines::SameString(Alphas(18), "Cycling")) thisFurnace.WaterCyclingMode = DataHVACGlobals::WaterCycling; - if (UtilityRoutines::SameString(Alphas(18), "ConstantOnDemand")) - thisFurnace.WaterCyclingMode = DataHVACGlobals::WaterConstantOnDemand; + if (Util::SameString(Alphas(18), "Constant")) thisFurnace.WaterCyclingMode = DataHVACGlobals::WaterConstant; + if (Util::SameString(Alphas(18), "Cycling")) thisFurnace.WaterCyclingMode = DataHVACGlobals::WaterCycling; + if (Util::SameString(Alphas(18), "ConstantOnDemand")) thisFurnace.WaterCyclingMode = DataHVACGlobals::WaterConstantOnDemand; // default to draw through if not specified in input if (lAlphaBlanks(18)) thisFurnace.WaterCyclingMode = DataHVACGlobals::WaterCycling; } else { @@ -4019,8 +4011,7 @@ namespace Furnaces { thisFurnace.SuppHeatCoilType = SuppHeatCoilType; thisFurnace.SuppHeatCoilName = SuppHeatCoilName; errFlag = false; - if (UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Electric")) { + if (Util::SameString(SuppHeatCoilType, "Coil:Heating:Fuel") || Util::SameString(SuppHeatCoilType, "Coil:Heating:Electric")) { thisFurnace.SuppHeatCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, SuppHeatCoilType, SuppHeatCoilName, errFlag); if (errFlag) { @@ -4067,7 +4058,7 @@ namespace Furnaces { } // IF (IsNotOK) THEN } - } else if (UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Water")) { + } else if (Util::SameString(SuppHeatCoilType, "Coil:Heating:Water")) { thisFurnace.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, SuppHeatCoilType, SuppHeatCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -4120,7 +4111,7 @@ namespace Furnaces { } } - } else if (UtilityRoutines::SameString(SuppHeatCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(SuppHeatCoilType, "Coil:Heating:Steam")) { thisFurnace.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, SuppHeatCoilType, SuppHeatCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -4201,8 +4192,8 @@ namespace Furnaces { } } - if (UtilityRoutines::SameString(Alphas(15), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; - if (UtilityRoutines::SameString(Alphas(15), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; + if (Util::SameString(Alphas(15), "BlowThrough")) thisFurnace.FanPlace = DataHVACGlobals::BlowThru; + if (Util::SameString(Alphas(15), "DrawThrough")) thisFurnace.FanPlace = DataHVACGlobals::DrawThru; if (thisFurnace.FanPlace == 0) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(15), Alphas(15))); @@ -4225,9 +4216,9 @@ namespace Furnaces { } // add the Dehumidification Type - if (UtilityRoutines::SameString(Alphas(17), "None") || UtilityRoutines::SameString(Alphas(17), "CoolReheat")) { + if (Util::SameString(Alphas(17), "None") || Util::SameString(Alphas(17), "CoolReheat")) { AirNodeFound = false; - if (UtilityRoutines::SameString(Alphas(17), "CoolReheat")) { + if (Util::SameString(Alphas(17), "CoolReheat")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::CoolReheat; thisFurnace.Humidistat = true; if (lAlphaBlanks(17)) { @@ -4239,7 +4230,7 @@ namespace Furnaces { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::None; } } - if (UtilityRoutines::SameString(Alphas(17), "None")) { + if (Util::SameString(Alphas(17), "None")) { thisFurnace.DehumidControlType_Num = DehumidificationControlMode::None; thisFurnace.Humidistat = false; } @@ -11119,7 +11110,7 @@ namespace Furnaces { std::string ChildCoolingCoilType = state.dataHVACAssistedCC->HXAssistedCoil(thisFurnace.CoolingCoilIndex).CoolingCoilType; std::string ChildCoolingCoilName = state.dataHVACAssistedCC->HXAssistedCoil(thisFurnace.CoolingCoilIndex).CoolingCoilName; - if (UtilityRoutines::SameString(ChildCoolingCoilType, "COIL:COOLING:DX")) { + if (Util::SameString(ChildCoolingCoilType, "COIL:COOLING:DX")) { int childCCIndex_DX = CoilCoolingDX::factory(state, ChildCoolingCoilName); if (childCCIndex_DX < 0) { ShowContinueError(state, format("Occurs in {} = {}", cCurrentModuleObject, thisFurnace.Name)); @@ -11128,7 +11119,7 @@ namespace Furnaces { } auto const &newCoil = state.dataCoilCooingDX->coilCoolingDXs[childCCIndex_DX]; thisFurnace.MinOATCompressorCooling = newCoil.performance.minOutdoorDrybulb; - } else if (UtilityRoutines::SameString(ChildCoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { + } else if (Util::SameString(ChildCoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { int childCCIndex_VS = state.dataHVACAssistedCC->HXAssistedCoil(thisFurnace.CoolingCoilIndex).CoolingCoilIndex; thisFurnace.MinOATCompressorCooling = VariableSpeedCoils::GetVSCoilMinOATCompressor(state, childCCIndex_VS, errFlag); } else { // Single speed diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index 0efa6426672..f95237c8654 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -312,7 +312,7 @@ void ProcessDateString(EnergyPlusData &state, int &PMonth, int &PDay, int &PWeekDay, - WeatherManager::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) + Weather::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) bool &ErrorsFound, ObjexxFCL::Optional_int PYear) { @@ -328,20 +328,20 @@ void ProcessDateString(EnergyPlusData &state, // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool errFlag; - int FstNum = int(UtilityRoutines::ProcessNumber(String, errFlag)); - DateType = WeatherManager::DateType::Invalid; + int FstNum = int(Util::ProcessNumber(String, errFlag)); + DateType = Weather::DateType::Invalid; if (!errFlag) { // Entered single number, do inverse JDay if (FstNum == 0) { PMonth = 0; PDay = 0; - DateType = WeatherManager::DateType::MonthDay; + DateType = Weather::DateType::MonthDay; } else if (FstNum < 0 || FstNum > 366) { ShowSevereError(state, format("Invalid Julian date Entered={}", String)); ErrorsFound = true; } else { InvOrdinalDay(FstNum, PMonth, PDay, 0); - DateType = WeatherManager::DateType::LastDayInMonth; + DateType = Weather::DateType::LastDayInMonth; } } else { int NumTokens = 0; @@ -356,10 +356,10 @@ void ProcessDateString(EnergyPlusData &state, DetermineDateTokens(state, String, NumTokens, TokenDay, TokenMonth, TokenWeekday, DateType, ErrorsFound, TokenYear); PYear = TokenYear; } - if (DateType == WeatherManager::DateType::MonthDay) { + if (DateType == Weather::DateType::MonthDay) { PDay = TokenDay; PMonth = TokenMonth; - } else if (DateType == WeatherManager::DateType::NthDayInMonth || DateType == WeatherManager::DateType::LastDayInMonth) { + } else if (DateType == Weather::DateType::NthDayInMonth || DateType == Weather::DateType::LastDayInMonth) { // interpret as TokenDay TokenWeekday in TokenMonth PDay = TokenDay; PMonth = TokenMonth; @@ -370,13 +370,13 @@ void ProcessDateString(EnergyPlusData &state, void DetermineDateTokens(EnergyPlusData &state, std::string const &String, - int &NumTokens, // Number of tokens found in string - int &TokenDay, // Value of numeric field found - int &TokenMonth, // Value of Month field found (1=Jan, 2=Feb, etc) - int &TokenWeekday, // Value of Weekday field found (1=Sunday, 2=Monday, etc), 0 if none - WeatherManager::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) - bool &ErrorsFound, // Set to true if cannot process this string as a date - ObjexxFCL::Optional_int TokenYear // Value of Year if one appears to be present and this argument is present + int &NumTokens, // Number of tokens found in string + int &TokenDay, // Value of numeric field found + int &TokenMonth, // Value of Month field found (1=Jan, 2=Feb, etc) + int &TokenWeekday, // Value of Weekday field found (1=Sunday, 2=Monday, etc), 0 if none + Weather::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) + bool &ErrorsFound, // Set to true if cannot process this string as a date + ObjexxFCL::Optional_int TokenYear // Value of Year if one appears to be present and this argument is present ) { @@ -411,7 +411,7 @@ void DetermineDateTokens(EnergyPlusData &state, TokenDay = 0; TokenMonth = 0; TokenWeekday = 0; - DateType = WeatherManager::DateType::Invalid; + DateType = Weather::DateType::Invalid; if (present(TokenYear)) TokenYear = 0; // Take out separator characters, other extraneous stuff @@ -457,41 +457,41 @@ void DetermineDateTokens(EnergyPlusData &state, } else if (Loop == 2) { // Field must be Day Month or Month Day (if both numeric, mon / day) InternalError = false; - NumField1 = int(UtilityRoutines::ProcessNumber(Fields(1), errFlag)); + NumField1 = int(Util::ProcessNumber(Fields(1), errFlag)); if (errFlag) { // Month day, but first field is not numeric, 2nd must be - NumField2 = int(UtilityRoutines::ProcessNumber(Fields(2), errFlag)); + NumField2 = int(Util::ProcessNumber(Fields(2), errFlag)); if (errFlag) { ShowSevereError(state, format("Invalid date field={}", String)); InternalError = true; } else { TokenDay = NumField2; } - TokenMonth = UtilityRoutines::FindItemInList(Fields(1).substr(0, 3), Months.begin(), Months.end()); + TokenMonth = Util::FindItemInList(Fields(1).substr(0, 3), Months.begin(), Months.end()); ValidateMonthDay(state, String, TokenDay, TokenMonth, InternalError); if (!InternalError) { - DateType = WeatherManager::DateType::MonthDay; + DateType = Weather::DateType::MonthDay; } else { ErrorsFound = true; } } else { // Month Day, first field was numeric, if 2nd is, then it's month day - NumField2 = int(UtilityRoutines::ProcessNumber(Fields(2), errFlag)); + NumField2 = int(Util::ProcessNumber(Fields(2), errFlag)); if (!errFlag) { TokenMonth = NumField1; TokenDay = NumField2; ValidateMonthDay(state, String, TokenDay, TokenMonth, InternalError); if (!InternalError) { - DateType = WeatherManager::DateType::MonthDay; + DateType = Weather::DateType::MonthDay; } else { ErrorsFound = true; } } else { // 2nd field was not numeric. Must be Month TokenDay = NumField1; - TokenMonth = UtilityRoutines::FindItemInList(Fields(2).substr(0, 3), Months.begin(), Months.end()); + TokenMonth = Util::FindItemInList(Fields(2).substr(0, 3), Months.begin(), Months.end()); ValidateMonthDay(state, String, TokenDay, TokenMonth, InternalError); if (!InternalError) { - DateType = WeatherManager::DateType::MonthDay; + DateType = Weather::DateType::MonthDay; NumTokens = 2; } else { ErrorsFound = true; @@ -501,32 +501,32 @@ void DetermineDateTokens(EnergyPlusData &state, } else if (Loop == 3) { // Field must be some combination of Weekday Month (if WkDayInMonth true) if (WkDayInMonth) { - NumField1 = int(UtilityRoutines::ProcessNumber(Fields(1), errFlag)); + NumField1 = int(Util::ProcessNumber(Fields(1), errFlag)); if (!errFlag) { // the expected result TokenDay = NumField1; - TokenWeekday = UtilityRoutines::FindItemInList(Fields(2).substr(0, 3), Weekdays.begin(), Weekdays.end()); + TokenWeekday = Util::FindItemInList(Fields(2).substr(0, 3), Weekdays.begin(), Weekdays.end()); if (TokenWeekday == 0) { - TokenMonth = UtilityRoutines::FindItemInList(Fields(2).substr(0, 3), Months.begin(), Months.end()); - TokenWeekday = UtilityRoutines::FindItemInList(Fields(3).substr(0, 3), Weekdays.begin(), Weekdays.end()); + TokenMonth = Util::FindItemInList(Fields(2).substr(0, 3), Months.begin(), Months.end()); + TokenWeekday = Util::FindItemInList(Fields(3).substr(0, 3), Weekdays.begin(), Weekdays.end()); if (TokenMonth == 0 || TokenWeekday == 0) InternalError = true; } else { - TokenMonth = UtilityRoutines::FindItemInList(Fields(3).substr(0, 3), Months.begin(), Months.end()); + TokenMonth = Util::FindItemInList(Fields(3).substr(0, 3), Months.begin(), Months.end()); if (TokenMonth == 0) InternalError = true; } - DateType = WeatherManager::DateType::NthDayInMonth; + DateType = Weather::DateType::NthDayInMonth; NumTokens = 3; if (TokenDay < 0 || TokenDay > 5) InternalError = true; } else { // first field was not numeric.... if (Fields(1) == "LA") { - DateType = WeatherManager::DateType::LastDayInMonth; + DateType = Weather::DateType::LastDayInMonth; NumTokens = 3; - TokenWeekday = UtilityRoutines::FindItemInList(Fields(2).substr(0, 3), Weekdays.begin(), Weekdays.end()); + TokenWeekday = Util::FindItemInList(Fields(2).substr(0, 3), Weekdays.begin(), Weekdays.end()); if (TokenWeekday == 0) { - TokenMonth = UtilityRoutines::FindItemInList(Fields(2).substr(0, 3), Months.begin(), Months.end()); - TokenWeekday = UtilityRoutines::FindItemInList(Fields(3).substr(0, 3), Weekdays.begin(), Weekdays.end()); + TokenMonth = Util::FindItemInList(Fields(2).substr(0, 3), Months.begin(), Months.end()); + TokenWeekday = Util::FindItemInList(Fields(3).substr(0, 3), Weekdays.begin(), Weekdays.end()); if (TokenMonth == 0 || TokenWeekday == 0) InternalError = true; } else { - TokenMonth = UtilityRoutines::FindItemInList(Fields(3).substr(0, 3), Months.begin(), Months.end()); + TokenMonth = Util::FindItemInList(Fields(3).substr(0, 3), Months.begin(), Months.end()); if (TokenMonth == 0) InternalError = true; } } else { // error.... @@ -534,10 +534,10 @@ void DetermineDateTokens(EnergyPlusData &state, } } } else { // mm/dd/yyyy or yyyy/mm/dd - NumField1 = int(UtilityRoutines::ProcessNumber(Fields(1), errFlag)); - NumField2 = int(UtilityRoutines::ProcessNumber(Fields(2), errFlag)); - NumField3 = int(UtilityRoutines::ProcessNumber(Fields(3), errFlag)); - DateType = WeatherManager::DateType::MonthDay; + NumField1 = int(Util::ProcessNumber(Fields(1), errFlag)); + NumField2 = int(Util::ProcessNumber(Fields(2), errFlag)); + NumField3 = int(Util::ProcessNumber(Fields(3), errFlag)); + DateType = Weather::DateType::MonthDay; // error detection later.. if (NumField1 > 100) { if (present(TokenYear)) { @@ -561,7 +561,7 @@ void DetermineDateTokens(EnergyPlusData &state, } if (InternalError) { - DateType = WeatherManager::DateType::Invalid; + DateType = Weather::DateType::Invalid; ErrorsFound = true; } } @@ -1133,7 +1133,7 @@ void ScanForReports(EnergyPlusData &state, state.dataIPShortCut->cNumericFieldNames); ReportType checkReportType = - static_cast(getEnumValue(ReportTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); + static_cast(getEnumValue(ReportTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); switch (checkReportType) { case ReportType::DXF: { @@ -1199,15 +1199,15 @@ void ScanForReports(EnergyPlusData &state, state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), "CONSTRUCTIONS")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), "CONSTRUCTIONS")) { state.dataGeneral->Constructions = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), "MATERIALS")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), "MATERIALS")) { state.dataGeneral->Materials = true; } if (NumNames > 1) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "CONSTRUCTIONS")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "CONSTRUCTIONS")) { state.dataGeneral->Constructions = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "MATERIALS")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "MATERIALS")) { state.dataGeneral->Materials = true; } } @@ -1231,17 +1231,16 @@ void ScanForReports(EnergyPlusData &state, state.dataGeneral->EMSoutput = true; - AvailRpt CheckAvailRpt = - static_cast(getEnumValue(AvailRptNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); + AvailRpt CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); state.dataRuntimeLang->OutputEMSActuatorAvailSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSActuatorAvailFull = (CheckAvailRpt == AvailRpt::Verbose); - CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); state.dataRuntimeLang->OutputEMSInternalVarsSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSInternalVarsFull = (CheckAvailRpt == AvailRpt::Verbose); - ERLdebugOutputLevel CheckERLlevel = static_cast( - getEnumValue(ERLdebugOutputLevelNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + ERLdebugOutputLevel CheckERLlevel = + static_cast(getEnumValue(ERLdebugOutputLevelNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); state.dataRuntimeLang->OutputEMSErrors = (CheckERLlevel == ERLdebugOutputLevel::ErrorsOnly || CheckERLlevel == ERLdebugOutputLevel::Verbose); state.dataRuntimeLang->OutputFullEMSTrace = (CheckERLlevel == ERLdebugOutputLevel::Verbose); @@ -1253,12 +1252,12 @@ void ScanForReports(EnergyPlusData &state, // Process the Scan Request DoReport = false; - ReportName rptName = static_cast(getEnumValue(ReportNamesUC, UtilityRoutines::makeUPPER(UtilityRoutines::makeUPPER(reportName)))); + ReportName rptName = static_cast(getEnumValue(ReportNamesUC, Util::makeUPPER(Util::makeUPPER(reportName)))); switch (rptName) { case ReportName::Constructions: { if (present(ReportKey)) { - if (UtilityRoutines::SameString(ReportKey(), "Constructions")) DoReport = state.dataGeneral->Constructions; - if (UtilityRoutines::SameString(ReportKey(), "Materials")) DoReport = state.dataGeneral->Materials; + if (Util::SameString(ReportKey(), "Constructions")) DoReport = state.dataGeneral->Constructions; + if (Util::SameString(ReportKey(), "Materials")) DoReport = state.dataGeneral->Materials; } } break; case ReportName::Viewfactorinfo: { @@ -1274,7 +1273,7 @@ void ScanForReports(EnergyPlusData &state, // IF (PRESENT(Option1)) Option1=SchRptOption } break; case ReportName::Surfaces: { - RptKey rptKey = static_cast(getEnumValue(RptKeyNamesUC, UtilityRoutines::makeUPPER(ReportKey()))); + RptKey rptKey = static_cast(getEnumValue(RptKeyNamesUC, Util::makeUPPER(ReportKey()))); switch (rptKey) { // Autodesk:OPTIONAL ReportKey used without PRESENT check case RptKey::Costinfo: { DoReport = state.dataGeneral->CostInfo; @@ -1359,7 +1358,7 @@ void CheckCreatedZoneItemName(EnergyPlusData &state, TooLong = true; } - int FoundItem = UtilityRoutines::FindItemInList(ResultName, ItemNames, NumItems); + int FoundItem = Util::FindItemInList(ResultName, ItemNames, NumItems); if (FoundItem != 0) { ShowSevereError(state, fmt::format("{}{}=\"{}\", Duplicate Generated name encountered.", calledFrom, CurrentObject, ItemName)); @@ -1373,18 +1372,18 @@ void CheckCreatedZoneItemName(EnergyPlusData &state, bool isReportPeriodBeginning(EnergyPlusData &state, const int periodIdx) { int currentDate; - int reportStartDate = state.dataWeatherManager->ReportPeriodInput(periodIdx).startJulianDate; - int reportStartHour = state.dataWeatherManager->ReportPeriodInput(periodIdx).startHour; - if (state.dataWeatherManager->ReportPeriodInput(periodIdx).startYear > 0) { - currentDate = WeatherManager::computeJulianDate(state.dataEnvrn->Year, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); + int reportStartDate = state.dataWeather->ReportPeriodInput(periodIdx).startJulianDate; + int reportStartHour = state.dataWeather->ReportPeriodInput(periodIdx).startHour; + if (state.dataWeather->ReportPeriodInput(periodIdx).startYear > 0) { + currentDate = Weather::computeJulianDate(state.dataEnvrn->Year, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); } else { - currentDate = WeatherManager::computeJulianDate(0, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); + currentDate = Weather::computeJulianDate(0, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); } return (currentDate == reportStartDate && state.dataGlobal->HourOfDay == reportStartHour); } void findReportPeriodIdx(EnergyPlusData &state, - const Array1D &ReportPeriodInputData, + const Array1D &ReportPeriodInputData, const int nReportPeriods, Array1D_bool &inReportPeriodFlags) { @@ -1396,9 +1395,9 @@ void findReportPeriodIdx(EnergyPlusData &state, int reportEndDate = ReportPeriodInputData(i).endJulianDate; int reportEndHour = ReportPeriodInputData(i).endHour; if (ReportPeriodInputData(i).startYear > 0) { - currentDate = WeatherManager::computeJulianDate(state.dataEnvrn->Year, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); + currentDate = Weather::computeJulianDate(state.dataEnvrn->Year, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); } else { - currentDate = WeatherManager::computeJulianDate(0, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); + currentDate = Weather::computeJulianDate(0, state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); } if (General::BetweenDateHoursLeftInclusive( currentDate, state.dataGlobal->HourOfDay, reportStartDate, reportStartHour, reportEndDate, reportEndHour)) { diff --git a/src/EnergyPlus/General.hh b/src/EnergyPlus/General.hh index b454c5a2104..b867b5a8c05 100644 --- a/src/EnergyPlus/General.hh +++ b/src/EnergyPlus/General.hh @@ -65,10 +65,10 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace WeatherManager { +namespace Weather { enum class DateType; struct ReportPeriodData; -} // namespace WeatherManager +} // namespace Weather namespace General { @@ -105,18 +105,18 @@ namespace General { int &PMonth, int &PDay, int &PWeekDay, - WeatherManager::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) + Weather::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) bool &ErrorsFound, ObjexxFCL::Optional_int PYear = _); void DetermineDateTokens(EnergyPlusData &state, std::string const &String, - int &NumTokens, // Number of tokens found in string - int &TokenDay, // Value of numeric field found - int &TokenMonth, // Value of Month field found (1=Jan, 2=Feb, etc) - int &TokenWeekday, // Value of Weekday field found (1=Sunday, 2=Monday, etc), 0 if none - WeatherManager::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) - bool &ErrorsFound, // Set to true if cannot process this string as a date + int &NumTokens, // Number of tokens found in string + int &TokenDay, // Value of numeric field found + int &TokenMonth, // Value of Month field found (1=Jan, 2=Feb, etc) + int &TokenWeekday, // Value of Weekday field found (1=Sunday, 2=Monday, etc), 0 if none + Weather::DateType &DateType, // DateType found (-1=invalid, 1=month/day, 2=nth day in month, 3=last day in month) + bool &ErrorsFound, // Set to true if cannot process this string as a date ObjexxFCL::Optional_int TokenYear = _ // Value of Year if one appears to be present and this argument is present ); @@ -245,7 +245,7 @@ namespace General { bool isReportPeriodBeginning(EnergyPlusData &state, int periodIdx); void findReportPeriodIdx(EnergyPlusData &state, - const Array1D &ReportPeriodInputData, + const Array1D &ReportPeriodInputData, int nReportPeriods, Array1D_bool &inReportPeriodFlags); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 5b77b80f20e..88d3c39e212 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -196,7 +196,7 @@ void ControlCompOutput(EnergyPlusData &state, if (ControlCompTypeNum != 0) { SimCompNum = ControlCompTypeNum; } else { - SimCompNum = UtilityRoutines::FindItemInSortedList(CompType, ListOfComponents, NumComponents); + SimCompNum = Util::FindItemInSortedList(CompType, ListOfComponents, NumComponents); ControlCompTypeNum = SimCompNum; } @@ -968,8 +968,8 @@ void TestSupplyAirPathIntegrity(EnergyPlusData &state, bool &ErrFound) state.dataZoneEquip->SupplyAirPath(BCount).ComponentName(Count), PrimaryAirLoopName); - AirLoopHVACCompType CompType = static_cast(getEnumValue( - AirLoopHVACCompTypeNamesUC, UtilityRoutines::makeUPPER(state.dataZoneEquip->SupplyAirPath(BCount).ComponentType(Count)))); + AirLoopHVACCompType CompType = static_cast( + getEnumValue(AirLoopHVACCompTypeNamesUC, Util::makeUPPER(state.dataZoneEquip->SupplyAirPath(BCount).ComponentType(Count)))); switch (CompType) { case AirLoopHVACCompType::SupplyPlenum: { @@ -1260,7 +1260,7 @@ void TestReturnAirPathIntegrity(EnergyPlusData &state, bool &ErrFound, Array2S_i state.dataZoneEquip->ReturnAirPath(BCount).ComponentName(Count), PrimaryAirLoopName); - if (UtilityRoutines::SameString(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count), "AirLoopHVAC:ZoneMixer")) { + if (Util::SameString(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count), "AirLoopHVAC:ZoneMixer")) { ++MixerCount; } } @@ -1277,8 +1277,8 @@ void TestReturnAirPathIntegrity(EnergyPlusData &state, bool &ErrFound, Array2S_i if (NumComp > 0) { - AirLoopHVACCompType CompType = static_cast(getEnumValue( - AirLoopHVACCompTypeNamesUC, UtilityRoutines::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(NumComp)))); + AirLoopHVACCompType CompType = static_cast( + getEnumValue(AirLoopHVACCompTypeNamesUC, Util::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(NumComp)))); switch (CompType) { case AirLoopHVACCompType::ZoneMixer: { @@ -1364,8 +1364,8 @@ void TestReturnAirPathIntegrity(EnergyPlusData &state, bool &ErrFound, Array2S_i if (NumComp > 1) { for (int Count3 = 1; Count3 <= NumComp - 1; ++Count3) { - AirLoopHVACCompType CompType = static_cast(getEnumValue( - AirLoopHVACCompTypeNamesUC, UtilityRoutines::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count3)))); + AirLoopHVACCompType CompType = static_cast( + getEnumValue(AirLoopHVACCompTypeNamesUC, Util::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count3)))); switch (CompType) { case AirLoopHVACCompType::ZoneMixer: { diff --git a/src/EnergyPlus/GeneratorFuelSupply.cc b/src/EnergyPlus/GeneratorFuelSupply.cc index 37c5ae6ac08..97ca5ea329d 100644 --- a/src/EnergyPlus/GeneratorFuelSupply.cc +++ b/src/EnergyPlus/GeneratorFuelSupply.cc @@ -135,9 +135,9 @@ namespace GeneratorFuelSupply { state.dataIPShortCut->cNumericFieldNames); state.dataGenerator->FuelSupply(FuelSupNum).Name = AlphArray(1); - if (UtilityRoutines::SameString("TemperatureFromAirNode", AlphArray(2))) { + if (Util::SameString("TemperatureFromAirNode", AlphArray(2))) { state.dataGenerator->FuelSupply(FuelSupNum).FuelTempMode = DataGenerators::FuelTemperatureMode::FuelInTempFromNode; - } else if (UtilityRoutines::SameString("Scheduled", AlphArray(2))) { + } else if (Util::SameString("Scheduled", AlphArray(2))) { state.dataGenerator->FuelSupply(FuelSupNum).FuelTempMode = DataGenerators::FuelTemperatureMode::FuelInTempSchedule; } else { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), AlphArray(2))); @@ -177,9 +177,9 @@ namespace GeneratorFuelSupply { for (auto &e : state.dataGenerator->FuelSupply) e.CompPowerLossFactor = NumArray(1); - if (UtilityRoutines::SameString(AlphArray(6), "GaseousConstituents")) { + if (Util::SameString(AlphArray(6), "GaseousConstituents")) { state.dataGenerator->FuelSupply(FuelSupNum).FuelTypeMode = DataGenerators::FuelMode::GaseousConstituents; - } else if (UtilityRoutines::SameString(AlphArray(6), "LiquidGeneric")) { + } else if (Util::SameString(AlphArray(6), "LiquidGeneric")) { state.dataGenerator->FuelSupply(FuelSupNum).FuelTypeMode = DataGenerators::FuelMode::GenericLiquid; } else { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(6), AlphArray(6))); @@ -573,7 +573,7 @@ namespace GeneratorFuelSupply { for (int i = 1; i <= state.dataGenerator->FuelSupply(FuelSupplyNum).NumConstituents; ++i) { std::string const &thisName = state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitName(i); - int thisGasID = UtilityRoutines::FindItem( + int thisGasID = Util::FindItem( thisName, state.dataGenerator->GasPhaseThermoChemistryData, &DataGenerators::GasPropertyDataStruct::ConstituentName); state.dataGenerator->FuelSupply(FuelSupplyNum).GasLibID(i) = thisGasID; diff --git a/src/EnergyPlus/GlobalNames.cc b/src/EnergyPlus/GlobalNames.cc index 2ffae0d2c81..4df7f0f2ebe 100644 --- a/src/EnergyPlus/GlobalNames.cc +++ b/src/EnergyPlus/GlobalNames.cc @@ -155,7 +155,7 @@ void VerifyUniqueChillerName( ShowContinueError(state, format("...Current entry is Chiller Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->ChillerNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); + state.dataGlobalNames->ChillerNames.emplace(NameToVerify, Util::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumChillers = static_cast(state.dataGlobalNames->ChillerNames.size()); } } @@ -183,7 +183,7 @@ void VerifyUniqueBaseboardName(EnergyPlusData &state, ShowContinueError(state, format("...Current entry is Baseboard Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->BaseboardNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); + state.dataGlobalNames->BaseboardNames.emplace(NameToVerify, Util::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumBaseboards = static_cast(state.dataGlobalNames->BaseboardNames.size()); } } @@ -208,7 +208,7 @@ void VerifyUniqueBoilerName( ShowContinueError(state, format("...Current entry is Boiler Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->BoilerNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); + state.dataGlobalNames->BoilerNames.emplace(NameToVerify, Util::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumBoilers = static_cast(state.dataGlobalNames->BoilerNames.size()); } } @@ -240,7 +240,7 @@ void VerifyUniqueCoilName( ShowContinueError(state, format("...Current entry is Coil Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->CoilNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); + state.dataGlobalNames->CoilNames.emplace(NameToVerify, Util::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumCoils = static_cast(state.dataGlobalNames->CoilNames.size()); } } @@ -254,7 +254,7 @@ void VerifyUniqueADUName( ShowContinueError(state, format("...Current entry is Air Distribution Unit Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->aDUNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); + state.dataGlobalNames->aDUNames.emplace(NameToVerify, Util::makeUPPER(TypeToVerify)); state.dataGlobalNames->numAirDistUnits = static_cast(state.dataGlobalNames->aDUNames.size()); } } diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index db600f9d129..09232479fea 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -134,8 +134,8 @@ GLHESlinky::GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohma this->name = objName; - std::string inletNodeName = UtilityRoutines::makeUPPER(j["inlet_node_name"].get()); - std::string outletNodeName = UtilityRoutines::makeUPPER(j["outlet_node_name"].get()); + std::string inletNodeName = Util::makeUPPER(j["inlet_node_name"].get()); + std::string outletNodeName = Util::makeUPPER(j["outlet_node_name"].get()); // get inlet node num this->inletNodeNum = NodeInputManager::GetOnlySingleNode(state, @@ -179,10 +179,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 = UtilityRoutines::makeUPPER(j["heat_exchanger_configuration"].get()); - if (UtilityRoutines::SameString(hxConfig, "VERTICAL")) { + std::string const hxConfig = Util::makeUPPER(j["heat_exchanger_configuration"].get()); + if (Util::SameString(hxConfig, "VERTICAL")) { this->verticalConfig = true; - } else if (UtilityRoutines::SameString(hxConfig, "HORIZONTAL")) { + } else if (Util::SameString(hxConfig, "HORIZONTAL")) { this->verticalConfig = false; } @@ -246,8 +246,8 @@ GLHESlinky::GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohma } // Initialize ground temperature model and get pointer reference - std::string const gtmType = UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()); - std::string const gtmName = UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_name"].get()); + std::string const gtmType = Util::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()); + std::string const gtmName = Util::makeUPPER(j["undisturbed_ground_temperature_model_name"].get()); this->groundTempModel = GetGroundTempModelAndInit(state, gtmType, gtmName); // Check for Errors @@ -272,7 +272,8 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: this->name = objName; // get inlet node num - std::string const inletNodeName = UtilityRoutines::makeUPPER(j["inlet_node_name"].get()); + std::string const inletNodeName = Util::makeUPPER(j["inlet_node_name"].get()); + this->inletNodeNum = NodeInputManager::GetOnlySingleNode(state, inletNodeName, errorsFound, @@ -284,7 +285,8 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: DataLoopNode::ObjectIsNotParent); // get outlet node num - std::string const outletNodeName = UtilityRoutines::makeUPPER(j["outlet_node_name"].get()); + std::string const outletNodeName = Util::makeUPPER(j["outlet_node_name"].get()); + this->outletNodeNum = NodeInputManager::GetOnlySingleNode(state, outletNodeName, errorsFound, @@ -307,7 +309,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: if (j.find("ghe_vertical_responsefactors_object_name") != j.end()) { // Response factors come from IDF object - this->myRespFactors = GetResponseFactor(state, UtilityRoutines::makeUPPER(j["ghe_vertical_responsefactors_object_name"].get())); + this->myRespFactors = GetResponseFactor(state, Util::makeUPPER(j["ghe_vertical_responsefactors_object_name"].get())); this->gFunctionsExist = true; } @@ -316,7 +318,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: // g-function calculation method if (j.find("g_function_calculation_method") != j.end()) { - std::string gFunctionMethodStr = UtilityRoutines::makeUPPER(j["g_function_calculation_method"].get()); + std::string gFunctionMethodStr = Util::makeUPPER(j["g_function_calculation_method"].get()); if (gFunctionMethodStr == "UHFCALC") { this->gFuncCalcMethod = GFuncCalcMethod::UniformHeatFlux; } else if (gFunctionMethodStr == "UBHWTCALC") { @@ -331,7 +333,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: if (j.find("ghe_vertical_array_object_name") != j.end()) { // Response factors come from array object this->myRespFactors = BuildAndGetResponseFactorObjectFromArray( - state, GetVertArray(state, UtilityRoutines::makeUPPER(j["ghe_vertical_array_object_name"].get()))); + state, GetVertArray(state, Util::makeUPPER(j["ghe_vertical_array_object_name"].get()))); } else { if (j.find("vertical_well_locations") == j.end()) { // No ResponseFactors, GHEArray, or SingleBH object are referenced @@ -347,7 +349,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: for (auto const &var : vars) { if (!var.at("ghe_vertical_single_object_name").empty()) { std::shared_ptr tempBHptr = - GetSingleBH(state, UtilityRoutines::makeUPPER(var.at("ghe_vertical_single_object_name").get())); + GetSingleBH(state, Util::makeUPPER(var.at("ghe_vertical_single_object_name").get())); tempVectOfBHObjects.push_back(tempBHptr); } else { break; @@ -411,8 +413,8 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: // Initialize ground temperature model and get pointer reference this->groundTempModel = GetGroundTempModelAndInit(state, - UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()), - UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_name"].get())); + Util::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()), + Util::makeUPPER(j["undisturbed_ground_temperature_model_name"].get())); // Check for Errors if (errorsFound) { @@ -432,7 +434,7 @@ GLHEVertSingle::GLHEVertSingle(EnergyPlusData &state, std::string const &objName } this->name = objName; - this->props = GetVertProps(state, UtilityRoutines::makeUPPER(j["ghe_vertical_properties_object_name"].get())); + this->props = GetVertProps(state, Util::makeUPPER(j["ghe_vertical_properties_object_name"].get())); this->xLoc = j["x_location"].get(); this->yLoc = j["y_location"].get(); this->dl_i = 0.0; @@ -452,7 +454,7 @@ GLHEVertArray::GLHEVertArray(EnergyPlusData &state, std::string const &objName, } this->name = objName; - this->props = GetVertProps(state, UtilityRoutines::makeUPPER(j["ghe_vertical_properties_object_name"].get())); + this->props = GetVertProps(state, Util::makeUPPER(j["ghe_vertical_properties_object_name"].get())); this->numBHinXDirection = j["number_of_boreholes_in_x_direction"].get(); this->numBHinYDirection = j["number_of_boreholes_in_y_direction"].get(); this->bhSpacing = j["borehole_spacing"].get(); @@ -471,7 +473,7 @@ GLHEResponseFactors::GLHEResponseFactors(EnergyPlusData &state, std::string cons } this->name = objName; - this->props = GetVertProps(state, UtilityRoutines::makeUPPER(j["ghe_vertical_properties_object_name"].get())); + this->props = GetVertProps(state, Util::makeUPPER(j["ghe_vertical_properties_object_name"].get())); this->numBoreholes = j["number_of_boreholes"].get(); this->gRefRatio = j["g_function_reference_ratio"].get(); this->maxSimYears = state.dataEnvrn->MaxNumberSimYears; @@ -2403,7 +2405,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); + std::string const &objNameUC = Util::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEVertProps(state, objNameUC, instance)); state.dataGroundHeatExchanger->vertPropsVector.push_back(thisObj); @@ -2423,7 +2425,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); + std::string const &objNameUC = Util::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEResponseFactors(state, objNameUC, instance)); state.dataGroundHeatExchanger->responseFactorsVector.push_back(thisObj); @@ -2443,7 +2445,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); + std::string const &objNameUC = Util::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEVertArray(state, objNameUC, instance)); state.dataGroundHeatExchanger->vertArraysVector.push_back(thisObj); @@ -2463,7 +2465,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); + std::string const &objNameUC = Util::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEVertSingle(state, objNameUC, instance)); state.dataGroundHeatExchanger->singleBoreholesVector.push_back(thisObj); @@ -2483,7 +2485,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); + std::string const &objNameUC = Util::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); state.dataGroundHeatExchanger->verticalGLHE.emplace_back(state, objNameUC, instance); } @@ -2503,7 +2505,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); + std::string const &objNameUC = Util::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); state.dataGroundHeatExchanger->slinkyGLHE.emplace_back(state, objNameUC, instance); } diff --git a/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc index 81e58677788..0fd074e70d5 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/FiniteDifferenceGroundTemperatureModel.cc @@ -175,7 +175,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) Real64 annualAveAirTemp_num; // Save current environment so we can revert back when done - int Envrn_reset = state.dataWeatherManager->Envrn; + int Envrn_reset = state.dataWeather->Envrn; Constant::KindOfSim KindOfSim_reset = state.dataGlobal->KindOfSim; int TimeStep_reset = state.dataGlobal->TimeStep; int HourOfDay_reset = state.dataGlobal->HourOfDay; @@ -191,7 +191,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) bool BeginHourFlag_reset = state.dataGlobal->BeginHourFlag; bool EndHourFlag_reset = state.dataGlobal->EndHourFlag; - if (!state.dataWeatherManager->WeatherFileExists) { + if (!state.dataWeather->WeatherFileExists) { ShowSevereError(state, "Site:GroundTemperature:Undisturbed:FiniteDifference -- using this model requires specification of a weather file."); ShowContinueError(state, "Either place in.epw in the working directory or specify a weather file on the command line using -w /path/to/weather.epw"); @@ -199,24 +199,24 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) } // We add a new period to force running all weather data - int originalNumOfEnvn = state.dataWeatherManager->NumOfEnvrn; - ++state.dataWeatherManager->NumOfEnvrn; - ++state.dataWeatherManager->TotRunPers; - state.dataWeatherManager->Environment.redimension(state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->RunPeriodInput.redimension(state.dataWeatherManager->TotRunPers); - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = Constant::KindOfSim::ReadAllWeatherData; - state.dataWeatherManager->RPReadAllWeatherData = true; + int originalNumOfEnvn = state.dataWeather->NumOfEnvrn; + ++state.dataWeather->NumOfEnvrn; + ++state.dataWeather->TotRunPers; + state.dataWeather->Environment.redimension(state.dataWeather->NumOfEnvrn); + state.dataWeather->RunPeriodInput.redimension(state.dataWeather->TotRunPers); + state.dataWeather->Environment(state.dataWeather->NumOfEnvrn).KindOfEnvrn = Constant::KindOfSim::ReadAllWeatherData; + state.dataWeather->RPReadAllWeatherData = true; state.dataGlobal->WeathSimReq = true; // RunPeriod is initialized to be one year of simulation // RunPeriodInput(TotRunPers).monWeekDay = 0; // Why do this? - WeatherManager::SetupEnvironmentTypes(state); + Weather::SetupEnvironmentTypes(state); // We reset the counter to the original number of run periods, so that GetNextEnvironment will fetch the one we added - state.dataWeatherManager->Envrn = originalNumOfEnvn; + state.dataWeather->Envrn = originalNumOfEnvn; Available = true; ErrorsFound = false; - WeatherManager::GetNextEnvironment(state, Available, ErrorsFound); + Weather::GetNextEnvironment(state, Available, ErrorsFound); if (ErrorsFound) { ShowFatalError(state, "Site:GroundTemperature:Undisturbed:FiniteDifference: error in reading weather file data"); } @@ -226,7 +226,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) ShowFatalError(state, "Site:GroundTemperature:Undisturbed:FiniteDifference: error in reading weather file data, bad KindOfSim."); } - weatherDataArray.dimension(state.dataWeatherManager->NumDaysInYear); + weatherDataArray.dimension(state.dataWeather->NumDaysInYear); state.dataGlobal->BeginEnvrnFlag = true; state.dataGlobal->EndEnvrnFlag = false; @@ -238,7 +238,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) annualAveAirTemp_num = 0.0; - while ((state.dataGlobal->DayOfSim < state.dataWeatherManager->NumDaysInYear) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ... + while ((state.dataGlobal->DayOfSim < state.dataWeather->NumDaysInYear) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ... ++state.dataGlobal->DayOfSim; @@ -281,7 +281,7 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) } } - WeatherManager::ManageWeather(state); + Weather::ManageWeather(state); outDryBulbTemp_num += state.dataEnvrn->OutDryBulbTemp; airDensity_num += state.dataEnvrn->OutAirDensity; @@ -322,16 +322,16 @@ void FiniteDiffGroundTempsModel::getWeatherData(EnergyPlusData &state) } // ... End day loop. - annualAveAirTemp = annualAveAirTemp_num / state.dataWeatherManager->NumDaysInYear; // Used for initalizing domain + annualAveAirTemp = annualAveAirTemp_num / state.dataWeather->NumDaysInYear; // Used for initalizing domain // Reset Envrionment when done reading data - --state.dataWeatherManager->NumOfEnvrn; // May need better way of eliminating the extra envrionment that was added to read the data - --state.dataWeatherManager->TotRunPers; + --state.dataWeather->NumOfEnvrn; // May need better way of eliminating the extra envrionment that was added to read the data + --state.dataWeather->TotRunPers; state.dataGlobal->KindOfSim = KindOfSim_reset; - state.dataWeatherManager->RPReadAllWeatherData = false; - state.dataWeatherManager->Environment.redimension(state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->RunPeriodInput.redimension(state.dataWeatherManager->TotRunPers); - state.dataWeatherManager->Envrn = Envrn_reset; + state.dataWeather->RPReadAllWeatherData = false; + state.dataWeather->Environment.redimension(state.dataWeather->NumOfEnvrn); + state.dataWeather->RunPeriodInput.redimension(state.dataWeather->TotRunPers); + state.dataWeather->Envrn = Envrn_reset; state.dataGlobal->TimeStep = TimeStep_reset; state.dataGlobal->HourOfDay = HourOfDay_reset; state.dataGlobal->BeginEnvrnFlag = BeginEnvrnFlag_reset; @@ -450,7 +450,7 @@ void FiniteDiffGroundTempsModel::performSimulation(EnergyPlusData &state) do { // loop over all days - for (state.dataGlobal->FDsimDay = 1; state.dataGlobal->FDsimDay <= state.dataWeatherManager->NumDaysInYear; ++state.dataGlobal->FDsimDay) { + for (state.dataGlobal->FDsimDay = 1; state.dataGlobal->FDsimDay <= state.dataWeather->NumDaysInYear; ++state.dataGlobal->FDsimDay) { bool iterationConverged = false; @@ -823,7 +823,7 @@ void FiniteDiffGroundTempsModel::initDomain(EnergyPlusData &state) evaluateSoilRhoCp(_, true); // Initialize the groundTemps array - groundTemps.dimension({1, state.dataWeatherManager->NumDaysInYear}, {1, totalNumCells}, 0.0); + groundTemps.dimension({1, state.dataWeather->NumDaysInYear}, {1, totalNumCells}, 0.0); tempModel.reset(); } @@ -937,10 +937,10 @@ Real64 FiniteDiffGroundTempsModel::getGroundTemp(EnergyPlusData &state) // All depths within domain j1 = j0 + 1; - if (simTimeInDays <= 1 || simTimeInDays >= state.dataWeatherManager->NumDaysInYear) { + if (simTimeInDays <= 1 || simTimeInDays >= state.dataWeather->NumDaysInYear) { // First day of year, last day of year, and leap day // Interpolate between first and last day - i0 = state.dataWeatherManager->NumDaysInYear; + i0 = state.dataWeather->NumDaysInYear; i1 = 1; // Lookup ground temps @@ -980,10 +980,10 @@ Real64 FiniteDiffGroundTempsModel::getGroundTemp(EnergyPlusData &state) j0 = totalNumCells; j1 = j0; - if (simTimeInDays <= 1 || simTimeInDays >= state.dataWeatherManager->NumDaysInYear) { + if (simTimeInDays <= 1 || simTimeInDays >= state.dataWeather->NumDaysInYear) { // First day of year, last day of year, and leap day // Interpolate between first and last day - i0 = state.dataWeatherManager->NumDaysInYear; + i0 = state.dataWeather->NumDaysInYear; i1 = 1; // Lookup ground temps @@ -1025,8 +1025,8 @@ Real64 FiniteDiffGroundTempsModel::getGroundTempAtTimeInSeconds(EnergyPlusData & simTimeInDays = seconds / Constant::SecsInDay; - if (simTimeInDays > state.dataWeatherManager->NumDaysInYear) { - simTimeInDays = remainder(simTimeInDays, state.dataWeatherManager->NumDaysInYear); + if (simTimeInDays > state.dataWeather->NumDaysInYear) { + simTimeInDays = remainder(simTimeInDays, state.dataWeather->NumDaysInYear); } return getGroundTemp(state); @@ -1044,15 +1044,15 @@ Real64 FiniteDiffGroundTempsModel::getGroundTempAtTimeInMonths(EnergyPlusData &s // Returns ground temperature when input time is in months // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 const aveDaysInMonth = state.dataWeatherManager->NumDaysInYear / 12; + Real64 const aveDaysInMonth = state.dataWeather->NumDaysInYear / 12; depth = _depth; // Convert months to days. Puts time in middle of specified month simTimeInDays = aveDaysInMonth * ((month - 1) + 0.5); - if (simTimeInDays > state.dataWeatherManager->NumDaysInYear) { - simTimeInDays = remainder(simTimeInDays, state.dataWeatherManager->NumDaysInYear); + if (simTimeInDays > state.dataWeather->NumDaysInYear) { + simTimeInDays = remainder(simTimeInDays, state.dataWeather->NumDaysInYear); } // Get and return ground temperature diff --git a/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc b/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc index 2d349746751..795254c01e6 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc @@ -96,8 +96,7 @@ namespace GroundTemperatureManager { // Called by objects requiring ground temperature models. Determines type and calls appropriate factory method. // Set object type - GroundTempObjType objectType = - static_cast(getEnumValue(groundTempModelNamesUC, UtilityRoutines::makeUPPER(objectType_str))); + GroundTempObjType objectType = static_cast(getEnumValue(groundTempModelNamesUC, Util::makeUPPER(objectType_str))); assert(objectType != GroundTempObjType::Invalid); diff --git a/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc index 197dc949181..8dc4986227e 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.cc @@ -185,7 +185,7 @@ Real64 KusudaGroundTempsModel::getGroundTemp(EnergyPlusData &state) // METHODOLOGY EMPLOYED: // Kusuda and Achenbach correlation is used - Real64 const secsInYear = Constant::SecsInDay * state.dataWeatherManager->NumDaysInYear; + Real64 const secsInYear = Constant::SecsInDay * state.dataWeather->NumDaysInYear; Real64 term1 = -depth * std::sqrt(Constant::Pi / (secsInYear * groundThermalDiffisivity)); Real64 term2 = (2 * Constant::Pi / secsInYear) * @@ -206,7 +206,7 @@ Real64 KusudaGroundTempsModel::getGroundTempAtTimeInSeconds(EnergyPlusData &stat // Returns the ground temperature when input time is in seconds // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 const secondsInYear = state.dataWeatherManager->NumDaysInYear * Constant::SecsInDay; + Real64 const secondsInYear = state.dataWeather->NumDaysInYear * Constant::SecsInDay; depth = _depth; @@ -232,8 +232,8 @@ Real64 KusudaGroundTempsModel::getGroundTempAtTimeInMonths(EnergyPlusData &state // Returns the ground temperature when input time is in months // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 const aveSecondsInMonth = (state.dataWeatherManager->NumDaysInYear / 12) * Constant::SecsInDay; - Real64 const secondsPerYear = state.dataWeatherManager->NumDaysInYear * Constant::SecsInDay; + Real64 const aveSecondsInMonth = (state.dataWeather->NumDaysInYear / 12) * Constant::SecsInDay; + Real64 const secondsPerYear = state.dataWeather->NumDaysInYear * Constant::SecsInDay; depth = _depth; diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc index dbb7bb346ef..f11aa458cbd 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.cc @@ -171,7 +171,7 @@ SiteBuildingSurfaceGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusData &sta // USE STATEMENTS: // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * Constant::SecsInDay / 12; + Real64 secPerMonth = state.dataWeather->NumDaysInYear * Constant::SecsInDay / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc index a0244844e33..0b789c4f120 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.cc @@ -160,7 +160,7 @@ Real64 SiteDeepGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusData &state, // Returns the ground temperature when input time is in seconds // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * Constant::SecsInDay / 12; + Real64 secPerMonth = state.dataWeather->NumDaysInYear * Constant::SecsInDay / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc index b14dd5d4a7d..6c06b546b09 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.cc @@ -118,10 +118,10 @@ std::shared_ptr SiteFCFactorMethodGroundTemps::FC GroundTemperatureManager::groundTempModelNames[static_cast(objType)])); errorsFound = true; - } else if (state.dataWeatherManager->wthFCGroundTemps) { + } else if (state.dataWeather->wthFCGroundTemps) { for (int i = 1; i <= 12; ++i) { - thisModel->fcFactorGroundTemps(i) = state.dataWeatherManager->GroundTempsFCFromEPWHeader(i); + thisModel->fcFactorGroundTemps(i) = state.dataWeather->GroundTempsFCFromEPWHeader(i); } state.dataEnvrn->FCGroundTemps = true; @@ -174,7 +174,7 @@ Real64 SiteFCFactorMethodGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusDat // Returns the ground temperature when input time is in seconds // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * Constant::SecsInDay / 12; + Real64 secPerMonth = state.dataWeather->NumDaysInYear * Constant::SecsInDay / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc b/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc index a28106bbb77..e0629f61588 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.cc @@ -160,7 +160,7 @@ Real64 SiteShallowGroundTemps::getGroundTempAtTimeInSeconds(EnergyPlusData &stat // USE STATEMENTS: // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 secPerMonth = state.dataWeatherManager->NumDaysInYear * Constant::SecsInDay / 12; + Real64 secPerMonth = state.dataWeather->NumDaysInYear * Constant::SecsInDay / 12; // Convert secs to months int month = ceil(_seconds / secPerMonth); diff --git a/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc b/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc index a4ebb71ee6f..866475f9001 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.cc @@ -134,7 +134,7 @@ Real64 XingGroundTempsModel::getGroundTemp(EnergyPlusData &state) // Returns the ground temperature for the Site:GroundTemperature:Undisturbed:Xing // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 tp = state.dataWeatherManager->NumDaysInYear; // Period of soil temperature cycle + Real64 tp = state.dataWeather->NumDaysInYear; // Period of soil temperature cycle // Inits Real64 Ts_1 = surfTempAmplitude_1; // Amplitude of surface temperature @@ -169,7 +169,7 @@ Real64 XingGroundTempsModel::getGroundTempAtTimeInMonths(EnergyPlusData &state, // Returns ground temperature when input time is in months // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 const aveDaysInMonth = state.dataWeatherManager->NumDaysInYear / 12; + Real64 const aveDaysInMonth = state.dataWeather->NumDaysInYear / 12; depth = _depth; @@ -200,8 +200,8 @@ Real64 XingGroundTempsModel::getGroundTempAtTimeInSeconds(EnergyPlusData &state, simTimeInDays = seconds / Constant::SecsInDay; - if (simTimeInDays > state.dataWeatherManager->NumDaysInYear) { - simTimeInDays = remainder(simTimeInDays, state.dataWeatherManager->NumDaysInYear); + if (simTimeInDays > state.dataWeather->NumDaysInYear) { + simTimeInDays = remainder(simTimeInDays, state.dataWeather->NumDaysInYear); } return getGroundTemp(state); diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index 299e64cb6a1..788b20c7286 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -228,8 +228,7 @@ void ManageControllers(EnergyPlusData &state, } if (ControllerIndex == 0) { - ControlNum = - UtilityRoutines::FindItemInList(ControllerName, state.dataHVACControllers->ControllerProps, &ControllerPropsType::ControllerName); + ControlNum = Util::FindItemInList(ControllerName, state.dataHVACControllers->ControllerProps, &ControllerPropsType::ControllerName); if (ControlNum == 0) { ShowFatalError( state, @@ -2541,8 +2540,7 @@ void CheckControllerListOrder(EnergyPlusData &state) // first see how many are water coil controllers int WaterCoilContrlCount = 0; // init for (int ContrlNum = 1; ContrlNum <= state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).NumControllers; ++ContrlNum) { - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).ControllerType(ContrlNum), - "CONTROLLER:WATERCOIL")) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).ControllerType(ContrlNum), "CONTROLLER:WATERCOIL")) { ++WaterCoilContrlCount; } } @@ -2552,13 +2550,11 @@ void CheckControllerListOrder(EnergyPlusData &state) ContrlSensedNodeNums = 0; int SensedNodeIndex = 0; for (int ContrlNum = 1; ContrlNum <= state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).NumControllers; ++ContrlNum) { - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).ControllerType(ContrlNum), - "CONTROLLER:WATERCOIL")) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).ControllerType(ContrlNum), "CONTROLLER:WATERCOIL")) { ++SensedNodeIndex; - int foundControl = - UtilityRoutines::FindItemInList(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).ControllerName(ContrlNum), - state.dataHVACControllers->ControllerProps, - &ControllerPropsType::ControllerName); + int foundControl = Util::FindItemInList(state.dataAirSystemsData->PrimaryAirSystems(AirSysNum).ControllerName(ContrlNum), + state.dataHVACControllers->ControllerProps, + &ControllerPropsType::ControllerName); if (foundControl > 0) { ContrlSensedNodeNums(1, SensedNodeIndex) = state.dataHVACControllers->ControllerProps(foundControl).SensedNode; } @@ -2695,8 +2691,7 @@ void GetControllerActuatorNodeNum(EnergyPlusData &state, } NodeNotFound = true; - int ControlNum = - UtilityRoutines::FindItemInList(ControllerName, state.dataHVACControllers->ControllerProps, &ControllerPropsType::ControllerName); + int ControlNum = Util::FindItemInList(ControllerName, state.dataHVACControllers->ControllerProps, &ControllerPropsType::ControllerName); if (ControlNum > 0 && ControlNum <= state.dataHVACControllers->NumControllers) { WaterInletNodeNum = state.dataHVACControllers->ControllerProps(ControlNum).ActuatedNode; NodeNotFound = false; @@ -2718,8 +2713,7 @@ int GetControllerIndex(EnergyPlusData &state, std::string const &ControllerName state.dataHVACControllers->GetControllerInputFlag = false; } - int ControllerIndex = - UtilityRoutines::FindItemInList(ControllerName, state.dataHVACControllers->ControllerProps, &ControllerPropsType::ControllerName); + int ControllerIndex = Util::FindItemInList(ControllerName, state.dataHVACControllers->ControllerProps, &ControllerPropsType::ControllerName); if (ControllerIndex == 0) { ShowFatalError(state, format("ManageControllers: Invalid controller={}. The only valid controller type for an AirLoopHVAC is Controller:WaterCoil.", diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index 423ae734ff1..5d8f2d693b8 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -141,7 +141,7 @@ namespace HVACCooledBeam { // Get the unit index if (CompIndex == 0) { - CBNum = UtilityRoutines::FindItemInList(CompName, state.dataHVACCooledBeam->CoolBeam); + CBNum = Util::FindItemInList(CompName, state.dataHVACCooledBeam->CoolBeam); if (CBNum == 0) { ShowFatalError(state, format("SimCoolBeam: Cool Beam Unit not found={}", CompName)); } @@ -272,9 +272,9 @@ namespace HVACCooledBeam { CoolBeam(CBNum).UnitType = CurrentModuleObject; CoolBeam(CBNum).UnitType_Num = 1; CoolBeam(CBNum).CBTypeString = Alphas(3); - if (UtilityRoutines::SameString(CoolBeam(CBNum).CBTypeString, "Passive")) { + if (Util::SameString(CoolBeam(CBNum).CBTypeString, "Passive")) { CoolBeam(CBNum).CBType = CooledBeamType::Passive; - } else if (UtilityRoutines::SameString(CoolBeam(CBNum).CBTypeString, "Active")) { + } else if (Util::SameString(CoolBeam(CBNum).CBTypeString, "Active")) { CoolBeam(CBNum).CBType = CooledBeamType::Active; } else { ShowSevereError(state, format("Illegal {} = {}.", cAlphaFields(3), CoolBeam(CBNum).CBTypeString)); diff --git a/src/EnergyPlus/HVACDXHeatPumpSystem.cc b/src/EnergyPlus/HVACDXHeatPumpSystem.cc index bf19e276006..a82518d383a 100644 --- a/src/EnergyPlus/HVACDXHeatPumpSystem.cc +++ b/src/EnergyPlus/HVACDXHeatPumpSystem.cc @@ -142,7 +142,7 @@ namespace HVACDXHeatPumpSystem { // Find the correct DXSystemNumber if (CompIndex == 0) { - DXSystemNum = UtilityRoutines::FindItemInList(DXHeatPumpSystemName, DXHeatPumpSystem); + DXSystemNum = Util::FindItemInList(DXHeatPumpSystemName, DXHeatPumpSystem); if (DXSystemNum == 0) { ShowFatalError(state, format("SimDXHeatPumpSystem: DXUnit not found={}", DXHeatPumpSystemName)); } @@ -327,13 +327,13 @@ namespace HVACDXHeatPumpSystem { } } - if (UtilityRoutines::SameString(Alphas(3), "Coil:Heating:DX:SingleSpeed")) { + if (Util::SameString(Alphas(3), "Coil:Heating:DX:SingleSpeed")) { DXHeatPumpSystem(DXHeatSysNum).HeatPumpCoilType = Alphas(3); DXHeatPumpSystem(DXHeatSysNum).HeatPumpCoilType_Num = CoilDX_HeatingEmpirical; DXHeatPumpSystem(DXHeatSysNum).HeatPumpCoilName = Alphas(4); - } else if (UtilityRoutines::SameString(Alphas(3), "Coil:Heating:DX:VariableSpeed")) { + } else if (Util::SameString(Alphas(3), "Coil:Heating:DX:VariableSpeed")) { DXHeatPumpSystem(DXHeatSysNum).HeatPumpCoilType = Alphas(3); DXHeatPumpSystem(DXHeatSysNum).HeatPumpCoilType_Num = Coil_HeatingAirToAirVariableSpeed; @@ -1146,7 +1146,7 @@ namespace HVACDXHeatPumpSystem { int NodeNum = 0; if (state.dataHVACDXHeatPumpSys->NumDXHeatPumpSystems > 0) { - int DXHeatSysNum = UtilityRoutines::FindItemInList(DXHeatCoilSysName, state.dataHVACDXHeatPumpSys->DXHeatPumpSystem); + int DXHeatSysNum = Util::FindItemInList(DXHeatCoilSysName, state.dataHVACDXHeatPumpSys->DXHeatPumpSystem); if (DXHeatSysNum > 0 && DXHeatSysNum <= state.dataHVACDXHeatPumpSys->NumDXHeatPumpSystems) { NodeNum = state.dataHVACDXHeatPumpSys->DXHeatPumpSystem(DXHeatSysNum).DXHeatPumpCoilInletNodeNum; } @@ -1171,7 +1171,7 @@ namespace HVACDXHeatPumpSystem { int NodeNum = 0; if (state.dataHVACDXHeatPumpSys->NumDXHeatPumpSystems > 0) { - int DXHeatSysNum = UtilityRoutines::FindItemInList(DXHeatCoilSysName, state.dataHVACDXHeatPumpSys->DXHeatPumpSystem); + int DXHeatSysNum = Util::FindItemInList(DXHeatCoilSysName, state.dataHVACDXHeatPumpSys->DXHeatPumpSystem); if (DXHeatSysNum > 0 && DXHeatSysNum <= state.dataHVACDXHeatPumpSys->NumDXHeatPumpSystems) { NodeNum = state.dataHVACDXHeatPumpSys->DXHeatPumpSystem(DXHeatSysNum).DXHeatPumpCoilOutletNodeNum; } diff --git a/src/EnergyPlus/HVACDuct.cc b/src/EnergyPlus/HVACDuct.cc index 9b0551e8c7d..d448f8d3cd2 100644 --- a/src/EnergyPlus/HVACDuct.cc +++ b/src/EnergyPlus/HVACDuct.cc @@ -135,7 +135,7 @@ namespace HVACDuct { // Get the duct component index if (CompIndex == 0) { - DuctNum = UtilityRoutines::FindItemInList(CompName, state.dataHVACDuct->Duct); + DuctNum = Util::FindItemInList(CompName, state.dataHVACDuct->Duct); if (DuctNum == 0) { ShowFatalError(state, format("SimDuct: Component not found={}", CompName)); } diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index 575614dbdbb..8d934d8e3c8 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -459,9 +459,9 @@ namespace HVACFan { if (isAlphaFieldBlank(5)) { speedControl = SpeedControlMethod::Discrete; - } else if (UtilityRoutines::SameString(alphaArgs(5), "Continuous")) { + } else if (Util::SameString(alphaArgs(5), "Continuous")) { speedControl = SpeedControlMethod::Continuous; - } else if (UtilityRoutines::SameString(alphaArgs(5), "Discrete")) { + } else if (Util::SameString(alphaArgs(5), "Discrete")) { speedControl = SpeedControlMethod::Discrete; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid entry.", routineName, locCurrentModuleObject, alphaArgs(1))); @@ -484,11 +484,11 @@ namespace HVACFan { if (m_designElecPowerWasAutosized) { if (isAlphaFieldBlank(6)) { m_powerSizingMethod = PowerSizingMethod::PowerPerFlowPerPressure; - } else if (UtilityRoutines::SameString(alphaArgs(6), "PowerPerFlow")) { + } else if (Util::SameString(alphaArgs(6), "PowerPerFlow")) { m_powerSizingMethod = PowerSizingMethod::PowerPerFlow; - } else if (UtilityRoutines::SameString(alphaArgs(6), "PowerPerFlowPerPressure")) { + } else if (Util::SameString(alphaArgs(6), "PowerPerFlowPerPressure")) { m_powerSizingMethod = PowerSizingMethod::PowerPerFlowPerPressure; - } else if (UtilityRoutines::SameString(alphaArgs(6), "TotalEfficiencyAndPressure")) { + } else if (Util::SameString(alphaArgs(6), "TotalEfficiencyAndPressure")) { m_powerSizingMethod = PowerSizingMethod::TotalEfficiencyAndPressure; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid entry.", routineName, locCurrentModuleObject, alphaArgs(1))); @@ -518,7 +518,7 @@ namespace HVACFan { } m_nightVentPressureDelta = numericArgs(10); m_nightVentFlowFraction = numericArgs(11); // not used - m_zoneNum = UtilityRoutines::FindItemInList(alphaArgs(8), state.dataHeatBal->Zone); + m_zoneNum = Util::FindItemInList(alphaArgs(8), state.dataHeatBal->Zone); if (m_zoneNum > 0) m_heatLossesDestination = ThermalLossDestination::ZoneGains; if (m_zoneNum == 0) { if (isAlphaFieldBlank(8)) { diff --git a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc index adfe1d1f59a..1f75e0cf4ef 100644 --- a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc +++ b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc @@ -132,7 +132,7 @@ namespace HVACHXAssistedCoolingCoil { // Find the correct HXAssistedCoolingCoil number if (CompIndex == 0) { - HXAssistedCoilNum = UtilityRoutines::FindItemInList(HXAssistedCoilName, state.dataHVACAssistedCC->HXAssistedCoil); + HXAssistedCoilNum = Util::FindItemInList(HXAssistedCoilName, state.dataHVACAssistedCC->HXAssistedCoil); if (HXAssistedCoilNum == 0) { ShowFatalError(state, format("HX Assisted Coil not found={}", HXAssistedCoilName)); } @@ -305,11 +305,11 @@ namespace HVACHXAssistedCoolingCoil { thisHXCoil.HeatExchangerType = AlphArray(2); thisHXCoil.HeatExchangerName = AlphArray(3); - if (UtilityRoutines::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:SensibleAndLatent")) { + if (Util::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:SensibleAndLatent")) { thisHXCoil.HeatExchangerType_Num = DataHVACGlobals::HX_AIRTOAIR_GENERIC; - } else if (UtilityRoutines::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:FlatPlate")) { + } else if (Util::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:FlatPlate")) { thisHXCoil.HeatExchangerType_Num = DataHVACGlobals::HX_AIRTOAIR_FLATPLATE; - } else if (UtilityRoutines::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:Desiccant:BalancedFlow")) { + } else if (Util::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:Desiccant:BalancedFlow")) { thisHXCoil.HeatExchangerType_Num = DataHVACGlobals::HX_DESICCANT_BALANCED; } else { ShowWarningError(state, format("{}{}=\"{}\"", RoutineName, CurrentModuleObject, thisHXCoil.Name)); @@ -320,7 +320,7 @@ namespace HVACHXAssistedCoolingCoil { thisHXCoil.CoolingCoilType = AlphArray(4); thisHXCoil.CoolingCoilName = AlphArray(5); - if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX")) { + if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX")) { thisHXCoil.CoolingCoilType_Num = DataHVACGlobals::CoilDX_Cooling; thisHXCoil.HXAssistedCoilType = CurrentModuleObject; thisHXCoil.HXAssistedCoilType_Num = DataHVACGlobals::CoilDX_CoolingHXAssisted; @@ -342,7 +342,7 @@ namespace HVACHXAssistedCoolingCoil { ShowContinueError(state, format("...occurs in {}=\"{}\"", CurrentModuleObject, thisHXCoil.Name)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:SingleSpeed")) { + } else if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:SingleSpeed")) { thisHXCoil.CoolingCoilType_Num = DataHVACGlobals::CoilDX_CoolingSingleSpeed; thisHXCoil.HXAssistedCoilType = CurrentModuleObject; thisHXCoil.HXAssistedCoilType_Num = DataHVACGlobals::CoilDX_CoolingHXAssisted; @@ -353,7 +353,7 @@ namespace HVACHXAssistedCoolingCoil { ShowContinueError(state, format("...occurs in {}=\"{}\"", CurrentModuleObject, thisHXCoil.Name)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { + } else if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { thisHXCoil.CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed; thisHXCoil.HXAssistedCoilType = CurrentModuleObject; thisHXCoil.HXAssistedCoilType_Num = DataHVACGlobals::CoilDX_CoolingHXAssisted; @@ -399,7 +399,7 @@ namespace HVACHXAssistedCoolingCoil { ShowContinueError(state, format("...Occurs in {}=\"{}\"", CurrentModuleObject, thisHXCoil.Name)); } - if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX")) { + if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX")) { CoolingCoilInletNodeNum = state.dataCoilCooingDX->coilCoolingDXs[thisHXCoil.CoolingCoilIndex].evapInletNodeIndex; if (SupplyAirOutletNode != CoolingCoilInletNodeNum) { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, CurrentModuleObject, thisHXCoil.Name)); @@ -436,7 +436,7 @@ namespace HVACHXAssistedCoolingCoil { ErrorsFound = true; } - } else if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:SingleSpeed")) { + } else if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:SingleSpeed")) { // Check node names in heat exchanger and coil objects for consistency CoolingCoilErrFlag = false; CoolingCoilInletNodeNum = @@ -483,7 +483,7 @@ namespace HVACHXAssistedCoolingCoil { ErrorsFound = true; } - } else if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { + } else if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:DX:VariableSpeed")) { // Check node names in heat exchanger and coil objects for consistency CoolingCoilErrFlag = false; CoolingCoilInletNodeNum = VariableSpeedCoils::GetCoilInletNodeVariableSpeed( @@ -636,12 +636,12 @@ namespace HVACHXAssistedCoolingCoil { thisHXCoil.HeatExchangerType = AlphArray(2); thisHXCoil.HeatExchangerName = AlphArray(3); - if (UtilityRoutines::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:SensibleAndLatent")) { + if (Util::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:SensibleAndLatent")) { thisHXCoil.HeatExchangerType_Num = DataHVACGlobals::HX_AIRTOAIR_GENERIC; - } else if (UtilityRoutines::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:FlatPlate")) { + } else if (Util::SameString(thisHXCoil.HeatExchangerType, "HeatExchanger:AirToAir:FlatPlate")) { thisHXCoil.HeatExchangerType_Num = DataHVACGlobals::HX_AIRTOAIR_FLATPLATE; // balanced desiccant HX not allowed with water coils at this time - // ELSEIF(UtilityRoutines::SameString(HXAssistedCoil(HXAssistedCoilNum)%HeatExchangerType,'HeatExchanger:Desiccant:BalancedFlow')) + // ELSEIF(Util::SameString(HXAssistedCoil(HXAssistedCoilNum)%HeatExchangerType,'HeatExchanger:Desiccant:BalancedFlow')) // THEN // HXAssistedCoil(HXAssistedCoilNum)%HeatExchangerType_Num = HX_DESICCANT_BALANCED } else { @@ -677,11 +677,11 @@ namespace HVACHXAssistedCoolingCoil { ShowContinueError(state, format("...Occurs in {}=\"{}\"", CurrentModuleObject, thisHXCoil.Name)); } - if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water") || - UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water:DetailedGeometry")) { - if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water:DetailedGeometry")) { + if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water") || + Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water:DetailedGeometry")) { + if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water:DetailedGeometry")) { thisHXCoil.CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWaterDetailed; - } else if (UtilityRoutines::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water")) { + } else if (Util::SameString(thisHXCoil.CoolingCoilType, "Coil:Cooling:Water")) { thisHXCoil.CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWater; } @@ -1076,7 +1076,7 @@ namespace HVACHXAssistedCoolingCoil { } if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - HXDXCoilIndex = UtilityRoutines::FindItem(HXDXCoilName, state.dataHVACAssistedCC->HXAssistedCoil); + HXDXCoilIndex = Util::FindItem(HXDXCoilName, state.dataHVACAssistedCC->HXAssistedCoil); } else { HXDXCoilIndex = 0; } @@ -1120,7 +1120,7 @@ namespace HVACHXAssistedCoolingCoil { // Find the correct Coil number if (CompIndex == 0) { if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - HXAssistedCoilNum = UtilityRoutines::FindItem(CompName, state.dataHVACAssistedCC->HXAssistedCoil); + HXAssistedCoilNum = Util::FindItem(CompName, state.dataHVACAssistedCC->HXAssistedCoil); } else { HXAssistedCoilNum = 0; } @@ -1183,10 +1183,10 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } - if (UtilityRoutines::SameString(CoilType, "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { + if (Util::SameString(CoilType, "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { if (WhichCoil != 0) { // coil does not have capacity in input so mine information from DX cooling coil @@ -1211,7 +1211,7 @@ namespace HVACHXAssistedCoolingCoil { state, "Requested DX Coil from CoilSystem:Cooling:DX:HeatExchangerAssisted not found", state.dataHVACAssistedCC->ErrCount); } } - } else if (UtilityRoutines::SameString(CoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + } else if (Util::SameString(CoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { if (WhichCoil != 0) { // coil does not have capacity in input so mine information from DX cooling coil CoilCapacity = WaterCoils::GetWaterCoilCapacity(state, @@ -1267,7 +1267,7 @@ namespace HVACHXAssistedCoolingCoil { } if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } else { WhichCoil = 0; } @@ -1311,7 +1311,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1351,7 +1351,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1392,7 +1392,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1449,7 +1449,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1487,7 +1487,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1525,7 +1525,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1563,7 +1563,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1602,7 +1602,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1640,7 +1640,7 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); } if (WhichCoil != 0) { @@ -1684,9 +1684,9 @@ namespace HVACHXAssistedCoolingCoil { if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - int WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + int WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); - if (UtilityRoutines::SameString(CoilType, "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { + if (Util::SameString(CoilType, "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { if (WhichCoil != 0) { // coil does not specify MaxWaterFlowRate MaxWaterFlowRate = 0.0; @@ -1694,7 +1694,7 @@ namespace HVACHXAssistedCoolingCoil { "Requested Max Water Flow Rate from CoilSystem:Cooling:DX:HeatExchangerAssisted N/A", state.dataHVACAssistedCC->ErrCount2); } - } else if (UtilityRoutines::SameString(CoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + } else if (Util::SameString(CoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { if (WhichCoil != 0) { MaxWaterFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, CoilType, GetHXDXCoilName(state, CoilType, CoilName, ErrorsFound), ErrorsFound); @@ -1746,10 +1746,10 @@ namespace HVACHXAssistedCoolingCoil { if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - int WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); + int WhichCoil = Util::FindItem(CoilName, state.dataHVACAssistedCC->HXAssistedCoil); - if (UtilityRoutines::SameString(CoilType, "CoilSystem:Cooling:DX:HeatExchangerAssisted") || - UtilityRoutines::SameString(CoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + if (Util::SameString(CoilType, "CoilSystem:Cooling:DX:HeatExchangerAssisted") || + Util::SameString(CoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { if (WhichCoil != 0) { MaxAirFlowRate = HeatRecovery::GetSupplyAirFlowRate(state, state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).HeatExchangerName, ErrorsFound); @@ -1795,11 +1795,11 @@ namespace HVACHXAssistedCoolingCoil { int WhichCoil = 0; if (state.dataHVACAssistedCC->TotalNumHXAssistedCoils > 0) { - WhichCoil = UtilityRoutines::FindItem(HXName, state.dataHVACAssistedCC->HXAssistedCoil, &HXAssistedCoilParameters::HeatExchangerName); + WhichCoil = Util::FindItem(HXName, state.dataHVACAssistedCC->HXAssistedCoil, &HXAssistedCoilParameters::HeatExchangerName); } if (WhichCoil != 0) { - if (UtilityRoutines::SameString(state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).HeatExchangerType, HXType)) { + if (Util::SameString(state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).HeatExchangerType, HXType)) { return true; } } diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index 2d8a47a3ac7..1c7307c5802 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -147,7 +147,7 @@ namespace HVACMultiSpeedHeatPump { } if (CompIndex == 0) { - MSHeatPumpNum = UtilityRoutines::FindItemInList(CompName, state.dataHVACMultiSpdHP->MSHeatPump); + MSHeatPumpNum = Util::FindItemInList(CompName, state.dataHVACMultiSpdHP->MSHeatPump); if (MSHeatPumpNum == 0) { ShowFatalError(state, format("MultiSpeed Heat Pump is not found={}", CompName)); } @@ -578,7 +578,7 @@ namespace HVACMultiSpeedHeatPump { BranchNodeConnections::TestCompSet(state, state.dataHVACMultiSpdHP->CurrentModuleObject, Alphas(1), Alphas(3), Alphas(4), "Air Nodes"); // Get the Controlling Zone or Location of the engine driven heat pump Thermostat - thisMSHP.ControlZoneNum = UtilityRoutines::FindItemInList(Alphas(5), state.dataHeatBal->Zone); + thisMSHP.ControlZoneNum = Util::FindItemInList(Alphas(5), state.dataHeatBal->Zone); thisMSHP.ControlZoneName = Alphas(5); if (thisMSHP.ControlZoneNum == 0) { ShowSevereError(state, @@ -605,10 +605,9 @@ namespace HVACMultiSpeedHeatPump { for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, - thisMSHP.Name) || - !UtilityRoutines::SameString( + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, + thisMSHP.Name) || + !Util::SameString( state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).TypeOf, state.dataHVACMultiSpdHP->CurrentModuleObject)) continue; @@ -676,8 +675,8 @@ namespace HVACMultiSpeedHeatPump { } // Get supply fan placement data - if (UtilityRoutines::SameString(Alphas(8), "BlowThrough") || UtilityRoutines::SameString(Alphas(8), "DrawThrough")) { - if (UtilityRoutines::SameString(Alphas(8), "BlowThrough")) { + if (Util::SameString(Alphas(8), "BlowThrough") || Util::SameString(Alphas(8), "DrawThrough")) { + if (Util::SameString(Alphas(8), "BlowThrough")) { thisMSHP.FanPlaceType = DataHVACGlobals::BlowThru; } else { thisMSHP.FanPlaceType = DataHVACGlobals::DrawThru; @@ -715,7 +714,7 @@ namespace HVACMultiSpeedHeatPump { } } - if (UtilityRoutines::SameString(Alphas(10), "Coil:Heating:DX:MultiSpeed")) { + if (Util::SameString(Alphas(10), "Coil:Heating:DX:MultiSpeed")) { thisMSHP.HeatCoilType = MultiSpeedHeatingCoil; thisMSHP.HeatCoilNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Coil:Heating:DX:MultiSpeed", Alphas(11)); thisMSHP.DXHeatCoilName = Alphas(11); @@ -764,10 +763,10 @@ namespace HVACMultiSpeedHeatPump { thisMSHP.DXHeatCoilName, "UNDEFINED", "UNDEFINED"); - } else if (UtilityRoutines::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage") || - UtilityRoutines::SameString(Alphas(10), "Coil:Heating:Gas:MultiStage")) { + } else if (Util::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage") || + Util::SameString(Alphas(10), "Coil:Heating:Gas:MultiStage")) { - if (UtilityRoutines::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage")) { + if (Util::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage")) { thisMSHP.HeatCoilType = DataHVACGlobals::Coil_HeatingElectric_MultiStage; thisMSHP.HeatCoilNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Coil:Heating:Electric:MultiStage", Alphas(11)); @@ -798,7 +797,7 @@ namespace HVACMultiSpeedHeatPump { } thisMSHP.HeatCoilName = Alphas(11); LocalError = false; - if (UtilityRoutines::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage")) { + if (Util::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage")) { HeatingCoils::GetCoilIndex(state, thisMSHP.HeatCoilName, thisMSHP.HeatCoilIndex, LocalError); } else { HeatingCoils::GetCoilIndex(state, thisMSHP.HeatCoilName, thisMSHP.HeatCoilIndex, LocalError); @@ -823,7 +822,7 @@ namespace HVACMultiSpeedHeatPump { ErrorsFound = true; LocalError = false; } - if (UtilityRoutines::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage")) { + if (Util::SameString(Alphas(10), "Coil:Heating:Electric:MultiStage")) { BranchNodeConnections::SetUpCompSets(state, state.dataHVACMultiSpdHP->CurrentModuleObject, thisMSHP.Name, @@ -840,7 +839,7 @@ namespace HVACMultiSpeedHeatPump { "UNDEFINED", "UNDEFINED"); } - } else if (UtilityRoutines::SameString(Alphas(10), "Coil:Heating:Water")) { + } else if (Util::SameString(Alphas(10), "Coil:Heating:Water")) { thisMSHP.HeatCoilType = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, Alphas(10), Alphas(11), IsNotOK, state.dataHVACMultiSpdHP->CurrentModuleObject); if (IsNotOK) { @@ -889,7 +888,7 @@ namespace HVACMultiSpeedHeatPump { state.dataLoopNodes->NodeID(HeatingCoilInletNode), state.dataLoopNodes->NodeID(HeatingCoilOutletNode)); } - } else if (UtilityRoutines::SameString(Alphas(10), "Coil:Heating:Steam")) { + } else if (Util::SameString(Alphas(10), "Coil:Heating:Steam")) { thisMSHP.HeatCoilType = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, Alphas(10), Alphas(11), IsNotOK, state.dataHVACMultiSpdHP->CurrentModuleObject); if (IsNotOK) { @@ -963,7 +962,7 @@ namespace HVACMultiSpeedHeatPump { // thisMSHP.MinOATCompressor = Numbers(1); // deprecated, now uses coil MinOAT inputs - if (UtilityRoutines::SameString(Alphas(12), "Coil:Cooling:DX:MultiSpeed")) { + if (Util::SameString(Alphas(12), "Coil:Cooling:DX:MultiSpeed")) { thisMSHP.CoolCoilType = MultiSpeedCoolingCoil; thisMSHP.DXCoolCoilName = Alphas(13); if (state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Coil:Cooling:DX:MultiSpeed", Alphas(13)) <= 0) { @@ -1023,7 +1022,7 @@ namespace HVACMultiSpeedHeatPump { // Get supplemental heating coil data thisMSHP.SuppHeatCoilName = Alphas(15); - if (UtilityRoutines::SameString(Alphas(14), "Coil:Heating:Fuel")) { + if (Util::SameString(Alphas(14), "Coil:Heating:Fuel")) { thisMSHP.SuppHeatCoilType = SuppHeatingCoilGas; errFlag = false; thisMSHP.SuppHeatCoilNum = HeatingCoils::GetHeatingCoilIndex(state, "Coil:Heating:Fuel", Alphas(15), errFlag); @@ -1066,7 +1065,7 @@ namespace HVACMultiSpeedHeatPump { "UNDEFINED", "UNDEFINED"); } - if (UtilityRoutines::SameString(Alphas(14), "Coil:Heating:Electric")) { + if (Util::SameString(Alphas(14), "Coil:Heating:Electric")) { thisMSHP.SuppHeatCoilType = SuppHeatingCoilElec; errFlag = false; thisMSHP.SuppHeatCoilNum = HeatingCoils::GetHeatingCoilIndex(state, "Coil:Heating:Electric", Alphas(15), errFlag); @@ -1111,7 +1110,7 @@ namespace HVACMultiSpeedHeatPump { "UNDEFINED"); } - if (UtilityRoutines::SameString(Alphas(14), "Coil:Heating:Water")) { + if (Util::SameString(Alphas(14), "Coil:Heating:Water")) { thisMSHP.SuppHeatCoilType = DataHVACGlobals::Coil_HeatingWater; ValidateComponent(state, Alphas(14), thisMSHP.SuppHeatCoilName, IsNotOK, state.dataHVACMultiSpdHP->CurrentModuleObject); if (IsNotOK) { @@ -1162,7 +1161,7 @@ namespace HVACMultiSpeedHeatPump { state.dataLoopNodes->NodeID(SuppHeatCoilOutletNode)); } } - if (UtilityRoutines::SameString(Alphas(14), "Coil:Heating:Steam")) { + if (Util::SameString(Alphas(14), "Coil:Heating:Steam")) { thisMSHP.SuppHeatCoilType = DataHVACGlobals::Coil_HeatingSteam; ValidateComponent(state, Alphas(14), thisMSHP.SuppHeatCoilName, IsNotOK, state.dataHVACMultiSpdHP->CurrentModuleObject); if (IsNotOK) { diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index 21df7847730..76bc507f1e6 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -124,7 +124,7 @@ namespace HVACSingleDuctInduc { // Get the induction unit index if (CompIndex == 0) { - IUNum = UtilityRoutines::FindItemInList(CompName, state.dataHVACSingleDuctInduc->IndUnit); + IUNum = Util::FindItemInList(CompName, state.dataHVACSingleDuctInduc->IndUnit); if (IUNum == 0) { ShowFatalError(state, format("SimIndUnit: Induction Unit not found={}", CompName)); } @@ -244,7 +244,7 @@ namespace HVACSingleDuctInduc { cNumericFields); int IUNum = IUIndex; - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataHVACSingleDuctInduc->IndUnit(IUNum).Name = Alphas(1); state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType = CurrentModuleObject; @@ -306,7 +306,7 @@ namespace HVACSingleDuctInduc { cAlphaFields(5)); state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType = Alphas(6); // type (key) of heating coil - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, "Coil:Heating:Water")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, "Coil:Heating:Water")) { state.dataHVACSingleDuctInduc->IndUnit(IUNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; } @@ -325,9 +325,9 @@ namespace HVACSingleDuctInduc { state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType = Alphas(8); // type (key) of cooling coil - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water")) { state.dataHVACSingleDuctInduc->IndUnit(IUNum).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; - } else if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { + } else if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { state.dataHVACSingleDuctInduc->IndUnit(IUNum).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } @@ -603,8 +603,7 @@ namespace HVACSingleDuctInduc { int OutletNode = state.dataHVACSingleDuctInduc->IndUnit(IUNum).OutAirNode; IndRat = state.dataHVACSingleDuctInduc->IndUnit(IUNum).InducRatio; // set the mass flow rates from the input volume flow rates - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, - "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction")) { state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxTotAirMassFlow = RhoAir * state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxTotAirVolFlow; state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxPriAirMassFlow = @@ -676,8 +675,8 @@ namespace HVACSingleDuctInduc { // check for upstream zero flow. If nonzero and schedule ON, set primary flow to max if (ScheduleManager::GetCurrentScheduleValue(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).SchedPtr) > 0.0 && state.dataLoopNodes->Node(PriNode).MassFlowRate > 0.0) { - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, - "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, + "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction")) { state.dataLoopNodes->Node(PriNode).MassFlowRate = state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxPriAirMassFlow; state.dataLoopNodes->Node(SecNode).MassFlowRate = state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxSecAirMassFlow; } @@ -688,8 +687,8 @@ namespace HVACSingleDuctInduc { // reset the max and min avail flows if (ScheduleManager::GetCurrentScheduleValue(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).SchedPtr) > 0.0 && state.dataLoopNodes->Node(PriNode).MassFlowRateMaxAvail > 0.0) { - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, - "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, + "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction")) { state.dataLoopNodes->Node(PriNode).MassFlowRateMaxAvail = state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxPriAirMassFlow; state.dataLoopNodes->Node(PriNode).MassFlowRateMinAvail = state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxPriAirMassFlow; state.dataLoopNodes->Node(SecNode).MassFlowRateMaxAvail = state.dataHVACSingleDuctInduc->IndUnit(IUNum).MaxSecAirMassFlow; @@ -816,7 +815,7 @@ namespace HVACSingleDuctInduc { } else { CheckZoneSizing(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, state.dataHVACSingleDuctInduc->IndUnit(IUNum).Name); - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, "Coil:Heating:Water")) { + 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); @@ -946,8 +945,8 @@ namespace HVACSingleDuctInduc { } else { CheckZoneSizing(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType, state.dataHVACSingleDuctInduc->IndUnit(IUNum).Name); - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water") || - UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water") || + Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, @@ -1068,14 +1067,14 @@ namespace HVACSingleDuctInduc { termUnitSizing.DesHeatingLoad = state.dataHVACSingleDuctInduc->IndUnit(IUNum).DesHeatingLoad; // save the induction ratio for use in subsequent sizing calcs termUnitSizing.InducRat = state.dataHVACSingleDuctInduc->IndUnit(IUNum).InducRatio; - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, "Coil:Heating:Water")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, "Coil:Heating:Water")) { WaterCoils::SetCoilDesFlow(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil, termUnitSizing.AirVolFlow, ErrorsFound); } - if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { + if (Util::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { WaterCoils::SetCoilDesFlow(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil, @@ -1367,7 +1366,7 @@ namespace HVACSingleDuctInduc { } if (state.dataHVACSingleDuctInduc->NumIndUnits > 0) { - int ItemNum = UtilityRoutines::FindItemInList(CompName, state.dataHVACSingleDuctInduc->IndUnit, &IndUnitData::MixerName); + int ItemNum = Util::FindItemInList(CompName, state.dataHVACSingleDuctInduc->IndUnit, &IndUnitData::MixerName); if (ItemNum > 0) return true; } diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index 006277e68a8..e1f04b388c3 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -180,7 +180,7 @@ void HVACSizingSimulationManager::RedoKickOffAndResize(EnergyPlusData &state) state.dataGlobal->KickOffSimulation = true; state.dataGlobal->RedoSizesHVACSimulation = true; - WeatherManager::ResetEnvironmentCounter(state); + Weather::ResetEnvironmentCounter(state); SimulationManager::SetupSimulation(state, ErrorsFound); state.dataGlobal->KickOffSimulation = false; @@ -213,20 +213,20 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) state.dataGlobal->DoingHVACSizingSimulations = true; state.dataGlobal->DoOutputReporting = true; - WeatherManager::ResetEnvironmentCounter(state); + Weather::ResetEnvironmentCounter(state); // iterations over set of sizing periods for HVAC sizing Simulation, will break out if no more are needed for (HVACSizingIterCount = 1; HVACSizingIterCount <= state.dataGlobal->HVACSizingSimMaxIterations; ++HVACSizingIterCount) { // need to extend Environment structure array to distinguish the HVAC Sizing Simulations from the regular run of that sizing period, repeats // for each set - WeatherManager::AddDesignSetToEnvironmentStruct(state, HVACSizingIterCount); + Weather::AddDesignSetToEnvironmentStruct(state, HVACSizingIterCount); state.dataGlobal->WarmupFlag = true; bool Available = true; - for (int i = 1; i <= state.dataWeatherManager->NumOfEnvrn; ++i) { // loop over environments + for (int i = 1; i <= state.dataWeather->NumOfEnvrn; ++i) { // loop over environments - WeatherManager::GetNextEnvironment(state, Available, ErrorsFound); + Weather::GetNextEnvironment(state, Available, ErrorsFound); if (ErrorsFound) break; if (!Available) continue; @@ -237,7 +237,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) if (state.dataGlobal->KindOfSim == Constant::KindOfSim::DesignDay) continue; if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodDesign) continue; - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).HVACSizingIterationNum != HVACSizingIterCount) continue; + if (state.dataWeather->Environment(state.dataWeather->Envrn).HVACSizingIterationNum != HVACSizingIterCount) continue; if (state.dataSysVars->ReportDuringHVACSizingSimulation) { if (state.dataSQLiteProcedures->sqlite) { @@ -324,7 +324,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) } } - WeatherManager::ManageWeather(state); + Weather::ManageWeather(state); ExteriorEnergyUse::ManageExteriorEnergyUse(state); diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index 2d150dda352..1e51ed3711f 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -126,7 +126,7 @@ void SimStandAloneERV(EnergyPlusData &state, // Find the correct Stand Alone ERV unit index if (CompIndex == 0) { - StandAloneERVNum = UtilityRoutines::FindItem(CompName, state.dataHVACStandAloneERV->StandAloneERV); + StandAloneERVNum = Util::FindItem(CompName, state.dataHVACStandAloneERV->StandAloneERV); if (StandAloneERVNum == 0) { ShowFatalError(state, format("SimStandAloneERV: Unit not found={}", CompName)); } @@ -725,7 +725,7 @@ void GetStandAloneERV(EnergyPlusData &state) thisOAController.Name = Alphas(1); thisOAController.ControllerType = MixedAir::MixedAirControllerType::ControllerStandAloneERV; - int WhichERV = UtilityRoutines::FindItemInList(Alphas(1), state.dataHVACStandAloneERV->StandAloneERV, &StandAloneERVData::ControllerName); + int WhichERV = Util::FindItemInList(Alphas(1), state.dataHVACStandAloneERV->StandAloneERV, &StandAloneERVData::ControllerName); if (WhichERV != 0) { AirFlowRate = state.dataHVACStandAloneERV->StandAloneERV(WhichERV).SupplyAirVolFlow; state.dataHVACStandAloneERV->StandAloneERV(WhichERV).ControllerIndex = OutAirNum; @@ -854,9 +854,9 @@ void GetStandAloneERV(EnergyPlusData &state) Real64 HighRHOARatio = 1.0; // READ Modify Air Flow Data // High humidity control option is YES, read in additional data - if (UtilityRoutines::SameString(Alphas(6), "Yes")) { + if (Util::SameString(Alphas(6), "Yes")) { - HStatZoneNum = UtilityRoutines::FindItemInList(Alphas(7), state.dataHeatBal->Zone); + HStatZoneNum = Util::FindItemInList(Alphas(7), state.dataHeatBal->Zone); thisOAController.HumidistatZoneNum = HStatZoneNum; // Get the node number for the zone with the humidistat @@ -911,17 +911,17 @@ void GetStandAloneERV(EnergyPlusData &state) HighRHOARatio = 1.0; } - if (UtilityRoutines::SameString(Alphas(8), "Yes")) { + if (Util::SameString(Alphas(8), "Yes")) { thisOAController.ModifyDuringHighOAMoisture = false; } else { thisOAController.ModifyDuringHighOAMoisture = true; } - } else if (!UtilityRoutines::SameString(Alphas(6), "No") && NumAlphas > 4 && (!lAlphaBlanks(5))) { + } else if (!Util::SameString(Alphas(6), "No") && NumAlphas > 4 && (!lAlphaBlanks(5))) { ShowWarningError(state, format("{} \"{}\"", CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("... Invalid {} = {}", cAlphaFields(6), Alphas(6))); ShowContinueError(state, format("... {} is assumed to be \"No\" and the simulation continues.", cAlphaFields(6))); - } // IF(UtilityRoutines::SameString(Alphas(6),'Yes'))THEN + } // IF(Util::SameString(Alphas(6),'Yes'))THEN thisOAController.HighRHOAFlowRatio = HighRHOARatio; if (WhichERV != 0) { @@ -1654,8 +1654,8 @@ Real64 GetSupplyAirFlowRate(EnergyPlusData &state, state.dataHVACStandAloneERV->GetERVInputFlag = false; } - if (UtilityRoutines::SameString(ERVType, "ZoneHVAC:EnergyRecoveryVentilator")) { - int WhichERV = UtilityRoutines::FindItem(ERVCtrlName, state.dataHVACStandAloneERV->StandAloneERV, &StandAloneERVData::ControllerName); + if (Util::SameString(ERVType, "ZoneHVAC:EnergyRecoveryVentilator")) { + int WhichERV = Util::FindItem(ERVCtrlName, state.dataHVACStandAloneERV->StandAloneERV, &StandAloneERVData::ControllerName); if (WhichERV != 0) { return state.dataHVACStandAloneERV->StandAloneERV(WhichERV).SupplyAirVolFlow; } diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index a11f276e3f2..4a51fac6acb 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -155,7 +155,7 @@ namespace HVACUnitaryBypassVAV { // Find the correct changeover-bypass VAV unit if (CompIndex == 0) { - CBVAVNum = UtilityRoutines::FindItemInList(CompName, state.dataHVACUnitaryBypassVAV->CBVAV); + CBVAVNum = Util::FindItemInList(CompName, state.dataHVACUnitaryBypassVAV->CBVAV); if (CBVAVNum == 0) { ShowFatalError(state, format("SimUnitaryBypassVAV: Unit not found={}", CompName)); } @@ -970,13 +970,13 @@ namespace HVACUnitaryBypassVAV { } } - if (UtilityRoutines::SameString(Alphas(18), "CoolingPriority")) { + if (Util::SameString(Alphas(18), "CoolingPriority")) { thisCBVAV.PriorityControl = PriorityCtrlMode::CoolingPriority; - } else if (UtilityRoutines::SameString(Alphas(18), "HeatingPriority")) { + } else if (Util::SameString(Alphas(18), "HeatingPriority")) { thisCBVAV.PriorityControl = PriorityCtrlMode::HeatingPriority; - } else if (UtilityRoutines::SameString(Alphas(18), "ZonePriority")) { + } else if (Util::SameString(Alphas(18), "ZonePriority")) { thisCBVAV.PriorityControl = PriorityCtrlMode::ZonePriority; - } else if (UtilityRoutines::SameString(Alphas(18), "LoadPriority")) { + } else if (Util::SameString(Alphas(18), "LoadPriority")) { thisCBVAV.PriorityControl = PriorityCtrlMode::LoadPriority; } else { ShowSevereError(state, format("{} illegal {} = {}", CurrentModuleObject, cAlphaFields(18), Alphas(18))); @@ -1005,11 +1005,11 @@ namespace HVACUnitaryBypassVAV { } // Dehumidification control mode - if (UtilityRoutines::SameString(Alphas(19), "None")) { + if (Util::SameString(Alphas(19), "None")) { thisCBVAV.DehumidControlType = DehumidControl::None; - } else if (UtilityRoutines::SameString(Alphas(19), "")) { + } else if (Util::SameString(Alphas(19), "")) { thisCBVAV.DehumidControlType = DehumidControl::None; - } else if (UtilityRoutines::SameString(Alphas(19), "Multimode")) { + } else if (Util::SameString(Alphas(19), "Multimode")) { if (thisCBVAV.CoolCoilType == DataHVACGlobals::CoilType::DXCoolingTwoStageWHumControl) { thisCBVAV.DehumidControlType = DehumidControl::Multimode; } else { @@ -1019,7 +1019,7 @@ namespace HVACUnitaryBypassVAV { ShowContinueError(state, format("Setting {} to \"None\" and the simulation continues.", cAlphaFields(19))); thisCBVAV.DehumidControlType = DehumidControl::None; } - } else if (UtilityRoutines::SameString(Alphas(19), "CoolReheat")) { + } else if (Util::SameString(Alphas(19), "CoolReheat")) { if (thisCBVAV.CoolCoilType == DataHVACGlobals::CoilType::DXCoolingTwoStageWHumControl) { thisCBVAV.DehumidControlType = DehumidControl::CoolReheat; } else { @@ -1042,7 +1042,7 @@ namespace HVACUnitaryBypassVAV { thisCBVAV.LastMode = HeatingMode; if (thisCBVAV.FanType == DataHVACGlobals::FanType::OnOff || thisCBVAV.FanType == DataHVACGlobals::FanType::Constant) { - if (thisCBVAV.FanType == DataHVACGlobals::FanType::OnOff && !UtilityRoutines::SameString(fanTypeString, "Fan:OnOff")) { + if (thisCBVAV.FanType == DataHVACGlobals::FanType::OnOff && !Util::SameString(fanTypeString, "Fan:OnOff")) { ShowWarningError( state, format("{} has {} = {} which is inconsistent with the fan object.", CurrentModuleObject, cAlphaFields(10), fanTypeString)); @@ -1051,7 +1051,7 @@ namespace HVACUnitaryBypassVAV { format(" The fan object ({}) is actually a valid fan type and the simulation continues.", thisCBVAV.FanName)); ShowContinueError(state, " Node connections errors may result due to the inconsistent fan type."); } - if (thisCBVAV.FanType == DataHVACGlobals::FanType::Constant && !UtilityRoutines::SameString(fanTypeString, "Fan:ConstantVolume")) { + if (thisCBVAV.FanType == DataHVACGlobals::FanType::Constant && !Util::SameString(fanTypeString, "Fan:ConstantVolume")) { ShowWarningError( state, format("{} has {} = {} which is inconsistent with fan object.", CurrentModuleObject, cAlphaFields(10), fanTypeString)); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, thisCBVAV.Name)); @@ -1115,10 +1115,10 @@ namespace HVACUnitaryBypassVAV { for (int BranchNum = 1; BranchNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).NumBranches; ++BranchNum) { for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name, - thisCBVAV.Name) || - !UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf, thisCBVAV.UnitType)) + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name, + thisCBVAV.Name) || + !Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf, + thisCBVAV.UnitType)) continue; thisCBVAV.AirLoopNumber = AirLoopNum; // Should EXIT here or do other checking? diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index def005ed9cc..ecf0e55208e 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -167,7 +167,7 @@ void SimulateVRF(EnergyPlusData &state, // CompIndex accounting if (CompIndex == 0) { - VRFTUNum = UtilityRoutines::FindItemInList(CompName, state.dataHVACVarRefFlow->VRFTU); + VRFTUNum = Util::FindItemInList(CompName, state.dataHVACVarRefFlow->VRFTU); if (VRFTUNum == 0) { ShowFatalError(state, format("SimulateVRF: VRF Terminal Unit not found={}", CompName)); } @@ -1546,7 +1546,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &thisTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); thisTUList.Name = cAlphaArgs(1); @@ -1826,7 +1826,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) cAlphaFieldNames(13)); // Field Name if (!ErrorsFound) { - if (UtilityRoutines::SameString(cAlphaArgs(19), "WETBULBTEMPERATURE")) { + if (Util::SameString(cAlphaArgs(19), "WETBULBTEMPERATURE")) { checkCurveIsNormalizedToOne(state, std::string{RoutineName} + cCurrentModuleObject, thisVrfSys.Name, @@ -1835,7 +1835,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) cAlphaArgs(13), RatedInletAirTempHeat, RatedOutdoorWetBulbTempHeat); - } else if (UtilityRoutines::SameString(cAlphaArgs(19), "DRYBULBTEMPERATURE")) { + } else if (Util::SameString(cAlphaArgs(19), "DRYBULBTEMPERATURE")) { checkCurveIsNormalizedToOne(state, std::string{RoutineName} + cCurrentModuleObject, thisVrfSys.Name, @@ -1908,9 +1908,9 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) cAlphaFieldNames(18)); // Field Name } - if (UtilityRoutines::SameString(cAlphaArgs(19), "WETBULBTEMPERATURE")) { + if (Util::SameString(cAlphaArgs(19), "WETBULBTEMPERATURE")) { thisVrfSys.HeatingPerformanceOATType = DataHVACGlobals::WetBulbIndicator; - } else if (UtilityRoutines::SameString(cAlphaArgs(19), "DRYBULBTEMPERATURE")) { + } else if (Util::SameString(cAlphaArgs(19), "DRYBULBTEMPERATURE")) { thisVrfSys.HeatingPerformanceOATType = DataHVACGlobals::DryBulbIndicator; } else { ShowSevereError( @@ -2035,7 +2035,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } } - thisVrfSys.MasterZonePtr = UtilityRoutines::FindItemInList(cAlphaArgs(24), state.dataHeatBal->Zone); + thisVrfSys.MasterZonePtr = Util::FindItemInList(cAlphaArgs(24), state.dataHeatBal->Zone); thisVrfSys.ThermostatPriority = static_cast(getEnumValue(ThermostatCtrlTypeUC, cAlphaArgs(25))); @@ -2061,7 +2061,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } } - thisVrfSys.ZoneTUListPtr = UtilityRoutines::FindItemInList(cAlphaArgs(27), state.dataHVACVarRefFlow->TerminalUnitList); + thisVrfSys.ZoneTUListPtr = Util::FindItemInList(cAlphaArgs(27), state.dataHVACVarRefFlow->TerminalUnitList); if (thisVrfSys.ZoneTUListPtr == 0) { ShowSevereError(state, format("{} = \"{}\"", cCurrentModuleObject, thisVrfSys.Name)); ShowContinueError(state, format("{} = {} not found.", cAlphaFieldNames(27), cAlphaArgs(27))); @@ -2070,9 +2070,9 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfSys.HeatRecoveryUsed = false; if (!lAlphaFieldBlanks(28)) { - if (UtilityRoutines::SameString(cAlphaArgs(28), "No")) { + if (Util::SameString(cAlphaArgs(28), "No")) { thisVrfSys.HeatRecoveryUsed = false; - } else if (UtilityRoutines::SameString(cAlphaArgs(28), "Yes")) { + } else if (Util::SameString(cAlphaArgs(28), "Yes")) { thisVrfSys.HeatRecoveryUsed = true; } else { ShowSevereError(state, format("{} = \"{}\"", cCurrentModuleObject, thisVrfSys.Name)); @@ -2178,10 +2178,9 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfSys.MaxOATDefrost = rNumericArgs(22); if (!lAlphaFieldBlanks(35)) { - if (UtilityRoutines::SameString(cAlphaArgs(34), "AirCooled")) thisVrfSys.CondenserType = DataHeatBalance::RefrigCondenserType::Air; - if (UtilityRoutines::SameString(cAlphaArgs(34), "EvaporativelyCooled")) - thisVrfSys.CondenserType = DataHeatBalance::RefrigCondenserType::Evap; - if (UtilityRoutines::SameString(cAlphaArgs(34), "WaterCooled")) { + if (Util::SameString(cAlphaArgs(34), "AirCooled")) thisVrfSys.CondenserType = DataHeatBalance::RefrigCondenserType::Air; + if (Util::SameString(cAlphaArgs(34), "EvaporativelyCooled")) thisVrfSys.CondenserType = DataHeatBalance::RefrigCondenserType::Evap; + if (Util::SameString(cAlphaArgs(34), "WaterCooled")) { thisVrfSys.CondenserType = DataHeatBalance::RefrigCondenserType::Water; thisVrfSys.VRFType = PlantEquipmentType::HeatPumpVRF; if (thisVrfSys.HeatingPerformanceOATType == DataHVACGlobals::WetBulbIndicator) { @@ -2480,7 +2479,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } thisVrfFluidCtrl.ZoneTUListPtr = - UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataHVACVarRefFlow->TerminalUnitList, state.dataHVACVarRefFlow->NumVRFTULists); + Util::FindItemInList(cAlphaArgs(3), state.dataHVACVarRefFlow->TerminalUnitList, state.dataHVACVarRefFlow->NumVRFTULists); if (thisVrfFluidCtrl.ZoneTUListPtr == 0) { ShowSevereError(state, cCurrentModuleObject + " = \"" + thisVrfFluidCtrl.Name + "\""); ShowContinueError(state, cAlphaFieldNames(3) + " = " + cAlphaArgs(3) + " not found."); @@ -2493,8 +2492,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) EnergyPlus::FluidProperties::GetFluidPropertiesData(state); state.dataFluidProps->GetInput = false; } - if (UtilityRoutines::FindItemInList( - thisVrfFluidCtrl.RefrigerantName, state.dataFluidProps->RefrigData, state.dataFluidProps->NumOfRefrigerants) == 0) { + if (Util::FindItemInList(thisVrfFluidCtrl.RefrigerantName, state.dataFluidProps->RefrigData, state.dataFluidProps->NumOfRefrigerants) == 0) { ShowSevereError(state, cCurrentModuleObject + " = " + thisVrfFluidCtrl.Name); ShowContinueError(state, "Illegal " + cAlphaFieldNames(4) + " = " + cAlphaArgs(4)); ErrorsFound = true; @@ -2539,9 +2537,9 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfFluidCtrl.SH = rNumericArgs(7); thisVrfFluidCtrl.SC = rNumericArgs(8); - if (UtilityRoutines::SameString(cAlphaArgs(5), "VariableTemp")) { + if (Util::SameString(cAlphaArgs(5), "VariableTemp")) { thisVrfFluidCtrl.AlgorithmIUCtrl = 1; - } else if (UtilityRoutines::SameString(cAlphaArgs(5), "ConstantTemp")) { + } else if (Util::SameString(cAlphaArgs(5), "ConstantTemp")) { thisVrfFluidCtrl.AlgorithmIUCtrl = 2; } else { thisVrfFluidCtrl.AlgorithmIUCtrl = 1; @@ -2676,9 +2674,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) // Defrost if (!lAlphaFieldBlanks(8)) { - if (UtilityRoutines::SameString(cAlphaArgs(8), "ReverseCycle")) - thisVrfFluidCtrl.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; - if (UtilityRoutines::SameString(cAlphaArgs(8), "Resistive")) thisVrfFluidCtrl.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; + if (Util::SameString(cAlphaArgs(8), "ReverseCycle")) thisVrfFluidCtrl.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; + if (Util::SameString(cAlphaArgs(8), "Resistive")) thisVrfFluidCtrl.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; if (thisVrfFluidCtrl.DefrostStrategy == StandardRatings::DefrostStrat::Invalid) { ShowSevereError(state, cCurrentModuleObject + ", \"" + thisVrfFluidCtrl.Name + "\" " + cAlphaFieldNames(8) + " not found: " + cAlphaArgs(8)); @@ -2689,8 +2686,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } if (!lAlphaFieldBlanks(9)) { - if (UtilityRoutines::SameString(cAlphaArgs(9), "Timed")) thisVrfFluidCtrl.DefrostControl = StandardRatings::HPdefrostControl::Timed; - if (UtilityRoutines::SameString(cAlphaArgs(9), "OnDemand")) thisVrfFluidCtrl.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; + if (Util::SameString(cAlphaArgs(9), "Timed")) thisVrfFluidCtrl.DefrostControl = StandardRatings::HPdefrostControl::Timed; + if (Util::SameString(cAlphaArgs(9), "OnDemand")) thisVrfFluidCtrl.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; if (thisVrfFluidCtrl.DefrostControl == StandardRatings::HPdefrostControl::Invalid) { ShowSevereError(state, cCurrentModuleObject + ", \"" + thisVrfFluidCtrl.Name + "\" " + cAlphaFieldNames(9) + " not found: " + cAlphaArgs(9)); @@ -2741,15 +2738,15 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) //@@ The control type std::string ThermostatPriorityType = "LoadPriority"; // cAlphaArgs( 25 ) - if (UtilityRoutines::SameString(ThermostatPriorityType, "LoadPriority")) { + if (Util::SameString(ThermostatPriorityType, "LoadPriority")) { thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::LoadPriority; - } else if (UtilityRoutines::SameString(ThermostatPriorityType, "ZonePriority")) { + } else if (Util::SameString(ThermostatPriorityType, "ZonePriority")) { thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::ZonePriority; - } else if (UtilityRoutines::SameString(ThermostatPriorityType, "ThermostatOffsetPriority")) { + } else if (Util::SameString(ThermostatPriorityType, "ThermostatOffsetPriority")) { thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::ThermostatOffsetPriority; - } else if (UtilityRoutines::SameString(ThermostatPriorityType, "Scheduled")) { + } else if (Util::SameString(ThermostatPriorityType, "Scheduled")) { thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::ScheduledPriority; - } else if (UtilityRoutines::SameString(ThermostatPriorityType, "MasterThermostatPriority")) { + } else if (Util::SameString(ThermostatPriorityType, "MasterThermostatPriority")) { thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::MasterThermostatPriority; if (thisVrfFluidCtrl.MasterZonePtr == 0) { ShowSevereError(state, cCurrentModuleObject + " = \"" + thisVrfFluidCtrl.Name + "\""); @@ -2881,7 +2878,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } thisVrfFluidCtrlHR.ZoneTUListPtr = - UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataHVACVarRefFlow->TerminalUnitList, state.dataHVACVarRefFlow->NumVRFTULists); + Util::FindItemInList(cAlphaArgs(3), state.dataHVACVarRefFlow->TerminalUnitList, state.dataHVACVarRefFlow->NumVRFTULists); if (thisVrfFluidCtrlHR.ZoneTUListPtr == 0) { ShowSevereError(state, cCurrentModuleObject + " = \"" + thisVrfFluidCtrlHR.Name + "\""); ShowContinueError(state, cAlphaFieldNames(3) + " = " + cAlphaArgs(3) + " not found."); @@ -2894,8 +2891,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) EnergyPlus::FluidProperties::GetFluidPropertiesData(state); state.dataFluidProps->GetInput = false; } - if (UtilityRoutines::FindItemInList( - thisVrfFluidCtrlHR.RefrigerantName, state.dataFluidProps->RefrigData, state.dataFluidProps->NumOfRefrigerants) == 0) { + if (Util::FindItemInList(thisVrfFluidCtrlHR.RefrigerantName, state.dataFluidProps->RefrigData, state.dataFluidProps->NumOfRefrigerants) == + 0) { ShowSevereError(state, cCurrentModuleObject + " = " + thisVrfFluidCtrlHR.Name); ShowContinueError(state, "Illegal " + cAlphaFieldNames(4) + " = " + cAlphaArgs(4)); ErrorsFound = true; @@ -2975,9 +2972,9 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } // IU Control Type - if (UtilityRoutines::SameString(cAlphaArgs(5), "VariableTemp")) { + if (Util::SameString(cAlphaArgs(5), "VariableTemp")) { thisVrfFluidCtrlHR.AlgorithmIUCtrl = 1; - } else if (UtilityRoutines::SameString(cAlphaArgs(5), "ConstantTemp")) { + } else if (Util::SameString(cAlphaArgs(5), "ConstantTemp")) { thisVrfFluidCtrlHR.AlgorithmIUCtrl = 2; } else { thisVrfFluidCtrlHR.AlgorithmIUCtrl = 1; @@ -3127,10 +3124,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) // Defrost if (!lAlphaFieldBlanks(8)) { - if (UtilityRoutines::SameString(cAlphaArgs(8), "ReverseCycle")) - thisVrfFluidCtrlHR.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; - if (UtilityRoutines::SameString(cAlphaArgs(8), "Resistive")) - thisVrfFluidCtrlHR.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; + if (Util::SameString(cAlphaArgs(8), "ReverseCycle")) thisVrfFluidCtrlHR.DefrostStrategy = StandardRatings::DefrostStrat::ReverseCycle; + if (Util::SameString(cAlphaArgs(8), "Resistive")) thisVrfFluidCtrlHR.DefrostStrategy = StandardRatings::DefrostStrat::Resistive; if (thisVrfFluidCtrlHR.DefrostStrategy == StandardRatings::DefrostStrat::Invalid) { ShowSevereError( state, cCurrentModuleObject + ", \"" + thisVrfFluidCtrlHR.Name + "\" " + cAlphaFieldNames(8) + " not found: " + cAlphaArgs(8)); @@ -3141,9 +3136,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } if (!lAlphaFieldBlanks(9)) { - if (UtilityRoutines::SameString(cAlphaArgs(9), "Timed")) thisVrfFluidCtrlHR.DefrostControl = StandardRatings::HPdefrostControl::Timed; - if (UtilityRoutines::SameString(cAlphaArgs(9), "OnDemand")) - thisVrfFluidCtrlHR.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; + if (Util::SameString(cAlphaArgs(9), "Timed")) thisVrfFluidCtrlHR.DefrostControl = StandardRatings::HPdefrostControl::Timed; + if (Util::SameString(cAlphaArgs(9), "OnDemand")) thisVrfFluidCtrlHR.DefrostControl = StandardRatings::HPdefrostControl::OnDemand; if (thisVrfFluidCtrlHR.DefrostControl == StandardRatings::HPdefrostControl::Invalid) { ShowSevereError( state, cCurrentModuleObject + ", \"" + thisVrfFluidCtrlHR.Name + "\" " + cAlphaFieldNames(9) + " not found: " + cAlphaArgs(9)); @@ -3309,14 +3303,14 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataHVACVarRefFlow->VRFTUNumericFields(VRFTUNum).FieldNames.allocate(NumNums); state.dataHVACVarRefFlow->VRFTUNumericFields(VRFTUNum).FieldNames = cNumericFieldNames; - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &thisVrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); thisVrfTU.Name = cAlphaArgs(1); for (int NumList = 1; NumList <= state.dataHVACVarRefFlow->NumVRFTULists; ++NumList) { - int ZoneTerminalUnitListNum = UtilityRoutines::FindItemInList(thisVrfTU.Name, - state.dataHVACVarRefFlow->TerminalUnitList(NumList).ZoneTUName, - state.dataHVACVarRefFlow->TerminalUnitList(NumList).NumTUInList); + int ZoneTerminalUnitListNum = Util::FindItemInList(thisVrfTU.Name, + state.dataHVACVarRefFlow->TerminalUnitList(NumList).ZoneTUName, + state.dataHVACVarRefFlow->TerminalUnitList(NumList).NumTUInList); if (ZoneTerminalUnitListNum > 0) { thisVrfTU.IndexToTUInTUList = ZoneTerminalUnitListNum; state.dataHVACVarRefFlow->TerminalUnitList(NumList).ZoneTUPtr(ZoneTerminalUnitListNum) = VRFTUNum; @@ -3386,14 +3380,14 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfTU.OpMode = DataHVACGlobals::ContFanCycCoil; } - if (UtilityRoutines::SameString(cAlphaArgs(6), "BlowThrough")) thisVrfTU.FanPlace = DataHVACGlobals::BlowThru; - if (UtilityRoutines::SameString(cAlphaArgs(6), "DrawThrough")) thisVrfTU.FanPlace = DataHVACGlobals::DrawThru; + if (Util::SameString(cAlphaArgs(6), "BlowThrough")) thisVrfTU.FanPlace = DataHVACGlobals::BlowThru; + if (Util::SameString(cAlphaArgs(6), "DrawThrough")) thisVrfTU.FanPlace = DataHVACGlobals::DrawThru; if (!lAlphaFieldBlanks(7) && !lAlphaFieldBlanks(8)) { // Get fan data std::string FanType = cAlphaArgs(7); std::string FanName = cAlphaArgs(8); - if (UtilityRoutines::SameString(FanType, "Fan:SystemModel")) { + if (Util::SameString(FanType, "Fan:SystemModel")) { if (!HVACFan::checkIfFanNameIsAFanSystem(state, FanName)) { ErrorsFound = true; } else { @@ -3409,7 +3403,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } // Check the type of the fan is correct - if (!UtilityRoutines::SameString(DataHVACGlobals::cFanTypes(thisVrfTU.fanType_Num), FanType)) { + if (!Util::SameString(DataHVACGlobals::cFanTypes(thisVrfTU.fanType_Num), FanType)) { ShowSevereError(state, cCurrentModuleObject + " = " + thisVrfTU.Name); ShowContinueError(state, "Fan type specified = " + cAlphaArgs(7)); ShowContinueError(state, @@ -3591,8 +3585,8 @@ 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 (UtilityRoutines::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num), - DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_FluidTCtrl_Cooling))) { + if (Util::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num), + DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_FluidTCtrl_Cooling))) { errFlag = false; if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).CoolingCoilAvailSchPtr(thisVrfTU.IndexToTUInTUList) = @@ -3686,8 +3680,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } else { // Algorithm Type: VRF model based on system curve - if (UtilityRoutines::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num), - DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_Cooling))) { + if (Util::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXCoolCoilType_Num), + DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_Cooling))) { if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).CoolingCoilAvailSchPtr(thisVrfTU.IndexToTUInTUList) = GetDXCoilAvailSchPtr(state, DXCoolingCoilType, cAlphaArgs(12), errFlag); @@ -3771,8 +3765,8 @@ 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 (UtilityRoutines::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num), - DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_FluidTCtrl_Heating))) { + if (Util::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num), + DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_FluidTCtrl_Heating))) { errFlag = false; if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).HeatingCoilAvailSchPtr(thisVrfTU.IndexToTUInTUList) = @@ -4025,8 +4019,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } else { // Algorithm Type: VRF model based on system curve - if (UtilityRoutines::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num), - DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_Heating))) { + if (Util::SameString(DataHVACGlobals::cAllCoilTypes(thisVrfTU.DXHeatCoilType_Num), + DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilVRF_Heating))) { if (thisVrfTU.TUListIndex > 0 && thisVrfTU.IndexToTUInTUList > 0) { state.dataHVACVarRefFlow->TerminalUnitList(thisVrfTU.TUListIndex).HeatingCoilAvailSchPtr(thisVrfTU.IndexToTUInTUList) = GetDXCoilAvailSchPtr(state, DXHeatingCoilType, cAlphaArgs(14), errFlag); @@ -4283,7 +4277,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfTU.HVACSizingIndex = 0; if (!lAlphaFieldBlanks(16)) { - thisVrfTU.HVACSizingIndex = UtilityRoutines::FindItemInList(cAlphaArgs(16), state.dataSize->ZoneHVACSizing); + thisVrfTU.HVACSizingIndex = Util::FindItemInList(cAlphaArgs(16), state.dataSize->ZoneHVACSizing); if (thisVrfTU.HVACSizingIndex == 0) { ShowSevereError(state, cAlphaFieldNames(16) + " = " + cAlphaArgs(16) + " not found."); ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + thisVrfTU.Name); @@ -4298,12 +4292,12 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfTU.SuppHeatCoilName = cAlphaArgs(18); errFlag = false; - if (UtilityRoutines::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Water")) { + if (Util::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Water")) { thisVrfTU.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingWater; - } else if (UtilityRoutines::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Steam")) { + } else if (Util::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Steam")) { thisVrfTU.SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; - } else if (UtilityRoutines::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Electric")) { + } else if (Util::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Fuel") || + Util::SameString(thisVrfTU.SuppHeatCoilType, "Coil:Heating:Electric")) { thisVrfTU.SuppHeatCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, thisVrfTU.SuppHeatCoilType, thisVrfTU.SuppHeatCoilName, errFlag); } @@ -4464,7 +4458,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } if (!lAlphaFieldBlanks(19)) { - thisVrfTU.ZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(19), state.dataHeatBal->Zone); + thisVrfTU.ZoneNum = Util::FindItemInList(cAlphaArgs(19), state.dataHeatBal->Zone); if (thisVrfTU.ZoneNum == 0) { ShowSevereError(state, cCurrentModuleObject + " = " + cAlphaArgs(1)); ShowContinueError(state, "Illegal " + cAlphaFieldNames(19) + " = " + cAlphaArgs(19)); @@ -5871,11 +5865,11 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool for (ELLoop = 1; ELLoop <= state.dataGlobal->NumOfZones; ++ELLoop) { // NumOfZoneEquipLists if (state.dataZoneEquip->ZoneEquipList(ELLoop).Name == "") continue; // dimensioned by NumOfZones. Only valid ones have names. for (ListLoop = 1; ListLoop <= state.dataZoneEquip->ZoneEquipList(ELLoop).NumOfEquipTypes; ++ListLoop) { - if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(ELLoop).EquipTypeName(ListLoop), - DataHVACGlobals::cVRFTUTypes(state.dataHVACVarRefFlow->VRFTU(TUIndex).VRFTUType_Num))) + if (!Util::SameString(state.dataZoneEquip->ZoneEquipList(ELLoop).EquipTypeName(ListLoop), + DataHVACGlobals::cVRFTUTypes(state.dataHVACVarRefFlow->VRFTU(TUIndex).VRFTUType_Num))) continue; - if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(ELLoop).EquipName(ListLoop), - state.dataHVACVarRefFlow->VRFTU(TUIndex).Name)) + if (!Util::SameString(state.dataZoneEquip->ZoneEquipList(ELLoop).EquipName(ListLoop), + state.dataHVACVarRefFlow->VRFTU(TUIndex).Name)) continue; state.dataHVACVarRefFlow->VRFTU(TUIndex).ZoneNum = ELLoop; state.dataHVACVarRefFlow->VRFTU(TUIndex).isInZone = true; @@ -5931,12 +5925,10 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { - if (UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name, - thisObjectName) && - UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf, - cCurrentModuleObject)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name, + thisObjectName) && + Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf, + cCurrentModuleObject)) { state.dataHVACVarRefFlow->VRFTU(TUIndex).airLoopNum = AirLoopNum; AirLoopFound = true; state.dataHVACVarRefFlow->VRFTU(TUIndex).isInAirLoop = true; @@ -5994,10 +5986,9 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool if (!AirLoopFound && !state.dataHVACVarRefFlow->VRFTU(TUIndex).isInOASys) { for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; ++OASysNum) { for (int OACompNum = 1; OACompNum <= state.dataAirLoop->OutsideAirSys(OASysNum).NumComponents; ++OACompNum) { - if (!UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentName(OACompNum), - state.dataHVACVarRefFlow->VRFTU(TUIndex).Name) || - !UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentType(OACompNum), - cCurrentModuleObject)) + if (!Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentName(OACompNum), + state.dataHVACVarRefFlow->VRFTU(TUIndex).Name) || + !Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentType(OACompNum), cCurrentModuleObject)) continue; state.dataHVACVarRefFlow->VRFTU(TUIndex).airLoopNum = 0; // need air loop number here? state.dataHVACVarRefFlow->VRFTU(TUIndex).isInOASys = true; @@ -10078,8 +10069,8 @@ void isVRFCoilPresent(EnergyPlusData &state, std::string_view VRFTUName, bool &C state.dataHVACVarRefFlow->GetVRFInputFlag = false; } - int WhichVRFTU = UtilityRoutines::FindItemInList( - VRFTUName, state.dataHVACVarRefFlow->VRFTU, &VRFTerminalUnitEquipment::Name, state.dataHVACVarRefFlow->NumVRFTU); + int WhichVRFTU = + Util::FindItemInList(VRFTUName, state.dataHVACVarRefFlow->VRFTU, &VRFTerminalUnitEquipment::Name, state.dataHVACVarRefFlow->NumVRFTU); if (WhichVRFTU != 0) { CoolCoilPresent = state.dataHVACVarRefFlow->VRFTU(WhichVRFTU).CoolingCoilPresent; HeatCoilPresent = state.dataHVACVarRefFlow->VRFTU(WhichVRFTU).HeatingCoilPresent; @@ -10874,8 +10865,8 @@ int GetVRFTUOutAirNodeFromName(EnergyPlusData &state, std::string const &VRFTUNa state.dataHVACVarRefFlow->GetVRFInputFlag = false; } - int WhichVRFTU = UtilityRoutines::FindItemInList( - VRFTUName, state.dataHVACVarRefFlow->VRFTU, &VRFTerminalUnitEquipment::Name, state.dataHVACVarRefFlow->NumVRFTU); + int WhichVRFTU = + Util::FindItemInList(VRFTUName, state.dataHVACVarRefFlow->VRFTU, &VRFTerminalUnitEquipment::Name, state.dataHVACVarRefFlow->NumVRFTU); if (WhichVRFTU != 0) { NodeNum = state.dataHVACVarRefFlow->VRFTU(WhichVRFTU).VRFTUOutletNodeNum; } else { @@ -10896,8 +10887,8 @@ int GetVRFTUInAirNodeFromName(EnergyPlusData &state, std::string const &VRFTUNam state.dataHVACVarRefFlow->GetVRFInputFlag = false; } - int WhichVRFTU = UtilityRoutines::FindItemInList( - VRFTUName, state.dataHVACVarRefFlow->VRFTU, &VRFTerminalUnitEquipment::Name, state.dataHVACVarRefFlow->NumVRFTU); + int WhichVRFTU = + Util::FindItemInList(VRFTUName, state.dataHVACVarRefFlow->VRFTU, &VRFTerminalUnitEquipment::Name, state.dataHVACVarRefFlow->NumVRFTU); if (WhichVRFTU != 0) { NodeNum = state.dataHVACVarRefFlow->VRFTU(WhichVRFTU).VRFTUInletNodeNum; } else { diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index d40296ffe72..f6e0d7acccf 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -136,7 +136,7 @@ namespace HWBaseboardRadiator { // Find the correct Baseboard Equipment if (CompIndex == 0) { - BaseboardNum = UtilityRoutines::FindItemInList(EquipName, state.dataHWBaseboardRad->HWBaseboard, &HWBaseboardParams::Name); + BaseboardNum = Util::FindItemInList(EquipName, state.dataHWBaseboardRad->HWBaseboard, &HWBaseboardParams::Name); if (BaseboardNum == 0) { ShowFatalError(state, format("SimHWBaseboard: Unit not found={}", EquipName)); } @@ -450,7 +450,7 @@ namespace HWBaseboardRadiator { thisHWBaseboard.EquipType = DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Water; //'ZoneHVAC:Baseboard:RadiantConvective:Water' thisHWBaseboard.designObjectName = state.dataIPShortCut->cAlphaArgs(2); // Name of the design object for this baseboard - thisHWBaseboard.DesignObjectPtr = UtilityRoutines::FindItemInList(thisHWBaseboard.designObjectName, HWBaseboardDesignNames); + thisHWBaseboard.DesignObjectPtr = Util::FindItemInList(thisHWBaseboard.designObjectName, HWBaseboardDesignNames); HWBaseboardDesignData &HWBaseboardDesignDataObject = state.dataHWBaseboardRad->HWBaseboardDesignObject(thisHWBaseboard.DesignObjectPtr); // Contains the data for the design object @@ -1577,7 +1577,7 @@ namespace HWBaseboardRadiator { // Find the correct baseboard if (CompIndex == 0) { - BaseboardNum = UtilityRoutines::FindItemInList(BaseboardName, state.dataHWBaseboardRad->HWBaseboard, &HWBaseboardParams::Name); + BaseboardNum = Util::FindItemInList(BaseboardName, state.dataHWBaseboardRad->HWBaseboard, &HWBaseboardParams::Name); if (BaseboardNum == 0) { ShowFatalError(state, format("UpdateHWBaseboardPlantConnection: Specified baseboard not valid ={}", BaseboardName)); } diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index c6987231e3b..b27d38ba9e4 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -171,8 +171,8 @@ namespace HeatBalFiniteDiffManager { if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) { { - state.dataHeatBalFiniteDiffMgr->CondFDSchemeType = static_cast( - getEnumValue(CondFDSchemeTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); + state.dataHeatBalFiniteDiffMgr->CondFDSchemeType = + static_cast(getEnumValue(CondFDSchemeTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); if (state.dataHeatBalFiniteDiffMgr->CondFDSchemeType == CondFDScheme::Invalid) { ShowSevereError(state, format("{}: invalid {} entered={}, must match CrankNicholsonSecondOrder or FullyImplicitFirstOrder.", @@ -226,7 +226,7 @@ namespace HeatBalFiniteDiffManager { state.dataIPShortCut->cNumericFieldNames); // Load the material derived type from the input data. - MaterNum = UtilityRoutines::FindItemInPtrList(MaterialNames(1), state.dataMaterial->Material); + MaterNum = Util::FindItemInPtrList(MaterialNames(1), state.dataMaterial->Material); if (MaterNum == 0) { ShowSevereError(state, format("{}: invalid {} entered={}, must match to a valid Material name.", @@ -327,7 +327,7 @@ namespace HeatBalFiniteDiffManager { state.dataIPShortCut->cNumericFieldNames); // Load the material derived type from the input data. - MaterNum = UtilityRoutines::FindItemInPtrList(MaterialNames(1), state.dataMaterial->Material); + MaterNum = Util::FindItemInPtrList(MaterialNames(1), state.dataMaterial->Material); if (MaterNum == 0) { ShowSevereError(state, format("{}: invalid {} entered={}, must match to a valid Material name.", diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 43582d51de2..032ead3aa18 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -456,7 +456,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err auto &thisZoneAirBalance = state.dataHeatBal->ZoneAirBalance(Loop); thisZoneAirBalance.Name = cAlphaArgs(1); thisZoneAirBalance.ZoneName = cAlphaArgs(2); - thisZoneAirBalance.ZonePtr = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); + thisZoneAirBalance.ZonePtr = Util::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); if (thisZoneAirBalance.ZonePtr == 0) { ShowSevereError(state, format(R"({}{}="{}", invalid (not found) {}="{}".)", @@ -486,7 +486,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err { thisZoneAirBalance.BalanceMethod = static_cast( getEnumValue(DataHeatBalance::AirBalanceTypeNamesUC, - UtilityRoutines::makeUPPER(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum + Util::makeUPPER(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum if (thisZoneAirBalance.BalanceMethod == DataHeatBalance::AirBalance::Invalid) { thisZoneAirBalance.BalanceMethod = DataHeatBalance::AirBalance::None; ShowWarningError(state, @@ -2718,9 +2718,9 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err ErrorsFound = true; } - thisMixing.fromSpaceIndex = UtilityRoutines::FindItemInList(cAlphaArgs(5), state.dataHeatBal->space); + thisMixing.fromSpaceIndex = Util::FindItemInList(cAlphaArgs(5), state.dataHeatBal->space); if (thisMixing.fromSpaceIndex == 0) { - thisMixing.FromZone = UtilityRoutines::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); + thisMixing.FromZone = Util::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); } else { thisMixing.FromZone = state.dataHeatBal->space(thisMixing.fromSpaceIndex).zoneNum; } @@ -3338,9 +3338,9 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err ErrorsFound = true; } - thisMixing.fromSpaceIndex = UtilityRoutines::FindItemInList(cAlphaArgs(5), state.dataHeatBal->space); + thisMixing.fromSpaceIndex = Util::FindItemInList(cAlphaArgs(5), state.dataHeatBal->space); if (thisMixing.fromSpaceIndex == 0) { - thisMixing.FromZone = UtilityRoutines::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); + thisMixing.FromZone = Util::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); } else { thisMixing.FromZone = state.dataHeatBal->space(thisMixing.fromSpaceIndex).zoneNum; } @@ -3803,7 +3803,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err NameThisObject = cAlphaArgs(1); int AlphaNum = 2; - int Zone1Num = UtilityRoutines::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); + int Zone1Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); if (Zone1Num == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) {}=\"{}\".", @@ -3816,7 +3816,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } ++AlphaNum; // 3 - int Zone2Num = UtilityRoutines::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); + int Zone2Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); if (Zone2Num == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) {}=\"{}\".", @@ -4592,7 +4592,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); + ZoneNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (ZoneNum != 0) { if (!state.dataRoomAir->AirModel(ZoneNum).Name.empty()) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index 2726663a854..c8cfb552ba5 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -282,7 +282,7 @@ namespace HeatBalanceHAMTManager { cAlphaFieldNames, cNumericFieldNames); - matid = UtilityRoutines::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); + matid = Util::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); if (matid == 0) { ShowSevereError(state, format("{} {}=\"{}\" is invalid (undefined).", cHAMTObject1, cAlphaFieldNames(1), AlphaArray(1))); @@ -318,7 +318,7 @@ namespace HeatBalanceHAMTManager { cAlphaFieldNames, cNumericFieldNames); - matid = UtilityRoutines::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); + matid = Util::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); if (matid == 0) { ShowSevereError(state, format("{} {}=\"{}\" is invalid (undefined).", cHAMTObject2, cAlphaFieldNames(1), AlphaArray(1))); @@ -413,7 +413,7 @@ namespace HeatBalanceHAMTManager { cAlphaFieldNames, cNumericFieldNames); - matid = UtilityRoutines::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); + matid = Util::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); if (matid == 0) { ShowSevereError(state, format("{} {}=\"{}\" is invalid (undefined).", cHAMTObject3, cAlphaFieldNames(1), AlphaArray(1))); @@ -460,7 +460,7 @@ namespace HeatBalanceHAMTManager { cAlphaFieldNames, cNumericFieldNames); - matid = UtilityRoutines::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); + matid = Util::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); if (matid == 0) { ShowSevereError(state, format("{} {}=\"{}\" is invalid (undefined).", cHAMTObject4, cAlphaFieldNames(1), AlphaArray(1))); ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties."); @@ -505,7 +505,7 @@ namespace HeatBalanceHAMTManager { cAlphaFieldNames, cNumericFieldNames); - matid = UtilityRoutines::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); + matid = Util::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); if (matid == 0) { ShowSevereError(state, format("{} {}=\"{}\" is invalid (undefined).", cHAMTObject5, cAlphaFieldNames(1), AlphaArray(1))); ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties."); @@ -553,7 +553,7 @@ namespace HeatBalanceHAMTManager { cAlphaFieldNames, cNumericFieldNames); - matid = UtilityRoutines::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); + matid = Util::FindItemInPtrList(AlphaArray(1), state.dataMaterial->Material); if (matid == 0) { ShowSevereError(state, format("{} {}=\"{}\" is invalid (undefined).", cHAMTObject6, cAlphaFieldNames(1), AlphaArray(1))); ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties."); @@ -600,7 +600,7 @@ namespace HeatBalanceHAMTManager { cAlphaFieldNames, cNumericFieldNames); - vtcsid = UtilityRoutines::FindItemInList(AlphaArray(1), state.dataSurface->Surface); + vtcsid = Util::FindItemInList(AlphaArray(1), state.dataSurface->Surface); if (vtcsid == 0) { ShowSevereError(state, format("{} {}=\"{}\" is invalid (undefined).", cHAMTObject7, cAlphaFieldNames(1), AlphaArray(1))); ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties."); @@ -1496,7 +1496,7 @@ namespace HeatBalanceHAMTManager { SurfTempInP = cells(Intcell(sid)).rhp1 * PsyPsatFnTemp(state, cells(Intcell(sid)).tempp1); - state.dataMstBal->RhoVaporSurfIn(sid) = SurfTempInP / (461.52 * (spaceMAT + Constant::KelvinConv)); + state.dataMstBal->RhoVaporSurfIn(sid) = SurfTempInP / (461.52 * (spaceMAT + Constant::Kelvin)); } void UpdateHeatBalHAMT(EnergyPlusData &state, int const sid) @@ -1651,7 +1651,7 @@ namespace HeatBalanceHAMTManager { // Return value Real64 WVDC; - WVDC = (2.e-7 * std::pow(Temperature + Constant::KelvinConv, 0.81)) / ambp; + WVDC = (2.e-7 * std::pow(Temperature + Constant::Kelvin, 0.81)) / ambp; return WVDC; } diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 4a75eb6d29f..7dd75b5388c 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -288,7 +288,7 @@ namespace HeatBalanceIntRadExchange { // If the window is bare this TS and it is the first time through we use the previous TS glass // temperature whether or not the window was shaded in the previous TS. If the window was shaded // the previous time step this temperature is a better starting value than the shade temperature. - SurfaceTempRad[ZoneSurfNum] = surface_window.ThetaFace(2 * construct.TotGlassLayers) - Constant::KelvinConv; + SurfaceTempRad[ZoneSurfNum] = surface_window.ThetaFace(2 * construct.TotGlassLayers) - Constant::Kelvin; SurfaceEmiss[ZoneSurfNum] = construct.InsideAbsorpThermal; // For windows with an interior shade or blind an effective inside surface temp // and emiss is used here that is a weighted combination of shade/blind and glass temp and emiss. @@ -307,12 +307,12 @@ namespace HeatBalanceIntRadExchange { CarrollMRTNumerator += SurfaceTempRad[ZoneSurfNum] * zone_info.Fp[ZoneSurfNum] * zone_info.Area[ZoneSurfNum]; CarrollMRTDenominator += zone_info.Fp[ZoneSurfNum] * zone_info.Area[ZoneSurfNum]; } - SurfaceTempInKto4th[ZoneSurfNum] = pow_4(SurfaceTempRad[ZoneSurfNum] + Constant::KelvinConv); + SurfaceTempInKto4th[ZoneSurfNum] = pow_4(SurfaceTempRad[ZoneSurfNum] + Constant::Kelvin); } if (state.dataHeatBalIntRadExchg->CarrollMethod) { if (CarrollMRTDenominator > 0.0) { - CarrollMRTInKTo4th = pow_4(CarrollMRTNumerator / CarrollMRTDenominator + Constant::KelvinConv); + CarrollMRTInKTo4th = pow_4(CarrollMRTNumerator / CarrollMRTDenominator + Constant::Kelvin); } else { // Likely only one surface in this enclosure CarrollMRTInKTo4th = 293.15; // arbitrary value, IR will be zero @@ -336,7 +336,7 @@ namespace HeatBalanceIntRadExchange { } } if (CarrollMRTDenominatorWin > 0.0) { - CarrollMRTInKTo4thWin = pow_4(CarrollMRTNumeratorWin / CarrollMRTDenominatorWin + Constant::KelvinConv); + CarrollMRTInKTo4thWin = pow_4(CarrollMRTNumeratorWin / CarrollMRTDenominatorWin + Constant::Kelvin); } state.dataSurface->SurfWinIRfromParentZone(RecSurfNum) += (zone_info.Fp[RecZoneSurfNum] * CarrollMRTInKTo4thWin) / SurfaceEmiss[RecZoneSurfNum]; @@ -1120,15 +1120,14 @@ namespace HeatBalanceIntRadExchange { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - std::string const thisSpaceOrSpaceListName = - UtilityRoutines::makeUPPER(fields.at("zone_or_zonelist_or_space_or_spacelist_name").get()); + std::string const thisSpaceOrSpaceListName = Util::makeUPPER(fields.at("zone_or_zonelist_or_space_or_spacelist_name").get()); // do not mark object as used here - let GetInputViewFactorsbyName do that // Look for matching radiant enclosure name (solar enclosures have the same names) bool enclMatchFound = false; for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) { auto &thisEnclosure = state.dataViewFactor->EnclRadInfo(enclosureNum); - if (UtilityRoutines::SameString(thisSpaceOrSpaceListName, thisEnclosure.Name)) { + if (Util::SameString(thisSpaceOrSpaceListName, thisEnclosure.Name)) { // View factor space name matches enclosure name enclMatchFound = true; break; @@ -1136,7 +1135,7 @@ namespace HeatBalanceIntRadExchange { } if (enclMatchFound) continue; // We're done with this instance // Find matching SpaceList name - int spaceListNum = UtilityRoutines::FindItemInList(thisSpaceOrSpaceListName, state.dataHeatBal->spaceList); + int spaceListNum = Util::FindItemInList(thisSpaceOrSpaceListName, state.dataHeatBal->spaceList); int zoneListNum = 0; int inputZoneNum = 0; size_t listSize = 0; @@ -1144,13 +1143,13 @@ namespace HeatBalanceIntRadExchange { listSize = int(state.dataHeatBal->spaceList(spaceListNum).spaces.size()); } else { // Check Zone and ZoneList for backwards compatibility - zoneListNum = UtilityRoutines::FindItemInList(thisSpaceOrSpaceListName, state.dataHeatBal->ZoneList); + zoneListNum = Util::FindItemInList(thisSpaceOrSpaceListName, state.dataHeatBal->ZoneList); if (zoneListNum > 0) { for (int const zoneNum : state.dataHeatBal->ZoneList(zoneListNum).Zone) { listSize += state.dataHeatBal->Zone(zoneNum).spaceIndexes.size(); } } else { - inputZoneNum = UtilityRoutines::FindItemInList(thisSpaceOrSpaceListName, state.dataHeatBal->Zone); + inputZoneNum = Util::FindItemInList(thisSpaceOrSpaceListName, state.dataHeatBal->Zone); if (inputZoneNum > 0) { listSize = state.dataHeatBal->Zone(inputZoneNum).spaceIndexes.size(); } @@ -1319,8 +1318,8 @@ namespace HeatBalanceIntRadExchange { } for (int index = 2; index <= NumAlphas; index += 2) { - int inx1 = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(index), enclosureSurfaceNames, N); - int inx2 = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(index + 1), enclosureSurfaceNames, N); + int inx1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(index), enclosureSurfaceNames, N); + int inx2 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(index + 1), enclosureSurfaceNames, N); if (inx1 == 0) { ShowSevereError(state, format("GetInputViewFactors: {}=\"{}\", invalid surface name.", cCurrentModuleObject, EnclosureName)); ShowContinueError(state, @@ -2001,7 +2000,7 @@ namespace HeatBalanceIntRadExchange { static constexpr std::string_view routineName("GetRadiantSystemSurface: "); // include trailing blank space // For radiant zone equipment, find the referenced surface and check if it is in the same zone or radiant enclosure - int const surfNum = UtilityRoutines::FindItemInList(SurfaceName, state.dataSurface->Surface); + int const surfNum = Util::FindItemInList(SurfaceName, state.dataSurface->Surface); // Trap for surfaces that do not exist if (surfNum == 0) { diff --git a/src/EnergyPlus/HeatBalanceInternalHeatGains.cc b/src/EnergyPlus/HeatBalanceInternalHeatGains.cc index 1acd6dcbd9b..fcf05c575ca 100644 --- a/src/EnergyPlus/HeatBalanceInternalHeatGains.cc +++ b/src/EnergyPlus/HeatBalanceInternalHeatGains.cc @@ -122,7 +122,7 @@ void SetupSpaceInternalGain(EnergyPlusData &state, int constexpr DeviceAllocInc(100); bool FoundDuplicate = false; - std::string UpperCaseObjectName = UtilityRoutines::makeUPPER(cComponentName); + std::string UpperCaseObjectName = Util::makeUPPER(cComponentName); auto &thisIntGain = state.dataHeatBal->spaceIntGainDevices(spaceNum); for (int IntGainsNum = 1; IntGainsNum <= thisIntGain.numberOfDevices; ++IntGainsNum) { diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index be91359f2d6..435b29f05c0 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -182,8 +182,8 @@ void KivaInstanceMap::initGround(EnergyPlusData &state, const KivaWeatherData &k setInitialBoundaryConditions(state, kivaWeather, accDate, 24, state.dataGlobal->NumOfTimeStepInHour); instance.calculate(); accDate += acceleratedTimestep; - while (accDate > 365 + state.dataWeatherManager->LeapYearAdd) { - accDate = accDate - (365 + state.dataWeatherManager->LeapYearAdd); + while (accDate > 365 + state.dataWeather->LeapYearAdd) { + accDate = accDate - (365 + state.dataWeather->LeapYearAdd); } // Accelerated timestepping @@ -192,8 +192,8 @@ void KivaInstanceMap::initGround(EnergyPlusData &state, const KivaWeatherData &k setInitialBoundaryConditions(state, kivaWeather, accDate, 24, state.dataGlobal->NumOfTimeStepInHour); instance.calculate(acceleratedTimestep * 24 * 60 * 60); accDate += acceleratedTimestep; - while (accDate > 365 + state.dataWeatherManager->LeapYearAdd) { - accDate = accDate - (365 + state.dataWeatherManager->LeapYearAdd); + while (accDate > 365 + state.dataWeather->LeapYearAdd) { + accDate = accDate - (365 + state.dataWeather->LeapYearAdd); } } @@ -207,7 +207,7 @@ int KivaInstanceMap::getAccDate(EnergyPlusData &state, const int numAccelaratedT int accDate = state.dataEnvrn->DayOfYear - 1 - acceleratedTimestep * (numAccelaratedTimesteps + 1); // date time = last timestep from the day before while (accDate <= 0) { - accDate = accDate + 365 + state.dataWeatherManager->LeapYearAdd; + accDate = accDate + 365 + state.dataWeather->LeapYearAdd; } return accDate; } @@ -237,7 +237,7 @@ void KivaInstanceMap::setInitialBoundaryConditions( std::shared_ptr bcs = instance.bcs; - bcs->outdoorTemp = kivaWeather.dryBulb[index] * weightNow + kivaWeather.dryBulb[indexPrev] * (1.0 - weightNow) + Constant::KelvinConv; + bcs->outdoorTemp = kivaWeather.dryBulb[index] * weightNow + kivaWeather.dryBulb[indexPrev] * (1.0 - weightNow) + Constant::Kelvin; bcs->localWindSpeed = (kivaWeather.windSpeed[index] * weightNow + kivaWeather.windSpeed[indexPrev] * (1.0 - weightNow)) * state.dataEnvrn->WeatherFileWindModCoeff * @@ -249,7 +249,7 @@ void KivaInstanceMap::setInitialBoundaryConditions( bcs->diffuseHorizontalFlux = 0.0; bcs->slabAbsRadiation = 0.0; bcs->wallAbsRadiation = 0.0; - bcs->deepGroundTemperature = kivaWeather.annualAverageDrybulbTemp + Constant::KelvinConv; + bcs->deepGroundTemperature = kivaWeather.annualAverageDrybulbTemp + Constant::Kelvin; // Estimate indoor temperature constexpr Real64 defaultFlagTemp = -999; // default sets this below -999 at -9999 so uses value if entered @@ -259,11 +259,11 @@ void KivaInstanceMap::setInitialBoundaryConditions( Real64 Tin; if (zoneAssumedTemperature > defaultFlagTemp) { - Tin = zoneAssumedTemperature + Constant::KelvinConv; + Tin = zoneAssumedTemperature + Constant::Kelvin; } else { switch (zoneControlType) { case KIVAZONE_UNCONTROLLED: { - Tin = assumedFloatingTemp + Constant::KelvinConv; + Tin = assumedFloatingTemp + Constant::Kelvin; break; } case KIVAZONE_TEMPCONTROL: { @@ -274,24 +274,24 @@ void KivaInstanceMap::setInitialBoundaryConditions( switch (controlType) { case DataHVACGlobals::ThermostatType::Uncontrolled: - Tin = assumedFloatingTemp + Constant::KelvinConv; + Tin = assumedFloatingTemp + Constant::Kelvin; break; case DataHVACGlobals::ThermostatType::SingleHeating: { int schNameId = state.dataZoneCtrls->TempControlledZone(zoneControlNum).SchIndx_SingleHeatSetPoint; Real64 setpoint = ScheduleManager::LookUpScheduleValue(state, schNameId, hour, timestep); - Tin = setpoint + Constant::KelvinConv; + Tin = setpoint + Constant::Kelvin; break; } case DataHVACGlobals::ThermostatType::SingleCooling: { int schNameId = state.dataZoneCtrls->TempControlledZone(zoneControlNum).SchIndx_SingleCoolSetPoint; Real64 setpoint = ScheduleManager::LookUpScheduleValue(state, schNameId, hour, timestep); - Tin = setpoint + Constant::KelvinConv; + Tin = setpoint + Constant::Kelvin; break; } case DataHVACGlobals::ThermostatType::SingleHeatCool: { int schNameId = state.dataZoneCtrls->TempControlledZone(zoneControlNum).SchIndx_SingleHeatCoolSetPoint; Real64 setpoint = ScheduleManager::LookUpScheduleValue(state, schNameId, hour, timestep); - Tin = setpoint + Constant::KelvinConv; + Tin = setpoint + Constant::Kelvin; break; } case DataHVACGlobals::ThermostatType::DualSetPointWithDeadBand: { @@ -299,16 +299,16 @@ void KivaInstanceMap::setInitialBoundaryConditions( int schNameIdCool = state.dataZoneCtrls->TempControlledZone(zoneControlNum).SchIndx_DualSetPointWDeadBandCool; Real64 heatSetpoint = ScheduleManager::LookUpScheduleValue(state, schNameIdHeat, hour, timestep); Real64 coolSetpoint = ScheduleManager::LookUpScheduleValue(state, schNameIdCool, hour, timestep); - constexpr Real64 heatBalanceTemp = 10.0 + Constant::KelvinConv; // (assumed) - constexpr Real64 coolBalanceTemp = 15.0 + Constant::KelvinConv; // (assumed) + constexpr Real64 heatBalanceTemp = 10.0 + Constant::Kelvin; // (assumed) + constexpr Real64 coolBalanceTemp = 15.0 + Constant::Kelvin; // (assumed) if (bcs->outdoorTemp < heatBalanceTemp) { - Tin = heatSetpoint + Constant::KelvinConv; + Tin = heatSetpoint + Constant::Kelvin; } else if (bcs->outdoorTemp > coolBalanceTemp) { - Tin = coolSetpoint + Constant::KelvinConv; + Tin = coolSetpoint + Constant::Kelvin; } else { Real64 weight = (coolBalanceTemp - bcs->outdoorTemp) / (coolBalanceTemp - heatBalanceTemp); - Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + Constant::KelvinConv; + Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + Constant::Kelvin; } break; } @@ -324,7 +324,7 @@ void KivaInstanceMap::setInitialBoundaryConditions( } case KIVAZONE_COMFORTCONTROL: { - Tin = standardTemp + Constant::KelvinConv; + Tin = standardTemp + Constant::Kelvin; break; } case KIVAZONE_STAGEDCONTROL: { @@ -333,21 +333,21 @@ void KivaInstanceMap::setInitialBoundaryConditions( int coolSpSchId = state.dataZoneCtrls->StageControlledZone(zoneControlNum).CSBchedIndex; Real64 heatSetpoint = ScheduleManager::LookUpScheduleValue(state, heatSpSchId, hour, timestep); Real64 coolSetpoint = ScheduleManager::LookUpScheduleValue(state, coolSpSchId, hour, timestep); - constexpr Real64 heatBalanceTemp = 10.0 + Constant::KelvinConv; // (assumed) - constexpr Real64 coolBalanceTemp = 15.0 + Constant::KelvinConv; // (assumed) + constexpr Real64 heatBalanceTemp = 10.0 + Constant::Kelvin; // (assumed) + constexpr Real64 coolBalanceTemp = 15.0 + Constant::Kelvin; // (assumed) if (bcs->outdoorTemp < heatBalanceTemp) { - Tin = heatSetpoint + Constant::KelvinConv; + Tin = heatSetpoint + Constant::Kelvin; } else if (bcs->outdoorTemp > coolBalanceTemp) { - Tin = coolSetpoint + Constant::KelvinConv; + Tin = coolSetpoint + Constant::Kelvin; } else { Real64 weight = (coolBalanceTemp - bcs->outdoorTemp) / (coolBalanceTemp - heatBalanceTemp); - Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + Constant::KelvinConv; + Tin = heatSetpoint * weight + coolSetpoint * (1.0 - weight) + Constant::Kelvin; } break; } default: { // error? - Tin = assumedFloatingTemp + Constant::KelvinConv; + Tin = assumedFloatingTemp + Constant::Kelvin; break; } } @@ -375,7 +375,7 @@ void KivaInstanceMap::setBoundaryConditions(EnergyPlusData &state) { std::shared_ptr bcs = instance.bcs; - bcs->outdoorTemp = state.dataEnvrn->OutDryBulbTemp + Constant::KelvinConv; + bcs->outdoorTemp = state.dataEnvrn->OutDryBulbTemp + Constant::Kelvin; bcs->localWindSpeed = DataEnvironment::WindSpeedAt(state, instance.ground->foundation.grade.roughness); bcs->windDirection = state.dataEnvrn->WindDir * Constant::DegToRadians; bcs->solarAzimuth = std::atan2(state.dataEnvrn->SOLCOS(1), state.dataEnvrn->SOLCOS(2)); @@ -388,8 +388,8 @@ void KivaInstanceMap::setBoundaryConditions(EnergyPlusData &state) state.dataHeatBal->SurfQdotRadIntGainsInPerArea(floorSurface) + // internal gains state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(floorSurface); // HVAC - bcs->slabConvectiveTemp = state.dataHeatBal->SurfTempEffBulkAir(floorSurface) + Constant::KelvinConv; - bcs->slabRadiantTemp = ThermalComfort::CalcSurfaceWeightedMRT(state, floorSurface, false) + Constant::KelvinConv; + bcs->slabConvectiveTemp = state.dataHeatBal->SurfTempEffBulkAir(floorSurface) + Constant::Kelvin; + bcs->slabRadiantTemp = ThermalComfort::CalcSurfaceWeightedMRT(state, floorSurface, false) + Constant::Kelvin; bcs->gradeForcedTerm = kmPtr->surfaceConvMap[floorSurface].f; bcs->gradeConvectionAlgorithm = kmPtr->surfaceConvMap[floorSurface].out; bcs->slabConvectionAlgorithm = kmPtr->surfaceConvMap[floorSurface].in; @@ -417,8 +417,8 @@ void KivaInstanceMap::setBoundaryConditions(EnergyPlusData &state) if (Atotal > 0.0) { bcs->wallAbsRadiation = QAtotal / Atotal; - bcs->wallRadiantTemp = TARadTotal / Atotal + Constant::KelvinConv; - bcs->wallConvectiveTemp = TAConvTotal / Atotal + Constant::KelvinConv; + bcs->wallRadiantTemp = TARadTotal / Atotal + Constant::Kelvin; + bcs->wallConvectiveTemp = TAConvTotal / Atotal + Constant::Kelvin; bcs->extWallForcedTerm = kmPtr->surfaceConvMap[wallSurfaces[0]].f; bcs->extWallConvectionAlgorithm = kmPtr->surfaceConvMap[wallSurfaces[0]].out; bcs->intWallConvectionAlgorithm = kmPtr->surfaceConvMap[wallSurfaces[0]].in; @@ -502,7 +502,7 @@ void KivaManager::readWeatherData(EnergyPlusData &state) } if (Pos != std::string::npos) LineResult.data.erase(0, Pos + 1); - if (UtilityRoutines::makeUPPER(Header(HdLine)) == "DATA PERIODS") { + if (Util::makeUPPER(Header(HdLine)) == "DATA PERIODS") { bool IOStatus; uppercase(LineResult.data); int NumHdArgs = 2; @@ -525,11 +525,11 @@ void KivaManager::readWeatherData(EnergyPlusData &state) switch (Count) { case 1: - NumHdArgs += 4 * UtilityRoutines::ProcessNumber(LineResult.data.substr(0, Pos), IOStatus); + NumHdArgs += 4 * Util::ProcessNumber(LineResult.data.substr(0, Pos), IOStatus); // TODO: Error if more than one period? Less than full year? break; case 2: - kivaWeather.intervalsPerHour = UtilityRoutines::ProcessNumber(LineResult.data.substr(0, Pos), IOStatus); + kivaWeather.intervalsPerHour = Util::ProcessNumber(LineResult.data.substr(0, Pos), IOStatus); break; default: break; @@ -586,63 +586,63 @@ void KivaManager::readWeatherData(EnergyPlusData &state) if (WeatherDataLine.eof) { break; } - WeatherManager::InterpretWeatherDataLine(state, - WeatherDataLine.data, - ErrorFound, - WYear, - WMonth, - WDay, - WHour, - WMinute, - DryBulb, - DewPoint, - RelHum, - AtmPress, - ETHoriz, - ETDirect, - IRHoriz, - GLBHoriz, - DirectRad, - DiffuseRad, - GLBHorizIllum, - DirectNrmIllum, - DiffuseHorizIllum, - ZenLum, - WindDir, - WindSpeed, - TotalSkyCover, - OpaqueSkyCover, - Visibility, - CeilHeight, - PresWeathObs, - PresWeathConds, - PrecipWater, - AerosolOptDepth, - SnowDepth, - DaysSinceLastSnow, - Albedo, - LiquidPrecip); + Weather::InterpretWeatherDataLine(state, + WeatherDataLine.data, + ErrorFound, + WYear, + WMonth, + WDay, + WHour, + WMinute, + DryBulb, + DewPoint, + RelHum, + AtmPress, + ETHoriz, + ETDirect, + IRHoriz, + GLBHoriz, + DirectRad, + DiffuseRad, + GLBHorizIllum, + DirectNrmIllum, + DiffuseHorizIllum, + ZenLum, + WindDir, + WindSpeed, + TotalSkyCover, + OpaqueSkyCover, + Visibility, + CeilHeight, + PresWeathObs, + PresWeathConds, + PrecipWater, + AerosolOptDepth, + SnowDepth, + DaysSinceLastSnow, + Albedo, + LiquidPrecip); // Checks for missing value if (DryBulb >= 99.9) { - DryBulb = state.dataWeatherManager->Missing.DryBulb; + DryBulb = state.dataWeather->wvarsMissing.OutDryBulbTemp; } if (DewPoint >= 99.9) { - DewPoint = state.dataWeatherManager->Missing.DewPoint; + DewPoint = state.dataWeather->wvarsMissing.OutDewPointTemp; } if (WindSpeed >= 999.0) { - WindSpeed = state.dataWeatherManager->Missing.WindSpd; + WindSpeed = state.dataWeather->wvarsMissing.WindSpeed; } if (OpaqueSkyCover >= 99.0) { - OpaqueSkyCover = state.dataWeatherManager->Missing.OpaqSkyCvr; + OpaqueSkyCover = state.dataWeather->wvarsMissing.OpaqueSkyCover; } kivaWeather.dryBulb.push_back(DryBulb); kivaWeather.windSpeed.push_back(WindSpeed); Real64 OSky = OpaqueSkyCover; - Real64 TDewK = min(DryBulb, DewPoint) + Constant::KelvinConv; - Real64 ESky = (0.787 + 0.764 * std::log(TDewK / Constant::KelvinConv)) * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky)); + Real64 TDewK = min(DryBulb, DewPoint) + Constant::Kelvin; + Real64 ESky = (0.787 + 0.764 * std::log(TDewK / Constant::Kelvin)) * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky)); kivaWeather.skyEmissivity.push_back(ESky); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 54f904522c3..29b3b2755c8 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -362,9 +362,9 @@ namespace HeatBalanceManager { NumNumbers, Status); if (ONum == 5) { - CNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataConstruction->Construct); + CNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataConstruction->Construct); } else { - CNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); + CNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); } if (CNum == 0) continue; state.dataConstruction->Construct(CNum).IsUsed = true; @@ -1112,7 +1112,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cNumericFieldNames); if (NumAlpha > 0) { { - int FlowTypeNum = getEnumValue(DataHeatBalance::AdjustmentTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(1))); + int FlowTypeNum = getEnumValue(DataHeatBalance::AdjustmentTypeNamesUC, Util::makeUPPER(AlphaName(1))); state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = static_cast(FlowTypeNum); AlphaName(1) = DataHeatBalance::AdjustmentTypeNamesCC[FlowTypeNum]; DataHeatBalance::AdjustmentType ZoneFlowAdjustment = state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment; @@ -1136,7 +1136,7 @@ namespace HeatBalanceManager { } if (NumAlpha > 1) { { - int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationFlowTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(2))); + int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationFlowTypeNamesUC, Util::makeUPPER(AlphaName(2))); state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment = static_cast(FlowTypeNum); AlphaName(2) = DataHeatBalance::InfiltrationFlowTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment == DataHeatBalance::InfiltrationFlow::Add || @@ -1164,7 +1164,7 @@ namespace HeatBalanceManager { } else { if (NumAlpha > 2) { { - int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(3))); + int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, Util::makeUPPER(AlphaName(3))); state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones = static_cast(FlowTypeNum); AlphaName(3) = DataHeatBalance::InfiltrationZoneTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones == DataHeatBalance::InfiltrationZoneType::Invalid) { @@ -1609,7 +1609,7 @@ namespace HeatBalanceManager { // Find the material in the list of materials - thisConstruct.LayerPoint(Layer) = UtilityRoutines::FindItemInPtrList(ConstructAlphas(Layer), state.dataMaterial->Material); + thisConstruct.LayerPoint(Layer) = Util::FindItemInPtrList(ConstructAlphas(Layer), state.dataMaterial->Material); // count number of glass layers if (thisConstruct.LayerPoint(Layer) > 0) { @@ -1634,7 +1634,7 @@ namespace HeatBalanceManager { if (thisConstruct.LayerPoint(Layer) == 0) { // This may be a TC GlazingGroup - thisConstruct.LayerPoint(Layer) = UtilityRoutines::FindItemInList(ConstructAlphas(Layer), state.dataHeatBal->TCGlazings); + thisConstruct.LayerPoint(Layer) = Util::FindItemInList(ConstructAlphas(Layer), state.dataHeatBal->TCGlazings); if (thisConstruct.LayerPoint(Layer) > 0) { // reset layer pointer to the first glazing in the TC GlazingGroup @@ -1704,9 +1704,9 @@ namespace HeatBalanceManager { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - std::string const thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + std::string const thisObjectName = Util::makeUPPER(instance.key()); - std::string construction_name = UtilityRoutines::makeUPPER(fields.at("construction_name").get()); + std::string construction_name = Util::makeUPPER(fields.at("construction_name").get()); int source_after_layer_number = fields.at("thermal_source_present_after_layer_number").get(); int calculation_after_layer_number = fields.at("temperature_calculation_requested_after_layer_number").get(); int ctf_dimensions = fields.at("dimensions_for_the_ctf_calculation").get(); @@ -1723,7 +1723,7 @@ namespace HeatBalanceManager { } // Find the construction - int construction_index = UtilityRoutines::FindItemInList(construction_name, state.dataConstruction->Construct); + int construction_index = Util::FindItemInList(construction_name, state.dataConstruction->Construct); if (construction_index == 0) { ShowSevereError(state, @@ -1827,7 +1827,7 @@ namespace HeatBalanceManager { // Find the material in the list of materials state.dataConstruction->Construct(TotRegConstructs + ConstrNum).LayerPoint(Layer) = - UtilityRoutines::FindItemInPtrList(ConstructAlphas(Layer), state.dataMaterial->Material); + Util::FindItemInPtrList(ConstructAlphas(Layer), state.dataMaterial->Material); if (state.dataConstruction->Construct(TotRegConstructs + ConstrNum).LayerPoint(Layer) == 0) { ShowSevereError(state, @@ -2038,8 +2038,7 @@ namespace HeatBalanceManager { TMP = index(state.dataIPShortCut->cAlphaArgs(1), char(2)); } - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBalMgr->CurrentModuleObject, ErrorsFound)) - continue; + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBalMgr->CurrentModuleObject, ErrorsFound)) continue; ++ZoneLoop; ProcessZoneData(state, @@ -2091,7 +2090,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cNumericFieldNames); state.dataHeatBal->ZoneList(ListNum).Name = state.dataIPShortCut->cAlphaArgs(1); - if (UtilityRoutines::FindItemInList(state.dataHeatBal->ZoneList(ListNum).Name, state.dataHeatBal->Zone) > 0) { + if (Util::FindItemInList(state.dataHeatBal->ZoneList(ListNum).Name, state.dataHeatBal->Zone) > 0) { ShowWarningError( state, format( @@ -2114,7 +2113,7 @@ namespace HeatBalanceManager { std::string ZoneName = state.dataIPShortCut->cAlphaArgs(ZoneNum + 1); state.dataHeatBal->ZoneList(ListNum).MaxZoneNameLength = max(state.dataHeatBal->ZoneList(ListNum).MaxZoneNameLength, len(ZoneName)); - state.dataHeatBal->ZoneList(ListNum).Zone(ZoneNum) = UtilityRoutines::FindItemInList(ZoneName, state.dataHeatBal->Zone); + state.dataHeatBal->ZoneList(ListNum).Zone(ZoneNum) = Util::FindItemInList(ZoneName, state.dataHeatBal->Zone); if (state.dataHeatBal->ZoneList(ListNum).Zone(ZoneNum) == 0) { ShowSevereError(state, format("{}{}=\"{}\": {} {} not found.", @@ -2172,7 +2171,7 @@ namespace HeatBalanceManager { state.dataHeatBal->ZoneGroup(GroupNum).Multiplier = state.dataIPShortCut->rNumericArgs(1); // Zone list - int ListNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->ZoneList); + int ListNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->ZoneList); state.dataHeatBal->ZoneGroup(GroupNum).ZoneList = ListNum; if (ListNum == 0) { @@ -2271,7 +2270,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cNumericFieldNames); // Assign surface number - int SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface); + int SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, format("{}{}=\"{}, object. Illegal value for {} has been found.", @@ -2377,7 +2376,7 @@ namespace HeatBalanceManager { state.dataHeatBal->ZoneLocalEnvironment(Loop).Name = state.dataIPShortCut->cAlphaArgs(1); // Assign zone number - int ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (ZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}, object. Illegal value for {} has been found.", @@ -2510,9 +2509,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 (UtilityRoutines::SameString("No", cAlphaArgs(4))) { + if (Util::SameString("No", cAlphaArgs(4))) { state.dataHeatBal->Zone(ZoneLoop).isPartOfTotalArea = false; - } else if (UtilityRoutines::SameString("Yes", cAlphaArgs(4)) || lAlphaFieldBlanks(4)) { + } else if (Util::SameString("Yes", cAlphaArgs(4)) || lAlphaFieldBlanks(4)) { state.dataHeatBal->Zone(ZoneLoop).isPartOfTotalArea = true; } else { ShowSevereError(state, format("{}{}=\"{}\".", RoutineName, cCurrentModuleObject, state.dataHeatBal->Zone(ZoneLoop).Name)); @@ -2572,13 +2571,13 @@ namespace HeatBalanceManager { ++spaceNum; auto const &objectFields = instance.value(); auto &thisSpace = state.dataHeatBal->space(spaceNum); - thisSpace.Name = UtilityRoutines::makeUPPER(instance.key()); + thisSpace.Name = Util::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); std::string zoneName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_name"); thisSpace.CeilingHeight = ip->getRealFieldValue(objectFields, objectSchemaProps, "ceiling_height"); thisSpace.Volume = ip->getRealFieldValue(objectFields, objectSchemaProps, "volume"); thisSpace.userEnteredFloorArea = ip->getRealFieldValue(objectFields, objectSchemaProps, "floor_area"); - int zoneNum = UtilityRoutines::FindItemInList(zoneName, state.dataHeatBal->Zone); + int zoneNum = Util::FindItemInList(zoneName, state.dataHeatBal->Zone); if (zoneNum > 0) { thisSpace.zoneNum = zoneNum; state.dataHeatBal->Zone(zoneNum).spaceIndexes.emplace_back(spaceNum); @@ -2591,7 +2590,7 @@ namespace HeatBalanceManager { thisSpace.spaceType = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "space_type"); bool spaceTypeFound = false; for (int spaceTypePtr = 1; spaceTypePtr <= state.dataGlobal->numSpaceTypes; ++spaceTypePtr) { - if (UtilityRoutines::SameString(thisSpace.spaceType, state.dataHeatBal->spaceTypes(spaceTypePtr))) { + if (Util::SameString(thisSpace.spaceType, state.dataHeatBal->spaceTypes(spaceTypePtr))) { thisSpace.spaceTypeNum = spaceTypePtr; spaceTypeFound = true; break; @@ -2631,15 +2630,15 @@ namespace HeatBalanceManager { ++spaceListNum; auto const &objectFields = instance.value(); auto &thisSpaceList = state.dataHeatBal->spaceList(spaceListNum); - thisSpaceList.Name = UtilityRoutines::makeUPPER(instance.key()); + thisSpaceList.Name = Util::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); - if (UtilityRoutines::FindItemInList(thisSpaceList.Name, state.dataHeatBal->Zone) > 0) { + if (Util::FindItemInList(thisSpaceList.Name, state.dataHeatBal->Zone) > 0) { ShowSevereError(state, format("{}{}=\"{}\": is a duplicate of a zone name.", RoutineName, cCurrentModuleObject, thisSpaceList.Name)); ErrorsFound = true; } - if (UtilityRoutines::FindItemInList(thisSpaceList.Name, state.dataHeatBal->space) > 0) { + if (Util::FindItemInList(thisSpaceList.Name, state.dataHeatBal->space) > 0) { ShowSevereError(state, format("{}{}=\"{}\": is a duplicate of a space name.", RoutineName, cCurrentModuleObject, thisSpaceList.Name)); ErrorsFound = true; @@ -2653,7 +2652,7 @@ namespace HeatBalanceManager { auto &extensiblesArray = extensibles.value(); for (auto &extensibleInstance : extensiblesArray) { std::string thisSpaceName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_name"); - int thisSpaceNum = UtilityRoutines::FindItemInList(thisSpaceName, state.dataHeatBal->space); + int thisSpaceNum = Util::FindItemInList(thisSpaceName, state.dataHeatBal->space); if (thisSpaceNum > 0) { thisSpaceList.spaces.emplace_back(thisSpaceNum); ++thisSpaceList.numListSpaces; @@ -2702,7 +2701,7 @@ namespace HeatBalanceManager { bool generalSpaceTypeExists = false; int generalSpaceTypeNum = 0; for (int spaceTypePtr = 1; spaceTypePtr <= state.dataGlobal->numSpaceTypes; ++spaceTypePtr) { - if (UtilityRoutines::SameString(state.dataHeatBal->spaceTypes(spaceTypePtr), "GENERAL")) { + if (Util::SameString(state.dataHeatBal->spaceTypes(spaceTypePtr), "GENERAL")) { generalSpaceTypeNum = spaceTypePtr; generalSpaceTypeExists = true; break; @@ -3044,57 +3043,52 @@ namespace HeatBalanceManager { state.dataHeatBalMgr->LoadZoneRptStdDev.allocate(state.dataGlobal->NumOfTimeStepInHour * 24); // MassConservation.allocate( NumOfZones ); - state.dataHeatBalFanSys->CrossedColdThreshRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->CrossedHeatThreshRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); + state.dataHeatBalFanSys->CrossedColdThreshRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->CrossedHeatThreshRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->CrossedColdThreshRepPeriod = false; state.dataHeatBalFanSys->CrossedHeatThreshRepPeriod = false; - if (state.dataWeatherManager->TotThermalReportPers > 0) { - state.dataHeatBalFanSys->ZoneHeatIndexHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + if (state.dataWeather->TotThermalReportPers > 0) { + state.dataHeatBalFanSys->ZoneHeatIndexHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->ZoneHeatIndexOccupiedHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->ZoneHeatIndexOccuHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->ZoneHumidexHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->ZoneHumidexHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->ZoneHumidexOccupiedHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->ZoneHumidexOccuHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->ZoneHumidexOccuHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->ZoneColdHourOfSafetyBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->ZoneHeatHourOfSafetyBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->ZoneDiscomfortWtExceedOccuHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + state.dataWeather->TotThermalReportPers); state.dataHeatBalFanSys->ZoneDiscomfortWtExceedOccupiedHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotThermalReportPers); + state.dataWeather->TotThermalReportPers); } - if (state.dataWeatherManager->TotCO2ReportPers > 0) { - state.dataHeatBalFanSys->ZoneCO2LevelHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotCO2ReportPers); - state.dataHeatBalFanSys->ZoneCO2LevelOccuHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotCO2ReportPers); + if (state.dataWeather->TotCO2ReportPers > 0) { + state.dataHeatBalFanSys->ZoneCO2LevelHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotCO2ReportPers); + state.dataHeatBalFanSys->ZoneCO2LevelOccuHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotCO2ReportPers); state.dataHeatBalFanSys->ZoneCO2LevelOccupiedHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotCO2ReportPers); + state.dataWeather->TotCO2ReportPers); } - if (state.dataWeatherManager->TotVisualReportPers > 0) { + if (state.dataWeather->TotVisualReportPers > 0) { state.dataHeatBalFanSys->ZoneLightingLevelHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotVisualReportPers); + state.dataWeather->TotVisualReportPers); state.dataHeatBalFanSys->ZoneLightingLevelOccuHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotVisualReportPers); + state.dataWeather->TotVisualReportPers); state.dataHeatBalFanSys->ZoneLightingLevelOccupiedHourBinsRepPeriod.allocate(state.dataGlobal->NumOfZones, - state.dataWeatherManager->TotVisualReportPers); + state.dataWeather->TotVisualReportPers); } - state.dataHeatBalFanSys->ZoneLowSETHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->ZoneHighSETHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->lowSETLongestHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->highSETLongestHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->lowSETLongestStartRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); - state.dataHeatBalFanSys->highSETLongestStartRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeatherManager->TotThermalReportPers); + state.dataHeatBalFanSys->ZoneLowSETHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->ZoneHighSETHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->lowSETLongestHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->highSETLongestHoursRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->lowSETLongestStartRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); + state.dataHeatBalFanSys->highSETLongestStartRepPeriod.allocate(state.dataGlobal->NumOfZones, state.dataWeather->TotThermalReportPers); state.dataHeatBalMgr->CountWarmupDayPoints = 0; } @@ -3891,7 +3885,7 @@ namespace HeatBalanceManager { // Get window name and check for match W5Name = std::string{DataLine(4).substr(19)}; - WindowNameInW5DataFile = UtilityRoutines::makeUPPER(W5Name); + WindowNameInW5DataFile = Util::makeUPPER(W5Name); if (DesiredConstructionName != WindowNameInW5DataFile) { // Doesn't match; read through file until next window entry is found Label20:; @@ -3912,7 +3906,7 @@ namespace HeatBalanceManager { if (NextLine.eof) goto Label1000; ++FileLineCount; bool error = false; - NGlSys = static_cast(UtilityRoutines::ProcessNumber(NextLine.data.substr(19), error)); + NGlSys = static_cast(Util::ProcessNumber(NextLine.data.substr(19), error)); if (NGlSys <= 0 || NGlSys > 2 || error) { ShowFatalError( state, @@ -3997,7 +3991,7 @@ namespace HeatBalanceManager { MullionOrientation = "Vertical"; if (NGlSys == 2) { error = false; - MullionWidth = UtilityRoutines::ProcessNumber(DataLine(10).substr(19), error); + MullionWidth = Util::ProcessNumber(DataLine(10).substr(19), error); if (error) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Mullion Width."); ShowContinueError(state, @@ -4005,7 +3999,7 @@ namespace HeatBalanceManager { ErrorsFound = true; } MullionWidth *= 0.001; - MullionOrientation = UtilityRoutines::ProcessNumber(DataLine(10).substr(88), error); + MullionOrientation = Util::ProcessNumber(DataLine(10).substr(88), error); if (error) { ShowSevereError(state, "HeatBalanceManager: SearchWindow5DataFile: Error in Read of Mullion Orientation."); ShowContinueError(state, @@ -4404,9 +4398,9 @@ namespace HeatBalanceManager { thisConstruct.FromWindow5DataFile = true; thisConstruct.W5FileGlazingSysHeight = WinHeight(IGlSys); thisConstruct.W5FileGlazingSysWidth = WinWidth(IGlSys); - if (UtilityRoutines::SameString(MullionOrientation, "Vertical")) { + if (Util::SameString(MullionOrientation, "Vertical")) { thisConstruct.W5FileMullionOrientation = DataWindowEquivalentLayer::Orientation::Vertical; - } else if (UtilityRoutines::SameString(MullionOrientation, "Horizontal")) { + } else if (Util::SameString(MullionOrientation, "Horizontal")) { thisConstruct.W5FileMullionOrientation = DataWindowEquivalentLayer::Orientation::Horizontal; } else { } @@ -4585,14 +4579,14 @@ namespace HeatBalanceManager { state.dataSurface->FrameDivider(FrDivNum).FrameVisAbsorp = FrameVisAbsorp; state.dataSurface->FrameDivider(FrDivNum).FrameEmis = FrameEmis; state.dataSurface->FrameDivider(FrDivNum).FrameEdgeWidth = 0.06355; // 2.5 in - if (UtilityRoutines::SameString(MullionOrientation, "Vertical")) { + if (Util::SameString(MullionOrientation, "Vertical")) { state.dataSurface->FrameDivider(FrDivNum).MullionOrientation = DataWindowEquivalentLayer::Orientation::Vertical; - } else if (UtilityRoutines::SameString(MullionOrientation, "Horizontal")) { + } else if (Util::SameString(MullionOrientation, "Horizontal")) { state.dataSurface->FrameDivider(FrDivNum).MullionOrientation = DataWindowEquivalentLayer::Orientation::Horizontal; } - if (UtilityRoutines::SameString(DividerType(IGlSys), "DividedLite")) { + if (Util::SameString(DividerType(IGlSys), "DividedLite")) { state.dataSurface->FrameDivider(FrDivNum).DividerType = DataSurfaces::FrameDividerType::DividedLite; - } else if (UtilityRoutines::SameString(DividerType(IGlSys), "Suspended")) { + } else if (Util::SameString(DividerType(IGlSys), "Suspended")) { state.dataSurface->FrameDivider(FrDivNum).DividerType = DataSurfaces::FrameDividerType::Suspended; } state.dataSurface->FrameDivider(FrDivNum).DividerWidth = DividerWidth(IGlSys); @@ -4722,7 +4716,7 @@ namespace HeatBalanceManager { int iFCConcreteLayer; // Layer pointer to the materials array // First get the concrete layer - iFCConcreteLayer = UtilityRoutines::FindItemInPtrList("~FC_Concrete", state.dataMaterial->Material); + iFCConcreteLayer = Util::FindItemInPtrList("~FC_Concrete", state.dataMaterial->Material); Rcon = state.dataMaterial->Material(iFCConcreteLayer)->Resistance; // Count number of constructions defined with Ffactor or Cfactor method @@ -4816,7 +4810,7 @@ namespace HeatBalanceManager { thisConstruct.LayerPoint(2) = iFCConcreteLayer; // The fictitious insulation is the outside layer - MaterNum = UtilityRoutines::FindItemInPtrList(format("~FC_Insulation_{}", Loop), state.dataMaterial->Material); + MaterNum = Util::FindItemInPtrList(format("~FC_Insulation_{}", Loop), state.dataMaterial->Material); thisConstruct.LayerPoint(1) = MaterNum; // Calculate the thermal resistance of the fictitious insulation layer @@ -4910,8 +4904,7 @@ namespace HeatBalanceManager { thisConstruct.LayerPoint(2) = iFCConcreteLayer; // The fictitious insulation is the outside layer - MaterNum = - UtilityRoutines::FindItemInPtrList("~FC_Insulation_" + fmt::to_string(Loop + TotFfactorConstructs), state.dataMaterial->Material); + MaterNum = Util::FindItemInPtrList("~FC_Insulation_" + fmt::to_string(Loop + TotFfactorConstructs), state.dataMaterial->Material); thisConstruct.LayerPoint(1) = MaterNum; // CR 8886 Rsoil should be in SI unit. From ASHRAE 90.1-2010 SI @@ -4977,7 +4970,7 @@ namespace HeatBalanceManager { ++constrNum; auto &thisConstruct = state.dataConstruction->Construct(constrNum); - thisConstruct.Name = UtilityRoutines::makeUPPER(thisObjectName); + thisConstruct.Name = Util::makeUPPER(thisObjectName); thisConstruct.TypeIsAirBoundary = true; thisConstruct.IsUsedCTF = false; @@ -4986,7 +4979,7 @@ namespace HeatBalanceManager { if (fields.find("air_exchange_method") != fields.end()) { airMethod = fields.at("air_exchange_method").get(); } - if (UtilityRoutines::SameString(airMethod, "SimpleMixing")) { + if (Util::SameString(airMethod, "SimpleMixing")) { thisConstruct.TypeIsAirBoundaryMixing = true; if (fields.find("simple_mixing_air_changes_per_hour") != fields.end()) { thisConstruct.AirBoundaryACH = fields.at("simple_mixing_air_changes_per_hour").get(); @@ -4998,7 +4991,7 @@ namespace HeatBalanceManager { } if (fields.find("simple_mixing_schedule_name") != fields.end()) { const std::string &schedName = fields.at("simple_mixing_schedule_name").get(); - thisConstruct.AirBoundaryMixingSched = ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(schedName)); + thisConstruct.AirBoundaryMixingSched = ScheduleManager::GetScheduleIndex(state, Util::makeUPPER(schedName)); if (thisConstruct.AirBoundaryMixingSched == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) Simple Mixing Schedule Name=\"{}\".", @@ -5078,7 +5071,7 @@ namespace HeatBalanceManager { state.dataSurface->SurfIncSolSSG(Loop).Name = state.dataIPShortCut->cAlphaArgs(1); // Assign surface number - SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, format("{}{}=\"{}, object. Illegal value for {} has been found.", @@ -5110,7 +5103,7 @@ namespace HeatBalanceManager { } // Assign construction number - ConstrNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct); + ConstrNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct); if (ConstrNum == 0) { ShowSevereError(state, format("{}{}=\"{}, object. Illegal value for {} has been found.", @@ -5176,7 +5169,7 @@ namespace HeatBalanceManager { state.dataSurface->FenLayAbsSSG(Loop).Name = state.dataIPShortCut->cAlphaArgs(1); // Assign surface number - SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, format("{}{}=\"{}, object. Illegal value for {} has been found.", @@ -5195,7 +5188,7 @@ namespace HeatBalanceManager { } // Assign construction number - ConstrNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct); + ConstrNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct); auto const &thisConstruct = state.dataConstruction->Construct(ConstrNum); if (ConstrNum == 0) { ShowSevereError(state, @@ -5765,7 +5758,7 @@ namespace HeatBalanceManager { } if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - thisMaterial->GasPointer = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(2), state.dataMaterial->Material); + thisMaterial->GasPointer = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(2), state.dataMaterial->Material); } else { ShowSevereError(state, format("{}{}=\"{}, object. Illegal value for {} has been found.", @@ -5776,12 +5769,10 @@ namespace HeatBalanceManager { ShowContinueError(state, format("{} does not have assigned WindowMaterial:Gas or WindowMaterial:GasMixutre.", cCurrentModuleObject)); } if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - thisMaterial->DeflectionStatePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->DeflectionState); + thisMaterial->DeflectionStatePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->DeflectionState); } if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - thisMaterial->SupportPillarPtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->SupportPillar); + thisMaterial->SupportPillarPtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->SupportPillar); } } @@ -6407,7 +6398,7 @@ namespace HeatBalanceManager { } // Simon: Assign thermal model number - ThermalModelNum = UtilityRoutines::FindItemInList(locAlphaArgs(4), state.dataMaterial->WindowThermalModel); + ThermalModelNum = Util::FindItemInList(locAlphaArgs(4), state.dataMaterial->WindowThermalModel); if (ThermalModelNum == 0) { ShowSevereError(state, format("{}{}=\"{}, object. Illegal value for {} has been found.", @@ -6655,7 +6646,7 @@ namespace HeatBalanceManager { AlphaIndex = 9 + (Layer * 3) - 2; currentOpticalLayer = int(Layer / 2) + 1; // Material info is contained in the thermal construct - thisConstruct.LayerPoint(Layer) = UtilityRoutines::FindItemInPtrList(locAlphaArgs(AlphaIndex), state.dataMaterial->Material); + thisConstruct.LayerPoint(Layer) = Util::FindItemInPtrList(locAlphaArgs(AlphaIndex), state.dataMaterial->Material); // Simon: Load only if optical layer if (mod(Layer, 2) != 0) { diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index c2f563a7e9a..b4c4949ff8d 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -5636,7 +5636,7 @@ void CalcThermalResilience(EnergyPlusData &state) for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { Real64 const ZoneW = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).airHumRatAvg; Real64 const ZoneT = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).ZTAV; - Real64 const TDewPointK = Psychrometrics::PsyTdpFnWPb(state, ZoneW, state.dataEnvrn->OutBaroPress) + Constant::KelvinConv; + Real64 const TDewPointK = Psychrometrics::PsyTdpFnWPb(state, ZoneW, state.dataEnvrn->OutBaroPress) + Constant::Kelvin; Real64 const e = 6.11 * std::exp(5417.7530 * ((1 / 273.16) - (1 / TDewPointK))); Real64 const h = 5.0 / 9.0 * (e - 10.0); Real64 const Humidex = ZoneT + h; @@ -5649,17 +5649,16 @@ void ReportThermalResilience(EnergyPlusData &state) { Array1D_bool reportPeriodFlags; - if (state.dataWeatherManager->TotReportPers > 0) { - reportPeriodFlags.dimension(state.dataWeatherManager->TotThermalReportPers, false); - General::findReportPeriodIdx( - state, state.dataWeatherManager->ThermalReportPeriodInput, state.dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + if (state.dataWeather->TotReportPers > 0) { + reportPeriodFlags.dimension(state.dataWeather->TotThermalReportPers, false); + General::findReportPeriodIdx(state, state.dataWeather->ThermalReportPeriodInput, state.dataWeather->TotThermalReportPers, reportPeriodFlags); } auto &ort = state.dataOutRptTab; - for (int i = 1; i <= state.dataWeatherManager->TotThermalReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotThermalReportPers; i++) { if (reportPeriodFlags(i)) { int curResMeterNumber = ort->meterNumTotalsBEPS(1); - state.dataWeatherManager->ThermalReportPeriodInput(i).totalElectricityUse += GetCurrentMeterValue(state, curResMeterNumber); + state.dataWeather->ThermalReportPeriodInput(i).totalElectricityUse += GetCurrentMeterValue(state, curResMeterNumber); } } @@ -5681,7 +5680,7 @@ void ReportThermalResilience(EnergyPlusData &state) for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { // the whole period // user specified reporting period - for (int i = 1; i <= state.dataWeatherManager->TotThermalReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotThermalReportPers; i++) { state.dataHeatBalFanSys->ZoneHeatIndexHourBinsRepPeriod(ZoneNum, i).assign(HINoBins, 0.0); state.dataHeatBalFanSys->ZoneHeatIndexOccuHourBinsRepPeriod(ZoneNum, i).assign(HINoBins, 0.0); state.dataHeatBalFanSys->ZoneHeatIndexOccupiedHourBinsRepPeriod(ZoneNum, i).assign(HINoBins, 0.0); @@ -5842,7 +5841,7 @@ void ReportThermalResilience(EnergyPlusData &state) } } - for (int i = 1; i <= state.dataWeatherManager->TotThermalReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotThermalReportPers; i++) { if (reportPeriodFlags(i)) { int ReportPeriodIdx = i; ColdTempThresh = state.dataHeatBal->People(iPeople).ColdStressTempThresh; @@ -6049,7 +6048,7 @@ void ReportThermalResilience(EnergyPlusData &state) } } - for (int i = 1; i <= state.dataWeatherManager->TotThermalReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotThermalReportPers; i++) { if (reportPeriodFlags(i)) { int ReportPeriodIdx = i; @@ -6224,7 +6223,7 @@ void ReportCO2Resilience(EnergyPlusData &state) if (state.dataHeatBalSurfMgr->reportCO2ResilienceFirstTime) { int NoBins = 3; for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - for (int i = 1; i <= state.dataWeatherManager->TotCO2ReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotCO2ReportPers; i++) { state.dataHeatBalFanSys->ZoneCO2LevelHourBinsRepPeriod(ZoneNum, i).assign(NoBins, 0.0); state.dataHeatBalFanSys->ZoneCO2LevelOccuHourBinsRepPeriod(ZoneNum, i).assign(NoBins, 0.0); state.dataHeatBalFanSys->ZoneCO2LevelOccupiedHourBinsRepPeriod(ZoneNum, i).assign(NoBins, 0.0); @@ -6252,17 +6251,16 @@ void ReportCO2Resilience(EnergyPlusData &state) } Array1D_bool reportPeriodFlags; - if (state.dataWeatherManager->TotReportPers > 0) { - reportPeriodFlags.dimension(state.dataWeatherManager->TotCO2ReportPers, false); - General::findReportPeriodIdx( - state, state.dataWeatherManager->CO2ReportPeriodInput, state.dataWeatherManager->TotCO2ReportPers, reportPeriodFlags); + if (state.dataWeather->TotReportPers > 0) { + reportPeriodFlags.dimension(state.dataWeather->TotCO2ReportPers, false); + General::findReportPeriodIdx(state, state.dataWeather->CO2ReportPeriodInput, state.dataWeather->TotCO2ReportPers, reportPeriodFlags); } auto &ort = state.dataOutRptTab; - for (int i = 1; i <= state.dataWeatherManager->TotCO2ReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotCO2ReportPers; i++) { if (reportPeriodFlags(i)) { int curResMeterNumber = ort->meterNumTotalsBEPS(1); - state.dataWeatherManager->CO2ReportPeriodInput(i).totalElectricityUse += GetCurrentMeterValue(state, curResMeterNumber); + state.dataWeather->CO2ReportPeriodInput(i).totalElectricityUse += GetCurrentMeterValue(state, curResMeterNumber); } } @@ -6283,7 +6281,7 @@ void ReportCO2Resilience(EnergyPlusData &state) state.dataHeatBal->Resilience(ZoneNum).ZoneCO2LevelOccuHourBins[2] += NumOcc * state.dataGlobal->TimeStepZone; state.dataHeatBal->Resilience(ZoneNum).ZoneCO2LevelOccupiedHourBins[2] += (NumOcc > 0) * state.dataGlobal->TimeStepZone; } - for (int i = 1; i <= state.dataWeatherManager->TotCO2ReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotCO2ReportPers; i++) { if (reportPeriodFlags(i)) { int ReportPeriodIdx = i; if (ZoneAirCO2 <= 1000) { @@ -6316,7 +6314,7 @@ void ReportVisualResilience(EnergyPlusData &state) if (state.dataHeatBalSurfMgr->reportVisualResilienceFirstTime) { int NoBins = 4; for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - for (int i = 1; i <= state.dataWeatherManager->TotVisualReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotVisualReportPers; i++) { state.dataHeatBalFanSys->ZoneLightingLevelHourBinsRepPeriod(ZoneNum, i).assign(NoBins, 0.0); state.dataHeatBalFanSys->ZoneLightingLevelOccuHourBinsRepPeriod(ZoneNum, i).assign(NoBins, 0.0); state.dataHeatBalFanSys->ZoneLightingLevelOccupiedHourBinsRepPeriod(ZoneNum, i).assign(NoBins, 0.0); @@ -6362,17 +6360,17 @@ void ReportVisualResilience(EnergyPlusData &state) } Array1D_bool reportPeriodFlags; - if (state.dataWeatherManager->TotReportPers > 0) { - reportPeriodFlags.dimension(state.dataWeatherManager->TotVisualReportPers, false); + if (state.dataWeather->TotReportPers > 0) { + reportPeriodFlags.dimension(state.dataWeather->TotVisualReportPers, false); General::findReportPeriodIdx( - state, state.dataWeatherManager->VisualReportPeriodInput, state.dataWeatherManager->TotVisualReportPers, reportPeriodFlags); + state, state.dataWeather->VisualReportPeriodInput, state.dataWeather->TotVisualReportPers, reportPeriodFlags); } auto &ort = state.dataOutRptTab; - for (int i = 1; i <= state.dataWeatherManager->TotVisualReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotVisualReportPers; i++) { if (reportPeriodFlags(i)) { int curResMeterNumber = ort->meterNumTotalsBEPS(1); - state.dataWeatherManager->VisualReportPeriodInput(i).totalElectricityUse += GetCurrentMeterValue(state, curResMeterNumber); + state.dataWeather->VisualReportPeriodInput(i).totalElectricityUse += GetCurrentMeterValue(state, curResMeterNumber); } } @@ -6400,7 +6398,7 @@ void ReportVisualResilience(EnergyPlusData &state) state.dataHeatBal->Resilience(ZoneNum).ZoneLightingLevelOccuHourBins[3] += NumOcc * state.dataGlobal->TimeStepZone; state.dataHeatBal->Resilience(ZoneNum).ZoneLightingLevelOccupiedHourBins[3] += (NumOcc > 0) * state.dataGlobal->TimeStepZone; } - for (int i = 1; i <= state.dataWeatherManager->TotVisualReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotVisualReportPers; i++) { if (reportPeriodFlags(i)) { int ReportPeriodIdx = i; if (avgZoneIllum <= 100) { @@ -7394,7 +7392,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, if (state.dataSurface->Surface(SurfNum).SurfHasSurroundingSurfProperty) { int SrdSurfsNum = state.dataSurface->Surface(SurfNum).SurfSurroundingSurfacesNum; // Absolute temperature of the outside surface of an exterior surface - Real64 TSurf = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfNum) + Constant::KelvinConv; + Real64 TSurf = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfNum) + Constant::Kelvin; for (int SrdSurfNum = 1; SrdSurfNum <= state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { // View factor of a surrounding surface @@ -7403,7 +7401,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, Real64 SrdSurfTempAbs = ScheduleManager::GetCurrentScheduleValue( state, state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + - Constant::KelvinConv; + Constant::Kelvin; state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) += Constant::StefanBoltzmann * AbsThermSurf * SrdSurfViewFac * (pow_4(SrdSurfTempAbs) - pow_4(TSurf)); } @@ -7706,7 +7704,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, if (state.dataHeatBal->AnyKiva) { for (auto const &kivaSurf : state.dataSurfaceGeometry->kivaManager.surfaceMap) { - state.dataHeatBalSurf->SurfTempIn(kivaSurf.first) = kivaSurf.second.results.Trad - Constant::KelvinConv; + state.dataHeatBalSurf->SurfTempIn(kivaSurf.first) = kivaSurf.second.results.Trad - Constant::Kelvin; } } @@ -8040,7 +8038,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, } else if (surface.HeatTransferAlgorithm == DataSurfaces::HeatTransferModel::Kiva) { // Read Kiva results for each surface state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = - state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.Tconv - Constant::KelvinConv; + state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.Tconv - Constant::Kelvin; TH11 = 0.0; } @@ -8124,7 +8122,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // time) | Convection and damping term state.dataHeatBalSurf->SurfTempIn(SurfNum) = state.dataHeatBalSurf->SurfTempInTmp(SurfNum); - Real64 const Sigma_Temp_4(Constant::StefanBoltzmann * pow_4(state.dataHeatBalSurf->SurfTempIn(SurfNum) + Constant::KelvinConv)); + Real64 const Sigma_Temp_4(Constant::StefanBoltzmann * pow_4(state.dataHeatBalSurf->SurfTempIn(SurfNum) + Constant::Kelvin)); // Calculate window heat gain for TDD:DIFFUSER since this calculation is usually done in WindowManager if (state.dataHeatBalSurf->AnyRadiantSystems(SurfNum)) @@ -8819,8 +8817,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // conduction from the outside surface | Coefficient for conduction (current // time) | Convection and damping term state.dataHeatBalSurf->SurfTempIn(surfNum) = state.dataHeatBalSurf->SurfTempInTmp(surfNum); - Real64 const Sigma_Temp_4(Constant::StefanBoltzmann * - pow_4(state.dataHeatBalSurf->SurfTempIn(surfNum) + Constant::KelvinConv)); + Real64 const Sigma_Temp_4(Constant::StefanBoltzmann * pow_4(state.dataHeatBalSurf->SurfTempIn(surfNum) + Constant::Kelvin)); // Calculate window heat gain for TDD:DIFFUSER since this calculation is usually done in WindowManager if (state.dataHeatBalSurf->AnyRadiantSystems(surfNum)) @@ -9771,14 +9768,14 @@ void GetGroundSurfacesTemperatureAverage(EnergyPlusData &state) if (GndSurfViewFactor == 0.0) continue; if (GndSurfsProperty.GndSurfs(gSurfNum).TempSchPtr == 0) continue; GndSurfaceTemp = ScheduleManager::GetCurrentScheduleValue(state, GndSurfsProperty.GndSurfs(gSurfNum).TempSchPtr); - GndSurfaceTempSum += GndSurfViewFactor * pow_4(GndSurfaceTemp + Constant::KelvinConv); + GndSurfaceTempSum += GndSurfViewFactor * pow_4(GndSurfaceTemp + Constant::Kelvin); } if (GndSurfaceTempSum == 0.0) { GndSurfsProperty.SurfsTempAvg = 0.0; state.dataSurface->Surface(SurfNum).UseSurfPropertyGndSurfTemp = false; continue; } - GndSurfsProperty.SurfsTempAvg = root_4(GndSurfaceTempSum / GndSurfsProperty.SurfsViewFactorSum) - Constant::KelvinConv; + GndSurfsProperty.SurfsTempAvg = root_4(GndSurfaceTempSum / GndSurfsProperty.SurfsViewFactorSum) - Constant::Kelvin; } } @@ -9851,10 +9848,10 @@ void GetSurroundingSurfacesTemperatureAverage(EnergyPlusData &state) auto &SrdSurfsProperty = state.dataSurface->SurroundingSurfsProperty(surface.SurfSurroundingSurfacesNum); for (int SrdSurfNum = 1; SrdSurfNum <= SrdSurfsProperty.TotSurroundingSurface; SrdSurfNum++) { SrdSurfaceTemp = - ScheduleManager::GetCurrentScheduleValue(state, SrdSurfsProperty.SurroundingSurfs(SrdSurfNum).TempSchNum) + Constant::KelvinConv; + ScheduleManager::GetCurrentScheduleValue(state, SrdSurfsProperty.SurroundingSurfs(SrdSurfNum).TempSchNum) + Constant::Kelvin; SrdSurfaceTempSum += SrdSurfsProperty.SurroundingSurfs(SrdSurfNum).ViewFactor * pow_4(SrdSurfaceTemp); } - surface.SrdSurfTemp = root_4(SrdSurfaceTempSum / surface.ViewFactorSrdSurfs) - Constant::KelvinConv; + surface.SrdSurfTemp = root_4(SrdSurfaceTempSum / surface.ViewFactorSrdSurfs) - Constant::Kelvin; } } } // namespace EnergyPlus::HeatBalanceSurfaceManager diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index 9da4ed901d8..4a2a2273fe0 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -572,7 +572,7 @@ void GshpSpecs::GetWatertoWaterHPInput(EnergyPlusData &state) for (int GSHPNum = 1; GSHPNum <= state.dataHPWaterToWaterSimple->NumGSHPs; ++GSHPNum) { auto &thisGSHP = state.dataHPWaterToWaterSimple->GSHP(GSHPNum); if (!thisGSHP.companionName.empty()) { - thisGSHP.companionIndex = UtilityRoutines::FindItemInList(thisGSHP.companionName, state.dataHPWaterToWaterSimple->GSHP); + thisGSHP.companionIndex = Util::FindItemInList(thisGSHP.companionName, state.dataHPWaterToWaterSimple->GSHP); if (thisGSHP.companionIndex == 0) { ShowSevereError(state, format("GetEquationFitWaterToWater Input: did not find companion heat pump named '{}' in heat pump called {}", @@ -1580,8 +1580,8 @@ void GshpSpecs::CalcWatertoWaterHPCooling(EnergyPlusData &state, Real64 const My Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; // SUBROUTINE PARAMETER DEFINITIONS: - Real64 constexpr CelsiustoKelvin(Constant::KelvinConv); // Conversion from Celsius to Kelvin - Real64 constexpr Tref(283.15); // Reference Temperature for performance curves,10C [K] + Real64 constexpr CelsiustoKelvin(Constant::Kelvin); // Conversion from Celsius to Kelvin + Real64 constexpr Tref(283.15); // Reference Temperature for performance curves,10C [K] static constexpr std::string_view RoutineName("CalcWatertoWaterHPCooling"); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -1746,8 +1746,8 @@ void GshpSpecs::CalcWatertoWaterHPHeating(EnergyPlusData &state, Real64 const My Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const CelsiustoKelvin(Constant::KelvinConv); // Conversion from Celsius to Kelvin - Real64 constexpr Tref(283.15); // Reference Temperature for performance curves,10C [K] + Real64 const CelsiustoKelvin(Constant::Kelvin); // Conversion from Celsius to Kelvin + Real64 constexpr Tref(283.15); // Reference Temperature for performance curves,10C [K] static constexpr std::string_view RoutineName("CalcWatertoWaterHPHeating"); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 855768e5c4d..b4bb39d5f68 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -140,7 +140,7 @@ namespace HeatRecovery { // Find the correct unit index int HeatExchNum; // index of unit being simulated if (CompIndex == 0) { - HeatExchNum = UtilityRoutines::FindItemInList(CompName, state.dataHeatRecovery->ExchCond); + HeatExchNum = Util::FindItemInList(CompName, state.dataHeatRecovery->ExchCond); if (HeatExchNum == 0) { ShowFatalError(state, format("SimHeatRecovery: Unit not found={}", CompName)); } @@ -501,19 +501,19 @@ namespace HeatRecovery { thisExchanger.NomElecPower = state.dataIPShortCut->rNumericArgs(10); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "Yes")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "Yes")) { thisExchanger.ControlToTemperatureSetPoint = true; } else { - if (!UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "No")) { + if (!Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "No")) { ShowSevereError(state, "Rotary HX Speed Modulation or Plate Bypass for Temperature Control for "); ShowContinueError(state, format("{} must be set to Yes or No", thisExchanger.Name)); ErrorsFound = true; } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "Plate")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), "Plate")) { thisExchanger.ExchConfig = HXConfigurationType::Plate; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "Rotary")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), "Rotary")) { thisExchanger.ExchConfig = HXConfigurationType::Rotary; } else { ShowSevereError(state, format("{} configuration not found= {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(8))); @@ -528,7 +528,7 @@ namespace HeatRecovery { ErrorsFound = true; } - if (!UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "None")) { + if (!Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "None")) { thisExchanger.ThresholdTemperature = state.dataIPShortCut->rNumericArgs(11); thisExchanger.InitialDefrostTime = state.dataIPShortCut->rNumericArgs(12); thisExchanger.RateofDefrostTimeIncrease = state.dataIPShortCut->rNumericArgs(13); @@ -1034,7 +1034,7 @@ namespace HeatRecovery { int const ExchNum = ExchIndex + NumAirToAirPlateExchs + NumAirToAirGenericExchs; auto &thisExchanger = state.dataHeatRecovery->ExchCond(ExchNum); for (int PerfDataNum = 1; PerfDataNum <= NumDesBalExchsPerfDataType1; ++PerfDataNum) { - if (UtilityRoutines::SameString(thisExchanger.HeatExchPerfName, state.dataHeatRecovery->BalDesDehumPerfData(PerfDataNum).Name)) { + if (Util::SameString(thisExchanger.HeatExchPerfName, state.dataHeatRecovery->BalDesDehumPerfData(PerfDataNum).Name)) { thisExchanger.PerfDataIndex = PerfDataNum; break; } @@ -4819,7 +4819,7 @@ namespace HeatRecovery { state.dataHeatRecovery->GetInputFlag = false; } - int const WhichHX = UtilityRoutines::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); + int const WhichHX = Util::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); if (WhichHX != 0) { return state.dataHeatRecovery->ExchCond(WhichHX).SupInletNode; } else { @@ -4851,7 +4851,7 @@ namespace HeatRecovery { state.dataHeatRecovery->GetInputFlag = false; } - int const WhichHX = UtilityRoutines::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); + int const WhichHX = Util::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); if (WhichHX != 0) { return state.dataHeatRecovery->ExchCond(WhichHX).SupOutletNode; } else { @@ -4883,7 +4883,7 @@ namespace HeatRecovery { state.dataHeatRecovery->GetInputFlag = false; } - int const WhichHX = UtilityRoutines::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); + int const WhichHX = Util::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); if (WhichHX != 0) { return state.dataHeatRecovery->ExchCond(WhichHX).SecInletNode; } else { @@ -4915,7 +4915,7 @@ namespace HeatRecovery { state.dataHeatRecovery->GetInputFlag = false; } - int const WhichHX = UtilityRoutines::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); + int const WhichHX = Util::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); if (WhichHX != 0) { return state.dataHeatRecovery->ExchCond(WhichHX).SecOutletNode; } else { @@ -4947,7 +4947,7 @@ namespace HeatRecovery { state.dataHeatRecovery->GetInputFlag = false; } - int const WhichHX = UtilityRoutines::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); + int const WhichHX = Util::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); if (WhichHX != 0) { return state.dataHeatRecovery->ExchCond(WhichHX).NomSupAirVolFlow; } else { @@ -4980,7 +4980,7 @@ namespace HeatRecovery { state.dataHeatRecovery->GetInputFlag = false; } - int const WhichHX = UtilityRoutines::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); + int const WhichHX = Util::FindItemInList(HXName, state.dataHeatRecovery->ExchCond); if (WhichHX != 0) { return state.dataHeatRecovery->ExchCond(WhichHX).ExchType; } else { diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 372fe21b064..086d4e05917 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -134,7 +134,7 @@ namespace HeatingCoils { // Find the correct HeatingCoilNumber with the Coil Name if (present(CompIndex)) { if (CompIndex == 0) { - CoilNum = UtilityRoutines::FindItemInList(CompName, state.dataHeatingCoils->HeatingCoil); + CoilNum = Util::FindItemInList(CompName, state.dataHeatingCoils->HeatingCoil); if (CoilNum == 0) { ShowFatalError(state, format("SimulateHeatingCoilComponents: Coil not found={}", CompName)); } @@ -1084,9 +1084,9 @@ namespace HeatingCoils { BranchNodeConnections::TestCompSet(state, CurrentModuleObject, Alphas(1), Alphas(3), Alphas(4), "Air Nodes"); - if ((UtilityRoutines::SameString(Alphas(5), "Refrigeration:Condenser:AirCooled")) || - (UtilityRoutines::SameString(Alphas(5), "Refrigeration:Condenser:EvaporativeCooled")) || - (UtilityRoutines::SameString(Alphas(5), "Refrigeration:Condenser:WaterCooled"))) { + if ((Util::SameString(Alphas(5), "Refrigeration:Condenser:AirCooled")) || + (Util::SameString(Alphas(5), "Refrigeration:Condenser:EvaporativeCooled")) || + (Util::SameString(Alphas(5), "Refrigeration:Condenser:WaterCooled"))) { if (lNumericBlanks(1)) { heatingCoil.Efficiency = 0.8; } else { @@ -1115,7 +1115,7 @@ namespace HeatingCoils { // Find the DX equipment index associated with the desuperheater heating coil. // The CoilNum may not be found here when zone heating equip. exists. Check again in InitHeatingCoil. // (when zone equipment heating coils are included in the input, the air loop DX equipment has not yet been read in) - if (UtilityRoutines::SameString(Alphas(5), "Refrigeration:CompressorRack")) { + if (Util::SameString(Alphas(5), "Refrigeration:CompressorRack")) { heatingCoil.ReclaimHeatingSource = HeatObjTypes::COMPRESSORRACK_REFRIGERATEDCASE; RefrigeratedCase::GetRefrigeratedRackIndex( state, Alphas(6), heatingCoil.ReclaimHeatingSourceIndexNum, DataHeatBalance::RefrigSystemType::Rack, DXCoilErrFlag, Alphas(5)); @@ -1139,9 +1139,9 @@ namespace HeatingCoils { state.dataHeatingCoils->ValidSourceType(CoilNum) = true; } } - } else if ((UtilityRoutines::SameString(Alphas(5), "Refrigeration:Condenser:AirCooled")) || - (UtilityRoutines::SameString(Alphas(5), "Refrigeration:Condenser:EvaporativeCooled")) || - (UtilityRoutines::SameString(Alphas(5), "Refrigeration:Condenser:WaterCooled"))) { + } else if ((Util::SameString(Alphas(5), "Refrigeration:Condenser:AirCooled")) || + (Util::SameString(Alphas(5), "Refrigeration:Condenser:EvaporativeCooled")) || + (Util::SameString(Alphas(5), "Refrigeration:Condenser:WaterCooled"))) { heatingCoil.ReclaimHeatingSource = HeatObjTypes::CONDENSER_REFRIGERATION; RefrigeratedCase::GetRefrigeratedRackIndex(state, Alphas(6), @@ -1169,7 +1169,7 @@ namespace HeatingCoils { state.dataHeatingCoils->ValidSourceType(CoilNum) = true; } } - } else if (UtilityRoutines::SameString(Alphas(5), "Coil:Cooling:DX:SingleSpeed")) { + } else if (Util::SameString(Alphas(5), "Coil:Cooling:DX:SingleSpeed")) { heatingCoil.ReclaimHeatingSource = HeatObjTypes::COIL_DX_COOLING; DXCoils::GetDXCoilIndex(state, Alphas(6), heatingCoil.ReclaimHeatingSourceIndexNum, DXCoilErrFlag, Alphas(5)); if (heatingCoil.ReclaimHeatingSourceIndexNum > 0) { @@ -1193,7 +1193,7 @@ namespace HeatingCoils { } } if (heatingCoil.ReclaimHeatingSourceIndexNum > 0) state.dataHeatingCoils->ValidSourceType(CoilNum) = true; - } else if (UtilityRoutines::SameString(Alphas(5), "Coil:Cooling:DX:VariableSpeed")) { + } else if (Util::SameString(Alphas(5), "Coil:Cooling:DX:VariableSpeed")) { heatingCoil.ReclaimHeatingSource = HeatObjTypes::COIL_DX_VARIABLE_COOLING; heatingCoil.ReclaimHeatingSourceIndexNum = VariableSpeedCoils::GetCoilIndexVariableSpeed(state, Alphas(5), Alphas(6), DXCoilErrFlag); if (heatingCoil.ReclaimHeatingSourceIndexNum > 0) { @@ -1216,7 +1216,7 @@ namespace HeatingCoils { state.dataHeatingCoils->ValidSourceType(CoilNum) = true; } } - } else if (UtilityRoutines::SameString(Alphas(5), "Coil:Cooling:DX:TwoSpeed")) { + } else if (Util::SameString(Alphas(5), "Coil:Cooling:DX:TwoSpeed")) { heatingCoil.ReclaimHeatingSource = HeatObjTypes::COIL_DX_MULTISPEED; DXCoils::GetDXCoilIndex(state, Alphas(6), heatingCoil.ReclaimHeatingSourceIndexNum, DXCoilErrFlag, Alphas(5)); if (heatingCoil.ReclaimHeatingSourceIndexNum > 0) { @@ -1239,7 +1239,7 @@ namespace HeatingCoils { state.dataHeatingCoils->ValidSourceType(CoilNum) = true; } } - } else if (UtilityRoutines::SameString(Alphas(5), "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { + } else if (Util::SameString(Alphas(5), "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { heatingCoil.ReclaimHeatingSource = HeatObjTypes::COIL_DX_MULTIMODE; DXCoils::GetDXCoilIndex(state, Alphas(6), heatingCoil.ReclaimHeatingSourceIndexNum, DXCoilErrFlag, Alphas(5)); if (heatingCoil.ReclaimHeatingSourceIndexNum > 0) { @@ -1262,7 +1262,7 @@ namespace HeatingCoils { state.dataHeatingCoils->ValidSourceType(CoilNum) = true; } } - } else if (UtilityRoutines::SameString(Alphas(5), "Coil:Cooling:DX")) { + } else if (Util::SameString(Alphas(5), "Coil:Cooling:DX")) { heatingCoil.ReclaimHeatingSource = HeatObjTypes::COIL_COOLING_DX_NEW; heatingCoil.ReclaimHeatingSourceIndexNum = CoilCoolingDX::factory(state, Alphas(6)); if (heatingCoil.ReclaimHeatingSourceIndexNum < 0) { @@ -1517,9 +1517,7 @@ namespace HeatingCoils { switch (heatingCoil.ReclaimHeatingSource) { case HeatObjTypes::COMPRESSORRACK_REFRIGERATEDCASE: { for (int RackNum = 1; RackNum <= state.dataRefrigCase->NumRefrigeratedRacks; ++RackNum) { - if (!UtilityRoutines::SameString(state.dataHeatBal->HeatReclaimRefrigeratedRack(RackNum).Name, - heatingCoil.ReclaimHeatingCoilName)) - continue; + if (!Util::SameString(state.dataHeatBal->HeatReclaimRefrigeratedRack(RackNum).Name, heatingCoil.ReclaimHeatingCoilName)) continue; heatingCoil.ReclaimHeatingSourceIndexNum = RackNum; if (allocated(state.dataHeatBal->HeatReclaimRefrigeratedRack)) { DataHeatBalance::HeatReclaimDataBase &HeatReclaim = @@ -1544,8 +1542,7 @@ namespace HeatingCoils { } break; case HeatObjTypes::CONDENSER_REFRIGERATION: { for (int CondNum = 1; CondNum <= state.dataRefrigCase->NumRefrigCondensers; ++CondNum) { - if (!UtilityRoutines::SameString(state.dataHeatBal->HeatReclaimRefrigCondenser(CondNum).Name, heatingCoil.ReclaimHeatingCoilName)) - continue; + if (!Util::SameString(state.dataHeatBal->HeatReclaimRefrigCondenser(CondNum).Name, heatingCoil.ReclaimHeatingCoilName)) continue; heatingCoil.ReclaimHeatingSourceIndexNum = CondNum; if (allocated(state.dataHeatBal->HeatReclaimRefrigCondenser)) { DataHeatBalance::HeatReclaimDataBase &HeatReclaim = @@ -1572,8 +1569,7 @@ namespace HeatingCoils { case HeatObjTypes::COIL_DX_MULTISPEED: case HeatObjTypes::COIL_DX_MULTIMODE: { for (int DXCoilNum = 1; DXCoilNum <= state.dataDXCoils->NumDXCoils; ++DXCoilNum) { - if (!UtilityRoutines::SameString(state.dataHeatBal->HeatReclaimDXCoil(DXCoilNum).Name, heatingCoil.ReclaimHeatingCoilName)) - continue; + if (!Util::SameString(state.dataHeatBal->HeatReclaimDXCoil(DXCoilNum).Name, heatingCoil.ReclaimHeatingCoilName)) continue; heatingCoil.ReclaimHeatingSourceIndexNum = DXCoilNum; if (allocated(state.dataHeatBal->HeatReclaimDXCoil)) { DataHeatBalance::HeatReclaimDataBase &HeatReclaim = @@ -1598,8 +1594,7 @@ namespace HeatingCoils { } break; case HeatObjTypes::COIL_DX_VARIABLE_COOLING: { for (int DXCoilNum = 1; DXCoilNum <= state.dataVariableSpeedCoils->NumVarSpeedCoils; ++DXCoilNum) { - if (!UtilityRoutines::SameString(state.dataHeatBal->HeatReclaimVS_DXCoil(DXCoilNum).Name, heatingCoil.ReclaimHeatingCoilName)) - continue; + if (!Util::SameString(state.dataHeatBal->HeatReclaimVS_DXCoil(DXCoilNum).Name, heatingCoil.ReclaimHeatingCoilName)) continue; heatingCoil.ReclaimHeatingSourceIndexNum = DXCoilNum; if (allocated(state.dataHeatBal->HeatReclaimVS_DXCoil)) { DataHeatBalance::HeatReclaimDataBase &HeatReclaim = @@ -2970,7 +2965,7 @@ namespace HeatingCoils { state.dataHeatingCoils->GetCoilsInputFlag = false; } - HeatingCoilIndex = UtilityRoutines::FindItem(HeatingCoilName, state.dataHeatingCoils->HeatingCoil); + HeatingCoilIndex = Util::FindItem(HeatingCoilName, state.dataHeatingCoils->HeatingCoil); if (HeatingCoilIndex == 0) { ShowSevereError(state, format("GetCoilIndex: Heating coil not found={}", HeatingCoilName)); ErrorsFound = true; @@ -3000,11 +2995,11 @@ namespace HeatingCoils { // Find the correct Coil number if (CompIndex == 0) { - int CoilNum = UtilityRoutines::FindItem(CompName, state.dataHeatingCoils->HeatingCoil); + int CoilNum = Util::FindItem(CompName, state.dataHeatingCoils->HeatingCoil); if (CoilNum == 0) { ShowFatalError(state, format("CheckHeatingCoilSchedule: Coil not found=\"{}\".", CompName)); } - if (!UtilityRoutines::SameString(CompType, DataHVACGlobals::cAllCoilTypes(state.dataHeatingCoils->HeatingCoil(CoilNum).HCoilType_Num))) { + if (!Util::SameString(CompType, DataHVACGlobals::cAllCoilTypes(state.dataHeatingCoils->HeatingCoil(CoilNum).HCoilType_Num))) { ShowSevereError(state, format("CheckHeatingCoilSchedule: Coil=\"{}\"", CompName)); ShowContinueError(state, format("...expected type=\"{}\", actual type=\"{}\".", @@ -3067,15 +3062,15 @@ namespace HeatingCoils { state.dataHeatingCoils->GetCoilsInputFlag = false; } - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { CoilCapacity = state.dataHeatingCoils->HeatingCoil(WhichCoil).NominalCapacity; } } else if (FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { CoilCapacity = state.dataHeatingCoils->HeatingCoil(WhichCoil).MSNominalCapacity(state.dataHeatingCoils->HeatingCoil(WhichCoil).NumOfStages); @@ -3127,11 +3122,11 @@ namespace HeatingCoils { int WhichCoil = 0; int AvailSchIndex = 0; - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { AvailSchIndex = state.dataHeatingCoils->HeatingCoil(WhichCoil).SchedPtr; } @@ -3172,11 +3167,11 @@ namespace HeatingCoils { int WhichCoil = 0; int NodeNumber = 0; - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { NodeNumber = state.dataHeatingCoils->HeatingCoil(WhichCoil).AirInletNodeNum; } @@ -3217,11 +3212,11 @@ namespace HeatingCoils { int WhichCoil = 0; int NodeNumber = 0; - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { NodeNumber = state.dataHeatingCoils->HeatingCoil(WhichCoil).AirOutletNodeNum; } @@ -3268,9 +3263,8 @@ namespace HeatingCoils { int CoilFound = 0; // note should eventually get rid of this string comparison - if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:SINGLESPEED") || - UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:TWOSPEED") || - UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { + if (Util::SameString(CoilType, "COIL:COOLING:DX:SINGLESPEED") || Util::SameString(CoilType, "COIL:COOLING:DX:TWOSPEED") || + Util::SameString(CoilType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) { bool SuppressWarning = true; DXCoils::GetDXCoilIndex(state, CoilName, CoilNum, GetCoilErrFlag, CoilType, SuppressWarning); for (NumCoil = 1; NumCoil <= state.dataHeatingCoils->NumHeatingCoils; ++NumCoil) { @@ -3282,7 +3276,7 @@ namespace HeatingCoils { CoilFound = CoilNum; break; } - } else if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED")) { + } else if (Util::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED")) { CoilNum = VariableSpeedCoils::GetCoilIndexVariableSpeed(state, CoilType, CoilName, GetCoilErrFlag); for (NumCoil = 1; NumCoil <= state.dataHeatingCoils->NumHeatingCoils; ++NumCoil) { if (state.dataHeatingCoils->HeatingCoil(NumCoil).ReclaimHeatingSource != HeatObjTypes::COIL_DX_VARIABLE_COOLING && @@ -3322,11 +3316,11 @@ namespace HeatingCoils { state.dataHeatingCoils->GetCoilsInputFlag = false; } - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - int WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + int WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { return state.dataHeatingCoils->HeatingCoil(WhichCoil).TempSetPointNodeNum; } @@ -3359,11 +3353,11 @@ namespace HeatingCoils { state.dataHeatingCoils->GetCoilsInputFlag = false; } - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - int WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + int WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { return state.dataHeatingCoils->HeatingCoil(WhichCoil).HCoilType_Num; } @@ -3397,11 +3391,11 @@ namespace HeatingCoils { } int WhichCoil = 0; - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); } if (WhichCoil == 0) { @@ -3435,11 +3429,11 @@ namespace HeatingCoils { state.dataHeatingCoils->GetCoilsInputFlag = false; } - int FoundType = UtilityRoutines::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); + int FoundType = Util::FindItem(CoilType, DataHVACGlobals::cAllCoilTypes, DataHVACGlobals::NumAllCoilTypes); if (FoundType == DataHVACGlobals::Coil_HeatingElectric || FoundType == DataHVACGlobals::Coil_HeatingElectric_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingGasOrOtherFuel || FoundType == DataHVACGlobals::Coil_HeatingGas_MultiStage || FoundType == DataHVACGlobals::Coil_HeatingDesuperheater) { - int WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); + int WhichCoil = Util::FindItem(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { return state.dataHeatingCoils->HeatingCoil(WhichCoil).PLFCurveIndex; } else { @@ -3473,7 +3467,7 @@ namespace HeatingCoils { state.dataHeatingCoils->GetCoilsInputFlag = false; } - int WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataHeatingCoils->HeatingCoil); + int WhichCoil = Util::FindItemInList(CoilName, state.dataHeatingCoils->HeatingCoil); if (WhichCoil != 0) { return state.dataHeatingCoils->HeatingCoil(WhichCoil).NumOfStages; } else { @@ -3538,7 +3532,7 @@ namespace HeatingCoils { state.dataHeatingCoils->GetCoilsInputFlag = false; } - HeatingCoilIndex = UtilityRoutines::FindItem(HeatingCoilName, state.dataHeatingCoils->HeatingCoil); + HeatingCoilIndex = Util::FindItem(HeatingCoilName, state.dataHeatingCoils->HeatingCoil); if (HeatingCoilIndex == 0) { ShowSevereError(state, format("GetCoilIndex: Heating coil not found={}", HeatingCoilName)); ErrorsFound = true; diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index bfdeb3e70ac..4f3f1dd22de 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -143,7 +143,7 @@ namespace HighTempRadiantSystem { // Find the correct ZoneHVAC:HighTemperatureRadiant if (CompIndex == 0) { - RadSysNum = UtilityRoutines::FindItemInList(CompName, state.dataHighTempRadSys->HighTempRadSys); + RadSysNum = Util::FindItemInList(CompName, state.dataHighTempRadSys->HighTempRadSys); if (RadSysNum == 0) { ShowFatalError(state, format("SimHighTempRadiantSystem: Unit not found={}", CompName)); } @@ -276,7 +276,7 @@ namespace HighTempRadiantSystem { } } - highTempRadSys.ZonePtr = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); + highTempRadSys.ZonePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); if (highTempRadSys.ZonePtr == 0) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); ShowContinueError(state, format("Occurs for {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/Humidifiers.cc b/src/EnergyPlus/Humidifiers.cc index 351997f0ff3..2458fbc550c 100644 --- a/src/EnergyPlus/Humidifiers.cc +++ b/src/EnergyPlus/Humidifiers.cc @@ -138,7 +138,7 @@ namespace Humidifiers { // Get the humidifier unit index if (CompIndex == 0) { - HumNum = UtilityRoutines::FindItemInList(CompName, Humidifier); + HumNum = Util::FindItemInList(CompName, Humidifier); if (HumNum == 0) { ShowFatalError(state, format("SimHumidifier: Unit not found={}", CompName)); } @@ -1427,7 +1427,7 @@ namespace Humidifiers { state.dataHumidifiers->GetInputFlag = false; } - WhichHumidifier = UtilityRoutines::FindItemInList(HumidifierName, state.dataHumidifiers->Humidifier); + WhichHumidifier = Util::FindItemInList(HumidifierName, state.dataHumidifiers->Humidifier); if (WhichHumidifier != 0) { NodeNum = state.dataHumidifiers->Humidifier(WhichHumidifier).AirInNode; } else { @@ -1450,7 +1450,7 @@ namespace Humidifiers { state.dataHumidifiers->GetInputFlag = false; } - int WhichHumidifier = UtilityRoutines::FindItemInList(HumidifierName, state.dataHumidifiers->Humidifier); + int WhichHumidifier = Util::FindItemInList(HumidifierName, state.dataHumidifiers->Humidifier); if (WhichHumidifier != 0) { return state.dataHumidifiers->Humidifier(WhichHumidifier).AirOutNode; } else { diff --git a/src/EnergyPlus/HybridModel.cc b/src/EnergyPlus/HybridModel.cc index 14c9ff4a727..99d6566c3b2 100644 --- a/src/EnergyPlus/HybridModel.cc +++ b/src/EnergyPlus/HybridModel.cc @@ -146,16 +146,14 @@ namespace HybridModel { cNumericFieldNames); ZoneListPtr = 0; - ZonePtr = - UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); // "Zone" is a 1D array, cAlphaArgs(2) is the zone name + ZonePtr = Util::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); // "Zone" is a 1D array, cAlphaArgs(2) is the zone name if (ZonePtr == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZoneListPtr = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataHeatBal->ZoneList); + ZoneListPtr = Util::FindItemInList(cAlphaArgs(2), state.dataHeatBal->ZoneList); if (ZonePtr > 0) { - state.dataHybridModel->HybridModelZone(ZonePtr).Name = cAlphaArgs(1); // Zone HybridModel name - state.dataHybridModel->FlagHybridModel_TM = UtilityRoutines::SameString(cAlphaArgs(3), "Yes"); // Calculate thermal mass option - state.dataHybridModel->FlagHybridModel_AI = - UtilityRoutines::SameString(cAlphaArgs(4), "Yes"); // Calculate infiltration rate option - state.dataHybridModel->FlagHybridModel_PC = UtilityRoutines::SameString(cAlphaArgs(5), "Yes"); // Calculate people count option + state.dataHybridModel->HybridModelZone(ZonePtr).Name = cAlphaArgs(1); // Zone HybridModel name + state.dataHybridModel->FlagHybridModel_TM = Util::SameString(cAlphaArgs(3), "Yes"); // Calculate thermal mass option + state.dataHybridModel->FlagHybridModel_AI = Util::SameString(cAlphaArgs(4), "Yes"); // Calculate infiltration rate option + state.dataHybridModel->FlagHybridModel_PC = Util::SameString(cAlphaArgs(5), "Yes"); // Calculate people count option // Pointers used to help decide which unknown parameter to solve // Zone Air Infiltration Rate and Zone Internal Thermal Mass calculations cannot be performed simultaneously diff --git a/src/EnergyPlus/HybridUnitaryAirConditioners.cc b/src/EnergyPlus/HybridUnitaryAirConditioners.cc index b67a249ad3e..46c9298e27c 100644 --- a/src/EnergyPlus/HybridUnitaryAirConditioners.cc +++ b/src/EnergyPlus/HybridUnitaryAirConditioners.cc @@ -97,7 +97,7 @@ void SimZoneHybridUnitaryAirConditioners(EnergyPlusData &state, } if (CompIndex == 0) { - CompNum = UtilityRoutines::FindItemInList(CompName, state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner); + CompNum = Util::FindItemInList(CompName, state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner); if (CompNum == 0) { ShowFatalError(state, "SimZoneHybridUnitaryAirConditioners: ZoneHVAC:HybridUnitaryHVAC not found."); } @@ -505,13 +505,13 @@ void GetInputZoneHybridUnitaryAirConditioners(EnergyPlusData &state, bool &Error IsNotOK = false; IsBlank = false; - UtilityRoutines::VerifyName(state, - Alphas(1), - state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner, - UnitLoop - 1, - IsNotOK, - IsBlank, - cCurrentModuleObject + " Name"); + Util::VerifyName(state, + Alphas(1), + state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner, + UnitLoop - 1, + IsNotOK, + IsBlank, + cCurrentModuleObject + " Name"); // A1, \field Name state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitLoop).Name = Alphas(1); @@ -628,9 +628,9 @@ void GetInputZoneHybridUnitaryAirConditioners(EnergyPlusData &state, bool &Error // A13, \field Fan Heat Included in Lookup Tables state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitLoop).FanHeatGain = false; if (!lAlphaBlanks(13)) { - if (UtilityRoutines::SameString(Alphas(13), "Yes")) { + if (Util::SameString(Alphas(13), "Yes")) { state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitLoop).FanHeatGain = false; - } else if (UtilityRoutines::SameString(Alphas(13), "No")) { + } else if (Util::SameString(Alphas(13), "No")) { state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitLoop).FanHeatGain = true; } else { ShowSevereError( @@ -671,7 +671,7 @@ void GetInputZoneHybridUnitaryAirConditioners(EnergyPlusData &state, bool &Error // A19, \ OA requirement pointer if (!lAlphaBlanks(19)) { state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitLoop).OARequirementsPtr = - UtilityRoutines::FindItemInList(Alphas(19), state.dataSize->OARequirements); + Util::FindItemInList(Alphas(19), state.dataSize->OARequirements); if (state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitLoop).OARequirementsPtr == 0) { ShowSevereError(state, format("{}{} = {} invalid data", RoutineName, cCurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Invalid-not found {}=\"{}\".", cAlphaFields(19), Alphas(19))); diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index 0afb251f2a8..d531fd6d2b6 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -156,7 +156,7 @@ namespace ICEngineElectricGenerator { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); state.dataICEngElectGen->ICEngineGenerator(genNum).Name = AlphArray(1); diff --git a/src/EnergyPlus/IOFiles.cc b/src/EnergyPlus/IOFiles.cc index 7ea08775593..1716904736e 100644 --- a/src/EnergyPlus/IOFiles.cc +++ b/src/EnergyPlus/IOFiles.cc @@ -330,7 +330,7 @@ void IOFiles::OutputControl::getInput(EnergyPlusData &state) auto found = fields.find(field_name); if (found != fields.end()) { input = found.value().get(); - input = UtilityRoutines::makeUPPER(input); + input = Util::makeUPPER(input); } else { state.dataInputProcessing->inputProcessor->getDefaultValue(state, "OutputControl:Files", field_name, input); } diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index 1c8cca37c0a..f42e43cc7ff 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -711,7 +711,7 @@ namespace IceThermalStorage { _, _, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); ++state.dataIceThermalStorage->TotalNumIceStorage; state.dataIceThermalStorage->SimpleIceStorage(iceNum).MapNum = state.dataIceThermalStorage->TotalNumIceStorage; @@ -721,9 +721,9 @@ namespace IceThermalStorage { // Get Ice Thermal Storage Type state.dataIceThermalStorage->SimpleIceStorage(iceNum).ITSType = state.dataIPShortCut->cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataIceThermalStorage->SimpleIceStorage(iceNum).ITSType, "IceOnCoilInternal")) { + if (Util::SameString(state.dataIceThermalStorage->SimpleIceStorage(iceNum).ITSType, "IceOnCoilInternal")) { state.dataIceThermalStorage->SimpleIceStorage(iceNum).ITSType_Num = ITSType::IceOnCoilInternal; - } else if (UtilityRoutines::SameString(state.dataIceThermalStorage->SimpleIceStorage(iceNum).ITSType, "IceOnCoilExternal")) { + } else if (Util::SameString(state.dataIceThermalStorage->SimpleIceStorage(iceNum).ITSType, "IceOnCoilExternal")) { state.dataIceThermalStorage->SimpleIceStorage(iceNum).ITSType_Num = ITSType::IceOnCoilExternal; } else { ShowSevereError(state, format("{}={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -815,7 +815,7 @@ namespace IceThermalStorage { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); ++state.dataIceThermalStorage->TotalNumIceStorage; @@ -990,9 +990,9 @@ namespace IceThermalStorage { } state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndicator = state.dataIPShortCut->cAlphaArgs(9); - if (UtilityRoutines::SameString(state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndicator, "INSIDEMELT")) { + if (Util::SameString(state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndicator, "INSIDEMELT")) { state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndex = DetIce::InsideMelt; - } else if ((UtilityRoutines::SameString(state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndicator, "OUTSIDEMELT")) || + } else if ((Util::SameString(state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndicator, "OUTSIDEMELT")) || (state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndicator.empty())) { state.dataIceThermalStorage->DetailedIceStorage(iceNum).ThawProcessIndex = DetIce::OutsideMelt; } else { diff --git a/src/EnergyPlus/InputProcessing/InputProcessor.cc b/src/EnergyPlus/InputProcessing/InputProcessor.cc index 6016650d5f9..10ce662ca4c 100644 --- a/src/EnergyPlus/InputProcessing/InputProcessor.cc +++ b/src/EnergyPlus/InputProcessing/InputProcessor.cc @@ -144,7 +144,7 @@ json const &InputProcessor::getFields(EnergyPlusData &state, std::string const & if (it2 == objs.end()) { // HACK: this is not ideal and should be removed once everything is case sensitive internally for (auto it3 = objs.begin(); it3 != objs.end(); ++it3) { - if (UtilityRoutines::makeUPPER(it3.key()) == objectName) { + if (Util::makeUPPER(it3.key()) == objectName) { return it3.value(); } } @@ -556,7 +556,7 @@ bool InputProcessor::findDefault(std::string &default_value, json const &schema_ default_value = s; } if (schema_field_obj.find("retaincase") == schema_field_obj.end()) { - default_value = UtilityRoutines::makeUPPER(default_value); + default_value = Util::makeUPPER(default_value); } return true; } @@ -736,7 +736,7 @@ std::pair InputProcessor::getObjectItemValue(std::string cons output.second = false; } if (schema_field_obj.find("retaincase") == schema_field_obj.end()) { - output.first = UtilityRoutines::makeUPPER(output.first); + output.first = Util::makeUPPER(output.first); } return output; } @@ -1041,7 +1041,7 @@ void InputProcessor::getObjectItem(EnergyPlusData &state, if (name_iter.find("retaincase") != name_iter.end()) { Alphas(alpha_index) = objectInfo.objectName; } else { - Alphas(alpha_index) = UtilityRoutines::makeUPPER(objectInfo.objectName); + Alphas(alpha_index) = Util::makeUPPER(objectInfo.objectName); } if (is_AlphaBlank) AlphaBlank()(alpha_index) = objectInfo.objectName.empty(); if (is_AlphaFieldNames) { @@ -1224,9 +1224,9 @@ int InputProcessor::getObjectItemNum(EnergyPlusData &state, int object_item_num = 1; bool found = false; - std::string const upperObjName = UtilityRoutines::makeUPPER(ObjName); + std::string const upperObjName = Util::makeUPPER(ObjName); for (auto it = obj->begin(); it != obj->end(); ++it) { - if (UtilityRoutines::makeUPPER(it.key()) == upperObjName) { + if (Util::makeUPPER(it.key()) == upperObjName) { found = true; break; } @@ -1262,11 +1262,11 @@ int InputProcessor::getObjectItemNum(EnergyPlusData &state, int object_item_num = 1; bool found = false; - std::string const upperObjName = UtilityRoutines::makeUPPER(ObjName); + std::string const upperObjName = Util::makeUPPER(ObjName); for (auto it = obj->begin(); it != obj->end(); ++it) { auto it2 = it.value().find(NameTypeVal); - if ((it2 != it.value().end()) && (UtilityRoutines::makeUPPER(it2.value().get()) == upperObjName)) { + if ((it2 != it.value().end()) && (Util::makeUPPER(it2.value().get()) == upperObjName)) { found = true; break; } @@ -1279,153 +1279,6 @@ int InputProcessor::getObjectItemNum(EnergyPlusData &state, return getIDFObjNum(state, ObjType, object_item_num); // if incoming input is idf, then return idf object order } -void InputProcessor::lowerRangeCheck(EnergyPlusData &state, - bool &ErrorsFound, // Set to true if error detected - std::string const &WhatFieldString, // Descriptive field for string - std::string const &WhatObjectString, // Descriptive field for object, Zone Name, etc. - std::string const &ErrorLevel, // 'Warning','Severe','Fatal') - std::string const &LowerBoundString, // String for error message, if applicable - bool const LowerBoundCondition, // Condition for error condition, if applicable - std::string_view const ValueString, // Value with digits if to be displayed with error - std::string_view const WhatObjectName // ObjectName -- used for error messages -) -{ - - // SUBROUTINE INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN July 2000 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine is a general purpose "range check" routine for GetInput routines. - // Using the standard "ErrorsFound" logical, this routine can produce a reasonable - // error message to describe the situation in addition to setting the ErrorsFound variable - // to true. This function is an overload to handle the lower bound check only. It is only - // used in WeatherManager. - - std::string ErrorString; // Uppercase representation of ErrorLevel - std::string Message1; - std::string Message2; - - bool Error = false; - if (!LowerBoundCondition) Error = true; - - if (Error) { - ConvertCaseToUpper(ErrorLevel, ErrorString); - Message1 = WhatObjectString; - if (!WhatObjectName.empty()) { - Message1 += fmt::format("=\"{}\", out of range data", WhatObjectName); - } - Message2 = "Out of range value field=" + WhatFieldString; - if (!ValueString.empty()) { - Message2 += fmt::format(", Value=[{}]", ValueString); - } - Message2 += fmt::format(", range={{{}}}", LowerBoundString); - - { - char const errorCheck = ErrorString[0]; - - if ((errorCheck == 'W') || (errorCheck == 'w')) { - ShowWarningError(state, Message1); - ShowContinueError(state, Message2); - - } else if ((errorCheck == 'S') || (errorCheck == 's')) { - ShowSevereError(state, Message1); - ShowContinueError(state, Message2); - ErrorsFound = true; - - } else if ((errorCheck == 'F') || (errorCheck == 'f')) { - ShowSevereError(state, Message1); - ShowContinueError(state, Message2); - ShowFatalError(state, "Program terminates due to preceding condition(s)."); - - } else { - ShowSevereError(state, Message1); - ShowContinueError(state, Message2); - ErrorsFound = true; - } - } - } -} - -void InputProcessor::rangeCheck(EnergyPlusData &state, - bool &ErrorsFound, // Set to true if error detected - std::string const &WhatFieldString, // Descriptive field for string - std::string const &WhatObjectString, // Descriptive field for object, Zone Name, etc. - std::string const &ErrorLevel, // 'Warning','Severe','Fatal') - std::string const &LowerBoundString, // String for error message, if applicable - bool const LowerBoundCondition, // Condition for error condition, if applicable - std::string const &UpperBoundString, // String for error message, if applicable - bool const UpperBoundCondition, // Condition for error condition, if applicable - std::string_view const ValueString, // Value with digits if to be displayed with error - std::string_view const WhatObjectName // ObjectName -- used for error messages -) -{ - - // SUBROUTINE INFORMATION: - // AUTHOR Linda Lawrie - // DATE WRITTEN July 2000 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // This subroutine is a general purpose "range check" routine for GetInput routines. - // Using the standard "ErrorsFound" logical, this routine can produce a reasonable - // error message to describe the situation in addition to setting the ErrorsFound variable - // to true. This function originally could do just the upper bound, but it was not used - // that way so that option has been removed. It is only used in WeatherManager. - - std::string ErrorString; // Uppercase representation of ErrorLevel - std::string Message1; - std::string Message2; - - bool Error = false; - if (!UpperBoundCondition) { - Error = true; - } - if (!LowerBoundCondition) { - Error = true; - } - - if (Error) { - ConvertCaseToUpper(ErrorLevel, ErrorString); - Message1 = WhatObjectString; - if (!WhatObjectName.empty()) { - Message1 += fmt::format("=\"{}\", out of range data", WhatObjectName); - } - Message2 = "Out of range value field=" + WhatFieldString; - if (!ValueString.empty()) { - Message2 += fmt::format(", Value=[{}]", ValueString); - } - Message2 += fmt::format(", range={{{} and {}}}", LowerBoundString, UpperBoundString); - - { - char const errorCheck = ErrorString[0]; - - if ((errorCheck == 'W') || (errorCheck == 'w')) { - ShowWarningError(state, Message1); - ShowContinueError(state, Message2); - - } else if ((errorCheck == 'S') || (errorCheck == 's')) { - ShowSevereError(state, Message1); - ShowContinueError(state, Message2); - ErrorsFound = true; - - } else if ((errorCheck == 'F') || (errorCheck == 'f')) { - ShowSevereError(state, Message1); - ShowContinueError(state, Message2); - ShowFatalError(state, "Program terminates due to preceding condition(s)."); - - } else { - ShowSevereError(state, Message1); - ShowContinueError(state, Message2); - ErrorsFound = true; - } - } - } -} - void InputProcessor::getMaxSchemaArgs(int &NumArgs, int &NumAlpha, int &NumNumeric) { NumArgs = 0; @@ -2115,7 +1968,7 @@ void InputProcessor::preScanReportingVariables(EnergyPlusData &state) json const &fields = obj.value(); for (auto const &extensions : fields[extension_key]) { try { - std::string const report_name = UtilityRoutines::makeUPPER(extensions.at("report_name").get()); + std::string const report_name = Util::makeUPPER(extensions.at("report_name").get()); if (report_name == "ALLMONTHLY" || report_name == "ALLSUMMARYANDMONTHLY") { for (int i = 1; i <= DataOutputs::NumMonthlyReports; ++i) { addVariablesForMonthlyReport(state, DataOutputs::MonthlyNamedReports(i)); @@ -2513,8 +2366,8 @@ void InputProcessor::addRecordToOutputVariableStructure(EnergyPlusData &state, s if (found == state.dataOutput->OutputVariablesForSimulation.end()) { std::map + // Util::case_insensitive_hasher, + Util::case_insensitive_comparator> data; // data.reserve(32); data.emplace(KeyValue, DataOutputs::OutputReportingVariables(state, KeyValue, VarName)); diff --git a/src/EnergyPlus/InputProcessing/InputProcessor.hh b/src/EnergyPlus/InputProcessing/InputProcessor.hh index f68c3bf8d2e..99f53699927 100644 --- a/src/EnergyPlus/InputProcessing/InputProcessor.hh +++ b/src/EnergyPlus/InputProcessing/InputProcessor.hh @@ -167,30 +167,6 @@ public: std::string const &ObjName // Name of the object type ); - void lowerRangeCheck(EnergyPlusData &state, - bool &ErrorsFound, // Set to true if error detected - std::string const &WhatFieldString, // Descriptive field for string - std::string const &WhatObjectString, // Descriptive field for object, Zone Name, etc. - std::string const &ErrorLevel, // 'Warning','Severe','Fatal') - std::string const &LowerBoundString, // String for error message, if applicable - bool const LowerBoundCondition, // Condition for error condition, if applicable - std::string_view const ValueString = {}, // Value with digits if to be displayed with error - std::string_view const WhatObjectName = {} // ObjectName -- used for error messages - ); - - void rangeCheck(EnergyPlusData &state, - bool &ErrorsFound, // Set to true if error detected - std::string const &WhatFieldString, // Descriptive field for string - std::string const &WhatObjectString, // Descriptive field for object, Zone Name, etc. - std::string const &ErrorLevel, // 'Warning','Severe','Fatal') - std::string const &LowerBoundString, // String for error message, if applicable - bool const LowerBoundCondition, // Condition for error condition, if applicable - std::string const &UpperBoundString, // String for error message, if applicable - bool const UpperBoundCondition, // Condition for error condition, if applicable - std::string_view const ValueString = {}, // Value with digits if to be displayed with error - std::string_view const WhatObjectName = {} // ObjectName -- used for error messages - ); - void getMaxSchemaArgs(int &NumArgs, int &NumAlpha, int &NumNumeric); void getObjectDefMaxArgs(EnergyPlusData &state, diff --git a/src/EnergyPlus/IntegratedHeatPump.cc b/src/EnergyPlus/IntegratedHeatPump.cc index 5aa0b214a79..01cd803d7fd 100644 --- a/src/EnergyPlus/IntegratedHeatPump.cc +++ b/src/EnergyPlus/IntegratedHeatPump.cc @@ -111,7 +111,7 @@ void SimIHP(EnergyPlusData &state, } if (CompIndex == 0) { - DXCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataIntegratedHP->IntegratedHeatPumps); + DXCoilNum = Util::FindItemInList(CompName, state.dataIntegratedHP->IntegratedHeatPumps); if (DXCoilNum == 0) { ShowFatalError(state, format("Integrated Heat Pump not found={}", CompName)); } @@ -1704,7 +1704,7 @@ int GetCoilIndexIHP(EnergyPlusData &state, state.dataIntegratedHP->GetCoilsInputFlag = false; } - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); + IndexNum = Util::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); if (IndexNum == 0) { ShowSevereError(state, format(R"(GetCoilIndexIHP: Could not find CoilType="{}" with Name="{}")", CoilType, CoilName)); @@ -1743,7 +1743,7 @@ int GetCoilInletNodeIHP(EnergyPlusData &state, state.dataIntegratedHP->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); + WhichCoil = Util::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); if (WhichCoil != 0) { NodeNumber = state.dataIntegratedHP->IntegratedHeatPumps(WhichCoil).AirCoolInletNodeNum; } @@ -1786,7 +1786,7 @@ int GetDWHCoilInletNodeIHP(EnergyPlusData &state, state.dataIntegratedHP->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); + WhichCoil = Util::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); if (WhichCoil != 0) { NodeNumber = state.dataIntegratedHP->IntegratedHeatPumps(WhichCoil).ODAirInletNodeNum; } @@ -1829,7 +1829,7 @@ int GetDWHCoilOutletNodeIHP(EnergyPlusData &state, state.dataIntegratedHP->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); + WhichCoil = Util::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); if (WhichCoil != 0) { NodeNumber = state.dataIntegratedHP->IntegratedHeatPumps(WhichCoil).ODAirOutletNodeNum; } @@ -1873,7 +1873,7 @@ int GetIHPDWHCoilPLFFPLR(EnergyPlusData &state, state.dataIntegratedHP->GetCoilsInputFlag = false; } - int WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); + int WhichCoil = Util::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); if (WhichCoil != 0) { auto &ihp = state.dataIntegratedHP->IntegratedHeatPumps(WhichCoil); @@ -1927,7 +1927,7 @@ Real64 GetDWHCoilCapacityIHP(EnergyPlusData &state, state.dataIntegratedHP->GetCoilsInputFlag = false; } - int WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); + int WhichCoil = Util::FindItemInList(CoilName, state.dataIntegratedHP->IntegratedHeatPumps); if (WhichCoil != 0) { auto &ihp = state.dataIntegratedHP->IntegratedHeatPumps(WhichCoil); diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index b53b4d53d30..c0223fc9820 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -623,9 +623,9 @@ namespace InternalHeatGains { // Following is an optional parameter (ASHRAE 55 warnings if (IHGNumAlphas >= 6) { - if (UtilityRoutines::SameString(IHGAlphas(6), "Yes")) { + if (Util::SameString(IHGAlphas(6), "Yes")) { thisPeople.Show55Warning = true; - } else if (!UtilityRoutines::SameString(IHGAlphas(6), "No") && !IHGAlphaFieldBlanks(6)) { + } else if (!Util::SameString(IHGAlphas(6), "No") && !IHGAlphaFieldBlanks(6)) { if (Item1 == 1) { ShowSevereError(state, format("{}{}=\"{}\", {} field should be Yes or No", @@ -748,7 +748,7 @@ namespace InternalHeatGains { // nothing to do here } break; case DataHeatBalance::CalcMRT::SurfaceWeighted: { - thisPeople.SurfacePtr = UtilityRoutines::FindItemInList(IHGAlphas(8), state.dataSurface->Surface); + thisPeople.SurfacePtr = Util::FindItemInList(IHGAlphas(8), state.dataSurface->Surface); if (thisPeople.SurfacePtr == 0 && ModelWithAdditionalInputs) { if (Item1 == 1) { ShowSevereError(state, @@ -2942,9 +2942,9 @@ namespace InternalHeatGains { if (IHGAlphaFieldBlanks(3)) { thisZoneITEq.FlowControlWithApproachTemps = false; } else { - if (UtilityRoutines::SameString(IHGAlphas(3), "FlowFromSystem")) { + if (Util::SameString(IHGAlphas(3), "FlowFromSystem")) { thisZoneITEq.FlowControlWithApproachTemps = false; - } else if (UtilityRoutines::SameString(IHGAlphas(3), "FlowControlWithApproachTemperatures")) { + } else if (Util::SameString(IHGAlphas(3), "FlowControlWithApproachTemperatures")) { thisZoneITEq.FlowControlWithApproachTemps = true; state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).HasAdjustedReturnTempByITE = true; state.dataHeatBal->Zone(thisZoneITEq.ZonePtr).NoHeatToReturnAir = false; @@ -3191,12 +3191,12 @@ namespace InternalHeatGains { } // Environmental class - thisZoneITEq.Class = static_cast(getEnumValue(ITEClassNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(10)))); + thisZoneITEq.Class = static_cast(getEnumValue(ITEClassNamesUC, Util::makeUPPER(IHGAlphas(10)))); ErrorsFound = ErrorsFound || (thisZoneITEq.Class == ITEClass::Invalid); // Air and supply inlet connections thisZoneITEq.AirConnectionType = - static_cast(getEnumValue(ITEInletConnectionNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(11)))); + static_cast(getEnumValue(ITEInletConnectionNamesUC, Util::makeUPPER(IHGAlphas(11)))); if (thisZoneITEq.AirConnectionType == ITEInletConnection::RoomAirModel) { // ZoneITEq(Loop).AirConnectionType = ITEInletConnection::RoomAirModel; ShowWarningError(state, @@ -3549,11 +3549,11 @@ namespace InternalHeatGains { IHGAlphaFieldBlanks, IHGAlphaFieldNames, IHGNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, IHGAlphas(1), contamSSModuleObject, ErrorsFound); + Util::IsNameEmpty(state, IHGAlphas(1), contamSSModuleObject, ErrorsFound); state.dataHeatBal->ZoneCO2Gen(Loop).Name = IHGAlphas(1); - state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = UtilityRoutines::FindItemInList(IHGAlphas(2), state.dataHeatBal->Zone); + state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr = Util::FindItemInList(IHGAlphas(2), state.dataHeatBal->Zone); if (state.dataHeatBal->ZoneCO2Gen(Loop).ZonePtr == 0) { ShowSevereError( state, @@ -4172,7 +4172,7 @@ namespace InternalHeatGains { int counter = 0; for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + std::string const &thisObjectName = Util::makeUPPER(instance.key()); ip->markObjectAsUsed(objectType, instance.key()); // For incoming idf, maintain object order @@ -4187,7 +4187,7 @@ namespace InternalHeatGains { } std::string areaName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, areaFieldName); - int zoneNum = UtilityRoutines::FindItemInList(areaName, state.dataHeatBal->Zone); + int zoneNum = Util::FindItemInList(areaName, state.dataHeatBal->Zone); if (zoneNum > 0) { inputObjects(objNum).spaceStartPtr = numGainInstances + 1; int numSpaces = state.dataHeatBal->Zone(zoneNum).numSpaces; @@ -4205,7 +4205,7 @@ namespace InternalHeatGains { } continue; } - int spaceNum = UtilityRoutines::FindItemInList(areaName, state.dataHeatBal->space); + int spaceNum = Util::FindItemInList(areaName, state.dataHeatBal->space); if (spaceNum > 0) { inputObjects(objNum).spaceStartPtr = numGainInstances + 1; ++numGainInstances; @@ -4216,7 +4216,7 @@ namespace InternalHeatGains { inputObjects(objNum).names.emplace_back(inputObjects(objNum).Name); continue; } - int zoneListNum = UtilityRoutines::FindItemInList(areaName, state.dataHeatBal->ZoneList); + int zoneListNum = Util::FindItemInList(areaName, state.dataHeatBal->ZoneList); if (zoneListNum > 0) { if (zoneListNotAllowed) { ShowSevereError( @@ -4240,7 +4240,7 @@ namespace InternalHeatGains { } continue; } - int spaceListNum = UtilityRoutines::FindItemInList(areaName, state.dataHeatBal->spaceList); + int spaceListNum = Util::FindItemInList(areaName, state.dataHeatBal->spaceList); if (spaceListNum > 0) { if (zoneListNotAllowed) { ShowSevereError( @@ -9451,8 +9451,7 @@ namespace InternalHeatGains { return DeviceIndex; } for (DeviceNum = 1; DeviceNum <= state.dataHeatBal->spaceIntGainDevices(spaceNum).numberOfDevices; ++DeviceNum) { - if ((UtilityRoutines::SameString(state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompObjectName, - intGainName.data())) && + if ((Util::SameString(state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompObjectName, intGainName.data())) && (state.dataHeatBal->spaceIntGainDevices(spaceNum).device(DeviceNum).CompType == intGainType)) { DeviceIndex = DeviceNum; break; diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index 8bc1b7cc4d1..984b7d75bb1 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -180,7 +180,7 @@ namespace LowTempRadiantSystem { // Find the correct Low Temp Radiant System if (CompIndex == 0) { - RadSysNum = UtilityRoutines::FindItemInList(CompName, state.dataLowTempRadSys->RadSysTypes); + RadSysNum = Util::FindItemInList(CompName, state.dataLowTempRadSys->RadSysTypes); if (RadSysNum == 0) { ShowFatalError(state, format("SimLowTempRadiantSystem: Unit not found={}", CompName)); } @@ -188,16 +188,13 @@ namespace LowTempRadiantSystem { SystemType = state.dataLowTempRadSys->RadSysTypes(RadSysNum).SystemType; switch (SystemType) { case LowTempRadiantSystem::SystemType::HydronicSystem: { - state.dataLowTempRadSys->RadSysTypes(RadSysNum).CompIndex = - UtilityRoutines::FindItemInList(CompName, state.dataLowTempRadSys->HydrRadSys); + state.dataLowTempRadSys->RadSysTypes(RadSysNum).CompIndex = Util::FindItemInList(CompName, state.dataLowTempRadSys->HydrRadSys); } break; case LowTempRadiantSystem::SystemType::ConstantFlowSystem: { - state.dataLowTempRadSys->RadSysTypes(RadSysNum).CompIndex = - UtilityRoutines::FindItemInList(CompName, state.dataLowTempRadSys->CFloRadSys); + state.dataLowTempRadSys->RadSysTypes(RadSysNum).CompIndex = Util::FindItemInList(CompName, state.dataLowTempRadSys->CFloRadSys); } break; case LowTempRadiantSystem::SystemType::ElectricSystem: { - state.dataLowTempRadSys->RadSysTypes(RadSysNum).CompIndex = - UtilityRoutines::FindItemInList(CompName, state.dataLowTempRadSys->ElecRadSys); + state.dataLowTempRadSys->RadSysTypes(RadSysNum).CompIndex = Util::FindItemInList(CompName, state.dataLowTempRadSys->ElecRadSys); } break; default: break; @@ -464,9 +461,9 @@ namespace LowTempRadiantSystem { // Determine Low Temp Radiant heating design capacity sizing method thisRadSysDesign.DesignHeatingCapMethodInput = Alphas(5); - if (UtilityRoutines::SameString(thisRadSysDesign.DesignHeatingCapMethodInput, "HeatingDesignCapacity")) { + if (Util::SameString(thisRadSysDesign.DesignHeatingCapMethodInput, "HeatingDesignCapacity")) { thisRadSysDesign.DesignHeatingCapMethod = HeatingDesignCapacity; - } else if (UtilityRoutines::SameString(thisRadSysDesign.DesignHeatingCapMethodInput, "CapacityPerFloorArea")) { + } else if (Util::SameString(thisRadSysDesign.DesignHeatingCapMethodInput, "CapacityPerFloorArea")) { thisRadSysDesign.DesignHeatingCapMethod = CapacityPerFloorArea; if (!lNumericBlanks(4)) { thisRadSysDesign.DesignScaledHeatingCapacity = Numbers(4); @@ -487,7 +484,7 @@ namespace LowTempRadiantSystem { ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(4))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(thisRadSysDesign.DesignHeatingCapMethodInput, "FractionOfAutosizedHeatingCapacity")) { + } else if (Util::SameString(thisRadSysDesign.DesignHeatingCapMethodInput, "FractionOfAutosizedHeatingCapacity")) { thisRadSysDesign.DesignHeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!lNumericBlanks(5)) { thisRadSysDesign.DesignScaledHeatingCapacity = Numbers(5); @@ -520,9 +517,9 @@ namespace LowTempRadiantSystem { // Determine Low Temp Radiant cooling design capacity sizing method thisRadSysDesign.DesignCoolingCapMethodInput = Alphas(7); - if (UtilityRoutines::SameString(thisRadSysDesign.DesignCoolingCapMethodInput, "CoolingDesignCapacity")) { + if (Util::SameString(thisRadSysDesign.DesignCoolingCapMethodInput, "CoolingDesignCapacity")) { thisRadSysDesign.DesignCoolingCapMethod = CoolingDesignCapacity; - } else if (UtilityRoutines::SameString(thisRadSysDesign.DesignCoolingCapMethodInput, "CapacityPerFloorArea")) { + } else if (Util::SameString(thisRadSysDesign.DesignCoolingCapMethodInput, "CapacityPerFloorArea")) { thisRadSysDesign.DesignCoolingCapMethod = CapacityPerFloorArea; if (!lNumericBlanks(7)) { thisRadSysDesign.DesignScaledCoolingCapacity = Numbers(7); @@ -544,7 +541,7 @@ namespace LowTempRadiantSystem { ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(7))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(thisRadSysDesign.DesignCoolingCapMethodInput, "FractionOfAutosizedCoolingCapacity")) { + } else if (Util::SameString(thisRadSysDesign.DesignCoolingCapMethodInput, "FractionOfAutosizedCoolingCapacity")) { thisRadSysDesign.DesignCoolingCapMethod = FractionOfAutosizedCoolingCapacity; if (!lNumericBlanks(8)) { thisRadSysDesign.DesignScaledCoolingCapacity = Numbers(8); @@ -575,11 +572,11 @@ namespace LowTempRadiantSystem { ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(9), Off)) { + if (Util::SameString(Alphas(9), Off)) { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlNone; - } else if (UtilityRoutines::SameString(Alphas(9), SimpleOff)) { + } else if (Util::SameString(Alphas(9), SimpleOff)) { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlSimpleOff; - } else if (UtilityRoutines::SameString(Alphas(9), VariableOff)) { + } else if (Util::SameString(Alphas(9), VariableOff)) { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlVariedOff; } else { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlSimpleOff; @@ -634,7 +631,7 @@ namespace LowTempRadiantSystem { thisRadSys.Name = Alphas(1); thisRadSys.designObjectName = Alphas(2); - thisRadSys.DesignObjectPtr = UtilityRoutines::FindItemInList(thisRadSys.designObjectName, VarFlowRadDesignNames); + thisRadSys.DesignObjectPtr = Util::FindItemInList(thisRadSys.designObjectName, VarFlowRadDesignNames); VarFlowRadDesignData variableFlowDesignDataObject{state.dataLowTempRadSys->HydronicRadiantSysDesign( thisRadSys.DesignObjectPtr)}; // Contains the data for variable flow hydronic systems @@ -651,7 +648,7 @@ namespace LowTempRadiantSystem { } thisRadSys.ZoneName = Alphas(4); - thisRadSys.ZonePtr = UtilityRoutines::FindItemInList(Alphas(4), Zone); + thisRadSys.ZonePtr = Util::FindItemInList(Alphas(4), Zone); if (thisRadSys.ZonePtr == 0) { ShowSevereError(state, format("{}Invalid {} = {}", RoutineName, cAlphaFields(3), Alphas(4))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, Alphas(1))); @@ -661,7 +658,7 @@ namespace LowTempRadiantSystem { thisRadSys.SurfListName = Alphas(5); SurfListNum = 0; if (state.dataSurfLists->NumOfSurfaceLists > 0) - SurfListNum = UtilityRoutines::FindItemInList(thisRadSys.SurfListName, state.dataSurfLists->SurfList); + SurfListNum = Util::FindItemInList(thisRadSys.SurfListName, state.dataSurfLists->SurfList); if (SurfListNum > 0) { // Found a valid surface list thisRadSys.NumOfSurfaces = state.dataSurfLists->SurfList(SurfListNum).NumOfSurfaces; thisRadSys.SurfacePtr.allocate(thisRadSys.NumOfSurfaces); @@ -683,7 +680,7 @@ namespace LowTempRadiantSystem { thisRadSys.SurfaceFrac.allocate(thisRadSys.NumOfSurfaces); thisRadSys.NumCircuits.allocate(thisRadSys.NumOfSurfaces); thisRadSys.SurfaceName(1) = thisRadSys.SurfListName; - thisRadSys.SurfacePtr(1) = UtilityRoutines::FindItemInList(thisRadSys.SurfaceName(1), Surface); + thisRadSys.SurfacePtr(1) = Util::FindItemInList(thisRadSys.SurfaceName(1), Surface); thisRadSys.SurfaceFrac(1) = 1.0; thisRadSys.NumCircuits(1) = 0.0; // Error checking for single surfaces @@ -821,9 +818,9 @@ namespace LowTempRadiantSystem { TestCompSet(state, CurrentModuleObject, Alphas(1), Alphas(8), Alphas(9), "Chilled Water Nodes"); } - if (UtilityRoutines::SameString(Alphas(10), OnePerSurf)) { + if (Util::SameString(Alphas(10), OnePerSurf)) { thisRadSys.NumCircCalcMethod = CircuitCalc::OneCircuit; - } else if (UtilityRoutines::SameString(Alphas(10), CalcFromLength)) { + } else if (Util::SameString(Alphas(10), CalcFromLength)) { thisRadSys.NumCircCalcMethod = CircuitCalc::CalculateFromLength; } else { thisRadSys.NumCircCalcMethod = CircuitCalc::OneCircuit; @@ -883,11 +880,11 @@ namespace LowTempRadiantSystem { thisRadSysDesign.MotorEffic = Numbers(5); thisRadSysDesign.FracMotorLossToFluid = Numbers(6); - if (UtilityRoutines::SameString(Alphas(4), Off)) { + if (Util::SameString(Alphas(4), Off)) { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlNone; - } else if (UtilityRoutines::SameString(Alphas(4), SimpleOff)) { + } else if (Util::SameString(Alphas(4), SimpleOff)) { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlSimpleOff; - } else if (UtilityRoutines::SameString(Alphas(4), VariableOff)) { + } else if (Util::SameString(Alphas(4), VariableOff)) { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlVariedOff; } else { thisRadSysDesign.CondCtrlType = CondContrlType::CondCtrlSimpleOff; @@ -933,7 +930,7 @@ namespace LowTempRadiantSystem { thisCFloSys.Name = Alphas(1); thisCFloSys.designObjectName = Alphas(2); - thisCFloSys.DesignObjectPtr = UtilityRoutines::FindItemInList(thisCFloSys.designObjectName, CFlowRadDesignNames); + thisCFloSys.DesignObjectPtr = Util::FindItemInList(thisCFloSys.designObjectName, CFlowRadDesignNames); ConstantFlowRadDesignData ConstantFlowRadDesignDataObject{ state.dataLowTempRadSys->CflowRadiantSysDesign(thisCFloSys.DesignObjectPtr)}; // Contains the data for variable flow hydronic systems @@ -950,7 +947,7 @@ namespace LowTempRadiantSystem { } thisCFloSys.ZoneName = Alphas(4); - thisCFloSys.ZonePtr = UtilityRoutines::FindItemInList(Alphas(4), Zone); + thisCFloSys.ZonePtr = Util::FindItemInList(Alphas(4), Zone); if (thisCFloSys.ZonePtr == 0) { ShowSevereError(state, format("{}Invalid {} = {}", RoutineName, cAlphaFields(4), Alphas(4))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, Alphas(1))); @@ -960,7 +957,7 @@ namespace LowTempRadiantSystem { thisCFloSys.SurfListName = Alphas(5); SurfListNum = 0; if (state.dataSurfLists->NumOfSurfaceLists > 0) - SurfListNum = UtilityRoutines::FindItemInList(thisCFloSys.SurfListName, state.dataSurfLists->SurfList); + SurfListNum = Util::FindItemInList(thisCFloSys.SurfListName, state.dataSurfLists->SurfList); if (SurfListNum > 0) { // Found a valid surface list thisCFloSys.NumOfSurfaces = state.dataSurfLists->SurfList(SurfListNum).NumOfSurfaces; thisCFloSys.SurfacePtr.allocate(thisCFloSys.NumOfSurfaces); @@ -985,7 +982,7 @@ namespace LowTempRadiantSystem { thisCFloSys.NumCircuits.allocate(thisCFloSys.NumOfSurfaces); state.dataLowTempRadSys->MaxCloNumOfSurfaces = max(state.dataLowTempRadSys->MaxCloNumOfSurfaces, thisCFloSys.NumOfSurfaces); thisCFloSys.SurfaceName(1) = thisCFloSys.SurfListName; - thisCFloSys.SurfacePtr(1) = UtilityRoutines::FindItemInList(thisCFloSys.SurfaceName(1), Surface); + thisCFloSys.SurfacePtr(1) = Util::FindItemInList(thisCFloSys.SurfaceName(1), Surface); thisCFloSys.SurfaceFrac(1) = 1.0; thisCFloSys.NumCircuits(1) = 0.0; // Error checking for single surfaces @@ -1136,9 +1133,9 @@ namespace LowTempRadiantSystem { ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(19), OnePerSurf)) { + if (Util::SameString(Alphas(19), OnePerSurf)) { thisCFloSys.NumCircCalcMethod = CircuitCalc::OneCircuit; - } else if (UtilityRoutines::SameString(Alphas(19), CalcFromLength)) { + } else if (Util::SameString(Alphas(19), CalcFromLength)) { thisCFloSys.NumCircCalcMethod = CircuitCalc::CalculateFromLength; } else { thisCFloSys.NumCircCalcMethod = CircuitCalc::OneCircuit; @@ -1195,7 +1192,7 @@ namespace LowTempRadiantSystem { } thisElecSys.ZoneName = Alphas(3); - thisElecSys.ZonePtr = UtilityRoutines::FindItemInList(Alphas(3), Zone); + thisElecSys.ZonePtr = Util::FindItemInList(Alphas(3), Zone); if (thisElecSys.ZonePtr == 0) { ShowSevereError(state, format("{}Invalid {} = {}", RoutineName, cAlphaFields(3), Alphas(3))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, Alphas(1))); @@ -1205,7 +1202,7 @@ namespace LowTempRadiantSystem { thisElecSys.SurfListName = Alphas(4); SurfListNum = 0; if (state.dataSurfLists->NumOfSurfaceLists > 0) - SurfListNum = UtilityRoutines::FindItemInList(thisElecSys.SurfListName, state.dataSurfLists->SurfList); + SurfListNum = Util::FindItemInList(thisElecSys.SurfListName, state.dataSurfLists->SurfList); if (SurfListNum > 0) { // Found a valid surface list thisElecSys.NumOfSurfaces = state.dataSurfLists->SurfList(SurfListNum).NumOfSurfaces; thisElecSys.SurfacePtr.allocate(thisElecSys.NumOfSurfaces); @@ -1222,7 +1219,7 @@ namespace LowTempRadiantSystem { thisElecSys.SurfaceName.allocate(thisElecSys.NumOfSurfaces); thisElecSys.SurfaceFrac.allocate(thisElecSys.NumOfSurfaces); thisElecSys.SurfaceName(1) = thisElecSys.SurfListName; - thisElecSys.SurfacePtr(1) = UtilityRoutines::FindItemInList(thisElecSys.SurfaceName(1), Surface); + thisElecSys.SurfacePtr(1) = Util::FindItemInList(thisElecSys.SurfaceName(1), Surface); thisElecSys.SurfaceFrac(1) = 1.0; // Error checking for single surfaces if (thisElecSys.SurfacePtr(1) == 0) { @@ -1245,7 +1242,7 @@ namespace LowTempRadiantSystem { // Heating user input data // Determine Low Temp Radiant heating design capacity sizing method - if (UtilityRoutines::SameString(Alphas(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { + if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { thisElecSys.HeatingCapMethod = HeatingDesignCapacity; if (!lNumericBlanks(iHeatDesignCapacityNumericNum)) { thisElecSys.ScaledHeatingCapacity = Numbers(iHeatDesignCapacityNumericNum); @@ -1263,7 +1260,7 @@ namespace LowTempRadiantSystem { ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { + } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { thisElecSys.HeatingCapMethod = CapacityPerFloorArea; if (!lNumericBlanks(iHeatCapacityPerFloorAreaNumericNum)) { thisElecSys.ScaledHeatingCapacity = Numbers(iHeatCapacityPerFloorAreaNumericNum); @@ -1288,7 +1285,7 @@ namespace LowTempRadiantSystem { ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { + } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { thisElecSys.HeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!lNumericBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { thisElecSys.ScaledHeatingCapacity = Numbers(iHeatFracOfAutosizedCapacityNumericNum); @@ -1802,9 +1799,9 @@ namespace LowTempRadiantSystem { FluidToSlabHeatTransferTypes HydronicSystemBaseData::getFluidToSlabHeatTransferInput(EnergyPlusData &state, std::string const &userInput) { - if (UtilityRoutines::SameString(userInput, "ConvectionOnly")) { + if (Util::SameString(userInput, "ConvectionOnly")) { return FluidToSlabHeatTransferTypes::ConvectionOnly; - } else if (UtilityRoutines::SameString(userInput, "ISOStandard")) { + } else if (Util::SameString(userInput, "ISOStandard")) { return FluidToSlabHeatTransferTypes::ISOStandard; } else { ShowWarningError(state, format("Invalid Fluid to Slab Heat Transfer Model Input = {}", userInput)); @@ -1819,21 +1816,21 @@ namespace LowTempRadiantSystem { std::string const &controlInputField, LowTempRadiantSystem::SystemType const typeOfRadiantSystem) { - if (UtilityRoutines::SameString(controlInput, "MeanAirTemperature")) { + if (Util::SameString(controlInput, "MeanAirTemperature")) { return LowTempRadiantControlTypes::MATControl; - } else if (UtilityRoutines::SameString(controlInput, "MeanRadiantTemperature")) { + } else if (Util::SameString(controlInput, "MeanRadiantTemperature")) { return LowTempRadiantControlTypes::MRTControl; - } else if (UtilityRoutines::SameString(controlInput, "OperativeTemperature")) { + } else if (Util::SameString(controlInput, "OperativeTemperature")) { return LowTempRadiantControlTypes::OperativeControl; - } else if (UtilityRoutines::SameString(controlInput, "OutdoorDryBulbTemperature")) { + } else if (Util::SameString(controlInput, "OutdoorDryBulbTemperature")) { return LowTempRadiantControlTypes::ODBControl; - } else if (UtilityRoutines::SameString(controlInput, "OutdoorWetBulbTemperature")) { + } else if (Util::SameString(controlInput, "OutdoorWetBulbTemperature")) { return LowTempRadiantControlTypes::OWBControl; - } else if (UtilityRoutines::SameString(controlInput, "SurfaceFaceTemperature")) { + } else if (Util::SameString(controlInput, "SurfaceFaceTemperature")) { return LowTempRadiantControlTypes::SurfFaceTempControl; - } else if (UtilityRoutines::SameString(controlInput, "SurfaceInteriorTemperature")) { + } else if (Util::SameString(controlInput, "SurfaceInteriorTemperature")) { return LowTempRadiantControlTypes::SurfIntTempControl; - } else if (UtilityRoutines::SameString(controlInput, "RunningMeanOutdoorDryBulbTemperature") && + } else if (Util::SameString(controlInput, "RunningMeanOutdoorDryBulbTemperature") && typeOfRadiantSystem == LowTempRadiantSystem::SystemType::ConstantFlowSystem) { state.dataLowTempRadSys->anyRadiantSystemUsingRunningMeanAverage = true; return LowTempRadiantControlTypes::RunningMeanODBControl; @@ -1849,9 +1846,9 @@ namespace LowTempRadiantSystem { std::string const &controlInput, std::string const &controlInputField) { - if (UtilityRoutines::SameString(controlInput, "HalfFlowPower")) { + if (Util::SameString(controlInput, "HalfFlowPower")) { return LowTempRadiantSetpointTypes::HalfFlowPower; - } else if (UtilityRoutines::SameString(controlInput, "ZeroFlowPower")) { + } else if (Util::SameString(controlInput, "ZeroFlowPower")) { return LowTempRadiantSetpointTypes::ZeroFlowPower; } else { ShowWarningError(state, format("Invalid {} = {}", controlInputField, controlInput)); @@ -5211,7 +5208,7 @@ namespace LowTempRadiantSystem { Real64 sum = 0.0; for (int hourNumber = 1; hourNumber <= Constant::HoursInDay; ++hourNumber) { for (int timeStepNumber = 1; timeStepNumber <= state.dataGlobal->NumOfTimeStepInHour; ++timeStepNumber) { - sum += state.dataWeatherManager->TodayOutDryBulbTemp(timeStepNumber, hourNumber); + sum += state.dataWeather->wvarsHrTsToday(timeStepNumber, hourNumber).OutDryBulbTemp; } } return sum / double(Constant::HoursInDay * state.dataGlobal->NumOfTimeStepInHour); diff --git a/src/EnergyPlus/Material.cc b/src/EnergyPlus/Material.cc index fed2f8430b3..b2319e921b9 100644 --- a/src/EnergyPlus/Material.cc +++ b/src/EnergyPlus/Material.cc @@ -245,7 +245,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + std::string const &thisObjectName = Util::makeUPPER(instance.key()); ip->markObjectAsUsed(state.dataHeatBalMgr->CurrentModuleObject, instance.key()); std::string materialName = thisObjectName; @@ -268,8 +268,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = materialName; std::string roughness = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "roughness"); - thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(roughness))); - + thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, Util::makeUPPER(roughness))); thisMaterial->Thickness = ip->getRealFieldValue(objectFields, objectSchemaProps, "thickness"); thisMaterial->Conductivity = ip->getRealFieldValue(objectFields, objectSchemaProps, "conductivity"); thisMaterial->Density = ip->getRealFieldValue(objectFields, objectSchemaProps, "density"); @@ -345,7 +344,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->group = Group::Regular; thisMaterial->Name = MaterialNames(1); - thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); + thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, Util::makeUPPER(MaterialNames(2)))); thisMaterial->Resistance = MaterialProps(1); thisMaterial->ROnly = true; @@ -519,7 +518,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Roughness = SurfaceRoughness::VerySmooth; thisMaterial->ROnly = true; thisMaterial->Thickness = MaterialProps(1); - if (!UtilityRoutines::SameString(MaterialNames(2), "SpectralAndAngle")) { + if (!Util::SameString(MaterialNames(2), "SpectralAndAngle")) { thisMaterial->Trans = MaterialProps(2); thisMaterial->ReflectSolBeamFront = MaterialProps(3); thisMaterial->ReflectSolBeamBack = MaterialProps(4); @@ -547,14 +546,14 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->GlassSpectralDataPtr = 0; if (state.dataHeatBal->TotSpectralData > 0 && !state.dataIPShortCut->lAlphaFieldBlanks(3)) { - thisMaterial->GlassSpectralDataPtr = UtilityRoutines::FindItemInList(MaterialNames(3), state.dataHeatBal->SpectralData); + thisMaterial->GlassSpectralDataPtr = Util::FindItemInList(MaterialNames(3), state.dataHeatBal->SpectralData); } - if (UtilityRoutines::SameString(MaterialNames(2), "SpectralAverage")) thisMaterial->GlassSpectralDataPtr = 0; + if (Util::SameString(MaterialNames(2), "SpectralAverage")) thisMaterial->GlassSpectralDataPtr = 0; // No need for spectral data for BSDF either - if (UtilityRoutines::SameString(MaterialNames(2), "BSDF")) thisMaterial->GlassSpectralDataPtr = 0; - if (UtilityRoutines::SameString(MaterialNames(2), "SpectralAndAngle")) thisMaterial->GlassSpectralAndAngle = true; + if (Util::SameString(MaterialNames(2), "BSDF")) thisMaterial->GlassSpectralDataPtr = 0; + if (Util::SameString(MaterialNames(2), "SpectralAndAngle")) thisMaterial->GlassSpectralAndAngle = true; - if (thisMaterial->GlassSpectralDataPtr == 0 && UtilityRoutines::SameString(MaterialNames(2), "Spectral")) { + if (thisMaterial->GlassSpectralDataPtr == 0 && Util::SameString(MaterialNames(2), "Spectral")) { ErrorsFound = true; ShowSevereError(state, format("{}=\"{}\" has {} = Spectral but has no matching MaterialProperty:GlazingSpectralData set", @@ -571,8 +570,8 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if } } - if (!UtilityRoutines::SameString(MaterialNames(2), "SpectralAverage") && !UtilityRoutines::SameString(MaterialNames(2), "Spectral") && - !UtilityRoutines::SameString(MaterialNames(2), "BSDF") && !UtilityRoutines::SameString(MaterialNames(2), "SpectralAndAngle")) { + if (!Util::SameString(MaterialNames(2), "SpectralAverage") && !Util::SameString(MaterialNames(2), "Spectral") && + !Util::SameString(MaterialNames(2), "BSDF") && !Util::SameString(MaterialNames(2), "SpectralAndAngle")) { ErrorsFound = true; ShowSevereError(state, format("{}=\"{}\", invalid specification.", state.dataHeatBalMgr->CurrentModuleObject, thisMaterial->Name)); ShowContinueError(state, @@ -583,7 +582,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // TH 8/24/2011, allow glazing properties MaterialProps(2 to 10) to equal 0 or 1: 0.0 =< Prop <= 1.0 // Fixed CR 8413 - modeling spandrel panels as glazing systems - if (UtilityRoutines::SameString(MaterialNames(2), "SpectralAverage")) { + if (Util::SameString(MaterialNames(2), "SpectralAverage")) { if (MaterialProps(2) + MaterialProps(3) > 1.0) { ErrorsFound = true; @@ -1109,9 +1108,9 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->AbsorpThermalBack = thisMaterial->EmissThermalBack; thisMaterial->TransThermal = thisMaterial->TausThermal; - if (UtilityRoutines::SameString(MaterialNames(2), "SpectralAverage")) thisMaterial->GlassSpectralDataPtr = 0; + if (Util::SameString(MaterialNames(2), "SpectralAverage")) thisMaterial->GlassSpectralDataPtr = 0; - // IF(dataMaterial.Material(MaterNum)%GlassSpectralDataPtr == 0 .AND. UtilityRoutines::SameString(MaterialNames(2),'Spectral')) THEN + // IF(dataMaterial.Material(MaterNum)%GlassSpectralDataPtr == 0 .AND. Util::SameString(MaterialNames(2),'Spectral')) THEN // ErrorsFound = .TRUE. // CALL ShowSevereError(state, TRIM(state.dataHeatBalMgr->CurrentModuleObject)//'="'//Trim(dataMaterial.Material(MaterNum)%Name)// & // '" has '//TRIM(cAlphaFieldNames(2))//' = Spectral but has no matching MaterialProperty:GlazingSpectralData set') @@ -1123,7 +1122,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // END IF // END IF - if (!UtilityRoutines::SameString(MaterialNames(2), "SpectralAverage")) { + if (!Util::SameString(MaterialNames(2), "SpectralAverage")) { ErrorsFound = true; ShowSevereError(state, state.dataHeatBalMgr->CurrentModuleObject + "=\"" + thisMaterial->Name + "\", invalid specification."); ShowContinueError(state, state.dataIPShortCut->cAlphaFieldNames(2) + " must be SpectralAverage, value=" + MaterialNames(2)); @@ -1171,8 +1170,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); thisMaterial->NumberOfGasesInMixture = 1; - thisMaterial->gasTypes(1) = static_cast(getEnumValue(GasTypeUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); - + thisMaterial->gasTypes(1) = static_cast(getEnumValue(GasTypeUC, Util::makeUPPER(MaterialNames(2)))); thisMaterial->Roughness = SurfaceRoughness::MediumRough; thisMaterial->Thickness = MaterialProps(1); @@ -1278,7 +1276,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); thisMaterial->NumberOfGasesInMixture = 1; - thisMaterial->gasTypes(1) = static_cast(getEnumValue(GasTypeUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); + thisMaterial->gasTypes(1) = static_cast(getEnumValue(GasTypeUC, Util::makeUPPER(MaterialNames(2)))); thisMaterial->Roughness = SurfaceRoughness::MediumRough; @@ -1298,7 +1296,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { // Get gap vent type - thisMaterial->gapVentType = static_cast(getEnumValue(GapVentTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); + thisMaterial->gapVentType = static_cast(getEnumValue(GapVentTypeUC, Util::makeUPPER(MaterialNames(3)))); } if (gasType == GasType::Custom) { @@ -1382,7 +1380,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->NumberOfGasesInMixture = NumGases; for (NumGas = 1; NumGas <= NumGases; ++NumGas) { thisMaterial->gasTypes(NumGas) = - static_cast(getEnumValue(GasTypeUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1 + NumGas)))); + static_cast(getEnumValue(GasTypeUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1 + NumGas)))); } thisMaterial->Roughness = SurfaceRoughness::MediumRough; // Unused @@ -1718,8 +1716,8 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); thisMaterial->ReflectanceModeling = MaterialNames(2); - if (!(UtilityRoutines::SameString(MaterialNames(2), "DoNotModel") || UtilityRoutines::SameString(MaterialNames(2), "ModelAsDirectBeam") || - UtilityRoutines::SameString(MaterialNames(2), "ModelAsDiffuse"))) { + if (!(Util::SameString(MaterialNames(2), "DoNotModel") || Util::SameString(MaterialNames(2), "ModelAsDirectBeam") || + Util::SameString(MaterialNames(2), "ModelAsDiffuse"))) { ErrorsFound = true; ShowSevereError(state, state.dataHeatBalMgr->CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value."); ShowContinueError(state, @@ -2050,9 +2048,9 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->ROnly = true; state.dataMaterial->Blind(Loop).MaterialNumber = MaterNum; - if (UtilityRoutines::SameString(MaterialNames(2), "Horizontal")) { + if (Util::SameString(MaterialNames(2), "Horizontal")) { state.dataMaterial->Blind(Loop).SlatOrientation = DataWindowEquivalentLayer::Orientation::Horizontal; - } else if (UtilityRoutines::SameString(MaterialNames(2), "Vertical")) { + } else if (Util::SameString(MaterialNames(2), "Vertical")) { state.dataMaterial->Blind(Loop).SlatOrientation = DataWindowEquivalentLayer::Orientation::Vertical; } state.dataMaterial->Blind(Loop).SlatWidth = MaterialProps(1); @@ -2099,7 +2097,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if ShowContinueError(state, "This will allow direct beam to be transmitted when Slat angle = 0."); } - if (!UtilityRoutines::SameString(MaterialNames(2), "Horizontal") && !UtilityRoutines::SameString(MaterialNames(2), "Vertical")) { + if (!Util::SameString(MaterialNames(2), "Horizontal") && !Util::SameString(MaterialNames(2), "Vertical")) { ErrorsFound = true; ShowSevereError(state, state.dataHeatBalMgr->CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value"); ShowContinueError(state, state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + MaterialNames(2) + "\", must be Horizontal or Vertical."); @@ -2338,9 +2336,9 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Roughness = SurfaceRoughness::Rough; thisMaterial->ROnly = true; - if (UtilityRoutines::SameString(MaterialNames(2), "Horizontal")) { + if (Util::SameString(MaterialNames(2), "Horizontal")) { thisMaterial->SlatOrientation = DataWindowEquivalentLayer::Orientation::Horizontal; - } else if (UtilityRoutines::SameString(MaterialNames(2), "Vertical")) { + } else if (Util::SameString(MaterialNames(2), "Vertical")) { thisMaterial->SlatOrientation = DataWindowEquivalentLayer::Orientation::Vertical; } thisMaterial->SlatWidth = MaterialProps(1); @@ -2391,7 +2389,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // MaximizeSolar or BlockBeamSolar thisMaterial->slatAngleType = SlatAngleType::FixedSlatAngle; if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - thisMaterial->slatAngleType = static_cast(getEnumValue(SlatAngleTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); + thisMaterial->slatAngleType = static_cast(getEnumValue(SlatAngleTypeUC, Util::makeUPPER(MaterialNames(3)))); } if (thisMaterial->SlatWidth < thisMaterial->SlatSeparation) { ShowWarningError(state, format("{}=\"{}\", Slat Seperation/Width", state.dataHeatBalMgr->CurrentModuleObject, MaterialNames(1))); @@ -2440,7 +2438,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->SlatAngle = 0.0; } - if (!UtilityRoutines::SameString(MaterialNames(2), "Horizontal") && !UtilityRoutines::SameString(MaterialNames(2), "Vertical")) { + if (!Util::SameString(MaterialNames(2), "Horizontal") && !Util::SameString(MaterialNames(2), "Vertical")) { ErrorsFound = true; ShowSevereError(state, format("{}=\"{}\", Illegal value", state.dataHeatBalMgr->CurrentModuleObject, MaterialNames(1))); ShowContinueError(state, @@ -2520,10 +2518,10 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); // need to treat the A2 with is just the name of the soil(it is // not important) - thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); - if (UtilityRoutines::SameString(MaterialNames(4), "Simple")) { + thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, Util::makeUPPER(MaterialNames(3)))); + if (Util::SameString(MaterialNames(4), "Simple")) { thisMaterial->EcoRoofCalculationMethod = 1; - } else if (UtilityRoutines::SameString(MaterialNames(4), "Advanced") || state.dataIPShortCut->lAlphaFieldBlanks(4)) { + } else if (Util::SameString(MaterialNames(4), "Advanced") || state.dataIPShortCut->lAlphaFieldBlanks(4)) { thisMaterial->EcoRoofCalculationMethod = 2; } else { ShowSevereError(state, format("{}=\"{}\", Illegal value", state.dataHeatBalMgr->CurrentModuleObject, MaterialNames(1))); @@ -2594,7 +2592,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBalMgr->CurrentModuleObject, ErrorsFound)) { + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBalMgr->CurrentModuleObject, ErrorsFound)) { ShowContinueError(state, "...All Thermochromic Glazing names must be unique regardless of subtype."); continue; } @@ -2627,7 +2625,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if state.dataHeatBal->TCGlazings(Loop).LayerName(iTC) = state.dataIPShortCut->cAlphaArgs(1 + iTC); // Find this glazing material in the material list - iMat = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(1 + iTC), state.dataMaterial->Material); + iMat = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(1 + iTC), state.dataMaterial->Material); if (iMat != 0) { // TC glazing auto *thisMaterial = dynamic_cast(state.dataMaterial->Material(iMat)); @@ -2813,7 +2811,7 @@ void GetVariableAbsorptanceInput(EnergyPlusData &state, bool &errorsFound) state.dataIPShortCut->cNumericFieldNames); // Load the material derived type from the input data. - int MaterNum = UtilityRoutines::FindItemInPtrList(alphas(2), state.dataMaterial->Material); + int MaterNum = Util::FindItemInPtrList(alphas(2), state.dataMaterial->Material); if (MaterNum == 0) { ShowSevereError(state, format("{}: invalid {} entered={}, must match to a valid Material name.", @@ -2838,8 +2836,7 @@ void GetVariableAbsorptanceInput(EnergyPlusData &state, bool &errorsFound) } thisMaterial->absorpVarCtrlSignal = VariableAbsCtrlSignal::SurfaceTemperature; // default value - thisMaterial->absorpVarCtrlSignal = - static_cast(getEnumValue(VariableAbsCtrlSignalUC, UtilityRoutines::makeUPPER(alphas(3)))); + thisMaterial->absorpVarCtrlSignal = static_cast(getEnumValue(VariableAbsCtrlSignalUC, Util::makeUPPER(alphas(3)))); // init to 0 as GetScheduleIndex returns 0 for not-found schedule thisMaterial->absorpThermalVarFuncIdx = Curve::GetCurveIndex(state, alphas(4)); thisMaterial->absorpThermalVarSchedIdx = ScheduleManager::GetScheduleIndex(state, alphas(5)); diff --git a/src/EnergyPlus/MatrixDataManager.cc b/src/EnergyPlus/MatrixDataManager.cc index 86a500f60fe..53658c6cf1a 100644 --- a/src/EnergyPlus/MatrixDataManager.cc +++ b/src/EnergyPlus/MatrixDataManager.cc @@ -153,7 +153,7 @@ namespace MatrixDataManager { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); ++MatNum; - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataMatrixDataManager->MatData(MatNum).Name = state.dataIPShortCut->cAlphaArgs(1); NumRows = std::floor(state.dataIPShortCut->rNumericArgs(1)); @@ -209,7 +209,7 @@ namespace MatrixDataManager { // METHODOLOGY EMPLOYED: // inputs name of matrix and returns integer index - // currently uses UtilityRoutines::FindItemInList( which is case sensitive + // currently uses Util::FindItemInList( which is case sensitive // Return value int MatrixIndexPtr; // Function result @@ -222,7 +222,7 @@ namespace MatrixDataManager { } if (state.dataMatrixDataManager->NumMats > 0) { - MatrixIndexPtr = UtilityRoutines::FindItemInList(MatrixName, state.dataMatrixDataManager->MatData); + MatrixIndexPtr = Util::FindItemInList(MatrixName, state.dataMatrixDataManager->MatData); } else { MatrixIndexPtr = 0; } diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index 9600dea9a93..1cb517cd539 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -185,11 +185,11 @@ void GetMicroCHPGeneratorInput(EnergyPlusData &state) state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).ThermalEffCurveID = Curve::GetCurveCheck(state, AlphArray(3), ErrorsFound, ObjMSGName); // Thermal Efficiency - if (UtilityRoutines::SameString(AlphArray(4), "InternalControl")) { + if (Util::SameString(AlphArray(4), "InternalControl")) { state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).InternalFlowControl = true; // A4, \field Cooling Water Flow Rate Mode state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).PlantFlowControl = false; } - if ((!(UtilityRoutines::SameString(AlphArray(4), "InternalControl"))) && (!(UtilityRoutines::SameString(AlphArray(4), "PlantControl")))) { + if ((!(Util::SameString(AlphArray(4), "InternalControl"))) && (!(Util::SameString(AlphArray(4), "PlantControl")))) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); ErrorsFound = true; @@ -225,12 +225,11 @@ void GetMicroCHPGeneratorInput(EnergyPlusData &state) } state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).Pstandby = NumArray(12); // N12 Standby Power [W] - if (UtilityRoutines::SameString(AlphArray(7), "TimeDelay")) { + if (Util::SameString(AlphArray(7), "TimeDelay")) { state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).WarmUpByTimeDelay = true; state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).WarmUpByEngineTemp = false; } - if ((!(UtilityRoutines::SameString(AlphArray(7), "NominalEngineTemperature"))) && - (!(UtilityRoutines::SameString(AlphArray(7), "TimeDelay")))) { + if ((!(Util::SameString(AlphArray(7), "NominalEngineTemperature"))) && (!(Util::SameString(AlphArray(7), "TimeDelay")))) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(7), AlphArray(7))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); ErrorsFound = true; @@ -245,12 +244,11 @@ void GetMicroCHPGeneratorInput(EnergyPlusData &state) state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).CoolDownDelay = NumArray(19); // N19 Cool Down Delay Time in seconds - if (UtilityRoutines::SameString(AlphArray(8), "MandatoryCoolDown")) { + if (Util::SameString(AlphArray(8), "MandatoryCoolDown")) { state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).MandatoryFullCoolDown = true; state.dataCHPElectGen->MicroCHPParamInput(CHPParamNum).WarmRestartOkay = false; } - if ((!(UtilityRoutines::SameString(AlphArray(8), "MandatoryCoolDown"))) && - (!(UtilityRoutines::SameString(AlphArray(8), "OptionalCoolDown")))) { + if ((!(Util::SameString(AlphArray(8), "MandatoryCoolDown"))) && (!(Util::SameString(AlphArray(8), "OptionalCoolDown")))) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); ErrorsFound = true; @@ -285,14 +283,14 @@ void GetMicroCHPGeneratorInput(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // GENERATOR:MICRO CHP, state.dataCHPElectGen->MicroCHP(GeneratorNum).DynamicsControlID = GeneratorNum; state.dataCHPElectGen->MicroCHP(GeneratorNum).Name = AlphArray(1); // A1 Generator name state.dataCHPElectGen->MicroCHP(GeneratorNum).ParamObjName = AlphArray(2); // A2 Micro CHP Parameter Object Name // find input structure - int thisParamID = UtilityRoutines::FindItemInList(AlphArray(2), state.dataCHPElectGen->MicroCHPParamInput); + int thisParamID = Util::FindItemInList(AlphArray(2), state.dataCHPElectGen->MicroCHPParamInput); if (thisParamID != 0) { state.dataCHPElectGen->MicroCHP(GeneratorNum).A42Model = state.dataCHPElectGen->MicroCHPParamInput(thisParamID); // entire structure of input data assigned here! @@ -305,7 +303,7 @@ void GetMicroCHPGeneratorInput(EnergyPlusData &state) if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { state.dataCHPElectGen->MicroCHP(GeneratorNum).ZoneName = AlphArray(3); // A3 Zone Name state.dataCHPElectGen->MicroCHP(GeneratorNum).ZoneID = - UtilityRoutines::FindItemInList(state.dataCHPElectGen->MicroCHP(GeneratorNum).ZoneName, state.dataHeatBal->Zone); + Util::FindItemInList(state.dataCHPElectGen->MicroCHP(GeneratorNum).ZoneName, state.dataHeatBal->Zone); if (state.dataCHPElectGen->MicroCHP(GeneratorNum).ZoneID == 0) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), AlphArray(3))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -366,7 +364,7 @@ void GetMicroCHPGeneratorInput(EnergyPlusData &state) DataLoopNode::ObjectIsNotParent); state.dataCHPElectGen->MicroCHP(GeneratorNum).FuelSupplyID = - UtilityRoutines::FindItemInList(AlphArray(8), state.dataGenerator->FuelSupply); // Fuel Supply ID + Util::FindItemInList(AlphArray(8), state.dataGenerator->FuelSupply); // Fuel Supply ID if (state.dataCHPElectGen->MicroCHP(GeneratorNum).FuelSupplyID == 0) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 2aeff6fd7f6..553c4b54929 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -158,7 +158,7 @@ void GetMTGeneratorInput(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); state.dataMircoturbElectGen->MTGenerator(GeneratorNum).Name = AlphArray(1); state.dataMircoturbElectGen->MTGenerator(GeneratorNum).RefElecPowerOutput = NumArray(1); @@ -521,12 +521,12 @@ void GetMTGeneratorInput(EnergyPlusData &state) state.dataMircoturbElectGen->MTGenerator(GeneratorNum).RefInletWaterTemp = NumArray(13); - if (UtilityRoutines::SameString(AlphArray(9), "InternalControl")) { + if (Util::SameString(AlphArray(9), "InternalControl")) { state.dataMircoturbElectGen->MTGenerator(GeneratorNum).InternalFlowControl = true; // A9, \field Heat Recovery Water Flow Operating Mode state.dataMircoturbElectGen->MTGenerator(GeneratorNum).PlantFlowControl = false; } - if ((!(UtilityRoutines::SameString(AlphArray(9), "InternalControl"))) && (!(UtilityRoutines::SameString(AlphArray(9), "PlantControl")))) { + if ((!(Util::SameString(AlphArray(9), "InternalControl"))) && (!(Util::SameString(AlphArray(9), "PlantControl")))) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(9), AlphArray(9))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); ShowContinueError(state, "Operating Mode must be INTERNAL CONTROL or PLANT CONTROL."); diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index 34a08a855bf..a9fcf79c5eb 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -264,7 +264,7 @@ void ManageOutsideAirSystem(EnergyPlusData &state, std::string const &OASysName, } if (OASysNum == 0) { - OASysNum = UtilityRoutines::FindItemInList(OASysName, state.dataAirLoop->OutsideAirSys); + OASysNum = Util::FindItemInList(OASysName, state.dataAirLoop->OutsideAirSys); if (OASysNum == 0) { ShowFatalError(state, format("ManageOutsideAirSystem: AirLoopHVAC:OutdoorAirSystem not found={}", OASysName)); } @@ -374,8 +374,8 @@ void SimOutsideAirSys(EnergyPlusData &state, int const OASysNum, bool const Firs for (int CompNum = 1; CompNum <= CurrentOASystem.NumComponents; ++CompNum) { CompType = CurrentOASystem.ComponentType(CompNum); CompName = CurrentOASystem.ComponentName(CompNum); - if (UtilityRoutines::SameString(CompType, "OutdoorAir:Mixer")) { - OAMixerNum = UtilityRoutines::FindItemInList(CompName, state.dataMixedAir->OAMixer); + if (Util::SameString(CompType, "OutdoorAir:Mixer")) { + OAMixerNum = Util::FindItemInList(CompName, state.dataMixedAir->OAMixer); OAControllerNum = CurrentOASystem.OAControllerIndex; if (state.dataMixedAir->OAController(OAControllerNum).MixNode != state.dataMixedAir->OAMixer(OAMixerNum).MixNode) { ShowSevereError( @@ -759,7 +759,7 @@ void SimOAMixer(EnergyPlusData &state, std::string const &CompName, int &CompInd } if (CompIndex == 0) { - OAMixerNum = UtilityRoutines::FindItemInList(CompName, state.dataMixedAir->OAMixer); + OAMixerNum = Util::FindItemInList(CompName, state.dataMixedAir->OAMixer); CompIndex = OAMixerNum; if (OAMixerNum == 0) { ShowFatalError(state, format("SimOAMixer: OutdoorAir:Mixer not found={}", CompName)); @@ -799,13 +799,13 @@ void SimOAController(EnergyPlusData &state, std::string const &CtrlName, int &Ct auto &primaryAirSystems = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum); bool sensLoadCtrlUnitarySystemFound = false; if (primaryAirSystems.EconomizerStagingCheckFlag == false) { - OAControllerNum = UtilityRoutines::FindItemInList(CtrlName, state.dataMixedAir->OAController); + OAControllerNum = Util::FindItemInList(CtrlName, state.dataMixedAir->OAController); if (state.dataMixedAir->OAController(OAControllerNum).EconomizerStagingType == DataHVACGlobals::EconomizerStagingType::EconomizerFirst) { for (int BranchNum = 1; BranchNum <= primaryAirSystems.NumBranches; ++BranchNum) { for (int CompNum = 1; CompNum <= primaryAirSystems.Branch(BranchNum).TotalComponents; ++CompNum) { if (primaryAirSystems.Branch(BranchNum).Comp(CompNum).CompType_Num == SimAirServingZones::CompType::UnitarySystemModel) { std::string_view unitarySystemName = primaryAirSystems.Branch(BranchNum).Comp(CompNum).Name; - int unitarySystemNum = UtilityRoutines::FindItemInList( + int unitarySystemNum = Util::FindItemInList( unitarySystemName, state.dataUnitarySystems->unitarySys, state.dataUnitarySystems->numUnitarySystems); if (state.dataUnitarySystems->unitarySys[unitarySystemNum - 1].m_ControlType == UnitarySystems::UnitarySys::UnitarySysCtrlType::Load) { @@ -838,7 +838,7 @@ void SimOAController(EnergyPlusData &state, std::string const &CtrlName, int &Ct if (CtrlIndex == 0) { if (state.dataMixedAir->NumOAControllers > 0) { - OAControllerNum = UtilityRoutines::FindItemInList(CtrlName, state.dataMixedAir->OAController); + OAControllerNum = Util::FindItemInList(CtrlName, state.dataMixedAir->OAController); } else { OAControllerNum = 0; } @@ -940,7 +940,7 @@ void GetOutsideAirSysInputs(EnergyPlusData &state) 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, UtilityRoutines::makeUPPER(AlphArray(AlphaNum)))); + static_cast(getEnumValue(ControllerKindNamesUC, Util::makeUPPER(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) { @@ -1258,8 +1258,7 @@ void GetOAControllerInputs(EnergyPlusData &state) // loop through each fault for each OA controller and determine economizer faultys for (int i = 1; i <= state.dataFaultsMgr->NumFaultyEconomizer; ++i) { if (state.dataFaultsMgr->FaultsEconomizer(i).ControllerTypeEnum != iController_AirEconomizer) continue; - if (UtilityRoutines::SameString(state.dataMixedAir->OAController(OutAirNum).Name, - state.dataFaultsMgr->FaultsEconomizer(i).ControllerName)) { + if (Util::SameString(state.dataMixedAir->OAController(OutAirNum).Name, state.dataFaultsMgr->FaultsEconomizer(i).ControllerName)) { state.dataFaultsMgr->FaultsEconomizer(i).ControllerID = OutAirNum; ++state.dataMixedAir->OAController(OutAirNum).NumFaultyEconomizer; } @@ -1269,8 +1268,7 @@ void GetOAControllerInputs(EnergyPlusData &state) if (state.dataMixedAir->OAController(OutAirNum).NumFaultyEconomizer > 0) { for (int j = 0, i = 1; i <= state.dataFaultsMgr->NumFaultyEconomizer; ++i) { if (state.dataFaultsMgr->FaultsEconomizer(i).ControllerTypeEnum != iController_AirEconomizer) continue; - if (UtilityRoutines::SameString(state.dataMixedAir->OAController(OutAirNum).Name, - state.dataFaultsMgr->FaultsEconomizer(i).ControllerName)) { + if (Util::SameString(state.dataMixedAir->OAController(OutAirNum).Name, state.dataFaultsMgr->FaultsEconomizer(i).ControllerName)) { state.dataMixedAir->OAController(OutAirNum).EconmizerFaultNum(++j) = i; } } @@ -1328,9 +1326,9 @@ void GetOAControllerInputs(EnergyPlusData &state) } // Adding new flag for DCV - if (UtilityRoutines::SameString(AlphArray(3), "Yes")) { + if (Util::SameString(AlphArray(3), "Yes")) { thisVentilationMechanical.DCVFlag = true; - } else if (UtilityRoutines::SameString(AlphArray(3), "No") || lAlphaBlanks(3)) { + } else if (Util::SameString(AlphArray(3), "No") || lAlphaBlanks(3)) { thisVentilationMechanical.DCVFlag = false; } else { ShowSevereError(state, @@ -1340,8 +1338,7 @@ void GetOAControllerInputs(EnergyPlusData &state) } // System outdoor air method - thisVentilationMechanical.SystemOAMethod = - static_cast(getEnumValue(SOAMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); + thisVentilationMechanical.SystemOAMethod = static_cast(getEnumValue(SOAMNamesUC, Util::makeUPPER(AlphArray(4)))); if (thisVentilationMechanical.SystemOAMethod == DataSizing::SysOAMethod::IAQP || thisVentilationMechanical.SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlSchOcc || @@ -1399,7 +1396,7 @@ void GetOAControllerInputs(EnergyPlusData &state) // Getting OA details from design specification OA object if (!lAlphaBlanks((groupNum - 1) * 3 + 6)) { state.dataMixedAir->DesignSpecOAObjName(groupNum) = AlphArray((groupNum - 1) * 3 + 6); - int ObjIndex = UtilityRoutines::FindItemInList(state.dataMixedAir->DesignSpecOAObjName(groupNum), state.dataSize->OARequirements); + int ObjIndex = Util::FindItemInList(state.dataMixedAir->DesignSpecOAObjName(groupNum), state.dataSize->OARequirements); state.dataMixedAir->DesignSpecOAObjIndex(groupNum) = ObjIndex; if (ObjIndex == 0) { @@ -1415,8 +1412,7 @@ void GetOAControllerInputs(EnergyPlusData &state) // Get zone air distribution details from design specification Zone Air Distribution object if (!lAlphaBlanks((groupNum - 1) * 3 + 7)) { state.dataMixedAir->DesignSpecZoneADObjName(groupNum) = AlphArray((groupNum - 1) * 3 + 7); - int ObjIndex = - UtilityRoutines::FindItemInList(state.dataMixedAir->DesignSpecZoneADObjName(groupNum), state.dataSize->ZoneAirDistribution); + int ObjIndex = Util::FindItemInList(state.dataMixedAir->DesignSpecZoneADObjName(groupNum), state.dataSize->ZoneAirDistribution); state.dataMixedAir->DesignSpecZoneADObjIndex(groupNum) = ObjIndex; if (ObjIndex == 0) { @@ -1430,12 +1426,11 @@ void GetOAControllerInputs(EnergyPlusData &state) } } - int ZoneNum = UtilityRoutines::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->Zone); if (ZoneNum > 0) { ++MechVentZoneCount; } else { - int ZoneListNum = - UtilityRoutines::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->ZoneList); + int ZoneListNum = Util::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->ZoneList); if (ZoneListNum > 0) { MechVentZoneCount += state.dataHeatBal->ZoneList(ZoneListNum).NumOfZones; } else { @@ -1459,7 +1454,7 @@ void GetOAControllerInputs(EnergyPlusData &state) // Loop through zone names and list of zone names, remove duplicate zones, and store designspec names and indexes for (int groupNum = 1; groupNum <= NumGroups; ++groupNum) { - int ZoneNum = UtilityRoutines::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->Zone); if (ZoneNum > 0) { if (std::any_of(thisVentilationMechanical.VentMechZone.begin(), thisVentilationMechanical.VentMechZone.end(), @@ -1485,9 +1480,9 @@ void GetOAControllerInputs(EnergyPlusData &state) thisMechVentZone.ZoneDesignSpecOAObjIndex = state.dataMixedAir->DesignSpecOAObjIndex(groupNum); } else { if (state.dataGlobal->DoZoneSizing) { - int ObjIndex = UtilityRoutines::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), - state.dataSize->ZoneSizingInput, - &ZoneSizingInputData::ZoneName); + int ObjIndex = Util::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), + state.dataSize->ZoneSizingInput, + &ZoneSizingInputData::ZoneName); if (ObjIndex > 0) { thisMechVentZone.ZoneDesignSpecOAObjName = state.dataSize->ZoneSizingInput(ObjIndex).DesignSpecOAObjName; thisMechVentZone.ZoneDesignSpecOAObjIndex = state.dataSize->ZoneSizingInput(ObjIndex).ZoneDesignSpecOAIndex; @@ -1501,9 +1496,9 @@ void GetOAControllerInputs(EnergyPlusData &state) thisMechVentZone.ZoneDesignSpecADObjIndex = state.dataMixedAir->DesignSpecZoneADObjIndex(groupNum); } else { if (state.dataGlobal->DoZoneSizing) { - int ObjIndex = UtilityRoutines::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), - state.dataSize->ZoneSizingInput, - &ZoneSizingInputData::ZoneName); + int ObjIndex = Util::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), + state.dataSize->ZoneSizingInput, + &ZoneSizingInputData::ZoneName); if (ObjIndex > 0) { thisMechVentZone.ZoneDesignSpecADObjName = state.dataSize->ZoneSizingInput(ObjIndex).ZoneAirDistEffObjName; thisMechVentZone.ZoneDesignSpecADObjIndex = state.dataSize->ZoneSizingInput(ObjIndex).ZoneAirDistributionIndex; @@ -1513,8 +1508,7 @@ void GetOAControllerInputs(EnergyPlusData &state) } } else { // Not a zone name, must be a zone list - int ZoneListNum = - UtilityRoutines::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->ZoneList); + int ZoneListNum = Util::FindItemInList(state.dataMixedAir->VentMechZoneOrListName(groupNum), state.dataHeatBal->ZoneList); if (ZoneListNum > 0) { for (int ScanZoneListNum = 1; ScanZoneListNum <= state.dataHeatBal->ZoneList(ZoneListNum).NumOfZones; ++ScanZoneListNum) { // check to make sure zone name is unique (not listed more than once)... @@ -1544,7 +1538,7 @@ void GetOAControllerInputs(EnergyPlusData &state) thisMechVentZone.ZoneDesignSpecOAObjIndex = state.dataMixedAir->DesignSpecOAObjIndex(groupNum); } else { if (state.dataGlobal->DoZoneSizing) { - int ObjIndex = UtilityRoutines::FindItemInList( + int ObjIndex = Util::FindItemInList( state.dataHeatBal->Zone(zoneNum2).Name, state.dataSize->ZoneSizingInput, &ZoneSizingInputData::ZoneName); if (ObjIndex > 0) { thisMechVentZone.ZoneDesignSpecOAObjName = state.dataSize->ZoneSizingInput(ObjIndex).DesignSpecOAObjName; @@ -1560,7 +1554,7 @@ void GetOAControllerInputs(EnergyPlusData &state) thisMechVentZone.ZoneDesignSpecADObjIndex = state.dataMixedAir->DesignSpecZoneADObjIndex(groupNum); } else { if (state.dataGlobal->DoZoneSizing) { - int ObjIndex = UtilityRoutines::FindItemInList( + int ObjIndex = Util::FindItemInList( state.dataHeatBal->Zone(zoneNum2).Name, state.dataSize->ZoneSizingInput, &ZoneSizingInputData::ZoneName); if (ObjIndex > 0) { thisMechVentZone.ZoneDesignSpecADObjName = @@ -1685,11 +1679,11 @@ void GetOAControllerInputs(EnergyPlusData &state) for (int EquipListNum = 1; EquipListNum <= state.dataZoneEquip->NumOfZoneEquipLists; ++EquipListNum) { if (EquipListNum == EquipListIndex) { for (int EquipNum = 1; EquipNum <= state.dataZoneEquip->ZoneEquipList(EquipListNum).NumOfEquipTypes; ++EquipNum) { - if (UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(EquipListNum).EquipTypeName(EquipNum), - "ZONEHVAC:AIRDISTRIBUTIONUNIT")) { + if (Util::SameString(state.dataZoneEquip->ZoneEquipList(EquipListNum).EquipTypeName(EquipNum), + "ZONEHVAC:AIRDISTRIBUTIONUNIT")) { for (int ADUNum = 1; ADUNum <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++ADUNum) { - if (UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(EquipListNum).EquipName(EquipNum), - state.dataDefineEquipment->AirDistUnit(ADUNum).Name)) { + if (Util::SameString(state.dataZoneEquip->ZoneEquipList(EquipListNum).EquipName(EquipNum), + state.dataDefineEquipment->AirDistUnit(ADUNum).Name)) { if ((state.dataDefineEquipment->AirDistUnit(ADUNum).EquipTypeEnum(EquipNum) == DataDefineEquip::ZnAirLoopEquipType::SingleDuctVAVReheat) || (state.dataDefineEquipment->AirDistUnit(ADUNum).EquipTypeEnum(EquipNum) == @@ -1773,7 +1767,7 @@ void GetOAControllerInputs(EnergyPlusData &state) // Link OA controller object with mechanical ventilation object for (int OAControllerNum = 1; OAControllerNum <= state.dataMixedAir->NumOAControllers; ++OAControllerNum) { - state.dataMixedAir->OAController(OAControllerNum).VentMechObjectNum = UtilityRoutines::FindItemInList( + state.dataMixedAir->OAController(OAControllerNum).VentMechObjectNum = Util::FindItemInList( state.dataMixedAir->OAController(OAControllerNum).VentilationMechanicalName, state.dataMixedAir->VentilationMechanical); if (state.dataMixedAir->OAController(OAControllerNum).VentMechObjectNum == 0 && !state.dataMixedAir->OAController(OAControllerNum).VentilationMechanicalName.empty()) { @@ -2099,47 +2093,47 @@ void ProcessOAControllerInputs(EnergyPlusData &state, format("{}=\"{}\": {}=\"{}\" is not an OutdoorAir:Node.", CurrentModuleObject, AlphArray(1), cAlphaFields(5), AlphArray(5))); ShowContinueError(state, "Confirm that this is the intended source for the outdoor air stream."); } - if (UtilityRoutines::SameString(AlphArray(6), "NoEconomizer")) { + if (Util::SameString(AlphArray(6), "NoEconomizer")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::NoEconomizer; - } else if (UtilityRoutines::SameString(AlphArray(6), "FixedDryBulb")) { + } else if (Util::SameString(AlphArray(6), "FixedDryBulb")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::FixedDryBulb; - } else if (UtilityRoutines::SameString(AlphArray(6), "FixedEnthalpy")) { + } else if (Util::SameString(AlphArray(6), "FixedEnthalpy")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::FixedEnthalpy; - } else if (UtilityRoutines::SameString(AlphArray(6), "FixedDewPointAndDryBulb")) { + } else if (Util::SameString(AlphArray(6), "FixedDewPointAndDryBulb")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::FixedDewPointAndDryBulb; - } else if (UtilityRoutines::SameString(AlphArray(6), "DifferentialDryBulb")) { + } else if (Util::SameString(AlphArray(6), "DifferentialDryBulb")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::DifferentialDryBulb; - } else if (UtilityRoutines::SameString(AlphArray(6), "DifferentialEnthalpy")) { + } else if (Util::SameString(AlphArray(6), "DifferentialEnthalpy")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::DifferentialEnthalpy; - } else if (UtilityRoutines::SameString(AlphArray(6), "DifferentialDryBulbAndEnthalpy")) { + } else if (Util::SameString(AlphArray(6), "DifferentialDryBulbAndEnthalpy")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::DifferentialDryBulbAndEnthalpy; - } else if (UtilityRoutines::SameString(AlphArray(6), "ElectronicEnthalpy")) { + } else if (Util::SameString(AlphArray(6), "ElectronicEnthalpy")) { state.dataMixedAir->OAController(OutAirNum).Econo = EconoOp::ElectronicEnthalpy; } else { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" value.", CurrentModuleObject, AlphArray(1), cAlphaFields(6), AlphArray(6))); ErrorsFound = true; } // Bypass choice - Added by Amit for new feature implementation - if (UtilityRoutines::SameString(AlphArray(7), "ModulateFlow")) { + if (Util::SameString(AlphArray(7), "ModulateFlow")) { state.dataMixedAir->OAController(OutAirNum).EconBypass = false; - } else if (UtilityRoutines::SameString(AlphArray(7), "MinimumFlowWithBypass")) { + } else if (Util::SameString(AlphArray(7), "MinimumFlowWithBypass")) { state.dataMixedAir->OAController(OutAirNum).EconBypass = true; } else { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" value.", CurrentModuleObject, AlphArray(1), cAlphaFields(7), AlphArray(7))); ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(9), "NoLockout")) { + if (Util::SameString(AlphArray(9), "NoLockout")) { state.dataMixedAir->OAController(OutAirNum).Lockout = LockoutType::NoLockoutPossible; - } else if (UtilityRoutines::SameString(AlphArray(9), "LockoutWithHeating")) { + } else if (Util::SameString(AlphArray(9), "LockoutWithHeating")) { state.dataMixedAir->OAController(OutAirNum).Lockout = LockoutType::LockoutWithHeatingPossible; - } else if (UtilityRoutines::SameString(AlphArray(9), "LockoutWithCompressor")) { + } else if (Util::SameString(AlphArray(9), "LockoutWithCompressor")) { state.dataMixedAir->OAController(OutAirNum).Lockout = LockoutType::LockoutWithCompressorPossible; } else { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" value.", CurrentModuleObject, AlphArray(1), cAlphaFields(9), AlphArray(9))); ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(10), "FixedMinimum")) { + if (Util::SameString(AlphArray(10), "FixedMinimum")) { state.dataMixedAir->OAController(OutAirNum).FixedMin = true; } else { state.dataMixedAir->OAController(OutAirNum).FixedMin = false; @@ -2232,9 +2226,9 @@ void ProcessOAControllerInputs(EnergyPlusData &state, state.dataMixedAir->OAController(OutAirNum).EconomizerOASchedPtr = GetScheduleIndex(state, AlphArray(15)); // High humidity control option can be used with any economizer flag - if (UtilityRoutines::SameString(AlphArray(16), "Yes")) { + if (Util::SameString(AlphArray(16), "Yes")) { - state.dataMixedAir->OAController(OutAirNum).HumidistatZoneNum = UtilityRoutines::FindItemInList(AlphArray(17), state.dataHeatBal->Zone); + state.dataMixedAir->OAController(OutAirNum).HumidistatZoneNum = Util::FindItemInList(AlphArray(17), state.dataHeatBal->Zone); // Get the node number for the zone with the humidistat if (state.dataMixedAir->OAController(OutAirNum).HumidistatZoneNum > 0) { @@ -2250,10 +2244,9 @@ void ProcessOAControllerInputs(EnergyPlusData &state, int OASysIndex = 0; for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; ++OASysNum) { for (int OAControllerNum = 1; OAControllerNum <= state.dataAirLoop->OutsideAirSys(OASysNum).NumControllers; ++OAControllerNum) { - if (!UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerType(OAControllerNum), - CurrentModuleObject) || - !UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName(OAControllerNum), - state.dataMixedAir->OAController(OutAirNum).Name)) + if (!Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerType(OAControllerNum), CurrentModuleObject) || + !Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName(OAControllerNum), + state.dataMixedAir->OAController(OutAirNum).Name)) continue; OASysIndex = OASysNum; OASysFound = true; @@ -2269,10 +2262,9 @@ void ProcessOAControllerInputs(EnergyPlusData &state, for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, - state.dataAirLoop->OutsideAirSys(OASysIndex).Name) || - !UtilityRoutines::SameString( + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).Name, + state.dataAirLoop->OutsideAirSys(OASysIndex).Name) || + !Util::SameString( state.dataAirSystemsData->PrimaryAirSystems(AirLoopNumber).Branch(BranchNum).Comp(CompNum).TypeOf, "AirLoopHVAC:OutdoorAirSystem")) continue; @@ -2337,7 +2329,7 @@ void ProcessOAControllerInputs(EnergyPlusData &state, state.dataMixedAir->OAController(OutAirNum).HighRHOAFlowRatio = 1.0; } - if (UtilityRoutines::SameString(AlphArray(16), "Yes") && state.dataMixedAir->OAController(OutAirNum).FixedMin) { + if (Util::SameString(AlphArray(16), "Yes") && state.dataMixedAir->OAController(OutAirNum).FixedMin) { if (state.dataMixedAir->OAController(OutAirNum).MaxOA > 0.0 && state.dataMixedAir->OAController(OutAirNum).MinOA != AutoSize) { Real64 OAFlowRatio = state.dataMixedAir->OAController(OutAirNum).MinOA / state.dataMixedAir->OAController(OutAirNum).MaxOA; if (state.dataMixedAir->OAController(OutAirNum).HighRHOAFlowRatio < OAFlowRatio) { @@ -2359,9 +2351,9 @@ void ProcessOAControllerInputs(EnergyPlusData &state, } if (NumAlphas >= 18) { - if (UtilityRoutines::SameString(AlphArray(18), "Yes")) { + if (Util::SameString(AlphArray(18), "Yes")) { state.dataMixedAir->OAController(OutAirNum).ModifyDuringHighOAMoisture = false; - } else if (UtilityRoutines::SameString(AlphArray(18), "No")) { + } else if (Util::SameString(AlphArray(18), "No")) { state.dataMixedAir->OAController(OutAirNum).ModifyDuringHighOAMoisture = true; } else { ShowSevereError(state, @@ -2380,9 +2372,9 @@ void ProcessOAControllerInputs(EnergyPlusData &state, } } - } else if (UtilityRoutines::SameString(AlphArray(16), "No") || lAlphaBlanks(16)) { + } else if (Util::SameString(AlphArray(16), "No") || lAlphaBlanks(16)) { if (NumAlphas >= 18) { - if (!UtilityRoutines::SameString(AlphArray(18), "Yes") && !UtilityRoutines::SameString(AlphArray(18), "No")) { + if (!Util::SameString(AlphArray(18), "Yes") && !Util::SameString(AlphArray(18), "No")) { ShowSevereError(state, format("{} \"{}\", invalid field value", CurrentModuleObject, state.dataMixedAir->OAController(OutAirNum).Name)); ShowContinueError(state, format("...{}=\"{}\" - valid values are \"Yes\" or \"No\".", cAlphaFields(18), AlphArray(18))); @@ -2394,7 +2386,7 @@ void ProcessOAControllerInputs(EnergyPlusData &state, ShowContinueError(state, format("...{}=\"{}\" - valid values are \"Yes\" or \"No\".", cAlphaFields(16), AlphArray(16))); ErrorsFound = true; if (NumAlphas >= 18) { - if (!UtilityRoutines::SameString(AlphArray(18), "Yes") && !UtilityRoutines::SameString(AlphArray(18), "No")) { + if (!Util::SameString(AlphArray(18), "Yes") && !Util::SameString(AlphArray(18), "No")) { ShowSevereError(state, format("{} \"{}\", invalid field value", CurrentModuleObject, state.dataMixedAir->OAController(OutAirNum).Name)); ShowContinueError(state, format("...{}=\"{}\" - valid values are \"Yes\" or \"No\".", cAlphaFields(18), AlphArray(18))); @@ -2405,9 +2397,9 @@ void ProcessOAControllerInputs(EnergyPlusData &state, if (NumAlphas > 18) { if (!lAlphaBlanks(19)) { - if (UtilityRoutines::SameString(AlphArray(19), "BypassWhenWithinEconomizerLimits")) { + if (Util::SameString(AlphArray(19), "BypassWhenWithinEconomizerLimits")) { state.dataMixedAir->OAController(OutAirNum).HeatRecoveryBypassControlType = BypassWhenWithinEconomizerLimits; - } else if (UtilityRoutines::SameString(AlphArray(19), "BypassWhenOAFlowGreaterThanMinimum")) { + } else if (Util::SameString(AlphArray(19), "BypassWhenOAFlowGreaterThanMinimum")) { state.dataMixedAir->OAController(OutAirNum).HeatRecoveryBypassControlType = BypassWhenOAFlowGreaterThanMinimum; } else { ShowWarningError(state, format("{}=\"{}\" invalid {}=\"{}\".", CurrentModuleObject, AlphArray(1), cAlphaFields(19), AlphArray(19))); @@ -2419,7 +2411,7 @@ void ProcessOAControllerInputs(EnergyPlusData &state, if (NumAlphas > 19) { if (!lAlphaBlanks(20)) { - if (UtilityRoutines::SameString(AlphArray(20), "EconomizerFirst")) { + if (Util::SameString(AlphArray(20), "EconomizerFirst")) { state.dataMixedAir->OAController(OutAirNum).EconomizerStagingType = DataHVACGlobals::EconomizerStagingType::EconomizerFirst; } else { state.dataMixedAir->OAController(OutAirNum).EconomizerStagingType = @@ -2428,7 +2420,7 @@ void ProcessOAControllerInputs(EnergyPlusData &state, } } - if (UtilityRoutines::SameString(AlphArray(16), "Yes") && state.dataMixedAir->OAController(OutAirNum).Econo == EconoOp::NoEconomizer) { + if (Util::SameString(AlphArray(16), "Yes") && state.dataMixedAir->OAController(OutAirNum).Econo == EconoOp::NoEconomizer) { ShowWarningError(state, format("{} \"{}\"", MixedAirControllerTypeNames[static_cast(state.dataMixedAir->OAController(OutAirNum).ControllerType)], @@ -2498,9 +2490,9 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con int thisOASys = 0; for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; ++OASysNum) { // find which OAsys has this controller - int found = UtilityRoutines::FindItemInList(thisOAController.Name, - state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName, - isize(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName)); + int found = Util::FindItemInList(thisOAController.Name, + state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName, + isize(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName)); if (found != 0) { thisOASys = OASysNum; state.dataAirLoop->OutsideAirSys(thisOASys).OAControllerIndex = GetOAController(state, thisOAController.Name); @@ -2512,12 +2504,12 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con ShowContinueError(state, "in list of valid OA Controllers."); ErrorsFound = true; } - int thisNumForMixer = UtilityRoutines::FindItem(CurrentModuleObjects[static_cast(CMO::OAMixer)], - state.dataAirLoop->OutsideAirSys(thisOASys).ComponentType, - isize(state.dataAirLoop->OutsideAirSys(thisOASys).ComponentType)); + int thisNumForMixer = Util::FindItem(CurrentModuleObjects[static_cast(CMO::OAMixer)], + state.dataAirLoop->OutsideAirSys(thisOASys).ComponentType, + isize(state.dataAirLoop->OutsideAirSys(thisOASys).ComponentType)); if (thisNumForMixer != 0) { std::string_view const equipName = state.dataAirLoop->OutsideAirSys(thisOASys).ComponentName(thisNumForMixer); - int thisMixerIndex = UtilityRoutines::FindItemInList(equipName, state.dataMixedAir->OAMixer); + int thisMixerIndex = Util::FindItemInList(equipName, state.dataMixedAir->OAMixer); if (thisMixerIndex != 0) { thisOAController.InletNode = state.dataMixedAir->OAMixer(thisMixerIndex).InletNode; } else { @@ -2920,8 +2912,7 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; ++OASysNum) { for (int OAControllerLoop2 = 1; OAControllerLoop2 <= state.dataAirLoop->OutsideAirSys(OASysNum).NumControllers; ++OAControllerLoop2) { - if (UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName(OAControllerLoop2), - loopOAController.Name)) { + if (Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerName(OAControllerLoop2), loopOAController.Name)) { thisOASys = OASysNum; OASysFound = true; break; @@ -2942,12 +2933,10 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con for (int CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(thisAirLoop).Branch(BranchNum).TotalComponents; ++CompNum) { - if (!UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(thisAirLoop).Branch(BranchNum).Comp(CompNum).Name, - state.dataAirLoop->OutsideAirSys(thisOASys).Name) || - !UtilityRoutines::SameString( - state.dataAirSystemsData->PrimaryAirSystems(thisAirLoop).Branch(BranchNum).Comp(CompNum).TypeOf, - "AirLoopHVAC:OutdoorAirSystem")) + if (!Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(thisAirLoop).Branch(BranchNum).Comp(CompNum).Name, + state.dataAirLoop->OutsideAirSys(thisOASys).Name) || + !Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(thisAirLoop).Branch(BranchNum).Comp(CompNum).TypeOf, + "AirLoopHVAC:OutdoorAirSystem")) continue; AirLoopFound = true; airLoopNum = thisAirLoop; @@ -4809,10 +4798,9 @@ void OAControllerProps::SizeOAController(EnergyPlusData &state) 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 const &CompName = state.dataAirLoop->OutsideAirSys(state.dataSize->CurOASysNum).ComponentName(CompNum); - if (UtilityRoutines::SameString(CompType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || - UtilityRoutines::SameString(CompType, "COIL:HEATING:WATER") || - UtilityRoutines::SameString(CompType, "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED")) { - if (UtilityRoutines::SameString(CompType, "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED")) { + if (Util::SameString(CompType, "COIL:COOLING:WATER:DETAILEDGEOMETRY") || Util::SameString(CompType, "COIL:HEATING:WATER") || + Util::SameString(CompType, "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED")) { + if (Util::SameString(CompType, "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED")) { CoilName = HVACHXAssistedCoolingCoil::GetHXDXCoilName(state, CompType, CompName, ErrorsFound); CoilType = HVACHXAssistedCoolingCoil::GetHXCoilType(state, CompType, CompName, ErrorsFound); } else { @@ -4968,7 +4956,7 @@ Array1D_int GetOAMixerNodeNumbers(EnergyPlusData &state, state.dataMixedAir->GetOAMixerInputFlag = false; } - int WhichOAMixer = UtilityRoutines::FindItemInList(OAMixerName, state.dataMixedAir->OAMixer); + int WhichOAMixer = Util::FindItemInList(OAMixerName, state.dataMixedAir->OAMixer); if (WhichOAMixer != 0) { OANodeNumbers(1) = state.dataMixedAir->OAMixer(WhichOAMixer).InletNode; OANodeNumbers(2) = state.dataMixedAir->OAMixer(WhichOAMixer).RelNode; @@ -5219,7 +5207,7 @@ int GetOASystemNumber(EnergyPlusData &state, std::string const &OASysName) // OA state.dataMixedAir->GetOASysInputFlag = false; } - return UtilityRoutines::FindItemInList(OASysName, state.dataAirLoop->OutsideAirSys); + return Util::FindItemInList(OASysName, state.dataAirLoop->OutsideAirSys); } int FindOAMixerMatchForOASystem(EnergyPlusData &state, int const OASysNumber) // Which OA System @@ -5241,9 +5229,9 @@ int FindOAMixerMatchForOASystem(EnergyPlusData &state, int const OASysNumber) // int OAMixerNumber = 0; if (OASysNumber > 0 && OASysNumber <= state.dataAirLoop->NumOASystems) { for (int OACompNum = 1; OACompNum <= state.dataAirLoop->OutsideAirSys(OASysNumber).NumComponents; ++OACompNum) { - if (UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNumber).ComponentType(OACompNum), "OUTDOORAIR:MIXER")) { - OAMixerNumber = UtilityRoutines::FindItemInList(state.dataAirLoop->OutsideAirSys(OASysNumber).ComponentName(OACompNum), - state.dataMixedAir->OAMixer); + if (Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNumber).ComponentType(OACompNum), "OUTDOORAIR:MIXER")) { + OAMixerNumber = + Util::FindItemInList(state.dataAirLoop->OutsideAirSys(OASysNumber).ComponentName(OACompNum), state.dataMixedAir->OAMixer); break; } } @@ -5267,7 +5255,7 @@ int GetOAMixerIndex(EnergyPlusData &state, std::string const &OAMixerName) // Wh state.dataMixedAir->GetOAMixerInputFlag = false; } - int OAMixerIndex = UtilityRoutines::FindItem(OAMixerName, state.dataMixedAir->OAMixer); + int OAMixerIndex = Util::FindItem(OAMixerName, state.dataMixedAir->OAMixer); if (OAMixerIndex == 0) { ShowSevereError(state, format("GetOAMixerIndex: Could not find OutdoorAir:Mixer, Name=\"{}\"", OAMixerName)); @@ -5372,7 +5360,7 @@ bool CheckForControllerWaterCoil(EnergyPlusData &state, for (int CompNum = 1; CompNum <= state.dataMixedAir->ControllerLists(Num).NumControllers; ++CompNum) { if (state.dataMixedAir->ControllerLists(Num).ControllerType(CompNum) != ControllerType) continue; - if (!UtilityRoutines::SameString(state.dataMixedAir->ControllerLists(Num).ControllerName(CompNum), ControllerName)) continue; + if (!Util::SameString(state.dataMixedAir->ControllerLists(Num).ControllerName(CompNum), ControllerName)) continue; OnControllerList = true; break; } @@ -5430,7 +5418,7 @@ void CheckControllerLists(EnergyPlusData &state, bool &ErrFound) // Now check AirLoopHVAC and AirLoopHVAC:OutdoorAirSystem int Found = 0; if (state.dataAirLoop->NumOASystems > 0) { - Found = UtilityRoutines::FindItemInList(ControllerListName, state.dataAirLoop->OutsideAirSys, &OutsideAirSysProps::ControllerListName); + Found = Util::FindItemInList(ControllerListName, state.dataAirLoop->OutsideAirSys, &OutsideAirSysProps::ControllerListName); if (Found > 0) ++Count; } @@ -5634,7 +5622,7 @@ int GetOAMixerNumber(EnergyPlusData &state, std::string const &OAMixerName // mu state.dataMixedAir->GetOAMixerInputFlag = false; } - return UtilityRoutines::FindItemInList(OAMixerName, state.dataMixedAir->OAMixer); + return Util::FindItemInList(OAMixerName, state.dataMixedAir->OAMixer); } // End of Utility Section of the Module //****************************************************************************** diff --git a/src/EnergyPlus/MixerComponent.cc b/src/EnergyPlus/MixerComponent.cc index 58cfaaf5ab9..bda19a41c27 100644 --- a/src/EnergyPlus/MixerComponent.cc +++ b/src/EnergyPlus/MixerComponent.cc @@ -104,7 +104,7 @@ void SimAirMixer(EnergyPlusData &state, std::string_view CompName, int &CompInde // Find the correct MixerNumber if (CompIndex == 0) { - MixerNum = UtilityRoutines::FindItemInList(CompName, state.dataMixerComponent->MixerCond, &MixerConditions::MixerName); + MixerNum = Util::FindItemInList(CompName, state.dataMixerComponent->MixerCond, &MixerConditions::MixerName); if (MixerNum == 0) { ShowFatalError(state, format("SimAirLoopMixer: Mixer not found={}", CompName)); } @@ -211,7 +211,7 @@ void GetMixerInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); state.dataMixerComponent->MixerCond(MixerNum).MixerName = AlphArray(1); @@ -618,7 +618,7 @@ void GetZoneMixerIndex(EnergyPlusData &state, std::string const &MixerName, int state.dataMixerComponent->GetZoneMixerIndexInputFlag = false; } - MixerIndex = UtilityRoutines::FindItemInList(MixerName, state.dataMixerComponent->MixerCond, &MixerConditions::MixerName); + MixerIndex = Util::FindItemInList(MixerName, state.dataMixerComponent->MixerCond, &MixerConditions::MixerName); if (MixerIndex == 0) { if (!ThisObjectType.empty()) { ShowSevereError(state, format("{}, GetZoneMixerIndex: Zone Mixer not found={}", ThisObjectType, MixerName)); diff --git a/src/EnergyPlus/MoistureBalanceEMPDManager.cc b/src/EnergyPlus/MoistureBalanceEMPDManager.cc index ef351a49b10..50352e726b0 100644 --- a/src/EnergyPlus/MoistureBalanceEMPDManager.cc +++ b/src/EnergyPlus/MoistureBalanceEMPDManager.cc @@ -199,7 +199,7 @@ void GetMoistureBalanceEMPDInput(EnergyPlusData &state) state.dataIPShortCut->cNumericFieldNames); // Load the material derived type from the input data. - MaterNum = UtilityRoutines::FindItemInPtrList(MaterialNames(1), state.dataMaterial->Material); + MaterNum = Util::FindItemInPtrList(MaterialNames(1), state.dataMaterial->Material); if (MaterNum == 0) { ShowSevereError(state, format("{}: invalid {} entered={}, must match to a valid Material name.", @@ -566,27 +566,26 @@ void CalcMoistureBalanceEMPD(EnergyPlusData &state, Taver = SurfTempIn; // Calculate average vapor density [kg/m^3], and RH for use in material property calculations. RVaver = rv_surface_old; - RHaver = RVaver * 461.52 * (Taver + Constant::KelvinConv) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); + RHaver = RVaver * 461.52 * (Taver + Constant::Kelvin) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); // Calculate the saturated vapor pressure, surface vapor pressure and dewpoint. Used to check for condensation in HeatBalanceSurfaceManager PVsat = PsyPsatFnTemp(state, Taver, RoutineName); PVsurf = RHaver * std::exp(23.7093 - 4111.0 / (Taver + 237.7)); - TempSat = 4111.0 / (23.7093 - std::log(PVsurf)) + 35.45 - Constant::KelvinConv; + TempSat = 4111.0 / (23.7093 - std::log(PVsurf)) + 35.45 - Constant::Kelvin; // Convert vapor resistance factor (user input) to diffusivity. Evaluate at local surface temperature. // 2e-7*T^0.81/P = vapor diffusivity in air. [kg/m-s-Pa] // 461.52 = universal gas constant for water [J/kg-K] // EMPDdiffusivity = [m^2/s] - EMPDdiffusivity = (2.0e-7 * pow(Taver + Constant::KelvinConv, 0.81) / state.dataEnvrn->OutBaroPress) / material->EMPDmu * 461.52 * - (Taver + Constant::KelvinConv); + EMPDdiffusivity = + (2.0e-7 * pow(Taver + Constant::Kelvin, 0.81) / state.dataEnvrn->OutBaroPress) / material->EMPDmu * 461.52 * (Taver + Constant::Kelvin); // Calculate slope of moisture sorption curve at current RH. [kg/kg-RH] dU_dRH = material->MoistACoeff * material->MoistBCoeff * pow(RHaver, material->MoistBCoeff - 1) + material->MoistCCoeff * material->MoistDCoeff * pow(RHaver, material->MoistDCoeff - 1); // Convert vapor density and temperature of zone air to RH - RHZone = - rho_vapor_air_in * 461.52 * (TempZone + Constant::KelvinConv) * std::exp(-23.7093 + 4111.0 / ((TempZone + Constant::KelvinConv) - 35.45)); + RHZone = rho_vapor_air_in * 461.52 * (TempZone + Constant::Kelvin) * std::exp(-23.7093 + 4111.0 / ((TempZone + Constant::Kelvin) - 35.45)); // Convert stored vapor density from previous timestep to RH. RH_deep_layer_old = PsyRhFnTdbRhov(state, Taver, rv_deep_old); @@ -598,7 +597,7 @@ void CalcMoistureBalanceEMPD(EnergyPlusData &state, Rcoating = 0; } else { Rcoating = material->EMPDCoatingThickness * material->EMPDmuCoating * state.dataEnvrn->OutBaroPress / - (2.0e-7 * pow(Taver + Constant::KelvinConv, 0.81) * 461.52 * (Taver + Constant::KelvinConv)); + (2.0e-7 * pow(Taver + Constant::Kelvin, 0.81) * 461.52 * (Taver + Constant::Kelvin)); } // Calculate mass-transfer coefficient between zone air and center of surface layer. [m/s] diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 8643d45ff55..15c7e67d71d 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -262,7 +262,7 @@ namespace RoomAir { AirNodeFoundFlag = false; for (AirNodeNum = AirNodeBeginNum; AirNodeNum <= state.dataRoomAir->TotNumOfAirNodes; ++AirNodeNum) { - if (UtilityRoutines::SameString(state.dataRoomAir->AirNode(AirNodeNum).ZoneName, thisZone.Name)) { + if (Util::SameString(state.dataRoomAir->AirNode(AirNodeNum).ZoneName, thisZone.Name)) { state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType = state.dataRoomAir->AirNode(AirNodeNum).ClassType; state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).AirNodeName = state.dataRoomAir->AirNode(AirNodeNum).Name; state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).Height = state.dataRoomAir->AirNode(AirNodeNum).Height; diff --git a/src/EnergyPlus/NodeInputManager.cc b/src/EnergyPlus/NodeInputManager.cc index df8ad699a87..1d39e72cb06 100644 --- a/src/EnergyPlus/NodeInputManager.cc +++ b/src/EnergyPlus/NodeInputManager.cc @@ -130,7 +130,7 @@ void GetNodeNums(EnergyPlusData &state, } if (!Name.empty()) { - int ThisOne = UtilityRoutines::FindItemInList(Name, state.dataNodeInputMgr->NodeLists); + int ThisOne = Util::FindItemInList(Name, state.dataNodeInputMgr->NodeLists); if (ThisOne != 0) { NumNodes = state.dataNodeInputMgr->NodeLists(ThisOne).NumOfNodesInList; NodeNumbers({1, NumNodes}) = state.dataNodeInputMgr->NodeLists(ThisOne).NodeNumbers({1, NumNodes}); @@ -552,7 +552,7 @@ void GetNodeListsInput(EnergyPlusData &state, bool &ErrorsFound) // Set to true for (int Loop = 1; Loop <= state.dataNodeInputMgr->NumOfNodeLists; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem( state, CurrentModuleObject, Loop, cAlphas, NumAlphas, rNumbers, NumNumbers, IOStatus); - if (UtilityRoutines::IsNameEmpty(state, cAlphas(1), CurrentModuleObject, localErrorsFound)) continue; + if (Util::IsNameEmpty(state, cAlphas(1), CurrentModuleObject, localErrorsFound)) continue; ++NCount; state.dataNodeInputMgr->NodeLists(NCount).Name = cAlphas(1); @@ -585,8 +585,7 @@ void GetNodeListsInput(EnergyPlusData &state, bool &ErrorsFound) // Set to true } state.dataNodeInputMgr->NodeLists(NCount).NodeNumbers(Loop1) = AssignNodeNumber( state, state.dataNodeInputMgr->NodeLists(NCount).NodeNames(Loop1), DataLoopNode::NodeFluidType::Blank, localErrorsFound); - if (UtilityRoutines::SameString(state.dataNodeInputMgr->NodeLists(NCount).NodeNames(Loop1), - state.dataNodeInputMgr->NodeLists(NCount).Name)) { + if (Util::SameString(state.dataNodeInputMgr->NodeLists(NCount).NodeNames(Loop1), state.dataNodeInputMgr->NodeLists(NCount).Name)) { ShowSevereError(state, format("{}{}=\"{}\", invalid node name in list.", RoutineName, CurrentModuleObject, cAlphas(1))); ShowContinueError(state, format("... Node {} Name=\"{}\", duplicates NodeList Name.", Loop1, cAlphas(Loop1 + 1))); localErrorsFound = true; @@ -617,8 +616,7 @@ void GetNodeListsInput(EnergyPlusData &state, bool &ErrorsFound) // Set to true for (int Loop2 = 1; Loop2 <= state.dataNodeInputMgr->NodeLists(Loop).NumOfNodesInList; ++Loop2) { for (int Loop1 = 1; Loop1 <= state.dataNodeInputMgr->NumOfNodeLists; ++Loop1) { if (Loop == Loop1) continue; // within a nodelist have already checked to see if node name duplicates nodelist name - if (!UtilityRoutines::SameString(state.dataNodeInputMgr->NodeLists(Loop).NodeNames(Loop2), - state.dataNodeInputMgr->NodeLists(Loop1).Name)) + if (!Util::SameString(state.dataNodeInputMgr->NodeLists(Loop).NodeNames(Loop2), state.dataNodeInputMgr->NodeLists(Loop1).Name)) continue; ShowSevereError( state, @@ -675,7 +673,7 @@ int AssignNodeNumber(EnergyPlusData &state, int NumNode = 0; if (state.dataNodeInputMgr->NumOfUniqueNodeNames > 0) { - NumNode = UtilityRoutines::FindItemInList( + NumNode = Util::FindItemInList( Name, state.dataLoopNodes->NodeID({1, state.dataNodeInputMgr->NumOfUniqueNodeNames}), state.dataNodeInputMgr->NumOfUniqueNodeNames); if (NumNode > 0) { AssignNodeNumber = NumNode; @@ -864,7 +862,7 @@ void CheckUniqueNodeNames( int Found; if (!CheckName.empty()) { - Found = UtilityRoutines::FindItemInList(CheckName, state.dataNodeInputMgr->UniqueNodeNames, state.dataNodeInputMgr->NumCheckNodes); + Found = Util::FindItemInList(CheckName, state.dataNodeInputMgr->UniqueNodeNames, state.dataNodeInputMgr->NumCheckNodes); if (Found != 0) { ShowSevereError(state, format("{}=\"{}\", duplicate node names found.", state.dataNodeInputMgr->CurCheckContextName, ObjectName)); ShowContinueError(state, format("...for Node Type(s)={}, duplicate node name=\"{}\".", NodeTypes, CheckName)); @@ -907,7 +905,7 @@ void CheckUniqueNodeNumbers( int Found; if (CheckNumber != 0) { - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataLoopNodes->NodeID(CheckNumber), state.dataNodeInputMgr->UniqueNodeNames, state.dataNodeInputMgr->NumCheckNodes); if (Found != 0) { ShowSevereError(state, format("{}=\"{}\", duplicate node names found.", state.dataNodeInputMgr->CurCheckContextName, ObjectName)); @@ -1036,18 +1034,18 @@ void CalcMoreNodeInfo(EnergyPlusData &state) nodeReportingStrings.push_back(std::string(NodeReportingCalc + state.dataLoopNodes->NodeID(iNode))); nodeFluidNames.push_back(FluidProperties::GetGlycolNameByIndex(state, state.dataLoopNodes->Node(iNode).FluidIndex)); for (int iReq = 1; iReq <= state.dataOutputProcessor->NumOfReqVariables; ++iReq) { - if (UtilityRoutines::SameString(state.dataOutputProcessor->ReqRepVars(iReq).Key, state.dataLoopNodes->NodeID(iNode)) || + if (Util::SameString(state.dataOutputProcessor->ReqRepVars(iReq).Key, state.dataLoopNodes->NodeID(iNode)) || state.dataOutputProcessor->ReqRepVars(iReq).Key.empty()) { - if (UtilityRoutines::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Wetbulb Temperature")) { + if (Util::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Wetbulb Temperature")) { state.dataNodeInputMgr->NodeWetBulbRepReq(iNode) = true; NodeWetBulbSchedPtr(iNode) = state.dataOutputProcessor->ReqRepVars(iReq).SchedPtr; - } else if (UtilityRoutines::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Relative Humidity")) { + } else if (Util::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Relative Humidity")) { NodeRelHumidityRepReq(iNode) = true; NodeRelHumiditySchedPtr(iNode) = state.dataOutputProcessor->ReqRepVars(iReq).SchedPtr; - } else if (UtilityRoutines::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Dewpoint Temperature")) { + } else if (Util::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Dewpoint Temperature")) { NodeDewPointRepReq(iNode) = true; NodeDewPointSchedPtr(iNode) = state.dataOutputProcessor->ReqRepVars(iReq).SchedPtr; - } else if (UtilityRoutines::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Specific Heat")) { + } else if (Util::SameString(state.dataOutputProcessor->ReqRepVars(iReq).VarName, "System Node Specific Heat")) { NodeSpecificHeatRepReq(iNode) = true; NodeSpecificHeatSchedPtr(iNode) = state.dataOutputProcessor->ReqRepVars(iReq).SchedPtr; } diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 1d0c1ed71f4..b3a1883129a 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -156,7 +156,7 @@ namespace OutdoorAirUnit { // Find the correct Outdoor Air Unit if (CompIndex == 0) { - OAUnitNum = UtilityRoutines::FindItemInList(CompName, state.dataOutdoorAirUnit->OutAirUnit); + OAUnitNum = Util::FindItemInList(CompName, state.dataOutdoorAirUnit->OutAirUnit); if (OAUnitNum == 0) { ShowFatalError(state, format("ZoneHVAC:OutdoorAirUnit not found={}", CompName)); } @@ -315,7 +315,7 @@ namespace OutdoorAirUnit { lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound); // A1 thisOutAirUnit.Name = state.dataIPShortCut->cAlphaArgs(1); @@ -339,7 +339,7 @@ namespace OutdoorAirUnit { // A3 thisOutAirUnit.ZoneName = state.dataIPShortCut->cAlphaArgs(3); - thisOutAirUnit.ZonePtr = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); + thisOutAirUnit.ZonePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); if (thisOutAirUnit.ZonePtr == 0) { if (lAlphaBlanks(3)) { @@ -405,10 +405,10 @@ namespace OutdoorAirUnit { } } // A6 :Fan Place - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "BlowThrough")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "BlowThrough")) { thisOutAirUnit.FanPlace = BlowThru; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "DrawThrough")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "DrawThrough")) { thisOutAirUnit.FanPlace = DrawThru; } if (thisOutAirUnit.FanPlace == 0) { @@ -663,7 +663,7 @@ namespace OutdoorAirUnit { thisOutAirUnit.OAEquip(InListNum).ComponentName = AlphArray(InListNum * 2 + 1); thisOutAirUnit.OAEquip(InListNum).Type = - static_cast(getEnumValue(CompTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(InListNum * 2)))); + static_cast(getEnumValue(CompTypeNamesUC, Util::makeUPPER(AlphArray(InListNum * 2)))); int const CompNum = InListNum; diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 54a5151c776..669ab9e50c4 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -309,11 +309,11 @@ namespace OutputProcessor { for (int i = 1; i <= op->NumOfReqVariables; ++i) { auto &reqRepVar = op->ReqRepVars(i); - if (!UtilityRoutines::SameString(reqRepVar.VarName, VarName)) { + if (!Util::SameString(reqRepVar.VarName, VarName)) { continue; } - if (!reqRepVar.Key.empty() && !(reqRepVar.is_simple_string && UtilityRoutines::SameString(reqRepVar.Key, KeyedValue)) && + if (!reqRepVar.Key.empty() && !(reqRepVar.is_simple_string && Util::SameString(reqRepVar.Key, KeyedValue)) && !(!reqRepVar.is_simple_string && RE2::FullMatch(std::string{KeyedValue}, *(reqRepVar.case_insensitive_pattern)))) { continue; } @@ -462,7 +462,7 @@ namespace OutputProcessor { ReportingFrequency ReportFreq(ReportingFrequency::Hourly); // Default // TODO: I think it's supposed to be upper case already, but tests aren't doing that at least... - const std::string FreqStringUpper = UtilityRoutines::makeUPPER(FreqString); + const std::string FreqStringUpper = Util::makeUPPER(FreqString); std::string::size_type const LenString = min(len(FreqString), static_cast(4u)); if (LenString < 4u) { @@ -914,7 +914,7 @@ namespace OutputProcessor { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - namesOfMeterCustom.emplace(UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1))); + namesOfMeterCustom.emplace(Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1))); } for (Loop = 1; Loop <= NumCustomMeters; ++Loop) { @@ -949,7 +949,7 @@ namespace OutputProcessor { // check if any fields reference another Meter:Custom int found = 0; for (fldIndex = 4; fldIndex <= NumAlpha; fldIndex += 2) { - if (namesOfMeterCustom.find(UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(fldIndex))) != namesOfMeterCustom.end()) { + if (namesOfMeterCustom.find(Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(fldIndex))) != namesOfMeterCustom.end()) { found = fldIndex; break; } @@ -1004,10 +1004,8 @@ namespace OutputProcessor { AddMeter(state, state.dataIPShortCut->cAlphaArgs(1), UnitsVar, std::string(), std::string(), std::string(), std::string()); op->EnergyMeters(op->NumEnergyMeters).TypeOfMeter = MtrType::Custom; // Can't use resource type in AddMeter cause it will confuse it with other meters. So, now: - GetStandardMeterResourceType(state, - op->EnergyMeters(op->NumEnergyMeters).ResourceType, - UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)), - errFlag); + GetStandardMeterResourceType( + state, op->EnergyMeters(op->NumEnergyMeters).ResourceType, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)), errFlag); if (errFlag) { ShowContinueError(state, format("..on {}=\"{}\".", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); BigErrorsFound = true; @@ -1179,7 +1177,7 @@ namespace OutputProcessor { lbrackPos = index(state.dataIPShortCut->cAlphaArgs(3), '['); if (lbrackPos != std::string::npos) state.dataIPShortCut->cAlphaArgs(1).erase(lbrackPos); - WhichMeter = UtilityRoutines::FindItem(state.dataIPShortCut->cAlphaArgs(3), op->EnergyMeters); + WhichMeter = Util::FindItem(state.dataIPShortCut->cAlphaArgs(3), op->EnergyMeters); if (WhichMeter == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}\".", @@ -1259,10 +1257,8 @@ namespace OutputProcessor { op->EnergyMeters(op->NumEnergyMeters).SourceMeter = WhichMeter; // Can't use resource type in AddMeter cause it will confuse it with other meters. So, now: - GetStandardMeterResourceType(state, - op->EnergyMeters(op->NumEnergyMeters).ResourceType, - UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)), - errFlag); + GetStandardMeterResourceType( + state, op->EnergyMeters(op->NumEnergyMeters).ResourceType, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)), errFlag); if (errFlag) { ShowContinueError(state, format("..on {}=\"{}\".", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); BigErrorsFound = true; @@ -1445,7 +1441,7 @@ namespace OutputProcessor { // the standard resource type. ErrorsFound = false; - std::string const meterType = UtilityRoutines::makeUPPER(UserInputResourceType); + std::string const meterType = Util::makeUPPER(UserInputResourceType); int eMeterResource = getEnumValue(Constant::eResourceNamesUC, meterType); @@ -1484,7 +1480,7 @@ namespace OutputProcessor { int Found; if (op->NumEnergyMeters > 0) { - Found = UtilityRoutines::FindItemInList(Name, op->EnergyMeters); + Found = Util::FindItemInList(Name, op->EnergyMeters); } else { Found = 0; } @@ -1603,27 +1599,27 @@ namespace OutputProcessor { op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters = 0; op->VarMeterArrays(op->NumVarMeterArrays).RepVariable = RepVarNum; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters = 0; - int Found = UtilityRoutines::FindItem(ResourceType + ":Facility", op->EnergyMeters); + int Found = Util::FindItem(ResourceType + ":Facility", op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; } if (!Group.empty()) { - Found = UtilityRoutines::FindItem(ResourceType + ':' + Group, op->EnergyMeters); + Found = Util::FindItem(ResourceType + ':' + Group, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; } - if (UtilityRoutines::SameString(Group, "Building")) { // Match to Zone and Space Type + if (Util::SameString(Group, "Building")) { // Match to Zone and Space Type if (!ZoneName.empty()) { - Found = UtilityRoutines::FindItem(ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); + Found = Util::FindItem(ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; } } if (!SpaceType.empty()) { - Found = UtilityRoutines::FindItem(ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); + Found = Util::FindItem(ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; @@ -1634,21 +1630,21 @@ namespace OutputProcessor { //!! Following if EndUse is by ResourceType if (!EndUse.empty()) { - Found = UtilityRoutines::FindItem(EndUse + ':' + ResourceType, op->EnergyMeters); + Found = Util::FindItem(EndUse + ':' + ResourceType, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; } - if (UtilityRoutines::SameString(Group, "Building")) { // Match to Zone + if (Util::SameString(Group, "Building")) { // Match to Zone if (!ZoneName.empty()) { - Found = UtilityRoutines::FindItem(EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); + Found = Util::FindItem(EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; } } if (!SpaceType.empty()) { - Found = UtilityRoutines::FindItem(EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); + Found = Util::FindItem(EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; @@ -1660,24 +1656,23 @@ namespace OutputProcessor { // End use subcategory if (!EndUseSub.empty()) { - Found = UtilityRoutines::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType, op->EnergyMeters); + Found = Util::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; addEndUseSubcategory(state, EndUse, EndUseSub); } - if (UtilityRoutines::SameString(Group, "Building")) { // Match to Zone + if (Util::SameString(Group, "Building")) { // Match to Zone if (!ZoneName.empty()) { - Found = UtilityRoutines::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); + Found = Util::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; } } if (!SpaceType.empty()) { - Found = - UtilityRoutines::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); + Found = Util::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); if (Found != 0) { ++op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters; op->VarMeterArrays(op->NumVarMeterArrays).OnMeters(op->VarMeterArrays(op->NumVarMeterArrays).NumOnMeters) = Found; @@ -1753,11 +1748,11 @@ namespace OutputProcessor { auto &op = state.dataOutputProcessor; // Basic ResourceType Meters - GetStandardMeterResourceType(state, ResourceType, UtilityRoutines::makeUPPER(ResourceType), LocalErrorsFound); + GetStandardMeterResourceType(state, ResourceType, Util::makeUPPER(ResourceType), LocalErrorsFound); if (!LocalErrorsFound) { if (op->NumEnergyMeters > 0) { - Found = UtilityRoutines::FindItem(ResourceType + ":Facility", op->EnergyMeters); + Found = Util::FindItem(ResourceType + ":Facility", op->EnergyMeters); } else { Found = 0; } @@ -1786,17 +1781,17 @@ namespace OutputProcessor { } if (!LocalErrorsFound && !Group.empty()) { - Found = UtilityRoutines::FindItem(ResourceType + ':' + Group, op->EnergyMeters); + Found = Util::FindItem(ResourceType + ':' + Group, op->EnergyMeters); if (Found == 0) AddMeter(state, ResourceType + ':' + Group, MtrUnits, ResourceType, "", "", Group); if (Group == "Building") { if (!ZoneName.empty()) { - Found = UtilityRoutines::FindItem(ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); + Found = Util::FindItem(ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); if (Found == 0) { AddMeter(state, ResourceType + ":Zone:" + ZoneName, MtrUnits, ResourceType, "", "", "Zone"); } } if (!SpaceType.empty()) { - Found = UtilityRoutines::FindItem(ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); + Found = Util::FindItem(ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); if (Found == 0) { AddMeter(state, ResourceType + ":SpaceType:" + SpaceType, MtrUnits, ResourceType, "", "", "SpaceType"); } @@ -1981,18 +1976,18 @@ namespace OutputProcessor { //!! Following if we do EndUse by ResourceType if (!LocalErrorsFound && !EndUse.empty()) { - Found = UtilityRoutines::FindItem(EndUse + ':' + ResourceType, op->EnergyMeters); + Found = Util::FindItem(EndUse + ':' + ResourceType, op->EnergyMeters); if (Found == 0) AddMeter(state, EndUse + ':' + ResourceType, MtrUnits, ResourceType, EndUse, "", ""); if (Group == "Building") { // Match to Zone and Space if (!ZoneName.empty()) { - Found = UtilityRoutines::FindItem(EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); + Found = Util::FindItem(EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); if (Found == 0) { AddMeter(state, EndUse + ':' + ResourceType + ":Zone:" + ZoneName, MtrUnits, ResourceType, EndUse, "", "Zone"); } } if (!SpaceType.empty()) { - Found = UtilityRoutines::FindItem(EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); + Found = Util::FindItem(EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); if (Found == 0) { AddMeter(state, EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, MtrUnits, ResourceType, EndUse, "", "SpaceType"); } @@ -2005,12 +2000,12 @@ namespace OutputProcessor { // End-Use Subcategories if (!LocalErrorsFound && !EndUseSub.empty()) { MeterName = EndUseSub + ':' + EndUse + ':' + ResourceType; - Found = UtilityRoutines::FindItem(MeterName, op->EnergyMeters); + Found = Util::FindItem(MeterName, op->EnergyMeters); if (Found == 0) AddMeter(state, MeterName, MtrUnits, ResourceType, EndUse, EndUseSub, ""); if (Group == "Building") { // Match to Zone and Space if (!ZoneName.empty()) { - Found = UtilityRoutines::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); + Found = Util::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":Zone:" + ZoneName, op->EnergyMeters); if (Found == 0) { AddMeter(state, EndUseSub + ':' + EndUse + ':' + ResourceType + ":Zone:" + ZoneName, @@ -2022,7 +2017,7 @@ namespace OutputProcessor { } } if (!SpaceType.empty()) { - Found = UtilityRoutines::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); + Found = Util::FindItem(EndUseSub + ':' + EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, op->EnergyMeters); if (Found == 0) { AddMeter(state, EndUseSub + ':' + EndUse + ':' + ResourceType + ":SpaceType:" + SpaceType, @@ -2068,7 +2063,7 @@ namespace OutputProcessor { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: ErrorsFound = false; - std::string UC_ResourceType = UtilityRoutines::makeUPPER(ResourceType); + std::string UC_ResourceType = Util::makeUPPER(ResourceType); CodeForIPUnits = RT_IPUnits::OtherJ; if (has(UC_ResourceType, "ELEC")) { @@ -3027,10 +3022,10 @@ namespace OutputProcessor { bool Found = false; for (size_t EndUseNum = 1; EndUseNum <= static_cast(Constant::EndUse::Num); ++EndUseNum) { - if (UtilityRoutines::SameString(op->EndUseCategory(EndUseNum).Name, EndUseName)) { + if (Util::SameString(op->EndUseCategory(EndUseNum).Name, EndUseName)) { for (EndUseSubNum = 1; EndUseSubNum <= op->EndUseCategory(EndUseNum).NumSubcategories; ++EndUseSubNum) { - if (UtilityRoutines::SameString(op->EndUseCategory(EndUseNum).SubcategoryName(EndUseSubNum), EndUseSubName)) { + if (Util::SameString(op->EndUseCategory(EndUseNum).SubcategoryName(EndUseSubNum), EndUseSubName)) { // Subcategory already exists, no further action required Found = true; break; @@ -3066,10 +3061,10 @@ namespace OutputProcessor { bool Found = false; for (size_t EndUseNum = 1; EndUseNum <= static_cast(Constant::EndUse::Num); ++EndUseNum) { - if (UtilityRoutines::SameString(op->EndUseCategory(EndUseNum).Name, EndUseName)) { + if (Util::SameString(op->EndUseCategory(EndUseNum).Name, EndUseName)) { for (int endUseSpTypeNum = 1; endUseSpTypeNum <= op->EndUseCategory(EndUseNum).numSpaceTypes; ++endUseSpTypeNum) { - if (UtilityRoutines::SameString(op->EndUseCategory(EndUseNum).spaceTypeName(endUseSpTypeNum), EndUseSpaceTypeName)) { + if (Util::SameString(op->EndUseCategory(EndUseNum).spaceTypeName(endUseSpTypeNum), EndUseSpaceTypeName)) { // Space type already exists, no further action required Found = true; break; @@ -4174,7 +4169,7 @@ namespace OutputProcessor { OutputProcessor::Unit unitStringToEnum(std::string const &unitIn) { // J.Glazer - August/September 2017 - std::string unitUpper = UtilityRoutines::makeUPPER(unitIn); + std::string unitUpper = Util::makeUPPER(unitIn); if (unitUpper == "J") { return OutputProcessor::Unit::J; } else if (unitUpper == "DELTAC") { @@ -4378,7 +4373,7 @@ void SetupOutputVariable(EnergyPlusData &state, } else { EndUseSub = ""; if (!EndUseKey.empty()) { - if (std::find(endUseCategoryNames.begin(), endUseCategoryNames.end(), UtilityRoutines::makeUPPER(std::string{EndUseKey})) != + if (std::find(endUseCategoryNames.begin(), endUseCategoryNames.end(), Util::makeUPPER(std::string{EndUseKey})) != endUseCategoryNames.end()) { EndUseSub = "General"; } @@ -4428,9 +4423,9 @@ void SetupOutputVariable(EnergyPlusData &state, thisRvar.storeType = VariableType; thisRvar.VarName = fmt::format("{}:{}", KeyedValue, VarName); thisRvar.VarNameOnly = VarName; - thisRvar.VarNameOnlyUC = UtilityRoutines::makeUPPER(VarName); - thisRvar.VarNameUC = UtilityRoutines::makeUPPER(thisRvar.VarName); - thisRvar.KeyNameOnlyUC = UtilityRoutines::makeUPPER(KeyedValue); + thisRvar.VarNameOnlyUC = Util::makeUPPER(VarName); + thisRvar.VarNameUC = Util::makeUPPER(thisRvar.VarName); + thisRvar.KeyNameOnlyUC = Util::makeUPPER(KeyedValue); thisRvar.units = VariableUnit; if (VariableUnit == OutputProcessor::Unit::customEMS) { thisRvar.unitNameCustomEMS = customUnitName; @@ -4607,9 +4602,9 @@ void SetupOutputVariable(EnergyPlusData &state, thisIVar.storeType = VariableType; thisIVar.VarName = fmt::format("{}:{}", KeyedValue, VarName); thisIVar.VarNameOnly = VarName; - thisIVar.VarNameOnlyUC = UtilityRoutines::makeUPPER(VarName); - thisIVar.VarNameUC = UtilityRoutines::makeUPPER(thisIVar.VarName); - thisIVar.KeyNameOnlyUC = UtilityRoutines::makeUPPER(KeyedValue); + thisIVar.VarNameOnlyUC = Util::makeUPPER(VarName); + thisIVar.VarNameUC = Util::makeUPPER(thisIVar.VarName); + thisIVar.KeyNameOnlyUC = Util::makeUPPER(KeyedValue); thisIVar.units = VariableUnit; AssignReportNumber(state, op->CurrentReportNumber); std::string const IDOut = fmt::to_string(op->CurrentReportNumber); @@ -5588,7 +5583,7 @@ void UpdateMeterReporting(EnergyPlusData &state) std::string::size_type wildCardPosition = index(name, '*'); if (wildCardPosition == std::string::npos) { - int meterIndex = UtilityRoutines::FindItem(name, op->EnergyMeters); + int meterIndex = Util::FindItem(name, op->EnergyMeters); if (meterIndex > 0) { ReportingFrequency ReportFreq = determineFrequency(state, freqString); SetInitialMeterReportingAndOutputNames(state, meterIndex, MeterFileOnlyIndicator, ReportFreq, CumulativeIndicator); @@ -5597,7 +5592,7 @@ void UpdateMeterReporting(EnergyPlusData &state) } else { // Wildcard input ReportingFrequency ReportFreq = determineFrequency(state, freqString); for (int meterIndex = 1; meterIndex <= op->NumEnergyMeters; ++meterIndex) { - if (UtilityRoutines::SameString(op->EnergyMeters(meterIndex).Name.substr(0, wildCardPosition), name.substr(0, wildCardPosition))) { + if (Util::SameString(op->EnergyMeters(meterIndex).Name.substr(0, wildCardPosition), name.substr(0, wildCardPosition))) { SetInitialMeterReportingAndOutputNames(state, meterIndex, MeterFileOnlyIndicator, ReportFreq, CumulativeIndicator); result = true; } @@ -6142,15 +6137,14 @@ int GetMeterIndex(EnergyPlusData &state, std::string const &MeterName) state.dataOutputProcessor->NumValidMeters = op->NumEnergyMeters; state.dataOutputProcessor->ValidMeterNames.allocate(state.dataOutputProcessor->NumValidMeters); for (Found = 1; Found <= state.dataOutputProcessor->NumValidMeters; ++Found) { - state.dataOutputProcessor->ValidMeterNames(Found) = UtilityRoutines::makeUPPER(op->EnergyMeters(Found).Name); + state.dataOutputProcessor->ValidMeterNames(Found) = Util::makeUPPER(op->EnergyMeters(Found).Name); } state.dataOutputProcessor->iValidMeterNames.allocate(state.dataOutputProcessor->NumValidMeters); SetupAndSort(state.dataOutputProcessor->ValidMeterNames, state.dataOutputProcessor->iValidMeterNames); op->GetMeterIndexFirstCall = false; } - MeterIndex = - UtilityRoutines::FindItemInSortedList(MeterName, state.dataOutputProcessor->ValidMeterNames, state.dataOutputProcessor->NumValidMeters); + MeterIndex = Util::FindItemInSortedList(MeterName, state.dataOutputProcessor->ValidMeterNames, state.dataOutputProcessor->NumValidMeters); if (MeterIndex != 0) MeterIndex = state.dataOutputProcessor->iValidMeterNames(MeterIndex); return MeterIndex; @@ -6692,15 +6686,14 @@ void GetMeteredVariables(EnergyPlusData &state, TimeStepTypes(NumVariables) = op->RVariableTypes(Loop).timeStepType; unitsForVar(NumVariables) = op->RVariableTypes(Loop).units; - ResourceTypes(NumVariables) = static_cast( - getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).ResourceType))); - + ResourceTypes(NumVariables) = + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER(op->EnergyMeters(MeterPtr).ResourceType))); Names(NumVariables) = op->RVariableTypes(Loop).VarNameUC; for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).EndUse.empty()) { - EndUses(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).EndUse); + EndUses(NumVariables) = Util::makeUPPER(op->EnergyMeters(MeterPtr).EndUse); break; } } @@ -6708,7 +6701,7 @@ void GetMeteredVariables(EnergyPlusData &state, for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).Group.empty()) { - Groups(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).Group); + Groups(NumVariables) = Util::makeUPPER(op->EnergyMeters(MeterPtr).Group); break; } } @@ -6775,14 +6768,14 @@ void GetMeteredVariables(EnergyPlusData &state, TimeStepTypes(NumVariables) = op->RVariableTypes(Loop).timeStepType; unitsForVar(NumVariables) = op->RVariableTypes(Loop).units; - ResourceTypes(NumVariables) = static_cast( - getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).ResourceType))); + ResourceTypes(NumVariables) = + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER(op->EnergyMeters(MeterPtr).ResourceType))); Names(NumVariables) = op->RVariableTypes(Loop).VarNameUC; for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).EndUse.empty()) { - EndUses(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).EndUse); + EndUses(NumVariables) = Util::makeUPPER(op->EnergyMeters(MeterPtr).EndUse); break; } } @@ -6790,7 +6783,7 @@ void GetMeteredVariables(EnergyPlusData &state, for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).Group.empty()) { - Groups(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).Group); + Groups(NumVariables) = Util::makeUPPER(op->EnergyMeters(MeterPtr).Group); break; } } @@ -6875,7 +6868,7 @@ void GetVariableKeyCountandType(EnergyPlusData &state, op->numVarNames = op->NumVariablesForOutput; op->varNames.allocate(op->numVarNames); for (Loop = 1; Loop <= op->NumVariablesForOutput; ++Loop) { - op->varNames(Loop) = UtilityRoutines::makeUPPER(op->DDVariableTypes(Loop).VarNameOnly); + op->varNames(Loop) = Util::makeUPPER(op->DDVariableTypes(Loop).VarNameOnly); } op->ivarNames.allocate(op->numVarNames); SetupAndSort(op->varNames, op->ivarNames); @@ -6886,7 +6879,7 @@ void GetVariableKeyCountandType(EnergyPlusData &state, op->numVarNames = op->NumVariablesForOutput; op->varNames.allocate(op->numVarNames); for (Loop = 1; Loop <= op->NumVariablesForOutput; ++Loop) { - op->varNames(Loop) = UtilityRoutines::makeUPPER(op->DDVariableTypes(Loop).VarNameOnly); + op->varNames(Loop) = Util::makeUPPER(op->DDVariableTypes(Loop).VarNameOnly); } op->ivarNames.allocate(op->numVarNames); SetupAndSort(op->varNames, op->ivarNames); @@ -6903,7 +6896,7 @@ void GetVariableKeyCountandType(EnergyPlusData &state, varNameUpper = varName; // Search Variable List First - VFound = UtilityRoutines::FindItemInSortedList(varNameUpper, op->varNames, op->numVarNames); + VFound = Util::FindItemInSortedList(varNameUpper, op->varNames, op->numVarNames); if (VFound != 0) { varType = op->DDVariableTypes(op->ivarNames(VFound)).variableType; } @@ -7045,7 +7038,7 @@ void GetVariableKeys(EnergyPlusData &state, Duplicate = false; maxKeyNames = size(keyNames); maxkeyVarIndexes = size(keyVarIndexes); - varNameUpper = UtilityRoutines::makeUPPER(varName); + varNameUpper = Util::makeUPPER(varName); auto &op = state.dataOutputProcessor; // Select based on variable type: integer, real, or meter @@ -7155,13 +7148,13 @@ bool ReportingThisVariable(EnergyPlusData &state, std::string const &RepVarName) auto &op = state.dataOutputProcessor; BeingReported = false; - Found = UtilityRoutines::FindItem(RepVarName, op->ReqRepVars, &ReqReportVariables::VarName); + Found = Util::FindItem(RepVarName, op->ReqRepVars, &ReqReportVariables::VarName); if (Found > 0) { BeingReported = true; } if (!BeingReported) { // check meter names too - Found = UtilityRoutines::FindItem(RepVarName, op->EnergyMeters); + Found = Util::FindItem(RepVarName, op->EnergyMeters); if (Found > 0) { if (op->EnergyMeters(Found).RptTS || op->EnergyMeters(Found).RptHR || op->EnergyMeters(Found).RptDY || op->EnergyMeters(Found).RptMN || op->EnergyMeters(Found).RptSM || op->EnergyMeters(Found).RptTSFO || op->EnergyMeters(Found).RptHRFO || @@ -7277,7 +7270,7 @@ void InitPollutionMeterReporting(EnergyPlusData &state, std::string const &Repor for (Loop = 1; Loop <= NumReqMeters; ++Loop) { - Meter = UtilityRoutines::FindItem(PollutionMeters(Loop), op->EnergyMeters); + Meter = Util::FindItem(PollutionMeters(Loop), op->EnergyMeters); if (Meter > 0) { // All the active meters for this run are set, but all are still searched for. indexGroupKey = DetermineIndexGroupKeyFromMeterName(state, op->EnergyMeters(Meter).Name); @@ -7455,7 +7448,7 @@ void ProduceRDDMDD(EnergyPlusData &state) op->ProduceReportVDD = ReportVDD::IDF; } if (!VarOption2.empty()) { - if (UtilityRoutines::SameString(VarOption2, "Name") || UtilityRoutines::SameString(VarOption2, "AscendingName")) { + if (Util::SameString(VarOption2, "Name") || Util::SameString(VarOption2, "AscendingName")) { SortByName = true; } } @@ -7654,7 +7647,7 @@ void AddToOutputVariableList(EnergyPlusData &state, int dup = 0; // for duplicate variable name if (op->NumVariablesForOutput > 0) { - dup = UtilityRoutines::FindItemInList(VarName, op->DDVariableTypes, &VariableTypeForDDOutput::VarNameOnly, op->NumVariablesForOutput); + dup = Util::FindItemInList(VarName, op->DDVariableTypes, &VariableTypeForDDOutput::VarNameOnly, op->NumVariablesForOutput); } else { op->DDVariableTypes.allocate(LVarAllocInc); op->MaxVariablesForOutput = LVarAllocInc; diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index ddc0a738496..f5606a621e0 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -357,7 +357,7 @@ void GetInputTabularMonthly(EnergyPlusData &state) state.dataInputProcessing->inputProcessor->getObjectItem(state, CurrentModuleObject, TabNum, AlphArray, NumAlphas, NumArray, NumNums, IOStat); if (TabNum - 1 > 0) { - UtilityRoutines::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); } if (NumAlphas < 2) { ShowSevereError(state, format("{}: No fields specified.", CurrentModuleObject)); @@ -371,31 +371,31 @@ void GetInputTabularMonthly(EnergyPlusData &state) std::string const curAggString = AlphArray(jField + 1); AggType curAggType; // kind of aggregation identified (see AggType parameters) // set accumulator values to default as appropriate for aggregation type - if (UtilityRoutines::SameString(curAggString, "SumOrAverage")) { + if (Util::SameString(curAggString, "SumOrAverage")) { curAggType = AggType::SumOrAvg; - } else if (UtilityRoutines::SameString(curAggString, "Maximum")) { + } else if (Util::SameString(curAggString, "Maximum")) { curAggType = AggType::Maximum; - } else if (UtilityRoutines::SameString(curAggString, "Minimum")) { + } else if (Util::SameString(curAggString, "Minimum")) { curAggType = AggType::Minimum; - } else if (UtilityRoutines::SameString(curAggString, "ValueWhenMaximumOrMinimum")) { + } else if (Util::SameString(curAggString, "ValueWhenMaximumOrMinimum")) { curAggType = AggType::ValueWhenMaxMin; - } else if (UtilityRoutines::SameString(curAggString, "HoursZero")) { + } else if (Util::SameString(curAggString, "HoursZero")) { curAggType = AggType::HoursZero; - } else if (UtilityRoutines::SameString(curAggString, "HoursNonzero")) { + } else if (Util::SameString(curAggString, "HoursNonzero")) { curAggType = AggType::HoursNonZero; - } else if (UtilityRoutines::SameString(curAggString, "HoursPositive")) { + } else if (Util::SameString(curAggString, "HoursPositive")) { curAggType = AggType::HoursPositive; - } else if (UtilityRoutines::SameString(curAggString, "HoursNonpositive")) { + } else if (Util::SameString(curAggString, "HoursNonpositive")) { curAggType = AggType::HoursNonPositive; - } else if (UtilityRoutines::SameString(curAggString, "HoursNegative")) { + } else if (Util::SameString(curAggString, "HoursNegative")) { curAggType = AggType::HoursNegative; - } else if (UtilityRoutines::SameString(curAggString, "HoursNonnegative")) { + } else if (Util::SameString(curAggString, "HoursNonnegative")) { curAggType = AggType::HoursNonNegative; - } else if (UtilityRoutines::SameString(curAggString, "SumOrAverageDuringHoursShown")) { + } else if (Util::SameString(curAggString, "SumOrAverageDuringHoursShown")) { curAggType = AggType::SumOrAverageHoursShown; - } else if (UtilityRoutines::SameString(curAggString, "MaximumDuringHoursShown")) { + } else if (Util::SameString(curAggString, "MaximumDuringHoursShown")) { curAggType = AggType::MaximumDuringHoursShown; - } else if (UtilityRoutines::SameString(curAggString, "MinimumDuringHoursShown")) { + } else if (Util::SameString(curAggString, "MinimumDuringHoursShown")) { curAggType = AggType::MinimumDuringHoursShown; } else { curAggType = AggType::SumOrAvg; @@ -614,7 +614,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // #ifdef ITM_KEYCACHE // Noel comment: First time in this TabNum/ColNum loop, let's save the results // of GetVariableKeyCountandType & GetVariableKeys. - std::string const curVariMeter = UtilityRoutines::makeUPPER(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); + std::string const curVariMeter = Util::makeUPPER(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); // call the key count function but only need count during this pass int KeyCount = 0; GetVariableKeyCountandType(state, curVariMeter, KeyCount, TypeVar, AvgSumVar, StepTypeVar, UnitsVar); @@ -652,7 +652,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) = IndexesForKeyVar(iKey) !noel // ENDDO // #else - // curVariMeter = UtilityRoutines::makeUPPER(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) + // curVariMeter = Util::makeUPPER(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) // ! call the key count function but only need count during this pass // CALL GetVariableKeyCountandType(state, curVariMeter,KeyCount,TypeVar,AvgSumVar,StepTypeVar,UnitsVar) // ALLOCATE(NamesOfKeys(KeyCount)) @@ -663,12 +663,12 @@ void InitializeTabularMonthly(EnergyPlusData &state) for (int iKey = 1; iKey <= KeyCount; ++iKey) { found = 0; // set a flag if environment variables are found - if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { + if (Util::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { environmentKeyFound = true; found = -1; // so not counted in list of unique keys } for (int jUnique = 1; jUnique <= UniqueKeyCount; ++jUnique) { - if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { + if (Util::SameString(UniqueKeyNames(jUnique), ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { found = jUnique; break; } @@ -761,12 +761,12 @@ void InitializeTabularMonthly(EnergyPlusData &state) for (int iKey = 1; iKey <= KeyCount; ++iKey) { found = 0; // set a flag if environment variables are found - if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { + if (Util::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), "ENVIRONMENT")) { environmentKeyFound = true; found = -1; // so not counted in list of unique keys } for (int jUnique = 1; jUnique <= UniqueKeyCount; ++jUnique) { - if (UtilityRoutines::SameString(UniqueKeyNames(jUnique), ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { + if (Util::SameString(UniqueKeyNames(jUnique), ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey))) { found = jUnique; break; } @@ -827,7 +827,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // IndexesForKeyVar(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) !noel // ENDDO // #else - // curVariMeter = UtilityRoutines::makeUPPER(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) + // curVariMeter = Util::makeUPPER(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) // ! call the key count function but only need count during this pass // CALL GetVariableKeyCountandType(state, curVariMeter,KeyCount,TypeVar,AvgSumVar,StepTypeVar,UnitsVar) // ALLOCATE(NamesOfKeys(KeyCount)) @@ -836,7 +836,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // #endif if (KeyCount == 1) { // first test if KeyCount is one to avoid referencing a zero element array - if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(1), "ENVIRONMENT")) { + if (Util::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(1), "ENVIRONMENT")) { environmentKeyFound = true; } } @@ -847,8 +847,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // search through the keys for the currently active key "UniqueKeyNames(kUniqueKey)" found = 0; for (int iKey = 1; iKey <= KeyCount; ++iKey) { - if (UtilityRoutines::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), - UniqueKeyNames(kUniqueKey))) { + if (Util::SameString(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).NamesOfKeys(iKey), UniqueKeyNames(kUniqueKey))) { found = iKey; break; } @@ -1104,8 +1103,8 @@ void GetInputTabularTimeBins(EnergyPlusData &state) } // validate the kind of variable - not used internally except for validation if (len(AlphArray(4)) > 0) { - if (!(UtilityRoutines::SameString(AlphArray(4), "ENERGY") || UtilityRoutines::SameString(AlphArray(4), "DEMAND") || - UtilityRoutines::SameString(AlphArray(4), "TEMPERATURE") || UtilityRoutines::SameString(AlphArray(4), "FLOWRATE"))) { + if (!(Util::SameString(AlphArray(4), "ENERGY") || Util::SameString(AlphArray(4), "DEMAND") || + Util::SameString(AlphArray(4), "TEMPERATURE") || Util::SameString(AlphArray(4), "FLOWRATE"))) { ShowWarningError( state, format("In {} named {} the Variable Type was not energy, demand, temperature, or flowrate.", CurrentModuleObject, AlphArray(1))); @@ -1177,7 +1176,7 @@ void GetInputTabularTimeBins(EnergyPlusData &state) // scan through the keys and look for the user specified key int found = 0; for (int iTable = 1; iTable <= ort->OutputTableBinned(iInObj).numTables; ++iTable) { - if (UtilityRoutines::SameString(objNames(iTable), ort->OutputTableBinned(iInObj).keyValue)) { + if (Util::SameString(objNames(iTable), ort->OutputTableBinned(iInObj).keyValue)) { found = iTable; break; } @@ -1300,51 +1299,51 @@ void GetInputTabularStyle(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); // ColumnSeparator - if (UtilityRoutines::SameString(AlphArray(1), "Comma")) { + if (Util::SameString(AlphArray(1), "Comma")) { ort->numStyles = 1; ort->TableStyle(1) = TableStyle::Comma; ort->del(1) = CharComma; // comma - } else if (UtilityRoutines::SameString(AlphArray(1), "Tab")) { + } else if (Util::SameString(AlphArray(1), "Tab")) { ort->numStyles = 1; ort->TableStyle(1) = TableStyle::Tab; ort->del(1) = CharTab; // tab - } else if (UtilityRoutines::SameString(AlphArray(1), "Fixed")) { + } else if (Util::SameString(AlphArray(1), "Fixed")) { ort->numStyles = 1; ort->TableStyle(1) = TableStyle::Fixed; ort->del(1) = CharSpace; // space - } else if (UtilityRoutines::SameString(AlphArray(1), "HTML")) { + } else if (Util::SameString(AlphArray(1), "HTML")) { ort->numStyles = 1; ort->TableStyle(1) = TableStyle::HTML; ort->del(1) = CharSpace; // space - this is not used much for HTML output - } else if (UtilityRoutines::SameString(AlphArray(1), "XML")) { + } else if (Util::SameString(AlphArray(1), "XML")) { ort->numStyles = 1; ort->TableStyle(1) = TableStyle::XML; ort->del(1) = CharSpace; // space - this is not used much for XML output - } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndHTML")) { + } else if (Util::SameString(AlphArray(1), "CommaAndHTML")) { ort->numStyles = 2; ort->TableStyle(1) = TableStyle::Comma; ort->del(1) = CharComma; // comma ort->TableStyle(2) = TableStyle::HTML; ort->del(2) = CharSpace; // space - this is not used much for HTML output - } else if (UtilityRoutines::SameString(AlphArray(1), "CommaAndXML")) { + } else if (Util::SameString(AlphArray(1), "CommaAndXML")) { ort->numStyles = 2; ort->TableStyle(1) = TableStyle::Comma; ort->del(1) = CharComma; // comma ort->TableStyle(2) = TableStyle::XML; ort->del(2) = CharSpace; // space - this is not used much for XML output - } else if (UtilityRoutines::SameString(AlphArray(1), "TabAndHTML")) { + } else if (Util::SameString(AlphArray(1), "TabAndHTML")) { ort->numStyles = 2; ort->TableStyle(1) = TableStyle::Tab; ort->del(1) = CharTab; // tab ort->TableStyle(2) = TableStyle::HTML; ort->del(2) = CharSpace; // space - this is not used much for HTML output - } else if (UtilityRoutines::SameString(AlphArray(1), "XMLandHTML")) { + } else if (Util::SameString(AlphArray(1), "XMLandHTML")) { ort->numStyles = 2; ort->TableStyle(1) = TableStyle::XML; ort->del(1) = CharSpace; // space - this is not used much for XML output ort->TableStyle(2) = TableStyle::HTML; ort->del(2) = CharSpace; // space - this is not used much for HTML output - } else if (UtilityRoutines::SameString(AlphArray(1), "All")) { + } else if (Util::SameString(AlphArray(1), "All")) { ort->numStyles = 5; ort->TableStyle(1) = TableStyle::Comma; ort->del(1) = CharComma; // comma @@ -1402,15 +1401,15 @@ void GetInputTabularStyle(EnergyPlusData &state) UnitsStyle SetUnitsStyleFromString(std::string const &unitStringIn) { UnitsStyle unitsStyleReturn; - if (UtilityRoutines::SameString(unitStringIn, "None")) { + if (Util::SameString(unitStringIn, "None")) { unitsStyleReturn = UnitsStyle::None; - } else if (UtilityRoutines::SameString(unitStringIn, "JTOKWH")) { + } else if (Util::SameString(unitStringIn, "JTOKWH")) { unitsStyleReturn = UnitsStyle::JtoKWH; - } else if (UtilityRoutines::SameString(unitStringIn, "JTOMJ")) { + } else if (Util::SameString(unitStringIn, "JTOMJ")) { unitsStyleReturn = UnitsStyle::JtoMJ; - } else if (UtilityRoutines::SameString(unitStringIn, "JTOGJ")) { + } else if (Util::SameString(unitStringIn, "JTOGJ")) { unitsStyleReturn = UnitsStyle::JtoGJ; - } else if (UtilityRoutines::SameString(unitStringIn, "INCHPOUND")) { + } else if (Util::SameString(unitStringIn, "INCHPOUND")) { unitsStyleReturn = UnitsStyle::InchPound; } else { unitsStyleReturn = UnitsStyle::NotFound; @@ -1485,93 +1484,93 @@ void GetInputOutputTableSummaryReports(EnergyPlusData &state) bool nameFound = false; if (AlphArray(iReport).empty()) { ShowFatalError(state, "Blank report name in Output:Table:SummaryReports"); - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AnnualBuildingUtilityPerformanceSummary")) { + } else if (Util::SameString(AlphArray(iReport), "AnnualBuildingUtilityPerformanceSummary")) { ort->displayTabularBEPS = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentCostEconomicsSummary")) { + } else if (Util::SameString(AlphArray(iReport), "ComponentCostEconomicsSummary")) { ort->displayTabularCompCosts = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "InputVerificationandResultsSummary")) { + } else if (Util::SameString(AlphArray(iReport), "InputVerificationandResultsSummary")) { ort->displayTabularVeriSum = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "ComponentSizingSummary")) { + } else if (Util::SameString(AlphArray(iReport), "ComponentSizingSummary")) { ort->displayComponentSizing = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "SurfaceShadowingSummary")) { + } else if (Util::SameString(AlphArray(iReport), "SurfaceShadowingSummary")) { ort->displaySurfaceShadowing = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "DemandEndUseComponentsSummary")) { + } else if (Util::SameString(AlphArray(iReport), "DemandEndUseComponentsSummary")) { ort->displayDemandEndUse = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AdaptiveComfortSummary")) { + } else if (Util::SameString(AlphArray(iReport), "AdaptiveComfortSummary")) { ort->displayAdaptiveComfort = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "SourceEnergyEndUseComponentsSummary")) { + } else if (Util::SameString(AlphArray(iReport), "SourceEnergyEndUseComponentsSummary")) { ort->displaySourceEnergyEndUseSummary = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "ZoneComponentLoadSummary")) { + } else if (Util::SameString(AlphArray(iReport), "ZoneComponentLoadSummary")) { ort->displayZoneComponentLoadSummary = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AirLoopComponentLoadSummary")) { + } else if (Util::SameString(AlphArray(iReport), "AirLoopComponentLoadSummary")) { ort->displayAirLoopComponentLoadSummary = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "FacilityComponentLoadSummary")) { + } else if (Util::SameString(AlphArray(iReport), "FacilityComponentLoadSummary")) { ort->displayFacilityComponentLoadSummary = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "LEEDSummary")) { + } else if (Util::SameString(AlphArray(iReport), "LEEDSummary")) { ort->displayLEEDSummary = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "LifeCycleCostReport")) { + } else if (Util::SameString(AlphArray(iReport), "LifeCycleCostReport")) { ort->displayLifeCycleCostReport = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "TariffReport")) { + } else if (Util::SameString(AlphArray(iReport), "TariffReport")) { ort->displayTariffReport = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "EconomicResultSummary")) { + } else if (Util::SameString(AlphArray(iReport), "EconomicResultSummary")) { ort->displayEconomicResultSummary = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "HeatEmissionsSummary")) { + } else if (Util::SameString(AlphArray(iReport), "HeatEmissionsSummary")) { ort->displayHeatEmissionsSummary = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "ThermalResilienceSummary")) { + } else if (Util::SameString(AlphArray(iReport), "ThermalResilienceSummary")) { ort->displayThermalResilienceSummary = true; ort->displayThermalResilienceSummaryExplicitly = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "CO2ResilienceSummary")) { + } else if (Util::SameString(AlphArray(iReport), "CO2ResilienceSummary")) { ort->displayCO2ResilienceSummary = true; ort->displayCO2ResilienceSummaryExplicitly = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "VisualResilienceSummary")) { + } else if (Util::SameString(AlphArray(iReport), "VisualResilienceSummary")) { ort->displayVisualResilienceSummary = true; ort->displayVisualResilienceSummaryExplicitly = true; ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "EnergyMeters")) { + } else if (Util::SameString(AlphArray(iReport), "EnergyMeters")) { ort->WriteTabularFiles = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "InitializationSummary")) { + } else if (Util::SameString(AlphArray(iReport), "InitializationSummary")) { ort->WriteTabularFiles = true; ort->displayEioSummary = true; nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummary")) { + } else if (Util::SameString(AlphArray(iReport), "AllSummary")) { ort->WriteTabularFiles = true; ort->displayTabularBEPS = true; ort->displayTabularVeriSum = true; @@ -1594,7 +1593,7 @@ void GetInputOutputTableSummaryReports(EnergyPlusData &state) for (int jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { state.dataOutRptPredefined->reportName(jReport).show = true; } - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndSizingPeriod")) { + } else if (Util::SameString(AlphArray(iReport), "AllSummaryAndSizingPeriod")) { ort->WriteTabularFiles = true; ort->displayTabularBEPS = true; ort->displayTabularVeriSum = true; @@ -1621,13 +1620,13 @@ void GetInputOutputTableSummaryReports(EnergyPlusData &state) ort->displayZoneComponentLoadSummary = true; ort->displayAirLoopComponentLoadSummary = true; ort->displayFacilityComponentLoadSummary = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllMonthly")) { + } else if (Util::SameString(AlphArray(iReport), "AllMonthly")) { ort->WriteTabularFiles = true; for (int jReport = 1; jReport <= numNamedMonthly; ++jReport) { ort->namedMonthly(jReport).show = true; } nameFound = true; - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndMonthly")) { + } else if (Util::SameString(AlphArray(iReport), "AllSummaryAndMonthly")) { ort->WriteTabularFiles = true; ort->displayTabularBEPS = true; ort->displayTabularVeriSum = true; @@ -1653,7 +1652,7 @@ void GetInputOutputTableSummaryReports(EnergyPlusData &state) for (int jReport = 1; jReport <= numNamedMonthly; ++jReport) { ort->namedMonthly(jReport).show = true; } - } else if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { + } else if (Util::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { ort->WriteTabularFiles = true; ort->displayTabularBEPS = true; ort->displayTabularVeriSum = true; @@ -1686,12 +1685,12 @@ void GetInputOutputTableSummaryReports(EnergyPlusData &state) } // check the reports that are predefined and are created by OutputReportPredefined for (int jReport = 1; jReport <= state.dataOutRptPredefined->numReportName; ++jReport) { - if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).name)) { + if (Util::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).name)) { ort->WriteTabularFiles = true; state.dataOutRptPredefined->reportName(jReport).show = true; nameFound = true; } - if (UtilityRoutines::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).abrev)) { + if (Util::SameString(AlphArray(iReport), state.dataOutRptPredefined->reportName(jReport).abrev)) { ort->WriteTabularFiles = true; state.dataOutRptPredefined->reportName(jReport).show = true; nameFound = true; @@ -1699,14 +1698,14 @@ void GetInputOutputTableSummaryReports(EnergyPlusData &state) } // check if the predefined monthly reports are used for (int jReport = 1; jReport <= numNamedMonthly; ++jReport) { - if (UtilityRoutines::SameString(AlphArray(iReport), ort->namedMonthly(jReport).title)) { + if (Util::SameString(AlphArray(iReport), ort->namedMonthly(jReport).title)) { ort->namedMonthly(jReport).show = true; ort->WriteTabularFiles = true; nameFound = true; } } if (!nameFound) { - if (UtilityRoutines::SameString(AlphArray(iReport), "Standard62.1Summary")) { + if (Util::SameString(AlphArray(iReport), "Standard62.1Summary")) { ShowWarningError(state, format("{} Field[{}]=\"Standard62.1Summary\", Report is not enabled.", CurrentModuleObject, iReport)); ShowContinueError(state, "Do Zone Sizing or Do System Sizing must be enabled in SimulationControl."); @@ -1960,19 +1959,19 @@ bool isCompLoadRepReq(EnergyPlusData &state) state.dataInputProcessing->inputProcessor->getObjectItem(state, CurrentModuleObject, 1, AlphArray, NumAlphas, NumArray, NumNums, IOStat); // loop through the fields looking for matching report titles for (int iReport = 1; iReport <= NumAlphas; ++iReport) { - if (UtilityRoutines::SameString(AlphArray(iReport), "ZoneComponentLoadSummary")) { + if (Util::SameString(AlphArray(iReport), "ZoneComponentLoadSummary")) { isFound = true; } - if (UtilityRoutines::SameString(AlphArray(iReport), "AirLoopComponentLoadSummary")) { + if (Util::SameString(AlphArray(iReport), "AirLoopComponentLoadSummary")) { isFound = true; } - if (UtilityRoutines::SameString(AlphArray(iReport), "FacilityComponentLoadSummary")) { + if (Util::SameString(AlphArray(iReport), "FacilityComponentLoadSummary")) { isFound = true; } - if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryAndSizingPeriod")) { + if (Util::SameString(AlphArray(iReport), "AllSummaryAndSizingPeriod")) { isFound = true; } - if (UtilityRoutines::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { + if (Util::SameString(AlphArray(iReport), "AllSummaryMonthlyAndSizingPeriod")) { isFound = true; } } @@ -2096,7 +2095,7 @@ void InitializePredefinedMonthlyTitles(EnergyPlusData &state) NumMonthlyReports)); } else { for (int xcount = 1; xcount <= numNamedMonthly; ++xcount) { - if (!UtilityRoutines::SameString(MonthlyNamedReports(xcount), ort->namedMonthly(xcount).title)) { + if (!Util::SameString(MonthlyNamedReports(xcount), ort->namedMonthly(xcount).title)) { 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)); @@ -3380,16 +3379,14 @@ void WriteTableOfContents(EnergyPlusData &state) } } - if (state.dataWeatherManager->TotReportPers > 0) { + if (state.dataWeather->TotReportPers > 0) { std::string ReportPeriodSummary = "Reporting Period Summary"; tbl_stream << "
" << "Reporting Period Summary" << "\n"; - AddTOCReportPeriod( - state.dataWeatherManager->TotThermalReportPers, "Thermal", state.dataWeatherManager->ThermalReportPeriodInput, tbl_stream); - AddTOCReportPeriod(state.dataWeatherManager->TotCO2ReportPers, "CO2", state.dataWeatherManager->CO2ReportPeriodInput, tbl_stream); - AddTOCReportPeriod( - state.dataWeatherManager->TotVisualReportPers, "Visual", state.dataWeatherManager->VisualReportPeriodInput, tbl_stream); + AddTOCReportPeriod(state.dataWeather->TotThermalReportPers, "Thermal", state.dataWeather->ThermalReportPeriodInput, tbl_stream); + AddTOCReportPeriod(state.dataWeather->TotCO2ReportPers, "CO2", state.dataWeather->CO2ReportPeriodInput, tbl_stream); + AddTOCReportPeriod(state.dataWeather->TotVisualReportPers, "Visual", state.dataWeather->VisualReportPeriodInput, tbl_stream); } } } @@ -3397,7 +3394,7 @@ void WriteTableOfContents(EnergyPlusData &state) void AddTOCReportPeriod(const int nReportPeriods, const std::string &kw, - const Array1D &ReportPeriodInputData, + const Array1D &ReportPeriodInputData, std::ostream &tbl_stream) { static std::string const Entire_Facility("Entire Facility"); @@ -5255,14 +5252,14 @@ void WriteTabularReports(EnergyPlusData &state) WriteCO2ResilienceTables(state); // code will crash if pure load calc if (ort->displayVisualResilienceSummary && !state.dataGlobal->DoPureLoadCalc) // code will crash if pure load calc WriteVisualResilienceTables(state); // code will crash if pure load calc - if (state.dataWeatherManager->TotReportPers > 0) WriteReportPeriodTimeConsumption(state); - for (int i = 1; i <= state.dataWeatherManager->TotThermalReportPers; i++) { + if (state.dataWeather->TotReportPers > 0) WriteReportPeriodTimeConsumption(state); + for (int i = 1; i <= state.dataWeather->TotThermalReportPers; i++) { WriteThermalResilienceTablesRepPeriod(state, i); } - for (int i = 1; i <= state.dataWeatherManager->TotCO2ReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotCO2ReportPers; i++) { WriteCO2ResilienceTablesRepPeriod(state, i); } - for (int i = 1; i <= state.dataWeatherManager->TotVisualReportPers; i++) { + for (int i = 1; i <= state.dataWeather->TotVisualReportPers; i++) { WriteVisualResilienceTablesRepPeriod(state, i); } @@ -6879,7 +6876,7 @@ void FillRemainingPredefinedEntries(EnergyPlusData &state) for (long iSch = 1; iSch <= state.dataScheduleMgr->NumSchedules; ++iSch) { std::string curSchName = state.dataScheduleMgr->Schedule(iSch).Name; std::string curSchType = ScheduleManager::GetScheduleType(state, iSch); - if (UtilityRoutines::SameString(curSchType, "FRACTION")) { + if (Util::SameString(curSchType, "FRACTION")) { PreDefTableEntry(state, state.dataOutRptPredefined->pdchLeedEflhEflh, curSchName, @@ -7061,7 +7058,7 @@ void WriteMonthlyTables(EnergyPlusData &state) GetUnitConversion(state, indexUnitConv, curConversionFactor, state.dataOutRptTab->curConversionOffset, curUnits); } else { // just do the Joule conversion // if units is in Joules, convert if specified - if (UtilityRoutines::SameString(unitEnumToString(ort->MonthlyColumns(curCol).units), "J")) { + if (Util::SameString(unitEnumToString(ort->MonthlyColumns(curCol).units), "J")) { curUnits = energyUnitsString; curConversionFactor = energyUnitsConversionFactor; state.dataOutRptTab->curConversionOffset = 0.0; @@ -7161,31 +7158,31 @@ void WriteMonthlyTables(EnergyPlusData &state) if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { curUnits += "/s"; } - if (UtilityRoutines::SameString(curUnits, "J/s")) { + if (Util::SameString(curUnits, "J/s")) { curUnits = "W"; } // CR7783 fix - if (UtilityRoutines::SameString(curUnits, "kWh/s")) { + if (Util::SameString(curUnits, "kWh/s")) { curUnits = "W"; curConversionFactor *= 3600000.0; } - if (UtilityRoutines::SameString(curUnits, "GJ/s")) { + if (Util::SameString(curUnits, "GJ/s")) { curUnits = "kW"; curConversionFactor *= 1000000.0; } - if (UtilityRoutines::SameString(curUnits, "MJ/s")) { + if (Util::SameString(curUnits, "MJ/s")) { curUnits = "kW"; curConversionFactor *= 1000.0; } - if (UtilityRoutines::SameString(curUnits, "therm/s")) { + if (Util::SameString(curUnits, "therm/s")) { curUnits = "kBtu/h"; curConversionFactor *= 360000.0; } - if (UtilityRoutines::SameString(curUnits, "kBtu/s")) { + if (Util::SameString(curUnits, "kBtu/s")) { curUnits = "kBtu/h"; curConversionFactor *= 3600.0; } - if (UtilityRoutines::SameString(curUnits, "ton-hrs/s")) { + if (Util::SameString(curUnits, "ton-hrs/s")) { curUnits = "ton"; curConversionFactor *= 3600.0; } @@ -7219,31 +7216,31 @@ void WriteMonthlyTables(EnergyPlusData &state) if (ort->MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable curUnits += "/s"; } - if (UtilityRoutines::SameString(curUnits, "J/s")) { + if (Util::SameString(curUnits, "J/s")) { curUnits = "W"; } // CR7783 fix - if (UtilityRoutines::SameString(curUnits, "kWh/s")) { + if (Util::SameString(curUnits, "kWh/s")) { curUnits = "W"; curConversionFactor *= 3600000.0; } - if (UtilityRoutines::SameString(curUnits, "GJ/s")) { + if (Util::SameString(curUnits, "GJ/s")) { curUnits = "kW"; curConversionFactor *= 1000000.0; } - if (UtilityRoutines::SameString(curUnits, "MJ/s")) { + if (Util::SameString(curUnits, "MJ/s")) { curUnits = "kW"; curConversionFactor *= 1000.0; } - if (UtilityRoutines::SameString(curUnits, "therm/s")) { + if (Util::SameString(curUnits, "therm/s")) { curUnits = "kBtu/h"; curConversionFactor *= 360000.0; } - if (UtilityRoutines::SameString(curUnits, "kBtu/s")) { + if (Util::SameString(curUnits, "kBtu/s")) { curUnits = "kBtu/h"; curConversionFactor *= 3600.0; } - if (UtilityRoutines::SameString(curUnits, "ton-hrs/s")) { + if (Util::SameString(curUnits, "ton-hrs/s")) { curUnits = "ton"; curConversionFactor *= 3600.0; } @@ -7716,30 +7713,30 @@ void WriteBEPSTable(EnergyPlusData &state) if (produceTabular) { if (state.dataGlobal->createPerfLog) { - UtilityRoutines::appendPerfLog(state, "Electricity ABUPS Total [J]", format("{:.3R}", collapsedTotal(1))); - UtilityRoutines::appendPerfLog(state, "Natural Gas ABUPS Total [J]", format("{:.3R}", collapsedTotal(2))); - UtilityRoutines::appendPerfLog(state, "Gasoline ABUPS Total [J]", format("{:.3R}", collapsedTotal(3))); - UtilityRoutines::appendPerfLog(state, "Diesel ABUPS Total [J]", format("{:.3R}", collapsedTotal(4))); - UtilityRoutines::appendPerfLog(state, "Coal ABUPS Total [J]", format("{:.3R}", collapsedTotal(5))); - UtilityRoutines::appendPerfLog(state, "Fuel Oil No 1 ABUPS Total [J]", format("{:.3R}", collapsedTotal(6))); - UtilityRoutines::appendPerfLog(state, "Fuel Oil No 2 ABUPS Total [J]", format("{:.3R}", collapsedTotal(7))); - UtilityRoutines::appendPerfLog(state, "Propane ABUPS Total [J]", format("{:.3R}", collapsedTotal(8))); - UtilityRoutines::appendPerfLog(state, "Other Fuel 1 ABUPS Total [J]", format("{:.3R}", collapsedTotal(9))); - UtilityRoutines::appendPerfLog(state, "Other Fuel 2 ABUPS Total [J]", format("{:.3R}", collapsedTotal(10))); - UtilityRoutines::appendPerfLog(state, "District Cooling ABUPS Total [J]", format("{:.3R}", collapsedTotal(11))); - UtilityRoutines::appendPerfLog(state, "District Heating Water ABUPS Total [J]", format("{:.3R}", collapsedTotal(12))); - UtilityRoutines::appendPerfLog(state, "District Heating Steam ABUPS Total [J]", format("{:.3R}", collapsedTotal(13))); - UtilityRoutines::appendPerfLog(state, "Water ABUPS Total [m3]", format("{:.3R}", collapsedTotal(14))); - UtilityRoutines::appendPerfLog(state, "Values Gathered Over [hours]", format("{:.2R}", ort->gatherElapsedTimeBEPS)); - UtilityRoutines::appendPerfLog(state, - "Facility Any Zone Oscillating Temperatures Time [hours]", - format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate)); - UtilityRoutines::appendPerfLog(state, - "Facility Any Zone Oscillating Temperatures During Occupancy Time [hours]", - format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateDuringOccupancy)); - UtilityRoutines::appendPerfLog(state, - "Facility Any Zone Oscillating Temperatures in Deadband Time [hours]", - format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateInDeadband)); + Util::appendPerfLog(state, "Electricity ABUPS Total [J]", format("{:.3R}", collapsedTotal(1))); + Util::appendPerfLog(state, "Natural Gas ABUPS Total [J]", format("{:.3R}", collapsedTotal(2))); + Util::appendPerfLog(state, "Gasoline ABUPS Total [J]", format("{:.3R}", collapsedTotal(3))); + Util::appendPerfLog(state, "Diesel ABUPS Total [J]", format("{:.3R}", collapsedTotal(4))); + Util::appendPerfLog(state, "Coal ABUPS Total [J]", format("{:.3R}", collapsedTotal(5))); + Util::appendPerfLog(state, "Fuel Oil No 1 ABUPS Total [J]", format("{:.3R}", collapsedTotal(6))); + Util::appendPerfLog(state, "Fuel Oil No 2 ABUPS Total [J]", format("{:.3R}", collapsedTotal(7))); + Util::appendPerfLog(state, "Propane ABUPS Total [J]", format("{:.3R}", collapsedTotal(8))); + Util::appendPerfLog(state, "Other Fuel 1 ABUPS Total [J]", format("{:.3R}", collapsedTotal(9))); + Util::appendPerfLog(state, "Other Fuel 2 ABUPS Total [J]", format("{:.3R}", collapsedTotal(10))); + Util::appendPerfLog(state, "District Cooling ABUPS Total [J]", format("{:.3R}", collapsedTotal(11))); + Util::appendPerfLog(state, "District Heating Water ABUPS Total [J]", format("{:.3R}", collapsedTotal(12))); + Util::appendPerfLog(state, "District Heating Steam ABUPS Total [J]", format("{:.3R}", collapsedTotal(13))); + Util::appendPerfLog(state, "Water ABUPS Total [m3]", format("{:.3R}", collapsedTotal(14))); + Util::appendPerfLog(state, "Values Gathered Over [hours]", format("{:.2R}", ort->gatherElapsedTimeBEPS)); + Util::appendPerfLog(state, + "Facility Any Zone Oscillating Temperatures Time [hours]", + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillate)); + Util::appendPerfLog(state, + "Facility Any Zone Oscillating Temperatures During Occupancy Time [hours]", + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateDuringOccupancy)); + Util::appendPerfLog(state, + "Facility Any Zone Oscillating Temperatures in Deadband Time [hours]", + format("{:.2R}", state.dataZoneTempPredictorCorrector->AnnualAnyZoneTempOscillateInDeadband)); } } for (int jEndUse = 1; jEndUse <= static_cast(Constant::EndUse::Num); ++jEndUse) { @@ -10745,7 +10742,7 @@ void writeRowReportPeriodInputVeri(const std::string &reportType, Array2D_string &tableBody, const int rowid, const int periodIdx, - const Array1D &ReportPeriodInputData) + const Array1D &ReportPeriodInputData) { tableBody(1, rowid) = reportType; tableBody(2, rowid) = std::to_string(periodIdx); @@ -12047,7 +12044,7 @@ std::string formatReportPeriodTimestamp(const int year, const int month, const i void WriteReportHeaderReportingPeriod(EnergyPlusData &state, const std::string &reportKeyWord, const int periodIdx, - const Array1D &ReportPeriodInputData) + const Array1D &ReportPeriodInputData) { WriteReportHeaders( state, @@ -12076,8 +12073,7 @@ void WriteReportPeriodTimeConsumption(EnergyPlusData &state) Array1D_int columnWidth; Array1D_string rowHead; Array2D_string tableBody; - int numRowsReportPeriod = - state.dataWeatherManager->TotThermalReportPers + state.dataWeatherManager->TotCO2ReportPers + state.dataWeatherManager->TotVisualReportPers; + int numRowsReportPeriod = state.dataWeather->TotThermalReportPers + state.dataWeather->TotCO2ReportPers + state.dataWeather->TotVisualReportPers; rowHead.allocate(numRowsReportPeriod); columnHead.allocate(6); columnWidth.allocate(6); @@ -12104,16 +12100,16 @@ void WriteReportPeriodTimeConsumption(EnergyPlusData &state) } // loop through rows int rowid = 1; - for (int periodIdx = 1; periodIdx <= state.dataWeatherManager->TotThermalReportPers; periodIdx++) { - writeRowReportPeriodInputVeri("Thermal", tableBody, rowid, periodIdx, state.dataWeatherManager->ThermalReportPeriodInput); + for (int periodIdx = 1; periodIdx <= state.dataWeather->TotThermalReportPers; periodIdx++) { + writeRowReportPeriodInputVeri("Thermal", tableBody, rowid, periodIdx, state.dataWeather->ThermalReportPeriodInput); rowid += 1; } - for (int periodIdx = 1; periodIdx <= state.dataWeatherManager->TotCO2ReportPers; periodIdx++) { - writeRowReportPeriodInputVeri("CO2", tableBody, rowid, periodIdx, state.dataWeatherManager->CO2ReportPeriodInput); + for (int periodIdx = 1; periodIdx <= state.dataWeather->TotCO2ReportPers; periodIdx++) { + writeRowReportPeriodInputVeri("CO2", tableBody, rowid, periodIdx, state.dataWeather->CO2ReportPeriodInput); rowid += 1; } - for (int periodIdx = 1; periodIdx <= state.dataWeatherManager->TotVisualReportPers; periodIdx++) { - writeRowReportPeriodInputVeri("Visual", tableBody, rowid, periodIdx, state.dataWeatherManager->VisualReportPeriodInput); + for (int periodIdx = 1; periodIdx <= state.dataWeather->TotVisualReportPers; periodIdx++) { + writeRowReportPeriodInputVeri("Visual", tableBody, rowid, periodIdx, state.dataWeather->VisualReportPeriodInput); rowid += 1; } @@ -12148,8 +12144,8 @@ void WriteThermalResilienceTablesRepPeriod(EnergyPlusData &state, int const peri } std::string tableType = "Thermal"; - WriteReportHeaderReportingPeriod(state, tableType, periodIdx, state.dataWeatherManager->ThermalReportPeriodInput); - std::string periodTitle = state.dataWeatherManager->ThermalReportPeriodInput(periodIdx).title; + WriteReportHeaderReportingPeriod(state, tableType, periodIdx, state.dataWeather->ThermalReportPeriodInput); + std::string periodTitle = state.dataWeather->ThermalReportPeriodInput(periodIdx).title; int columnNum = 5; Array1D_int columnWidth; @@ -13134,8 +13130,8 @@ void WriteCO2ResilienceTablesRepPeriod(EnergyPlusData &state, const int periodId if (ort->WriteTabularFiles) { return; } - WriteReportHeaderReportingPeriod(state, "CO2", periodIdx, state.dataWeatherManager->CO2ReportPeriodInput); - std::string periodTitle = state.dataWeatherManager->CO2ReportPeriodInput(periodIdx).title; + WriteReportHeaderReportingPeriod(state, "CO2", periodIdx, state.dataWeather->CO2ReportPeriodInput); + std::string periodTitle = state.dataWeather->CO2ReportPeriodInput(periodIdx).title; Array1D_int columnWidth; columnWidth.allocate(numColumnCO2Tbl); @@ -13238,8 +13234,8 @@ void WriteVisualResilienceTablesRepPeriod(EnergyPlusData &state, const int perio return; } - WriteReportHeaderReportingPeriod(state, "Visual", periodIdx, state.dataWeatherManager->VisualReportPeriodInput); - std::string periodTitle = state.dataWeatherManager->VisualReportPeriodInput(periodIdx).title; + WriteReportHeaderReportingPeriod(state, "Visual", periodIdx, state.dataWeather->VisualReportPeriodInput); + std::string periodTitle = state.dataWeather->VisualReportPeriodInput(periodIdx).title; Array1D_int columnWidth; columnWidth.allocate(numColumnVisualTbl); @@ -13557,9 +13553,9 @@ void WritePredefinedTables(EnergyPlusData &state) // finally assign the entry to the place in the table body if (unitsStyle_cur == UnitsStyle::InchPound || unitsStyle_cur == UnitsStyle::JtoKWH) { int columnUnitConv = colUnitConv(colCurrent); - if (UtilityRoutines::SameString(state.dataOutRptPredefined->subTable(jSubTable).name, "SizingPeriod:DesignDay") && + if (Util::SameString(state.dataOutRptPredefined->subTable(jSubTable).name, "SizingPeriod:DesignDay") && unitsStyle_cur == UnitsStyle::InchPound) { - if (UtilityRoutines::SameString(columnHead(colCurrent), "Humidity Value")) { + if (Util::SameString(columnHead(colCurrent), "Humidity Value")) { std::string repTableTag; LookupSItoIP(state, state.dataOutRptPredefined->tableEntry(lTableEntry + 1).charEntry, @@ -13699,8 +13695,8 @@ void WriteComponentSizing(EnergyPlusData &state) // entries for the particular subtable. for (iTableEntry = 1; iTableEntry <= state.dataOutRptPredefined->numCompSizeTableEntry; ++iTableEntry) { if (!state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).written) { - if (UtilityRoutines::SameString(state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).typeField, - state.dataOutRptPredefined->CompSizeTableEntry(foundEntry).typeField)) { + if (Util::SameString(state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).typeField, + state.dataOutRptPredefined->CompSizeTableEntry(foundEntry).typeField)) { state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).active = true; } } @@ -13717,7 +13713,7 @@ void WriteComponentSizing(EnergyPlusData &state) curDesc = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).description; // look through the list of unique items to see if it matches for (jUnique = 1; jUnique <= numUniqueDesc; ++jUnique) { - if (UtilityRoutines::SameString(curDesc, uniqueDesc(jUnique))) { + if (Util::SameString(curDesc, uniqueDesc(jUnique))) { foundDesc = jUnique; break; } @@ -13731,7 +13727,7 @@ void WriteComponentSizing(EnergyPlusData &state) foundObj = 0; curObj = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).nameField; for (jUnique = 1; jUnique <= numUniqueObj; ++jUnique) { - if (UtilityRoutines::SameString(curObj, uniqueObj(jUnique))) { + if (Util::SameString(curObj, uniqueObj(jUnique))) { foundObj = jUnique; break; } @@ -13779,7 +13775,7 @@ void WriteComponentSizing(EnergyPlusData &state) curDesc = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).description; foundDesc = 0; for (jUnique = 1; jUnique <= numUniqueDesc; ++jUnique) { - if (UtilityRoutines::SameString(uniqueDesc(jUnique), curDesc)) { + if (Util::SameString(uniqueDesc(jUnique), curDesc)) { foundDesc = jUnique; break; } @@ -13787,7 +13783,7 @@ void WriteComponentSizing(EnergyPlusData &state) curObj = state.dataOutRptPredefined->CompSizeTableEntry(iTableEntry).nameField; foundObj = 0; for (jUnique = 1; jUnique <= numUniqueObj; ++jUnique) { - if (UtilityRoutines::SameString(rowHead(jUnique), curObj)) { + if (Util::SameString(rowHead(jUnique), curObj)) { foundObj = jUnique; break; } @@ -15745,10 +15741,10 @@ void CollectPeakZoneConditions( if (isCooling) { // Time of Peak Load - if ((size_t)desDaySelected <= state.dataWeatherManager->DesDayInput.size()) { + if ((size_t)desDaySelected <= state.dataWeather->DesDayInput.size()) { compLoad.peakDateHrMin = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(desDaySelected).Month, - state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth, + state.dataWeather->DesDayInput(desDaySelected).Month, + state.dataWeather->DesDayInput(desDaySelected).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText(state, timeOfMax)); } else { compLoad.peakDateHrMin = thisCalcFinalZoneSizing.CoolPeakDateHrMin; @@ -15801,10 +15797,10 @@ void CollectPeakZoneConditions( } else { // Time of Peak Load - if ((size_t)desDaySelected <= state.dataWeatherManager->DesDayInput.size()) { + if ((size_t)desDaySelected <= state.dataWeather->DesDayInput.size()) { compLoad.peakDateHrMin = format("{}/{} {}", - state.dataWeatherManager->DesDayInput(desDaySelected).Month, - state.dataWeatherManager->DesDayInput(desDaySelected).DayOfMonth, + state.dataWeather->DesDayInput(desDaySelected).Month, + state.dataWeather->DesDayInput(desDaySelected).DayOfMonth, state.dataRptCoilSelection->coilSelectionReportObj->getTimeText(state, timeOfMax)); } else { compLoad.peakDateHrMin = thisCalcFinalZoneSizing.HeatPeakDateHrMin; @@ -16978,7 +16974,7 @@ void WriteTable(EnergyPlusData &state, // if report name and subtable name the same add "record" to the end ort->activeSubTableName = ConvertToElementTag(ort->activeSubTableName); ort->activeReportNameNoSpace = ConvertToElementTag(ort->activeReportName); - if (UtilityRoutines::SameString(ort->activeSubTableName, ort->activeReportNameNoSpace)) { + if (Util::SameString(ort->activeSubTableName, ort->activeReportNameNoSpace)) { ort->activeSubTableName += "Record"; } // if no subtable name use the report name and add "record" to the end @@ -16996,7 +16992,7 @@ void WriteTable(EnergyPlusData &state, rowLabelTags(jRow) = "none"; } rowUnitStrings(jRow) = GetUnitSubString(rowLabels(jRow)); - if (UtilityRoutines::SameString(rowUnitStrings(jRow), "Invalid/Undefined")) { + if (Util::SameString(rowUnitStrings(jRow), "Invalid/Undefined")) { rowUnitStrings(jRow) = ""; } } @@ -17006,7 +17002,7 @@ void WriteTable(EnergyPlusData &state, columnLabelTags(iCol) = "none"; } columnUnitStrings(iCol) = GetUnitSubString(columnLabels(iCol)); - if (UtilityRoutines::SameString(columnUnitStrings(iCol), "Invalid/Undefined")) { + if (Util::SameString(columnUnitStrings(iCol), "Invalid/Undefined")) { columnUnitStrings(iCol) = ""; } } @@ -17424,12 +17420,12 @@ void DetermineBuildingFloorArea(EnergyPlusData &state) // check if this zone is also a return plenum or a supply plenum // found = 0 // if (NumZoneReturnPlenums > 0) THEN - // found = UtilityRoutines::FindItemInList(thisZone%Name, ZoneRetPlenCond%ZoneName, NumZoneReturnPlenums) + // found = Util::FindItemInList(thisZone%Name, ZoneRetPlenCond%ZoneName, NumZoneReturnPlenums) // endif // IF (found /= 0) curZoneArea = 0.0d0 // found = 0 // if (NumZoneSupplyPlenums > 0) THEN - // found = UtilityRoutines::FindItemInList(thisZone%Name, ZoneSupPlenCond%ZoneName, NumZoneSupplyPlenums) + // found = Util::FindItemInList(thisZone%Name, ZoneSupPlenCond%ZoneName, NumZoneSupplyPlenums) // endif // IF (found /= 0) curZoneArea = 0.0d0 @@ -18567,7 +18563,7 @@ void LookupSItoIP(EnergyPlusData &state, std::string const &stringInWithSI, int int constexpr misParen(2); int constexpr misBrce(3); int constexpr misNoHint(4); - std::string const stringInUpper(UtilityRoutines::makeUPPER(stringInWithSI)); + std::string const stringInUpper(Util::makeUPPER(stringInWithSI)); auto &ort = state.dataOutRptTab; stringOutWithIP = ""; @@ -18599,7 +18595,7 @@ void LookupSItoIP(EnergyPlusData &state, std::string const &stringInWithSI, int int foundConv = 0; int firstOfSeveral = 0; for (int iUnit = 1; iUnit <= ort->UnitConvSize; ++iUnit) { - if (UtilityRoutines::SameString(ort->UnitConv(iUnit).siName, unitSIOnly)) { + if (Util::SameString(ort->UnitConv(iUnit).siName, unitSIOnly)) { if (ort->UnitConv(iUnit).several) { if (firstOfSeveral == 0) firstOfSeveral = iUnit; if (ort->UnitConv(iUnit).is_default) defaultConv = iUnit; @@ -18881,8 +18877,8 @@ Real64 getSpecificUnitMultiplier(EnergyPlusData &state, std::string const &SIuni auto &ort = state.dataOutRptTab; for (state.dataOutRptTab->iUnitGsum = 1; state.dataOutRptTab->iUnitGsum <= ort->UnitConvSize; ++state.dataOutRptTab->iUnitGsum) { - if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsum).siName, SIunit)) { - if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsum).ipName, IPunit)) { + if (Util::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsum).siName, SIunit)) { + if (Util::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsum).ipName, IPunit)) { state.dataOutRptTab->foundGsum = state.dataOutRptTab->iUnitGsum; break; } @@ -18995,8 +18991,8 @@ Real64 getSpecificUnitIndex(EnergyPlusData &state, std::string const &SIunit, st auto &ort = state.dataOutRptTab; for (state.dataOutRptTab->iUnitGsui = 1; state.dataOutRptTab->iUnitGsui <= ort->UnitConvSize; ++state.dataOutRptTab->iUnitGsui) { - if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsui).siName, SIunit)) { - if (UtilityRoutines::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsui).ipName, IPunit)) { + if (Util::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsui).siName, SIunit)) { + if (Util::SameString(ort->UnitConv(state.dataOutRptTab->iUnitGsui).ipName, IPunit)) { state.dataOutRptTab->foundGsui = state.dataOutRptTab->iUnitGsui; break; } diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index 305ed6b1c43..aa19127f89b 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -564,7 +564,7 @@ namespace OutputReportTabular { void AddTOCReportPeriod(const int nReportPeriods, const std::string &kw, - const Array1D &ReportPeriodInputData, + const Array1D &ReportPeriodInputData, std::ostream &tbl_stream); //====================================================================================================================== @@ -650,7 +650,7 @@ namespace OutputReportTabular { Array2D_string &tableBody, const int rowid, const int periodIdx, - const Array1D &ReportPeriodInputData); + const Array1D &ReportPeriodInputData); void WriteVeriSumTable(EnergyPlusData &state); @@ -663,7 +663,7 @@ namespace OutputReportTabular { void WriteReportHeaderReportingPeriod(EnergyPlusData &state, const std::string &reportKeyWord, const int periodIdx, - const Array1D &ReportPeriodInputData); + const Array1D &ReportPeriodInputData); void WriteReportPeriodTimeConsumption(EnergyPlusData &state); diff --git a/src/EnergyPlus/OutputReportTabularAnnual.cc b/src/EnergyPlus/OutputReportTabularAnnual.cc index d191cf9b5ac..048a847edbc 100644 --- a/src/EnergyPlus/OutputReportTabularAnnual.cc +++ b/src/EnergyPlus/OutputReportTabularAnnual.cc @@ -1089,45 +1089,45 @@ AnnualFieldSet::AggregationKind stringToAggKind(EnergyPlusData &state, std::stri { AnnualFieldSet::AggregationKind outAggType; - if (UtilityRoutines::SameString(inString, "SumOrAverage")) { + if (Util::SameString(inString, "SumOrAverage")) { outAggType = AnnualFieldSet::AggregationKind::sumOrAvg; - } else if (UtilityRoutines::SameString(inString, "Maximum")) { + } else if (Util::SameString(inString, "Maximum")) { outAggType = AnnualFieldSet::AggregationKind::maximum; - } else if (UtilityRoutines::SameString(inString, "Minimum")) { + } else if (Util::SameString(inString, "Minimum")) { outAggType = AnnualFieldSet::AggregationKind::minimum; - } else if (UtilityRoutines::SameString(inString, "ValueWhenMaximumOrMinimum")) { + } else if (Util::SameString(inString, "ValueWhenMaximumOrMinimum")) { outAggType = AnnualFieldSet::AggregationKind::valueWhenMaxMin; - } else if (UtilityRoutines::SameString(inString, "HoursZero")) { + } else if (Util::SameString(inString, "HoursZero")) { outAggType = AnnualFieldSet::AggregationKind::hoursZero; - } else if (UtilityRoutines::SameString(inString, "HoursNonzero")) { + } else if (Util::SameString(inString, "HoursNonzero")) { outAggType = AnnualFieldSet::AggregationKind::hoursNonZero; - } else if (UtilityRoutines::SameString(inString, "HoursPositive")) { + } else if (Util::SameString(inString, "HoursPositive")) { outAggType = AnnualFieldSet::AggregationKind::hoursPositive; - } else if (UtilityRoutines::SameString(inString, "HoursNonpositive")) { + } else if (Util::SameString(inString, "HoursNonpositive")) { outAggType = AnnualFieldSet::AggregationKind::hoursNonPositive; - } else if (UtilityRoutines::SameString(inString, "HoursNegative")) { + } else if (Util::SameString(inString, "HoursNegative")) { outAggType = AnnualFieldSet::AggregationKind::hoursNegative; - } else if (UtilityRoutines::SameString(inString, "HoursNonNegative")) { + } else if (Util::SameString(inString, "HoursNonNegative")) { outAggType = AnnualFieldSet::AggregationKind::hoursNonNegative; - } else if (UtilityRoutines::SameString(inString, "HoursInTenPercentBins")) { + } else if (Util::SameString(inString, "HoursInTenPercentBins")) { outAggType = AnnualFieldSet::AggregationKind::hoursInTenPercentBins; - } else if (UtilityRoutines::SameString(inString, "HourInTenBinsMinToMax")) { + } else if (Util::SameString(inString, "HourInTenBinsMinToMax")) { outAggType = AnnualFieldSet::AggregationKind::hoursInTenBinsMinToMax; - } else if (UtilityRoutines::SameString(inString, "HourInTenBinsZeroToMax")) { + } else if (Util::SameString(inString, "HourInTenBinsZeroToMax")) { outAggType = AnnualFieldSet::AggregationKind::hoursInTenBinsZeroToMax; - } else if (UtilityRoutines::SameString(inString, "HourInTenBinsMinToZero")) { + } else if (Util::SameString(inString, "HourInTenBinsMinToZero")) { outAggType = AnnualFieldSet::AggregationKind::hoursInTenBinsMinToZero; - } else if (UtilityRoutines::SameString(inString, "HoursInTenBinsPlusMinusTwoStdDev")) { + } else if (Util::SameString(inString, "HoursInTenBinsPlusMinusTwoStdDev")) { outAggType = AnnualFieldSet::AggregationKind::hoursInTenBinsPlusMinusTwoStdDev; - } else if (UtilityRoutines::SameString(inString, "HoursInTenBinsPlusMinusThreeStdDev")) { + } else if (Util::SameString(inString, "HoursInTenBinsPlusMinusThreeStdDev")) { outAggType = AnnualFieldSet::AggregationKind::hoursInTenBinsPlusMinusThreeStdDev; - } else if (UtilityRoutines::SameString(inString, "NoAggregation")) { + } else if (Util::SameString(inString, "NoAggregation")) { outAggType = AnnualFieldSet::AggregationKind::noAggregation; - } else if (UtilityRoutines::SameString(inString, "SumOrAverageDuringHoursShown")) { + } else if (Util::SameString(inString, "SumOrAverageDuringHoursShown")) { outAggType = AnnualFieldSet::AggregationKind::sumOrAverageHoursShown; - } else if (UtilityRoutines::SameString(inString, "MaximumDuringHoursShown")) { + } else if (Util::SameString(inString, "MaximumDuringHoursShown")) { outAggType = AnnualFieldSet::AggregationKind::maximumDuringHoursShown; - } else if (UtilityRoutines::SameString(inString, "MinimumDuringHoursShown")) { + } else if (Util::SameString(inString, "MinimumDuringHoursShown")) { outAggType = AnnualFieldSet::AggregationKind::minimumDuringHoursShown; } else { outAggType = AnnualFieldSet::AggregationKind::sumOrAvg; diff --git a/src/EnergyPlus/PVWatts.cc b/src/EnergyPlus/PVWatts.cc index 792fdb66e65..240bd7b0ef2 100644 --- a/src/EnergyPlus/PVWatts.cc +++ b/src/EnergyPlus/PVWatts.cc @@ -152,9 +152,9 @@ namespace PVWatts { // Initialize m_pvwattsData // Location - ssc_data_set_number(pvwattsData_, "lat", state.dataWeatherManager->WeatherFileLatitude); - ssc_data_set_number(pvwattsData_, "lon", state.dataWeatherManager->WeatherFileLongitude); - ssc_data_set_number(pvwattsData_, "tz", state.dataWeatherManager->WeatherFileTimeZone); + ssc_data_set_number(pvwattsData_, "lat", state.dataWeather->WeatherFileLatitude); + ssc_data_set_number(pvwattsData_, "lon", state.dataWeather->WeatherFileLongitude); + ssc_data_set_number(pvwattsData_, "tz", state.dataWeather->WeatherFileTimeZone); // System Properties ssc_data_set_number(pvwattsData_, "time_step", state.dataGlobal->TimeStepZone); ssc_data_set_number(pvwattsData_, "system_capacity", dcSystemCapacity_ * 0.001); @@ -293,7 +293,7 @@ namespace PVWatts { if (lAlphaFieldBlanks(AlphaFields::SURFACE_NAME)) { surfaceNum = 0; } else { - surfaceNum = UtilityRoutines::FindItemInList(cAlphaArgs(AlphaFields::SURFACE_NAME), state.dataSurface->Surface); + surfaceNum = Util::FindItemInList(cAlphaArgs(AlphaFields::SURFACE_NAME), state.dataSurface->Surface); } if (errorsFound) { @@ -411,7 +411,7 @@ namespace PVWatts { ssc_data_set_number(pvwattsData_, "diffuse", state.dataEnvrn->DifSolarRad); ssc_data_set_number(pvwattsData_, "tamb", state.dataEnvrn->OutDryBulbTemp); ssc_data_set_number(pvwattsData_, "wspd", state.dataEnvrn->WindSpeed); - Real64 albedo = state.dataWeatherManager->TodayAlbedo(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + Real64 albedo = state.dataWeather->wvarsHrTsToday(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay).Albedo; if (!(std::isfinite(albedo) && albedo > 0.0 && albedo < 1)) { albedo = 0.2; } diff --git a/src/EnergyPlus/PackagedThermalStorageCoil.cc b/src/EnergyPlus/PackagedThermalStorageCoil.cc index 8a09ba1f885..187ac9aab94 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -131,7 +131,7 @@ void SimTESCoil(EnergyPlusData &state, int TESCoilNum = 0; if (CompIndex == 0) { - TESCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataPackagedThermalStorageCoil->TESCoil); + TESCoilNum = Util::FindItemInList(CompName, state.dataPackagedThermalStorageCoil->TESCoil); if (TESCoilNum == 0) { ShowFatalError(state, format("Thermal Energy Storage Cooling Coil not found={}", CompName)); } @@ -240,7 +240,7 @@ void GetTESCoilInput(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueCoilName(state, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); @@ -295,7 +295,7 @@ void GetTESCoilInput(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "USERDEFINEDFLUIDTYPE")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "USERDEFINEDFLUIDTYPE")) { if (!(state.dataIPShortCut->lAlphaFieldBlanks(6))) { thisTESCoil.StorageFluidName = state.dataIPShortCut->cAlphaArgs(6); if (CheckFluidPropertyName(state, state.dataIPShortCut->cAlphaArgs(6)) == 0) { @@ -4301,7 +4301,7 @@ void GetTESCoilIndex( } if (state.dataPackagedThermalStorageCoil->NumTESCoils > 0) { - CoilIndex = UtilityRoutines::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil); + CoilIndex = Util::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil); } else { CoilIndex = 0; } @@ -4341,8 +4341,7 @@ void GetTESCoilAirInletNode( } if (state.dataPackagedThermalStorageCoil->NumTESCoils > 0) { - CoilIndex = - UtilityRoutines::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); + CoilIndex = Util::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); } else { CoilIndex = 0; } @@ -4381,8 +4380,7 @@ void GetTESCoilAirOutletNode( } if (state.dataPackagedThermalStorageCoil->NumTESCoils > 0) { - CoilIndex = - UtilityRoutines::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); + CoilIndex = Util::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); } else { CoilIndex = 0; } @@ -4421,8 +4419,7 @@ void GetTESCoilCoolingCapacity( } if (state.dataPackagedThermalStorageCoil->NumTESCoils > 0) { - CoilIndex = - UtilityRoutines::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); + CoilIndex = Util::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); } else { CoilIndex = 0; } @@ -4469,8 +4466,7 @@ void GetTESCoilCoolingAirFlowRate( } if (state.dataPackagedThermalStorageCoil->NumTESCoils > 0) { - CoilIndex = - UtilityRoutines::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); + CoilIndex = Util::FindItem(CoilName, state.dataPackagedThermalStorageCoil->TESCoil, state.dataPackagedThermalStorageCoil->NumTESCoils); } else { CoilIndex = 0; } diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 9a55f4033ae..8b52a07f65d 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -209,7 +209,7 @@ namespace PhotovoltaicThermalCollectors { auto &thisTmpSimplePVTperf = tmpSimplePVTperf(Item); thisTmpSimplePVTperf.Name = state.dataIPShortCut->cAlphaArgs(1); thisTmpSimplePVTperf.ThermEfficMode = - static_cast(getEnumValue(ThermEfficTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + static_cast(getEnumValue(ThermEfficTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); thisTmpSimplePVTperf.ThermalActiveFract = state.dataIPShortCut->rNumericArgs(1); thisTmpSimplePVTperf.ThermEffic = state.dataIPShortCut->rNumericArgs(2); thisTmpSimplePVTperf.ThermEffSchedNum = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); @@ -257,7 +257,7 @@ namespace PhotovoltaicThermalCollectors { auto &thisTmpBIPVTperf = tmpBIPVTperf(Item); thisTmpBIPVTperf.Name = state.dataIPShortCut->cAlphaArgs(1); thisTmpBIPVTperf.OSCMName = state.dataIPShortCut->cAlphaArgs(2); - Found = UtilityRoutines::FindItemInList(thisTmpBIPVTperf.OSCMName, state.dataSurface->OSCM); + Found = Util::FindItemInList(thisTmpBIPVTperf.OSCMName, state.dataSurface->OSCM); if (Found == 0) { ShowSevereError(state, format("GetBIPVTCollectorsInput: Invalid outside model name={}, object type={}, object name={}", @@ -335,7 +335,7 @@ namespace PhotovoltaicThermalCollectors { thisPVT.Name = state.dataIPShortCut->cAlphaArgs(1); thisPVT.Type = DataPlant::PlantEquipmentType::PVTSolarCollectorFlatPlate; - thisPVT.SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); + thisPVT.SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); // check surface if (thisPVT.SurfNum == 0) { if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { @@ -383,14 +383,14 @@ namespace PhotovoltaicThermalCollectors { ErrorsFound = true; } else { thisPVT.PVTModelName = state.dataIPShortCut->cAlphaArgs(3); - int ThisParamObj = UtilityRoutines::FindItemInList(thisPVT.PVTModelName, tmpSimplePVTperf); + int ThisParamObj = Util::FindItemInList(thisPVT.PVTModelName, tmpSimplePVTperf); if (ThisParamObj > 0) { thisPVT.Simple = tmpSimplePVTperf(ThisParamObj); // entire structure assigned // do one-time setups on input data thisPVT.AreaCol = state.dataSurface->Surface(thisPVT.SurfNum).Area * thisPVT.Simple.ThermalActiveFract; thisPVT.ModelType = PVTModelType::Simple; } else { - ThisParamObj = UtilityRoutines::FindItemInList(PVT(Item).PVTModelName, tmpBIPVTperf); + ThisParamObj = Util::FindItemInList(PVT(Item).PVTModelName, tmpBIPVTperf); if (ThisParamObj > 0) { thisPVT.BIPVT = tmpBIPVTperf(ThisParamObj); // entire structure assigned // do one-time setups on input data @@ -407,7 +407,7 @@ namespace PhotovoltaicThermalCollectors { } if (allocated(state.dataPhotovoltaic->PVarray)) { // then PV input gotten... but don't expect this to be true. - thisPVT.PVnum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataPhotovoltaic->PVarray); + thisPVT.PVnum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataPhotovoltaic->PVarray); // check PV if (thisPVT.PVnum == 0) { ShowSevereError(state, @@ -424,9 +424,9 @@ namespace PhotovoltaicThermalCollectors { thisPVT.PVfound = false; } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "Water")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "Water")) { thisPVT.WorkingFluidType = WorkingFluidEnum::LIQUID; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "Air")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "Air")) { thisPVT.WorkingFluidType = WorkingFluidEnum::AIR; } else { if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { @@ -618,7 +618,7 @@ namespace PhotovoltaicThermalCollectors { // finish set up of PV, because PV get-input follows PVT's get input. if (!this->PVfound) { if (allocated(state.dataPhotovoltaic->PVarray)) { - this->PVnum = UtilityRoutines::FindItemInList(this->PVname, state.dataPhotovoltaic->PVarray); + this->PVnum = Util::FindItemInList(this->PVname, state.dataPhotovoltaic->PVarray); if (this->PVnum == 0) { ShowSevereError(state, format("Invalid name for photovoltaic generator = {}", this->PVname)); ShowContinueError(state, format("Entered in flat plate photovoltaic-thermal collector = {}", this->Name)); @@ -1860,7 +1860,7 @@ namespace PhotovoltaicThermalCollectors { state.dataPhotovoltaicThermalCollector->GetInputFlag = false; } - WhichPVT = UtilityRoutines::FindItemInList(PVTName, state.dataPhotovoltaicThermalCollector->PVT); + WhichPVT = Util::FindItemInList(PVTName, state.dataPhotovoltaicThermalCollector->PVT); if (WhichPVT != 0) { NodeNum = state.dataPhotovoltaicThermalCollector->PVT(WhichPVT).HVACInletNodeNum; } else { @@ -1891,7 +1891,7 @@ namespace PhotovoltaicThermalCollectors { state.dataPhotovoltaicThermalCollector->GetInputFlag = false; } - WhichPVT = UtilityRoutines::FindItemInList(PVTName, state.dataPhotovoltaicThermalCollector->PVT); + WhichPVT = Util::FindItemInList(PVTName, state.dataPhotovoltaicThermalCollector->PVT); if (WhichPVT != 0) { NodeNum = state.dataPhotovoltaicThermalCollector->PVT(WhichPVT).HVACOutletNodeNum; } else { diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index a9ed83859e9..ddf708c366a 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -141,7 +141,7 @@ namespace Photovoltaics { } if (GeneratorIndex == 0) { - PVnum = UtilityRoutines::FindItemInList(GeneratorName, state.dataPhotovoltaic->PVarray); + PVnum = Util::FindItemInList(GeneratorName, state.dataPhotovoltaic->PVarray); if (PVnum == 0) { ShowFatalError(state, format("SimPhotovoltaicGenerator: Specified PV not one of valid Photovoltaic Generators {}", GeneratorName)); } @@ -299,12 +299,11 @@ namespace Photovoltaics { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataPhotovoltaic->PVarray(PVnum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataPhotovoltaic->PVarray(PVnum).SurfaceName = state.dataIPShortCut->cAlphaArgs(2); - state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); + state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); // required-surface if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); @@ -343,11 +342,11 @@ namespace Photovoltaics { } state.dataPhotovoltaic->PVarray(PVnum).PVModelType = PVModel::Invalid; - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataPhotovoltaic->cPVSimplePerfObjectName)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataPhotovoltaic->cPVSimplePerfObjectName)) { state.dataPhotovoltaic->PVarray(PVnum).PVModelType = PVModel::Simple; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataPhotovoltaic->cPVEquiv1DiodePerfObjectName)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataPhotovoltaic->cPVEquiv1DiodePerfObjectName)) { state.dataPhotovoltaic->PVarray(PVnum).PVModelType = PVModel::TRNSYS; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataPhotovoltaic->cPVSandiaPerfObjectName)) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataPhotovoltaic->cPVSandiaPerfObjectName)) { state.dataPhotovoltaic->PVarray(PVnum).PVModelType = PVModel::Sandia; } else { // throw error, did not find module performance type if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { @@ -365,17 +364,17 @@ namespace Photovoltaics { state.dataPhotovoltaic->PVarray(PVnum).PerfObjName = state.dataIPShortCut->cAlphaArgs(4); // check later once perf objects are loaded state.dataPhotovoltaic->PVarray(PVnum).CellIntegrationMode = CellIntegration::Invalid; - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "Decoupled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "Decoupled")) { state.dataPhotovoltaic->PVarray(PVnum).CellIntegrationMode = CellIntegration::Decoupled; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "DecoupledUllebergDynamic")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "DecoupledUllebergDynamic")) { state.dataPhotovoltaic->PVarray(PVnum).CellIntegrationMode = CellIntegration::DecoupledUllebergDynamic; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "IntegratedSurfaceOutsideFace")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "IntegratedSurfaceOutsideFace")) { state.dataPhotovoltaic->PVarray(PVnum).CellIntegrationMode = CellIntegration::SurfaceOutsideFace; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "IntegratedTranspiredCollector")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "IntegratedTranspiredCollector")) { state.dataPhotovoltaic->PVarray(PVnum).CellIntegrationMode = CellIntegration::TranspiredCollector; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "IntegratedExteriorVentedCavity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "IntegratedExteriorVentedCavity")) { state.dataPhotovoltaic->PVarray(PVnum).CellIntegrationMode = CellIntegration::ExteriorVentedCavity; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "PhotovoltaicThermalSolarCollector")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "PhotovoltaicThermalSolarCollector")) { state.dataPhotovoltaic->PVarray(PVnum).CellIntegrationMode = CellIntegration::PVTSolarCollector; } else { if (state.dataIPShortCut->lAlphaFieldBlanks(5)) { @@ -402,9 +401,9 @@ namespace Photovoltaics { case CellIntegration::SurfaceOutsideFace: case CellIntegration::TranspiredCollector: case CellIntegration::ExteriorVentedCavity: { - dupPtr = UtilityRoutines::FindItemInList(state.dataPhotovoltaic->PVarray(PVnum).SurfaceName, - state.dataPhotovoltaic->PVarray({PVnum + 1, state.dataPhotovoltaic->NumPVs}), - &PVArrayStruct::SurfaceName); + dupPtr = Util::FindItemInList(state.dataPhotovoltaic->PVarray(PVnum).SurfaceName, + state.dataPhotovoltaic->PVarray({PVnum + 1, state.dataPhotovoltaic->NumPVs}), + &PVArrayStruct::SurfaceName); if (dupPtr != 0) dupPtr += PVnum; // to correct for shortened array in find item if (dupPtr != 0) { auto &thisPVarray = state.dataPhotovoltaic->PVarray(dupPtr); @@ -469,15 +468,15 @@ namespace Photovoltaics { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { continue; } tmpSimpleModuleParams(ModNum).Name = state.dataIPShortCut->cAlphaArgs(1); tmpSimpleModuleParams(ModNum).ActiveFraction = state.dataIPShortCut->rNumericArgs(1); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "Fixed")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "Fixed")) { tmpSimpleModuleParams(ModNum).EfficencyInputMode = Efficiency::Fixed; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "Scheduled")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "Scheduled")) { tmpSimpleModuleParams(ModNum).EfficencyInputMode = Efficiency::Scheduled; } else { if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { @@ -522,13 +521,13 @@ namespace Photovoltaics { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { continue; } tmpTNRSYSModuleParams(ModNum).Name = state.dataIPShortCut->cAlphaArgs(1); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "CrystallineSilicon")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "CrystallineSilicon")) { tmpTNRSYSModuleParams(ModNum).CellType = SiPVCells::Crystalline; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "AmorphousSilicon")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "AmorphousSilicon")) { tmpTNRSYSModuleParams(ModNum).CellType = SiPVCells::Amorphous; } else { if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { @@ -553,14 +552,14 @@ namespace Photovoltaics { tmpTNRSYSModuleParams(ModNum).ShuntResistance = state.dataIPShortCut->rNumericArgs(5); tmpTNRSYSModuleParams(ModNum).RefIsc = state.dataIPShortCut->rNumericArgs(6); tmpTNRSYSModuleParams(ModNum).RefVoc = state.dataIPShortCut->rNumericArgs(7); - tmpTNRSYSModuleParams(ModNum).RefTemperature = state.dataIPShortCut->rNumericArgs(8) + Constant::KelvinConv; + tmpTNRSYSModuleParams(ModNum).RefTemperature = state.dataIPShortCut->rNumericArgs(8) + Constant::Kelvin; tmpTNRSYSModuleParams(ModNum).RefInsolation = state.dataIPShortCut->rNumericArgs(9); tmpTNRSYSModuleParams(ModNum).Imp = state.dataIPShortCut->rNumericArgs(10); tmpTNRSYSModuleParams(ModNum).Vmp = state.dataIPShortCut->rNumericArgs(11); tmpTNRSYSModuleParams(ModNum).TempCoefIsc = state.dataIPShortCut->rNumericArgs(12); tmpTNRSYSModuleParams(ModNum).TempCoefVoc = state.dataIPShortCut->rNumericArgs(13); - tmpTNRSYSModuleParams(ModNum).NOCTAmbTemp = state.dataIPShortCut->rNumericArgs(14) + Constant::KelvinConv; - tmpTNRSYSModuleParams(ModNum).NOCTCellTemp = state.dataIPShortCut->rNumericArgs(15) + Constant::KelvinConv; + tmpTNRSYSModuleParams(ModNum).NOCTAmbTemp = state.dataIPShortCut->rNumericArgs(14) + Constant::Kelvin; + tmpTNRSYSModuleParams(ModNum).NOCTCellTemp = state.dataIPShortCut->rNumericArgs(15) + Constant::Kelvin; tmpTNRSYSModuleParams(ModNum).NOCTInsolation = state.dataIPShortCut->rNumericArgs(16); tmpTNRSYSModuleParams(ModNum).HeatLossCoef = state.dataIPShortCut->rNumericArgs(17); tmpTNRSYSModuleParams(ModNum).HeatCapacity = state.dataIPShortCut->rNumericArgs(18); @@ -584,7 +583,7 @@ namespace Photovoltaics { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { continue; } @@ -636,7 +635,7 @@ namespace Photovoltaics { switch (state.dataPhotovoltaic->PVarray(PVnum).PVModelType) { case PVModel::Simple: { - ThisParamObj = UtilityRoutines::FindItemInList(state.dataPhotovoltaic->PVarray(PVnum).PerfObjName, tmpSimpleModuleParams); + ThisParamObj = Util::FindItemInList(state.dataPhotovoltaic->PVarray(PVnum).PerfObjName, tmpSimpleModuleParams); if (ThisParamObj > 0) { state.dataPhotovoltaic->PVarray(PVnum).SimplePVModule = tmpSimpleModuleParams(ThisParamObj); // entire structure assignment @@ -653,7 +652,7 @@ namespace Photovoltaics { } } break; case PVModel::TRNSYS: { - ThisParamObj = UtilityRoutines::FindItemInList(state.dataPhotovoltaic->PVarray(PVnum).PerfObjName, tmpTNRSYSModuleParams); + ThisParamObj = Util::FindItemInList(state.dataPhotovoltaic->PVarray(PVnum).PerfObjName, tmpTNRSYSModuleParams); if (ThisParamObj > 0) { state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVModule = tmpTNRSYSModuleParams(ThisParamObj); // entire structure assignment } else { @@ -665,8 +664,8 @@ namespace Photovoltaics { } } break; case PVModel::Sandia: { - ThisParamObj = UtilityRoutines::FindItemInList( - state.dataPhotovoltaic->PVarray(PVnum).PerfObjName, tmpSNLModuleParams, &SNLModuleParamsStuct::name); + ThisParamObj = + Util::FindItemInList(state.dataPhotovoltaic->PVarray(PVnum).PerfObjName, tmpSNLModuleParams, &SNLModuleParamsStuct::name); if (ThisParamObj > 0) { state.dataPhotovoltaic->PVarray(PVnum).SNLPVModule = tmpSNLModuleParams(ThisParamObj); // entire structure assignment } else { @@ -786,8 +785,7 @@ namespace Photovoltaics { if (SurfNum > 0) { GetPVZone = state.dataSurface->Surface(SurfNum).Zone; if (GetPVZone == 0) { // might need to get the zone number from the name - GetPVZone = UtilityRoutines::FindItemInList( - state.dataSurface->Surface(SurfNum).ZoneName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + GetPVZone = Util::FindItemInList(state.dataSurface->Surface(SurfNum).ZoneName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); } } @@ -1187,9 +1185,9 @@ namespace Photovoltaics { // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && state.dataPhotovoltaicState->MyEnvrnFlag(PVnum)) { state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVcalc.CellTempK = - state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::KelvinConv; + state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::Kelvin; state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVcalc.LastCellTempK = - state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::KelvinConv; + state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::Kelvin; state.dataPhotovoltaicState->MyEnvrnFlag(PVnum) = false; } @@ -1283,7 +1281,7 @@ namespace Photovoltaics { state.dataPhotovoltaic->ShuntResistance = state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVModule.ShuntResistance; // convert ambient temperature from C to K - Tambient = state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::KelvinConv; + Tambient = state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::Kelvin; auto &thisPVarray = state.dataPhotovoltaic->PVarray; @@ -1325,19 +1323,19 @@ namespace Photovoltaics { state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVModule.HeatCapacity * state.dataPhotovoltaicState->PVTimeStep)); } break; case CellIntegration::SurfaceOutsideFace: { - CellTemp = state.dataHeatBalSurf->SurfTempOut(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::KelvinConv; + CellTemp = state.dataHeatBalSurf->SurfTempOut(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::Kelvin; } break; case CellIntegration::TranspiredCollector: { GetUTSCTsColl(state, state.dataPhotovoltaic->PVarray(PVnum).UTSCPtr, CellTemp); - CellTemp += Constant::KelvinConv; + CellTemp += Constant::Kelvin; } break; case CellIntegration::ExteriorVentedCavity: { GetExtVentedCavityTsColl(state, state.dataPhotovoltaic->PVarray(PVnum).ExtVentCavPtr, CellTemp); - CellTemp += Constant::KelvinConv; + CellTemp += Constant::Kelvin; } break; case CellIntegration::PVTSolarCollector: { GetPVTTsColl(state, thisPVarray(PVnum).PVTPtr, CellTemp); - CellTemp += Constant::KelvinConv; + CellTemp += Constant::Kelvin; } break; default: break; @@ -1415,19 +1413,19 @@ namespace Photovoltaics { state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVModule.HeatCapacity * state.dataPhotovoltaicState->PVTimeStep); } break; case CellIntegration::SurfaceOutsideFace: { - CellTemp = state.dataHeatBalSurf->SurfTempOut(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::KelvinConv; + CellTemp = state.dataHeatBalSurf->SurfTempOut(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + Constant::Kelvin; } break; case CellIntegration::TranspiredCollector: { GetUTSCTsColl(state, state.dataPhotovoltaic->PVarray(PVnum).UTSCPtr, CellTemp); - CellTemp += Constant::KelvinConv; + CellTemp += Constant::Kelvin; } break; case CellIntegration::ExteriorVentedCavity: { GetExtVentedCavityTsColl(state, state.dataPhotovoltaic->PVarray(PVnum).ExtVentCavPtr, CellTemp); - CellTemp += Constant::KelvinConv; + CellTemp += Constant::Kelvin; } break; case CellIntegration::PVTSolarCollector: { GetPVTTsColl(state, thisPVarray(PVnum).PVTPtr, CellTemp); - CellTemp += Constant::KelvinConv; + CellTemp += Constant::Kelvin; } break; default: { assert(false); @@ -1444,7 +1442,7 @@ namespace Photovoltaics { } // convert cell temperature back to C - CellTempC = CellTemp - Constant::KelvinConv; + CellTempC = CellTemp - Constant::Kelvin; // calculate array based outputs (so far, the outputs are module based IA = state.dataPhotovoltaic->PVarray(PVnum).NumSeriesNParall * IM; @@ -2175,7 +2173,7 @@ namespace Photovoltaics { if (Ee > 0.0) { // following is equation 8 in King et al. nov. 2003 - dTc = DiodeFactor * ((1.38066e-23 * (Tc + Constant::KelvinConv)) / 1.60218e-19); + dTc = DiodeFactor * ((1.38066e-23 * (Tc + Constant::Kelvin)) / 1.60218e-19); BVmpEe = BVmp0 + mBVmp * (1.0 - Ee); @@ -2214,7 +2212,7 @@ namespace Photovoltaics { Real64 BVocEe; // working variable if (Ee > 0.0) { - dTc = DiodeFactor * ((1.38066e-23 * (Tc + Constant::KelvinConv)) / 1.60218e-19); + dTc = DiodeFactor * ((1.38066e-23 * (Tc + Constant::Kelvin)) / 1.60218e-19); BVocEe = BVoc0 + mBVoc * (1.0 - Ee); SandiaVoc = Voc0 + NcellSer * dTc * std::log(Ee) + BVocEe * (Tc - 25.0); diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index 9af113f4042..b5284efeac9 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -272,8 +272,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) // General user input data state.dataPipeHT->PipeHT(Item).Construction = state.dataIPShortCut->cAlphaArgs(2); - state.dataPipeHT->PipeHT(Item).ConstructionNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); + state.dataPipeHT->PipeHT(Item).ConstructionNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); if (state.dataPipeHT->PipeHT(Item).ConstructionNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); @@ -331,8 +330,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) switch (indoorType) { case PipeIndoorBoundaryType::Zone: state.dataPipeHT->PipeHT(Item).EnvironmentPtr = EnvrnPtr::ZoneEnv; - state.dataPipeHT->PipeHT(Item).EnvrZonePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(6), state.dataHeatBal->Zone); + state.dataPipeHT->PipeHT(Item).EnvrZonePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(6), state.dataHeatBal->Zone); if (state.dataPipeHT->PipeHT(Item).EnvrZonePtr == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(6), state.dataIPShortCut->cAlphaArgs(6))); ShowContinueError(state, format("Entered in {}={}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -428,8 +426,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) // General user input data state.dataPipeHT->PipeHT(Item).Construction = state.dataIPShortCut->cAlphaArgs(2); - state.dataPipeHT->PipeHT(Item).ConstructionNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); + state.dataPipeHT->PipeHT(Item).ConstructionNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); if (state.dataPipeHT->PipeHT(Item).ConstructionNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); @@ -565,8 +562,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) // General user input data state.dataPipeHT->PipeHT(Item).Construction = state.dataIPShortCut->cAlphaArgs(2); - state.dataPipeHT->PipeHT(Item).ConstructionNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); + state.dataPipeHT->PipeHT(Item).ConstructionNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); if (state.dataPipeHT->PipeHT(Item).ConstructionNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); @@ -619,9 +615,9 @@ void GetPipesHeatTransfer(EnergyPlusData &state) // Solar inclusion flag // A6, \field Sun Exposure - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "SUNEXPOSED")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "SUNEXPOSED")) { state.dataPipeHT->PipeHT(Item).SolarExposed = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "NOSUN")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "NOSUN")) { state.dataPipeHT->PipeHT(Item).SolarExposed = false; } else { ShowSevereError(state, format("GetPipesHeatTransfer: invalid key for sun exposure flag for {}", state.dataIPShortCut->cAlphaArgs(1))); @@ -651,8 +647,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) // Also get the soil material name // A7, \field Soil Material state.dataPipeHT->PipeHT(Item).SoilMaterial = state.dataIPShortCut->cAlphaArgs(6); - state.dataPipeHT->PipeHT(Item).SoilMaterialNum = - UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(6), state.dataMaterial->Material); + state.dataPipeHT->PipeHT(Item).SoilMaterialNum = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(6), state.dataMaterial->Material); if (state.dataPipeHT->PipeHT(Item).SoilMaterialNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(6), state.dataPipeHT->PipeHT(Item).SoilMaterial)); ShowContinueError(state, format("Found in {}={}", cCurrentModuleObject, state.dataPipeHT->PipeHT(Item).Name)); @@ -1416,8 +1411,8 @@ void PipeHTData::CalcBuriedPipeSoil(EnergyPlusData &state) // Current Simulation // If on soil boundary, load up local variables and perform calculations NodePast = this->T(WidthIndex, DepthIndex, LengthIndex, TimeIndex::Previous); - PastNodeTempAbs = NodePast + Constant::KelvinConv; - SkyTempAbs = state.dataEnvrn->SkyTemp + Constant::KelvinConv; + PastNodeTempAbs = NodePast + Constant::Kelvin; + SkyTempAbs = state.dataEnvrn->SkyTemp + Constant::Kelvin; TopRoughness = this->SoilRoughness; TopThermAbs = this->SoilThermAbs; TopSolarAbs = this->SoilSolarAbs; diff --git a/src/EnergyPlus/Plant/EquipAndOperations.cc b/src/EnergyPlus/Plant/EquipAndOperations.cc index 77a2185d53e..9f692e66fc1 100644 --- a/src/EnergyPlus/Plant/EquipAndOperations.cc +++ b/src/EnergyPlus/Plant/EquipAndOperations.cc @@ -294,8 +294,8 @@ namespace DataPlant { for (int compNum = 1; compNum <= NumComps; ++compNum) { auto &this_equip(this->CoolingOnlyEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; - DataPlant::PlantEquipmentType Type = static_cast( - getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_equip.TypeOf))); + DataPlant::PlantEquipmentType Type = + static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); @@ -381,8 +381,7 @@ namespace DataPlant { auto &this_equip(this->HeatingOnlyEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; DataPlant::PlantEquipmentType Type; - Type = static_cast( - getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); @@ -471,8 +470,7 @@ namespace DataPlant { auto &this_equip(this->SimultHeatCoolCoolingEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; DataPlant::PlantEquipmentType Type; - Type = static_cast( - getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); @@ -560,8 +558,7 @@ namespace DataPlant { auto &this_equip(this->SimultHeatCoolHeatingEquipList(equipListNum).Comp(compNum)); PlantLocation compLoc; DataPlant::PlantEquipmentType Type; - Type = static_cast( - getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); bool errFlag1(false); int NumSearchResults(0); PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, compLoc, errFlag1, _, _, NumSearchResults); @@ -676,9 +673,9 @@ namespace DataPlant { bool founditCooling = false; bool founditHeating = false; for (auto &thisHP : state.dataEIRPlantLoopHeatPump->heatPumps) { - std::string const thisPLHPName = UtilityRoutines::makeUPPER(thisHP.name); + std::string const thisPLHPName = Util::makeUPPER(thisHP.name); // find cooling side heat pump - std::string const targetDedHRCoolName = UtilityRoutines::makeUPPER(this->DedicatedHR_ChWRetControl_Name); + std::string const targetDedHRCoolName = Util::makeUPPER(this->DedicatedHR_ChWRetControl_Name); if (thisPLHPName == targetDedHRCoolName) { // found it this->DedicatedHR_CoolingPLHP = thisHP; // store pointer to cooling side of heat pump founditCooling = true; @@ -725,7 +722,7 @@ namespace DataPlant { } // find heating side heat pump - std::string const targetDedHRHeatName = UtilityRoutines::makeUPPER(this->DedicatedHR_HWRetControl_Name); + std::string const targetDedHRHeatName = Util::makeUPPER(this->DedicatedHR_HWRetControl_Name); if (thisPLHPName == targetDedHRHeatName) { // found it this->DedicatedHR_HeatingPLHP = thisHP; // store pointer to heating side of heat pump founditHeating = true; diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 659ee7ecc1d..11c55b7a71b 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -379,17 +379,17 @@ void GetPlantLoopData(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); } - UtilityRoutines::IsNameEmpty(state, Alpha(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alpha(1), CurrentModuleObject, ErrorsFound); this_loop.Name = Alpha(1); // Load the Plant Loop Name - if (UtilityRoutines::SameString(Alpha(2), "STEAM")) { + if (Util::SameString(Alpha(2), "STEAM")) { this_loop.FluidType = DataLoopNode::NodeFluidType::Steam; this_loop.FluidName = Alpha(2); - } else if (UtilityRoutines::SameString(Alpha(2), "WATER")) { + } else if (Util::SameString(Alpha(2), "WATER")) { this_loop.FluidType = DataLoopNode::NodeFluidType::Water; this_loop.FluidName = Alpha(2); this_loop.FluidIndex = FindGlycol(state, Alpha(2)); - } else if (UtilityRoutines::SameString(Alpha(2), "USERDEFINEDFLUIDTYPE")) { + } else if (Util::SameString(Alpha(2), "USERDEFINEDFLUIDTYPE")) { this_loop.FluidType = DataLoopNode::NodeFluidType::Water; this_loop.FluidName = Alpha(3); // check for valid fluid name @@ -504,15 +504,15 @@ void GetPlantLoopData(EnergyPlusData &state) // Load the load distribution scheme. LoadingScheme = Alpha(14); - if (UtilityRoutines::SameString(LoadingScheme, "Optimal")) { + if (Util::SameString(LoadingScheme, "Optimal")) { this_loop.LoadDistribution = DataPlant::LoadingScheme::Optimal; - } else if (UtilityRoutines::SameString(LoadingScheme, "SequentialLoad")) { + } else if (Util::SameString(LoadingScheme, "SequentialLoad")) { this_loop.LoadDistribution = DataPlant::LoadingScheme::Sequential; - } else if (UtilityRoutines::SameString(LoadingScheme, "UniformLoad")) { + } else if (Util::SameString(LoadingScheme, "UniformLoad")) { this_loop.LoadDistribution = DataPlant::LoadingScheme::Uniform; - } else if (UtilityRoutines::SameString(LoadingScheme, "UniformPLR")) { + } else if (Util::SameString(LoadingScheme, "UniformPLR")) { this_loop.LoadDistribution = DataPlant::LoadingScheme::UniformPLR; - } else if (UtilityRoutines::SameString(LoadingScheme, "SequentialUniformPLR")) { + } else if (Util::SameString(LoadingScheme, "SequentialUniformPLR")) { this_loop.LoadDistribution = DataPlant::LoadingScheme::SequentialUniformPLR; } else { ShowWarningError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); @@ -524,9 +524,9 @@ void GetPlantLoopData(EnergyPlusData &state) // When dual setpoint is allowed in condenser loop modify this code. if (this_loop.TypeOfLoop == LoopType::Plant) { // Get the Loop Demand Calculation Scheme - if (UtilityRoutines::SameString(Alpha(16), "SingleSetpoint")) { + if (Util::SameString(Alpha(16), "SingleSetpoint")) { this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; - } else if (UtilityRoutines::SameString(Alpha(16), "DualSetpointDeadband")) { + } else if (Util::SameString(Alpha(16), "DualSetpointDeadband")) { if (this_loop.FluidType == DataLoopNode::NodeFluidType::Steam) { ShowWarningError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); ShowContinueError(state, @@ -538,7 +538,7 @@ void GetPlantLoopData(EnergyPlusData &state) } else { this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand; } - } else if (UtilityRoutines::SameString(Alpha(16), "")) { + } else if (Util::SameString(Alpha(16), "")) { this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; } else { ShowWarningError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); @@ -552,11 +552,11 @@ void GetPlantLoopData(EnergyPlusData &state) // When Commonpipe is allowed in condenser loop modify this code. Sankar 06/29/2009 if (this_loop.TypeOfLoop == LoopType::Plant) { - if (UtilityRoutines::SameString(Alpha(17), "CommonPipe")) { + if (Util::SameString(Alpha(17), "CommonPipe")) { this_loop.CommonPipeType = DataPlant::CommonPipeType::Single; - } else if (UtilityRoutines::SameString(Alpha(17), "TwoWayCommonPipe")) { + } else if (Util::SameString(Alpha(17), "TwoWayCommonPipe")) { this_loop.CommonPipeType = DataPlant::CommonPipeType::TwoWay; - } else if (UtilityRoutines::SameString(Alpha(17), "None") || state.dataIPShortCut->lAlphaFieldBlanks(17)) { + } else if (Util::SameString(Alpha(17), "None") || state.dataIPShortCut->lAlphaFieldBlanks(17)) { this_loop.CommonPipeType = DataPlant::CommonPipeType::No; } else { ShowSevereError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); @@ -599,7 +599,8 @@ void GetPlantLoopData(EnergyPlusData &state) MatchedPressureString = false; this_loop.PressureSimType = - static_cast(getEnumValue(PressureSimTypeNamesUC, UtilityRoutines::makeUPPER(Alpha(PressSimAlphaIndex)))); + static_cast(getEnumValue(PressureSimTypeNamesUC, Util::makeUPPER(Alpha(PressSimAlphaIndex)))); + switch (this_loop.PressureSimType) { // Check all types case DataPlant::PressSimType::NoPressure: @@ -876,7 +877,7 @@ void GetPlantInput(EnergyPlusData &state) this_comp.TypeOf = this_comp_type; this_comp.location = EnergyPlus::PlantLocation(LoopNum, LoopSideNum, BranchNum, CompNum); - this_comp.Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_comp_type))); + this_comp.Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_comp_type))); switch (this_comp.Type) { case PlantEquipmentType::Pipe: { @@ -2936,8 +2937,8 @@ void InitOneTimePlantSizingInfo(EnergyPlusData &state, int const LoopNum) // loo if (state.dataPlnt->PlantLoop(LoopNum).PlantSizNum == 0) { if (state.dataSize->NumPltSizInput > 0) { - PlantSizNum = UtilityRoutines::FindItemInList( - state.dataPlnt->PlantLoop(LoopNum).Name, state.dataSize->PlantSizData, &PlantSizingData::PlantLoopName); + PlantSizNum = + Util::FindItemInList(state.dataPlnt->PlantLoop(LoopNum).Name, state.dataSize->PlantSizData, &PlantSizingData::PlantLoopName); if (PlantSizNum > 0) { state.dataPlnt->PlantLoop(LoopNum).PlantSizNum = PlantSizNum; } @@ -2991,8 +2992,8 @@ void SizePlantLoop(EnergyPlusData &state, // PlantSizData(PlantSizNum)%DesVolFlowRate = 0.0D0 ! DSU2 } else { if (state.dataSize->NumPltSizInput > 0) { - PlantSizNum = UtilityRoutines::FindItemInList( - state.dataPlnt->PlantLoop(LoopNum).Name, state.dataSize->PlantSizData, &PlantSizingData::PlantLoopName); + PlantSizNum = + Util::FindItemInList(state.dataPlnt->PlantLoop(LoopNum).Name, state.dataSize->PlantSizData, &PlantSizingData::PlantLoopName); } } state.dataPlnt->PlantLoop(LoopNum).PlantSizNum = PlantSizNum; diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 249cca66c67..a386d8d401f 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -589,7 +589,7 @@ void GetWrapperInput(EnergyPlusData &state) // initialize nth chiller heater index (including identical units) for current wrapper int NumChHtrPerWrapper = 0; - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound)) { + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound)) { continue; } @@ -769,7 +769,7 @@ void GetWrapperInput(EnergyPlusData &state) if (state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectType == "CHILLERHEATERPERFORMANCE:ELECTRIC:EIR") { std::string CompName = state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperComponentName; - int CompIndex = UtilityRoutines::FindItemInList(CompName, state.dataPlantCentralGSHP->ChillerHeater); + int CompIndex = Util::FindItemInList(CompName, state.dataPlantCentralGSHP->ChillerHeater); // User may enter invalid name rather than selecting one from the object list if (CompIndex <= 0) { ShowSevereError(state, format("GetWrapperInput: Invalid Chiller Heater Modules Performance Component Name ={}", CompName)); @@ -1214,7 +1214,7 @@ void GetChillerHeaterInput(EnergyPlusData &state) state.dataIPShortCut->cNumericFieldNames); state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).Name = state.dataIPShortCut->cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, CHErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, CHErrorsFound); state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).CondModeCooling = state.dataIPShortCut->cAlphaArgs(4); @@ -1297,7 +1297,7 @@ void GetChillerHeaterInput(EnergyPlusData &state) } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "WaterCooled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "WaterCooled")) { state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).condenserType = CondenserType::WaterCooled; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index c2911270696..7e7264af2df 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -150,7 +150,7 @@ namespace PlantChillers { state.dataPlantChillers->GetElectricInput = false; } for (auto &thisChiller : state.dataPlantChillers->ElectricChiller) { - if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { + if (Util::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -204,7 +204,7 @@ namespace PlantChillers { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueChillerName(state, @@ -218,7 +218,7 @@ namespace PlantChillers { thisChiller.ChillerType = DataPlant::PlantEquipmentType::Chiller_Electric; thisChiller.CondenserType = static_cast( - getEnumValue(DataPlant::CondenserTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + getEnumValue(DataPlant::CondenserTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); switch (thisChiller.CondenserType) { case DataPlant::CondenserType::AirCooled: case DataPlant::CondenserType::WaterCooled: @@ -2139,7 +2139,7 @@ namespace PlantChillers { state.dataPlantChillers->GetEngineDrivenInput = false; } for (auto &thisChiller : state.dataPlantChillers->EngineDrivenChiller) { - if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { + if (Util::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -2228,7 +2228,7 @@ namespace PlantChillers { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueChillerName(state, @@ -4210,7 +4210,7 @@ namespace PlantChillers { state.dataPlantChillers->GetGasTurbineInput = false; } for (auto &thisChiller : state.dataPlantChillers->GTChiller) { - if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { + if (Util::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -4300,7 +4300,7 @@ namespace PlantChillers { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueChillerName(state, @@ -6203,7 +6203,7 @@ namespace PlantChillers { state.dataPlantChillers->GetConstCOPInput = false; } for (auto &thisChiller : state.dataPlantChillers->ConstCOPChiller) { - if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { + if (Util::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -6285,7 +6285,7 @@ namespace PlantChillers { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueChillerName(state, diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index e0755c8af3f..9acd8599553 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -489,7 +489,7 @@ namespace PlantComponentTemperatureSources { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataPlantCompTempSrc->WaterSource(SourceNum).Name = state.dataIPShortCut->cAlphaArgs(1); diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 997f1f2fa03..b92334143e1 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -375,7 +375,7 @@ void GetPlantOperationInput(EnergyPlusData &state, bool &GetInputOK) for (OpNum = 1; OpNum <= NumPlantOpSchemes; ++OpNum) { state.dataInputProcessing->inputProcessor->getObjectItem( state, CurrentModuleObject, OpNum, state.dataIPShortCut->cAlphaArgs, NumAlphas, state.dataIPShortCut->rNumericArgs, NumNums, IOStat); - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound)) continue; + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound)) continue; } CurrentModuleObject = "CondenserEquipmentOperationSchemes"; @@ -383,7 +383,7 @@ void GetPlantOperationInput(EnergyPlusData &state, bool &GetInputOK) for (OpNum = 1; OpNum <= NumCondOpSchemes; ++OpNum) { state.dataInputProcessing->inputProcessor->getObjectItem( state, CurrentModuleObject, OpNum, state.dataIPShortCut->cAlphaArgs, NumAlphas, state.dataIPShortCut->rNumericArgs, NumNums, IOStat); - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound)) continue; + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound)) continue; } // Load the Plant data structure @@ -844,7 +844,7 @@ void FindRangeBasedOrUncontrolledInput(EnergyPlusData &state, for (Num = 1; Num <= NumSchemes; ++Num) { state.dataInputProcessing->inputProcessor->getObjectItem( state, CurrentModuleObject, Num, AlphArray, NumAlphas, NumArray, NumNums, IOStat); - if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; + if (Util::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; if (Num == NumSchemes) { ShowSevereError(state, format("{} = \"{}\", could not find {} = \"{}\".", @@ -1068,7 +1068,7 @@ void FindDeltaTempRangeInput(EnergyPlusData &state, if (NumSchemes > 0) { for (Num = 1; Num <= NumSchemes; ++Num) { state.dataInputProcessing->inputProcessor->getObjectItem(state, cmoStr, Num, AlphArray, NumAlphas, NumArray, NumNums, IOStat); - if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; + if (Util::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; if (Num == NumSchemes) { ShowSevereError(state, format("{} = \"{}\", could not find {} = \"{}\".", @@ -1308,8 +1308,8 @@ void LoadEquipList(EnergyPlusData &state, FoundIntendedList = false; // find name in set of possible list for (Num = 1; Num <= state.dataPlantCondLoopOp->TotNumLists; ++Num) { - if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name, - state.dataPlantCondLoopOp->EquipListsNameList(Num))) { + if (Util::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name, + state.dataPlantCondLoopOp->EquipListsNameList(Num))) { FoundIntendedList = true; // get object item for real this time { @@ -1409,7 +1409,7 @@ void FindCompSPInput(EnergyPlusData &state, SchemeNameFound = true; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(CurrentModuleObject))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(CurrentModuleObject))); if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { LoopOpSchemeObj = "PlantEquipmentOperationSchemes"; @@ -1421,7 +1421,7 @@ void FindCompSPInput(EnergyPlusData &state, for (int Num = 1; Num <= NumSchemes; ++Num) { state.dataInputProcessing->inputProcessor->getObjectItem( state, CurrentModuleObject, Num, state.dataIPShortCut->cAlphaArgs, NumAlphas, state.dataIPShortCut->rNumericArgs, NumNums, IOStat); - if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, state.dataIPShortCut->cAlphaArgs(1))) break; + if (Util::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, state.dataIPShortCut->cAlphaArgs(1))) break; if (Num == NumSchemes) { ShowSevereError(state, format("{} = \"{}\", could not find {} = \"{}\".", @@ -1871,7 +1871,7 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, auto &instancesValue = schemeInstances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + auto const &thisObjectName = Util::makeUPPER(instance.key()); state.dataInputProcessing->inputProcessor->markObjectAsUsed(cCurrentModuleObject, thisObjectName); scheme.Name = thisObjectName; scheme.TypeOf = "PlantEquipmentOperation:ChillerHeaterChangeover"; @@ -1900,34 +1900,34 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, : (scheme.TempReset.BackupLowOutdoorTemp = scheme.TempReset.LowOutdoorTemp); auto const zoneNameList = fields.find("zone_load_polling_zonelist_name"); if (zoneNameList != fields.end()) { - scheme.ZoneListName = UtilityRoutines::makeUPPER(zoneNameList.value().get()); + scheme.ZoneListName = Util::makeUPPER(zoneNameList.value().get()); } auto const coolPlantEqOpCoolingLoad = fields.find("cooling_only_load_plant_equipment_operation_cooling_load_name"); if (coolPlantEqOpCoolingLoad != fields.end()) { - coolingOnlyLoadOpName = UtilityRoutines::makeUPPER(coolPlantEqOpCoolingLoad.value().get()); + coolingOnlyLoadOpName = Util::makeUPPER(coolPlantEqOpCoolingLoad.value().get()); } auto const heatPlantEqOpHeatingLoad = fields.find("heating_only_load_plant_equipment_operation_heating_load_name"); if (heatPlantEqOpHeatingLoad != fields.end()) { - heatingOnlyLoadOpName = UtilityRoutines::makeUPPER(heatPlantEqOpHeatingLoad.value().get()); + heatingOnlyLoadOpName = Util::makeUPPER(heatPlantEqOpHeatingLoad.value().get()); } auto const simulEqOpCoolingLoad = fields.find("simultaneous_cooling_and_heating_plant_equipment_operation_cooling_load_name"); if (simulEqOpCoolingLoad != fields.end()) { - simulHeatCoolCoolingOpName = UtilityRoutines::makeUPPER(simulEqOpCoolingLoad.value().get()); + simulHeatCoolCoolingOpName = Util::makeUPPER(simulEqOpCoolingLoad.value().get()); scheme.PlantOps.SimulHeatCoolCoolingOpInput = true; } auto const simulEqOpHeatingLoad = fields.find("simultaneous_cooling_and_heating_plant_equipment_operation_heating_load_name"); if (simulEqOpHeatingLoad != fields.end()) { - simultHeatCoolHeatingOpName = UtilityRoutines::makeUPPER(simulEqOpHeatingLoad.value().get()); + simultHeatCoolHeatingOpName = Util::makeUPPER(simulEqOpHeatingLoad.value().get()); scheme.PlantOps.SimultHeatCoolHeatingOpInput = true; } auto const dedicatedCWHPName = fields.find("dedicated_chilled_water_return_recovery_heat_pump_name"); if (dedicatedCWHPName != fields.end()) { - scheme.DedicatedHR_ChWRetControl_Name = UtilityRoutines::makeUPPER(dedicatedCWHPName.value().get()); + scheme.DedicatedHR_ChWRetControl_Name = Util::makeUPPER(dedicatedCWHPName.value().get()); scheme.PlantOps.DedicatedHR_ChWRetControl_Input = true; } auto const dedicatedHWHPName = fields.find("dedicated_hot_water_return_recovery_heat_pump_name"); if (dedicatedHWHPName != fields.end()) { - scheme.DedicatedHR_HWRetControl_Name = UtilityRoutines::makeUPPER(dedicatedHWHPName.value().get()); + scheme.DedicatedHR_HWRetControl_Name = Util::makeUPPER(dedicatedHWHPName.value().get()); scheme.PlantOps.DedicatedHR_HWRetControl_Input = true; } } @@ -1950,8 +1950,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, // process cooling only mode equipment lists and ranges for (auto instance = coolLoadInstancesValue.begin(); instance != coolLoadInstancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(coolingOnlyLoadOpName, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(coolingOnlyLoadOpName, thisObjectName)) continue; int numfields = fields.size(); scheme.PlantOps.NumCoolingOnlyEquipLists = (numfields - 1) / 3; // assume correctly formed field sets? @@ -1959,61 +1959,53 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, for (int listNum = 1; listNum <= scheme.PlantOps.NumCoolingOnlyEquipLists; ++listNum) { switch (listNum) { case 1: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_1_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_1_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_1_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_1_upper_limit").get(); } break; case 2: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_2_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_2_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_2_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_2_upper_limit").get(); } break; case 3: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_3_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_3_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_3_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_3_upper_limit").get(); } break; case 4: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_4_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_4_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_4_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_4_upper_limit").get(); } break; case 5: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_5_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_5_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_5_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_5_upper_limit").get(); } break; case 6: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_6_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_6_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_6_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_6_upper_limit").get(); } break; case 7: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_7_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_7_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_7_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_7_upper_limit").get(); } break; case 8: { - scheme.CoolingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_8_equipment_list_name").get()); + scheme.CoolingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_8_equipment_list_name").get()); scheme.CoolingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_8_lower_limit").get(); scheme.CoolingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_8_upper_limit").get(); @@ -2035,8 +2027,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, for (auto instance = equipListInstancesValue.begin(); instance != equipListInstancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(scheme.CoolingOnlyEquipList(listNum).Name, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(scheme.CoolingOnlyEquipList(listNum).Name, thisObjectName)) continue; auto extensibles = objectFields.find("equipment"); auto const &extensionSchemaProps = equipListObjectSchemaProps["equipment"]["items"]["properties"]; @@ -2060,8 +2052,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, // process heating only mode equipment lists and ranges for (auto instance = heatLoadInstancesValue.begin(); instance != heatLoadInstancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(heatingOnlyLoadOpName, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(heatingOnlyLoadOpName, thisObjectName)) continue; int numfields = fields.size(); scheme.PlantOps.NumHeatingOnlyEquipLists = (numfields - 1) / 3; // assume correctly formed field sets? @@ -2069,61 +2061,53 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, for (int listNum = 1; listNum <= scheme.PlantOps.NumHeatingOnlyEquipLists; ++listNum) { switch (listNum) { case 1: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_1_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_1_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_1_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_1_upper_limit").get(); } break; case 2: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_2_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_2_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_2_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_2_upper_limit").get(); } break; case 3: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_3_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_3_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_3_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_3_upper_limit").get(); } break; case 4: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_4_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_4_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_4_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_4_upper_limit").get(); } break; case 5: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_5_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_5_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_5_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_5_upper_limit").get(); } break; case 6: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_6_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_6_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_6_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_6_upper_limit").get(); } break; case 7: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_7_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_7_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_7_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_7_upper_limit").get(); } break; case 8: { - scheme.HeatingOnlyEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_8_equipment_list_name").get()); + scheme.HeatingOnlyEquipList(listNum).Name = Util::makeUPPER(fields.at("range_8_equipment_list_name").get()); scheme.HeatingOnlyEquipList(listNum).RangeLowerLimit = fields.at("load_range_8_lower_limit").get(); scheme.HeatingOnlyEquipList(listNum).RangeUpperLimit = fields.at("load_range_8_upper_limit").get(); @@ -2145,8 +2129,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, for (auto instance = equipListInstancesValue.begin(); instance != equipListInstancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(scheme.HeatingOnlyEquipList(listNum).Name, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(scheme.HeatingOnlyEquipList(listNum).Name, thisObjectName)) continue; auto extensibles = objectFields.find("equipment"); auto const &extensionSchemaProps = equipListObjectSchemaProps["equipment"]["items"]["properties"]; @@ -2171,8 +2155,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, for (auto instance = coolLoadInstancesValue.begin(); instance != coolLoadInstancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(simulHeatCoolCoolingOpName, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(simulHeatCoolCoolingOpName, thisObjectName)) continue; int numfields = fields.size(); scheme.PlantOps.NumSimultHeatCoolCoolingEquipLists = (numfields - 1) / 3; // assume correctly formed field sets? @@ -2181,14 +2165,14 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, switch (listNum) { case 1: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_1_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_1_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_1_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_1_upper_limit").get(); } break; case 2: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_2_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_2_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_2_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_2_upper_limit").get(); @@ -2196,7 +2180,7 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 3: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_3_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_3_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_3_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_3_upper_limit").get(); @@ -2204,21 +2188,21 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 4: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_4_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_4_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_4_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_4_upper_limit").get(); } break; case 5: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_5_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_5_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_5_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_5_upper_limit").get(); } break; case 6: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_6_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_6_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_6_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_6_upper_limit").get(); @@ -2226,7 +2210,7 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 7: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_7_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_7_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_7_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_7_upper_limit").get(); @@ -2234,7 +2218,7 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 8: { scheme.SimultHeatCoolCoolingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_8_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_8_equipment_list_name").get()); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeLowerLimit = fields.at("load_range_8_lower_limit").get(); scheme.SimultHeatCoolCoolingEquipList(listNum).RangeUpperLimit = fields.at("load_range_8_upper_limit").get(); @@ -2256,8 +2240,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, for (auto instance = equipListInstancesValue.begin(); instance != equipListInstancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(scheme.SimultHeatCoolCoolingEquipList(listNum).Name, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(scheme.SimultHeatCoolCoolingEquipList(listNum).Name, thisObjectName)) continue; auto extensibles = objectFields.find("equipment"); auto const &extensionSchemaProps = equipListObjectSchemaProps["equipment"]["items"]["properties"]; @@ -2282,8 +2266,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, for (auto instance = heatLoadInstancesValue.begin(); instance != heatLoadInstancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(simultHeatCoolHeatingOpName, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(simultHeatCoolHeatingOpName, thisObjectName)) continue; int numfields = fields.size(); scheme.PlantOps.NumSimultHeatCoolHeatingEquipLists = (numfields - 1) / 3; // assume correctly formed field sets? @@ -2292,14 +2276,14 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, switch (listNum) { case 1: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_1_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_1_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_1_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_1_upper_limit").get(); } break; case 2: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_2_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_2_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_2_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_2_upper_limit").get(); @@ -2307,7 +2291,7 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 3: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_3_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_3_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_3_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_3_upper_limit").get(); @@ -2315,21 +2299,21 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 4: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_4_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_4_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_4_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_4_upper_limit").get(); } break; case 5: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_5_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_5_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_5_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_5_upper_limit").get(); } break; case 6: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_6_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_6_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_6_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_6_upper_limit").get(); @@ -2337,7 +2321,7 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 7: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_7_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_7_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_7_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_7_upper_limit").get(); @@ -2345,7 +2329,7 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, case 8: { scheme.SimultHeatCoolHeatingEquipList(listNum).Name = - UtilityRoutines::makeUPPER(fields.at("range_8_equipment_list_name").get()); + Util::makeUPPER(fields.at("range_8_equipment_list_name").get()); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeLowerLimit = fields.at("load_range_8_lower_limit").get(); scheme.SimultHeatCoolHeatingEquipList(listNum).RangeUpperLimit = fields.at("load_range_8_upper_limit").get(); @@ -2372,8 +2356,8 @@ void GetChillerHeaterChangeoverOpSchemeInput(EnergyPlusData &state, auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - if (!UtilityRoutines::SameString(scheme.SimultHeatCoolHeatingEquipList(listNum).Name, thisObjectName)) continue; + auto const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(scheme.SimultHeatCoolHeatingEquipList(listNum).Name, thisObjectName)) continue; auto extensibles = objectFields.find("equipment"); auto const &extensionSchemaProps = objectSchemaProps["equipment"]["items"]["properties"]; @@ -2452,7 +2436,7 @@ void GetUserDefinedOpSchemeInput(EnergyPlusData &state, state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, state.dataIPShortCut->cAlphaArgs(1))) + if (Util::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, state.dataIPShortCut->cAlphaArgs(1))) break; // found the correct one if (Num == NumSchemes) { // did not find it ShowSevereError(state, @@ -2499,7 +2483,7 @@ void GetUserDefinedOpSchemeInput(EnergyPlusData &state, state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).EMSIntVarRemainingLoadValue); } } - StackMngrNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); + StackMngrNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).ErlSimProgramMngr = StackMngrNum; } else { @@ -2513,7 +2497,7 @@ void GetUserDefinedOpSchemeInput(EnergyPlusData &state, } } if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - StackMngrNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); + StackMngrNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).ErlInitProgramMngr = StackMngrNum; } else { @@ -2628,8 +2612,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, UtilityRoutines::makeUPPER(this_equip.TypeOf))); + Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, Util::makeUPPER(this_equip.TypeOf))); errFlag1 = false; PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, plantLoc, errFlag1, _, _, NumSearchResults, _, LoopNum); diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index 37574bee17b..9b5c299f0a2 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -222,7 +222,7 @@ void GetFluidHeatExchangerInput(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataPlantHXFluidToFluid->FluidHX(CompLoop).Name = cAlphaArgs(1); @@ -292,19 +292,19 @@ void GetFluidHeatExchangerInput(EnergyPlusData &state) state.dataPlantHXFluidToFluid->FluidHX(CompLoop).SupplySideLoop.DesignVolumeFlowRateWasAutoSized = true; } - if (UtilityRoutines::SameString(cAlphaArgs(7), "CrossFlowBothUnMixed")) { + if (Util::SameString(cAlphaArgs(7), "CrossFlowBothUnMixed")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).HeatExchangeModelType = FluidHXType::CrossFlowBothUnMixed; - } else if (UtilityRoutines::SameString(cAlphaArgs(7), "CrossFlowBothMixed")) { + } else if (Util::SameString(cAlphaArgs(7), "CrossFlowBothMixed")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).HeatExchangeModelType = FluidHXType::CrossFlowBothMixed; - } else if (UtilityRoutines::SameString(cAlphaArgs(7), "CrossFlowSupplyMixedDemandUnMixed")) { + } else if (Util::SameString(cAlphaArgs(7), "CrossFlowSupplyMixedDemandUnMixed")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).HeatExchangeModelType = FluidHXType::CrossFlowSupplyLoopMixedDemandLoopUnMixed; - } else if (UtilityRoutines::SameString(cAlphaArgs(7), "CrossFlowSupplyUnMixedDemandMixed")) { + } else if (Util::SameString(cAlphaArgs(7), "CrossFlowSupplyUnMixedDemandMixed")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).HeatExchangeModelType = FluidHXType::CrossFlowSupplyLoopUnMixedDemandLoopMixed; - } else if (UtilityRoutines::SameString(cAlphaArgs(7), "CounterFlow")) { + } else if (Util::SameString(cAlphaArgs(7), "CounterFlow")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).HeatExchangeModelType = FluidHXType::CounterFlow; - } else if (UtilityRoutines::SameString(cAlphaArgs(7), "ParallelFlow")) { + } else if (Util::SameString(cAlphaArgs(7), "ParallelFlow")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).HeatExchangeModelType = FluidHXType::ParallelFlow; - } else if (UtilityRoutines::SameString(cAlphaArgs(7), "Ideal")) { + } else if (Util::SameString(cAlphaArgs(7), "Ideal")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).HeatExchangeModelType = FluidHXType::Ideal; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid entry.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -325,29 +325,29 @@ void GetFluidHeatExchangerInput(EnergyPlusData &state) } } - if (UtilityRoutines::SameString(cAlphaArgs(8), "UncontrolledOn")) { + if (Util::SameString(cAlphaArgs(8), "UncontrolledOn")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::UncontrolledOn; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "OperationSchemeModulated")) { + } else if (Util::SameString(cAlphaArgs(8), "OperationSchemeModulated")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::OperationSchemeModulated; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "OperationSchemeOnOff")) { + } else if (Util::SameString(cAlphaArgs(8), "OperationSchemeOnOff")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::OperationSchemeOnOff; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "HeatingSetpointModulated")) { + } else if (Util::SameString(cAlphaArgs(8), "HeatingSetpointModulated")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::HeatingSetPointModulated; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "HeatingSetpointOnOff")) { + } else if (Util::SameString(cAlphaArgs(8), "HeatingSetpointOnOff")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::HeatingSetPointOnOff; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "CoolingSetpointModulated")) { + } else if (Util::SameString(cAlphaArgs(8), "CoolingSetpointModulated")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::CoolingSetPointModulated; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "CoolingSetpointOnOff")) { + } else if (Util::SameString(cAlphaArgs(8), "CoolingSetpointOnOff")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::CoolingSetPointOnOff; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "DualDeadbandSetpointModulated")) { + } else if (Util::SameString(cAlphaArgs(8), "DualDeadbandSetpointModulated")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::DualDeadBandSetPointModulated; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "DualDeadbandSetpointOnOff")) { + } else if (Util::SameString(cAlphaArgs(8), "DualDeadbandSetpointOnOff")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::DualDeadBandSetPointOnOff; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "CoolingDifferentialOnOff")) { + } else if (Util::SameString(cAlphaArgs(8), "CoolingDifferentialOnOff")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::CoolingDifferentialOnOff; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "CoolingSetpointOnOffWithComponentOverride")) { + } else if (Util::SameString(cAlphaArgs(8), "CoolingSetpointOnOffWithComponentOverride")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::CoolingSetPointOnOffWithComponentOverride; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "TrackComponentOnOff")) { + } else if (Util::SameString(cAlphaArgs(8), "TrackComponentOnOff")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).controlMode = ControlType::TrackComponentOnOff; } else { ShowSevereError(state, format("{}{}=\"{}\", invalid entry.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -488,11 +488,11 @@ void GetFluidHeatExchangerInput(EnergyPlusData &state) } if (!lAlphaFieldBlanks(13)) { - if (UtilityRoutines::SameString(cAlphaArgs(13), "WetBulbTemperature")) { + if (Util::SameString(cAlphaArgs(13), "WetBulbTemperature")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).ControlSignalTemp = CtrlTempType::WetBulbTemperature; - } else if (UtilityRoutines::SameString(cAlphaArgs(13), "DryBulbTemperature")) { + } else if (Util::SameString(cAlphaArgs(13), "DryBulbTemperature")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).ControlSignalTemp = CtrlTempType::DryBulbTemperature; - } else if (UtilityRoutines::SameString(cAlphaArgs(13), "Loop")) { + } else if (Util::SameString(cAlphaArgs(13), "Loop")) { state.dataPlantHXFluidToFluid->FluidHX(CompLoop).ControlSignalTemp = CtrlTempType::LoopTemperature; } } else { diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index e495480945a..9acaec05da9 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -405,14 +405,14 @@ void GetPlantProfileInput(EnergyPlusData &state) _, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataPlantLoadProfile->PlantProfile(ProfileNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataPlantLoadProfile->PlantProfile(ProfileNum).Type = DataPlant::PlantEquipmentType::PlantLoadProfile; // parameter assigned in DataPlant - state.dataPlantLoadProfile->PlantProfile(ProfileNum).FluidType = static_cast( - getEnumValue(PlantLoopFluidTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + state.dataPlantLoadProfile->PlantProfile(ProfileNum).FluidType = + static_cast(getEnumValue(PlantLoopFluidTypeNamesUC, Util::makeUPPER(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 33911525ca6..6bba4901573 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1174,7 +1174,7 @@ PlantComponent *EIRPlantLoopHeatPump::factory(EnergyPlusData &state, DataPlant:: } for (auto &plhp : state.dataEIRPlantLoopHeatPump->heatPumps) { - if (plhp.name == UtilityRoutines::makeUPPER(hp_name) && plhp.EIRHPType == hp_type) { + if (plhp.name == Util::makeUPPER(hp_name) && plhp.EIRHPType == hp_type) { return &plhp; } } @@ -1187,12 +1187,12 @@ void EIRPlantLoopHeatPump::pairUpCompanionCoils(EnergyPlusData &state) { for (auto &thisHP : state.dataEIRPlantLoopHeatPump->heatPumps) { if (!thisHP.companionCoilName.empty()) { - std::string const thisCoilName = UtilityRoutines::makeUPPER(thisHP.name); + std::string const thisCoilName = Util::makeUPPER(thisHP.name); DataPlant::PlantEquipmentType thisCoilType = thisHP.EIRHPType; - std::string const targetCompanionName = UtilityRoutines::makeUPPER(thisHP.companionCoilName); + std::string const targetCompanionName = Util::makeUPPER(thisHP.companionCoilName); for (auto &potentialCompanionCoil : state.dataEIRPlantLoopHeatPump->heatPumps) { DataPlant::PlantEquipmentType potentialCompanionType = potentialCompanionCoil.EIRHPType; - std::string potentialCompanionName = UtilityRoutines::makeUPPER(potentialCompanionCoil.name); + std::string potentialCompanionName = Util::makeUPPER(potentialCompanionCoil.name); if (potentialCompanionName == thisCoilName) { // skip the current coil continue; @@ -1254,7 +1254,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) for (auto const &classToInput : classesToInput) { cCurrentModuleObject = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(cCurrentModuleObject))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(cCurrentModuleObject))); int numPLHP = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); if (numPLHP > 0) { auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); @@ -1268,14 +1268,14 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) EIRPlantLoopHeatPump thisPLHP; thisPLHP.EIRHPType = classToInput.thisType; - thisPLHP.name = UtilityRoutines::makeUPPER(thisObjectName); - std::string loadSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("load_side_inlet_node_name").get()); - std::string loadSideOutletNodeName = UtilityRoutines::makeUPPER(fields.at("load_side_outlet_node_name").get()); - std::string condenserType = UtilityRoutines::makeUPPER(fields.at("condenser_type").get()); - std::string sourceSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("source_side_inlet_node_name").get()); - std::string sourceSideOutletNodeName = UtilityRoutines::makeUPPER(fields.at("source_side_outlet_node_name").get()); - thisPLHP.companionCoilName = UtilityRoutines::makeUPPER( - state.dataInputProcessing->inputProcessor->getAlphaFieldValue(fields, schemaProps, "companion_heat_pump_name")); + thisPLHP.name = Util::makeUPPER(thisObjectName); + std::string loadSideInletNodeName = Util::makeUPPER(fields.at("load_side_inlet_node_name").get()); + std::string loadSideOutletNodeName = Util::makeUPPER(fields.at("load_side_outlet_node_name").get()); + std::string condenserType = Util::makeUPPER(fields.at("condenser_type").get()); + std::string sourceSideInletNodeName = Util::makeUPPER(fields.at("source_side_inlet_node_name").get()); + std::string sourceSideOutletNodeName = Util::makeUPPER(fields.at("source_side_outlet_node_name").get()); + thisPLHP.companionCoilName = + Util::makeUPPER(state.dataInputProcessing->inputProcessor->getAlphaFieldValue(fields, schemaProps, "companion_heat_pump_name")); thisPLHP.loadSideDesignVolFlowRate = state.dataInputProcessing->inputProcessor->getRealFieldValue(fields, schemaProps, "load_side_reference_flow_rate"); @@ -1299,24 +1299,23 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) thisPLHP.sizingFactor = state.dataInputProcessing->inputProcessor->getRealFieldValue(fields, schemaProps, "sizing_factor"); - std::string const capFtName = - UtilityRoutines::makeUPPER(fields.at("capacity_modifier_function_of_temperature_curve_name").get()); + std::string const capFtName = Util::makeUPPER(fields.at("capacity_modifier_function_of_temperature_curve_name").get()); thisPLHP.capFuncTempCurveIndex = Curve::GetCurveIndex(state, capFtName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLHP (name={}; entered curve name: {}", thisPLHP.name, capFtName)); errorsFound = true; } - std::string const eirFtName = UtilityRoutines::makeUPPER( - fields.at("electric_input_to_output_ratio_modifier_function_of_temperature_curve_name").get()); + std::string const eirFtName = + Util::makeUPPER(fields.at("electric_input_to_output_ratio_modifier_function_of_temperature_curve_name").get()); thisPLHP.powerRatioFuncTempCurveIndex = Curve::GetCurveIndex(state, eirFtName); if (thisPLHP.powerRatioFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLHP (name={}; entered curve name: {}", thisPLHP.name, eirFtName)); errorsFound = true; } - std::string const eirFplrName = UtilityRoutines::makeUPPER( - fields.at("electric_input_to_output_ratio_modifier_function_of_part_load_ratio_curve_name").get()); + std::string const eirFplrName = + Util::makeUPPER(fields.at("electric_input_to_output_ratio_modifier_function_of_part_load_ratio_curve_name").get()); thisPLHP.powerRatioFuncPLRCurveIndex = Curve::GetCurveIndex(state, eirFplrName); if (thisPLHP.powerRatioFuncPLRCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLHP (name={}; entered curve name: {}", thisPLHP.name, eirFplrName)); @@ -1334,17 +1333,17 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) auto const minimumSupplyWaterTempCurveName = fields.find("minimum_supply_water_temperature_curve_name"); if (minimumSupplyWaterTempCurveName != fields.end()) { thisPLHP.minSupplyWaterTempCurveIndex = - Curve::GetCurveIndex(state, UtilityRoutines::makeUPPER(minimumSupplyWaterTempCurveName.value().get())); + Curve::GetCurveIndex(state, Util::makeUPPER(minimumSupplyWaterTempCurveName.value().get())); } auto const maximumSupplyWaterTempCurveName = fields.find("maximum_supply_water_temperature_curve_name"); if (maximumSupplyWaterTempCurveName != fields.end()) { thisPLHP.maxSupplyWaterTempCurveIndex = - Curve::GetCurveIndex(state, UtilityRoutines::makeUPPER(maximumSupplyWaterTempCurveName.value().get())); + Curve::GetCurveIndex(state, Util::makeUPPER(maximumSupplyWaterTempCurveName.value().get())); } std::string flowControlTypeName = - UtilityRoutines::makeUPPER(state.dataInputProcessing->inputProcessor->getAlphaFieldValue(fields, schemaProps, "flow_mode")); + Util::makeUPPER(state.dataInputProcessing->inputProcessor->getAlphaFieldValue(fields, schemaProps, "flow_mode")); thisPLHP.flowControl = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, flowControlTypeName)); // fields only in heating object @@ -1359,8 +1358,8 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) "HEATINGCAPACITY", "COOLINGCAPACITY", "GREATEROFHEATINGORCOOLING"}; auto const heatSizingType = fields.find("heat_pump_sizing_method"); if (heatSizingType != fields.end()) { - thisPLHP.heatSizingMethod = static_cast( - getEnumValue(PLHPHeatSizTypeNamesUC, UtilityRoutines::makeUPPER(heatSizingType.value().get()))); + thisPLHP.heatSizingMethod = + static_cast(getEnumValue(PLHPHeatSizTypeNamesUC, Util::makeUPPER(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) { @@ -1373,15 +1372,15 @@ 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, UtilityRoutines::makeUPPER(controlType.value().get()))); + thisPLHP.sysControlType = + static_cast(getEnumValue(PLHPCtrlTypeNamesUC, Util::makeUPPER(controlType.value().get()))); } else { thisPLHP.sysControlType = ControlType::Load; } auto const capacityDryAirCurveName = fields.find("dry_outdoor_correction_factor_curve_name"); if (capacityDryAirCurveName != fields.end()) { thisPLHP.capacityDryAirCurveIndex = - Curve::GetCurveIndex(state, UtilityRoutines::makeUPPER(capacityDryAirCurveName.value().get())); + Curve::GetCurveIndex(state, Util::makeUPPER(capacityDryAirCurveName.value().get())); } constexpr std::array(DefrostControl::Num)> PLHPDefrostTypeNamesUC = { @@ -1389,7 +1388,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) auto const defrostControlStrategy = fields.find("heat_pump_defrost_control"); if (defrostControlStrategy != fields.end()) { thisPLHP.defrostStrategy = static_cast( - getEnumValue(PLHPDefrostTypeNamesUC, UtilityRoutines::makeUPPER(defrostControlStrategy.value().get()))); + getEnumValue(PLHPDefrostTypeNamesUC, Util::makeUPPER(defrostControlStrategy.value().get()))); } else { thisPLHP.defrostStrategy = DefrostControl::None; } @@ -1418,25 +1417,24 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) auto const timedEmpiricalDefFreqStratCurveName = fields.find("timed_empirical_defrost_frequency_curve_name"); if (timedEmpiricalDefFreqStratCurveName != fields.end()) { thisPLHP.defrostFreqCurveIndex = - Curve::GetCurveIndex(state, UtilityRoutines::makeUPPER(timedEmpiricalDefFreqStratCurveName.value().get())); + Curve::GetCurveIndex(state, Util::makeUPPER(timedEmpiricalDefFreqStratCurveName.value().get())); } auto const timedEmpiricalDefHeatLoadPenaltyCurveName = fields.find("timed_empirical_defrost_heat_load_penalty_curve_name"); if (timedEmpiricalDefHeatLoadPenaltyCurveName != fields.end()) { - thisPLHP.defrostHeatLoadCurveIndex = Curve::GetCurveIndex( - state, UtilityRoutines::makeUPPER(timedEmpiricalDefHeatLoadPenaltyCurveName.value().get())); + thisPLHP.defrostHeatLoadCurveIndex = + Curve::GetCurveIndex(state, Util::makeUPPER(timedEmpiricalDefHeatLoadPenaltyCurveName.value().get())); thisPLHP.defrostLoadCurveDims = state.dataCurveManager->PerfCurve(thisPLHP.defrostHeatLoadCurveIndex)->numDims; } auto const defrostHeatEnergyCurveIndexCurveName = fields.find("timed_empirical_defrost_heat_input_energy_fraction_curve_name"); if (defrostHeatEnergyCurveIndexCurveName != fields.end()) { thisPLHP.defrostHeatEnergyCurveIndex = - Curve::GetCurveIndex(state, UtilityRoutines::makeUPPER(defrostHeatEnergyCurveIndexCurveName.value().get())); + Curve::GetCurveIndex(state, Util::makeUPPER(defrostHeatEnergyCurveIndexCurveName.value().get())); thisPLHP.defrostEnergyCurveDims = state.dataCurveManager->PerfCurve(thisPLHP.defrostHeatEnergyCurveIndex)->numDims; } } else if (thisPLHP.EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRHeating) { // used for Timed or OnDemand auto const defEIRFTCurveName = fields.find("defrost_energy_input_ratio_function_of_temperature_curve_name"); if (defEIRFTCurveName != fields.end()) { - thisPLHP.defrostEIRFTIndex = - Curve::GetCurveIndex(state, UtilityRoutines::makeUPPER(defEIRFTCurveName.value().get())); + thisPLHP.defrostEIRFTIndex = Curve::GetCurveIndex(state, Util::makeUPPER(defEIRFTCurveName.value().get())); } } @@ -2353,7 +2351,7 @@ PlantComponent *EIRFuelFiredHeatPump::factory(EnergyPlusData &state, DataPlant:: } for (auto &plhp : state.dataEIRFuelFiredHeatPump->heatPumps) { - if (plhp.name == UtilityRoutines::makeUPPER(hp_name) && plhp.EIRHPType == hp_type) { + if (plhp.name == Util::makeUPPER(hp_name) && plhp.EIRHPType == hp_type) { return &plhp; } } @@ -2366,12 +2364,12 @@ void EIRFuelFiredHeatPump::pairUpCompanionCoils(EnergyPlusData &state) { for (auto &thisHP : state.dataEIRFuelFiredHeatPump->heatPumps) { if (!thisHP.companionCoilName.empty()) { - std::string thisCoilName = UtilityRoutines::makeUPPER(thisHP.name); + std::string thisCoilName = Util::makeUPPER(thisHP.name); DataPlant::PlantEquipmentType thisCoilType = thisHP.EIRHPType; - std::string targetCompanionName = UtilityRoutines::makeUPPER(thisHP.companionCoilName); + std::string targetCompanionName = Util::makeUPPER(thisHP.companionCoilName); for (auto &potentialCompanionCoil : state.dataEIRFuelFiredHeatPump->heatPumps) { DataPlant::PlantEquipmentType potentialCompanionType = potentialCompanionCoil.EIRHPType; - std::string potentialCompanionName = UtilityRoutines::makeUPPER(potentialCompanionCoil.name); + std::string potentialCompanionName = Util::makeUPPER(potentialCompanionCoil.name); if (potentialCompanionName == thisCoilName) { // skip the current coil continue; @@ -2436,7 +2434,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) cCurrentModuleObject = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(cCurrentModuleObject))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(cCurrentModuleObject))); auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); if (instances == state.dataInputProcessing->inputProcessor->epJSON.end()) continue; @@ -2457,27 +2455,27 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } // A1-A3 - thisPLHP.name = UtilityRoutines::makeUPPER(thisObjectName); - std::string loadSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("water_inlet_node_name").get()); - std::string loadSideOutletNodeName = UtilityRoutines::makeUPPER(fields.at("water_outlet_node_name").get()); + thisPLHP.name = Util::makeUPPER(thisObjectName); + std::string loadSideInletNodeName = Util::makeUPPER(fields.at("water_inlet_node_name").get()); + std::string loadSideOutletNodeName = Util::makeUPPER(fields.at("water_outlet_node_name").get()); // Implicit - // std::string condenserType = "AIRSOURCE"; // UtilityRoutines::makeUPPER(fields.at("condenser_type").get()); + // std::string condenserType = "AIRSOURCE"; // Util::makeUPPER(fields.at("condenser_type").get()); thisPLHP.airSource = true; thisPLHP.waterSource = false; // A4 - std::string sourceSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("air_source_node_name").get()); - // UtilityRoutines::makeUPPER(fields.at("source_side_outlet_node_name").get()); + std::string sourceSideInletNodeName = Util::makeUPPER(fields.at("air_source_node_name").get()); + // Util::makeUPPER(fields.at("source_side_outlet_node_name").get()); std::string sourceSideOutletNodeName = format("{}_SOURCE_SIDE_OUTLET_NODE", thisPLHP.name); // A5 auto compCoilFound = fields.find(companionCoilFieldTag); if (compCoilFound != fields.end()) { // optional field - thisPLHP.companionCoilName = UtilityRoutines::makeUPPER(compCoilFound.value().get()); + thisPLHP.companionCoilName = Util::makeUPPER(compCoilFound.value().get()); } // A6 Fuel Type - std::string tempRsrStr = UtilityRoutines::makeUPPER(fields.at("fuel_type").get()); + std::string tempRsrStr = Util::makeUPPER(fields.at("fuel_type").get()); thisPLHP.fuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, tempRsrStr)); // Validate fuel type input static constexpr std::string_view RoutineName("processInputForEIRPLHP: "); @@ -2490,7 +2488,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } // A7 End use category - thisPLHP.endUseSubcat = UtilityRoutines::makeUPPER(fields.at("end_use_subcategory").get()); + thisPLHP.endUseSubcat = Util::makeUPPER(fields.at("end_use_subcategory").get()); if (thisPLHP.endUseSubcat == "") { thisPLHP.endUseSubcat = "Heat Pump Fuel Fired"; // or "General"? } @@ -2556,20 +2554,19 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A8 flow mode thisPLHP.flowMode = static_cast( - getEnumValue(DataPlant::FlowModeNamesUC, UtilityRoutines::makeUPPER(fields.at("flow_mode").get()))); + getEnumValue(DataPlant::FlowModeNamesUC, Util::makeUPPER(fields.at("flow_mode").get()))); // A9 outdoor_air_temperature_curve_input_variable - std::string oaTempCurveInputVar = - UtilityRoutines::makeUPPER(fields.at("outdoor_air_temperature_curve_input_variable").get()); + std::string oaTempCurveInputVar = Util::makeUPPER(fields.at("outdoor_air_temperature_curve_input_variable").get()); thisPLHP.oaTempCurveInputVar = static_cast(getEnumValue(OATempCurveVarNamesUC, oaTempCurveInputVar)); // A10 water_temperature_curve_input_variable - std::string waterTempCurveInputVar = UtilityRoutines::makeUPPER(fields.at("water_temperature_curve_input_variable").get()); + std::string waterTempCurveInputVar = Util::makeUPPER(fields.at("water_temperature_curve_input_variable").get()); thisPLHP.waterTempCurveInputVar = static_cast(getEnumValue(WaterTempCurveVarNamesUC, waterTempCurveInputVar)); // A11 normalized_capacity_function_of_temperature_curve_name - std::string const &capFtName = - UtilityRoutines::makeUPPER(fields.at("normalized_capacity_function_of_temperature_curve_name").get()); + std::string const &capFtName = Util::makeUPPER(fields.at("normalized_capacity_function_of_temperature_curve_name").get()); + thisPLHP.capFuncTempCurveIndex = Curve::GetCurveIndex(state, capFtName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLFFHP (name={}; entered curve name: {}", thisPLHP.name, capFtName)); @@ -2578,15 +2575,14 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A12 fuel_energy_input_ratio_function_of_temperature_curve_name std::string const &eirFtName = - UtilityRoutines::makeUPPER(fields.at("fuel_energy_input_ratio_function_of_temperature_curve_name").get()); + Util::makeUPPER(fields.at("fuel_energy_input_ratio_function_of_temperature_curve_name").get()); thisPLHP.powerRatioFuncTempCurveIndex = Curve::GetCurveIndex(state, eirFtName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLFFHP (name={}; entered curve name: {}", thisPLHP.name, eirFtName)); errorsFound = true; } // A13 fuel_energy_input_ratio_function_of_plr_curve_name - std::string const &eirFplrName = - UtilityRoutines::makeUPPER(fields.at("fuel_energy_input_ratio_function_of_plr_curve_name").get()); + std::string const &eirFplrName = Util::makeUPPER(fields.at("fuel_energy_input_ratio_function_of_plr_curve_name").get()); thisPLHP.powerRatioFuncPLRCurveIndex = Curve::GetCurveIndex(state, eirFplrName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLFFHP (name={}; entered curve name: {}", thisPLHP.name, eirFplrName)); @@ -2627,7 +2623,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } else { auto eirDefrostCurveFound = fields.find("fuel_energy_input_ratio_defrost_adjustment_curve_name"); if (eirDefrostCurveFound != fields.end()) { - std::string const eirDefrostCurveName = UtilityRoutines::makeUPPER(eirDefrostCurveFound.value().get()); + std::string const eirDefrostCurveName = Util::makeUPPER(eirDefrostCurveFound.value().get()); thisPLHP.defrostEIRCurveIndex = Curve::GetCurveIndex(state, eirDefrostCurveName); if (thisPLHP.defrostEIRCurveIndex == 0) { ShowSevereError( @@ -2643,8 +2639,8 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) if (thisPLHP.EIRHPType == DataPlant::PlantEquipmentType::HeatPumpFuelFiredCooling) { thisPLHP.defrostType = DefrostType::Invalid; } else { - thisPLHP.defrostType = static_cast( - getEnumValue(DefrostTypeNamesUC, UtilityRoutines::makeUPPER(fields.at("defrost_control_type").get()))); + thisPLHP.defrostType = + static_cast(getEnumValue(DefrostTypeNamesUC, Util::makeUPPER(fields.at("defrost_control_type").get()))); if (thisPLHP.defrostType == DefrostType::Invalid) { thisPLHP.defrostType = DefrostType::OnDemand; // set to default thisPLHP.defrostOpTimeFrac = 0.0; @@ -2714,7 +2710,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A16 cycling_ratio_factor_curve_name auto crfCurveFound = fields.find("cycling_ratio_factor_curve_name"); if (crfCurveFound != fields.end()) { - std::string const cycRatioCurveName = UtilityRoutines::makeUPPER(crfCurveFound.value().get()); + std::string const cycRatioCurveName = Util::makeUPPER(crfCurveFound.value().get()); thisPLHP.cycRatioCurveIndex = Curve::GetCurveIndex(state, cycRatioCurveName); if (thisPLHP.cycRatioCurveIndex == 0) { ShowSevereError(state, @@ -2743,7 +2739,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A17 auxiliary_electric_energy_input_ratio_function_of_temperature_curve_name auto auxElecEIRFTCurveFound = fields.find("auxiliary_electric_energy_input_ratio_function_of_temperature_curve_name"); if (auxElecEIRFTCurveFound != fields.end()) { - std::string const &auxEIRFTName = UtilityRoutines::makeUPPER(auxElecEIRFTCurveFound.value().get()); + std::string const &auxEIRFTName = Util::makeUPPER(auxElecEIRFTCurveFound.value().get()); thisPLHP.auxElecEIRFoTempCurveIndex = Curve::GetCurveIndex(state, auxEIRFTName); if (thisPLHP.auxElecEIRFoTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR FFHP (name={}; entered curve name: {}", thisPLHP.name, auxEIRFTName)); @@ -2756,7 +2752,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A18 auxiliary_electric_energy_input_ratio_function_of_plr_curve_name auto auxElecEIRFPLRCurveFound = fields.find("auxiliary_electric_energy_input_ratio_function_of_plr_curve_name"); if (auxElecEIRFPLRCurveFound != fields.end()) { - std::string const &auxEIRFPLRName = UtilityRoutines::makeUPPER(auxElecEIRFPLRCurveFound.value().get()); + std::string const &auxEIRFPLRName = Util::makeUPPER(auxElecEIRFPLRCurveFound.value().get()); thisPLHP.auxElecEIRFoPLRCurveIndex = Curve::GetCurveIndex(state, auxEIRFPLRName); if (thisPLHP.auxElecEIRFoPLRCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR FFHP (name={}; entered curve name: {}", thisPLHP.name, auxEIRFPLRName)); diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 7e9e1359905..b0f0a2d0a19 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -516,7 +516,7 @@ namespace PlantPipingSystemsManager { // Get the name, validate thisDomain.Name = state.dataIPShortCut->cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // Mesh extents, validated by IP thisDomain.Extents.xMax = state.dataIPShortCut->rNumericArgs(1); thisDomain.Extents.yMax = state.dataIPShortCut->rNumericArgs(2); @@ -622,9 +622,9 @@ namespace PlantPipingSystemsManager { thisDomain.Moisture.Theta_sat = state.dataIPShortCut->rNumericArgs(14) / 100.0; // check if there is a basement - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "YES")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "YES")) { thisDomain.HasBasement = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "NO")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "NO")) { thisDomain.HasBasement = false; } else { IssueSevereInputFieldError(state, @@ -680,9 +680,9 @@ namespace PlantPipingSystemsManager { // check for dimension shift CurIndex = 8; - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(CurIndex), "YES")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(CurIndex), "YES")) { thisDomain.BasementZone.ShiftPipesByWidth = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(CurIndex), "NO")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(CurIndex), "NO")) { thisDomain.BasementZone.ShiftPipesByWidth = false; } else { IssueSevereInputFieldError(state, @@ -699,7 +699,7 @@ namespace PlantPipingSystemsManager { CurIndex = 9; thisDomain.BasementZone.WallBoundaryOSCMName = state.dataIPShortCut->cAlphaArgs(CurIndex); thisDomain.BasementZone.WallBoundaryOSCMIndex = - UtilityRoutines::FindItemInList(thisDomain.BasementZone.WallBoundaryOSCMName, state.dataSurface->OSCM); + Util::FindItemInList(thisDomain.BasementZone.WallBoundaryOSCMName, state.dataSurface->OSCM); if (thisDomain.BasementZone.WallBoundaryOSCMIndex <= 0) { IssueSevereInputFieldError(state, RoutineName, @@ -729,7 +729,7 @@ namespace PlantPipingSystemsManager { CurIndex = 10; thisDomain.BasementZone.FloorBoundaryOSCMName = state.dataIPShortCut->cAlphaArgs(CurIndex); thisDomain.BasementZone.FloorBoundaryOSCMIndex = - UtilityRoutines::FindItemInList(thisDomain.BasementZone.FloorBoundaryOSCMName, state.dataSurface->OSCM); + Util::FindItemInList(thisDomain.BasementZone.FloorBoundaryOSCMName, state.dataSurface->OSCM); if (thisDomain.BasementZone.FloorBoundaryOSCMIndex <= 0) { IssueSevereInputFieldError(state, RoutineName, @@ -866,9 +866,9 @@ namespace PlantPipingSystemsManager { thisDomain.VertInsDepth = state.dataIPShortCut->rNumericArgs(11); // Set flag for slab in-grade or slab on-grade - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "INGRADE")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "INGRADE")) { thisDomain.SlabInGradeFlag = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "ONGRADE")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "ONGRADE")) { thisDomain.SlabInGradeFlag = false; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5))); @@ -878,8 +878,8 @@ namespace PlantPipingSystemsManager { // Get slab material properties if (thisDomain.SlabInGradeFlag) { - thisDomain.SlabMaterialNum = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(6), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + thisDomain.SlabMaterialNum = + Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(6), state.dataMaterial->Material, state.dataMaterial->TotMaterials); if (thisDomain.SlabMaterialNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(6), state.dataIPShortCut->cAlphaArgs(6))); ShowContinueError(state, format("Found in: {}", thisDomain.Name)); @@ -894,9 +894,9 @@ namespace PlantPipingSystemsManager { // set flag for horizontal insulation if (thisDomain.SlabInGradeFlag) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "NO")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "NO")) { thisDomain.HorizInsPresentFlag = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "YES")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "YES")) { thisDomain.HorizInsPresentFlag = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(7), state.dataIPShortCut->cAlphaArgs(7))); @@ -907,8 +907,8 @@ namespace PlantPipingSystemsManager { // Get horizontal insulation material properties if (thisDomain.HorizInsPresentFlag) { - thisDomain.HorizInsMaterialNum = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(8), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + thisDomain.HorizInsMaterialNum = + Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(8), state.dataMaterial->Material, state.dataMaterial->TotMaterials); if (thisDomain.HorizInsMaterialNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(8), state.dataIPShortCut->cAlphaArgs(8))); ShowContinueError(state, format("Found in: {}", thisDomain.Name)); @@ -926,7 +926,7 @@ namespace PlantPipingSystemsManager { } // Set flag for horizontal insulation extents - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "PERIMETER")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "PERIMETER")) { thisDomain.FullHorizInsPresent = false; // Horizontal insulation perimeter width if (thisDomain.HorizInsWidth <= 0.0) { @@ -934,7 +934,7 @@ namespace PlantPipingSystemsManager { ShowContinueError(state, format("Found in: {}", thisDomain.Name)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "FULL")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "FULL")) { thisDomain.FullHorizInsPresent = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(9), state.dataIPShortCut->cAlphaArgs(9))); @@ -944,9 +944,9 @@ namespace PlantPipingSystemsManager { } // set flag for vertical insulation - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "NO")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "NO")) { thisDomain.VertInsPresentFlag = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "YES")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "YES")) { thisDomain.VertInsPresentFlag = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(10), state.dataIPShortCut->cAlphaArgs(10))); @@ -956,8 +956,8 @@ namespace PlantPipingSystemsManager { // Get vertical insulation material properties if (thisDomain.VertInsPresentFlag) { - thisDomain.VertInsMaterialNum = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(11), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + thisDomain.VertInsMaterialNum = + Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(11), state.dataMaterial->Material, state.dataMaterial->TotMaterials); if (thisDomain.VertInsMaterialNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(11), state.dataIPShortCut->cAlphaArgs(11))); ShowContinueError(state, format("Found in: {}", thisDomain.Name)); @@ -983,9 +983,9 @@ namespace PlantPipingSystemsManager { } // Set simulation interval flag - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(12), "TIMESTEP")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(12), "TIMESTEP")) { thisDomain.SimTimeStepFlag = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(12), "HOURLY")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(12), "HOURLY")) { thisDomain.SimHourlyFlag = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(12), state.dataIPShortCut->cAlphaArgs(12))); @@ -999,7 +999,7 @@ namespace PlantPipingSystemsManager { thisDomain.HasZoneCoupledSlab = true; // get boundary condition model names and indices -- error check - thisDomain.ZoneCoupledOSCMIndex = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataSurface->OSCM); + thisDomain.ZoneCoupledOSCMIndex = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataSurface->OSCM); if (thisDomain.ZoneCoupledOSCMIndex <= 0) { IssueSevereInputFieldError(state, RoutineName, @@ -1185,7 +1185,7 @@ namespace PlantPipingSystemsManager { CurIndex = 4; thisDomain.BasementZone.FloorBoundaryOSCMName = state.dataIPShortCut->cAlphaArgs(CurIndex); thisDomain.BasementZone.FloorBoundaryOSCMIndex = - UtilityRoutines::FindItemInList(thisDomain.BasementZone.FloorBoundaryOSCMName, state.dataSurface->OSCM); + Util::FindItemInList(thisDomain.BasementZone.FloorBoundaryOSCMName, state.dataSurface->OSCM); if (thisDomain.BasementZone.FloorBoundaryOSCMIndex <= 0) { IssueSevereInputFieldError(state, RoutineName, @@ -1217,7 +1217,7 @@ namespace PlantPipingSystemsManager { CurIndex = 8; thisDomain.BasementZone.WallBoundaryOSCMName = state.dataIPShortCut->cAlphaArgs(CurIndex); thisDomain.BasementZone.WallBoundaryOSCMIndex = - UtilityRoutines::FindItemInList(thisDomain.BasementZone.WallBoundaryOSCMName, state.dataSurface->OSCM); + Util::FindItemInList(thisDomain.BasementZone.WallBoundaryOSCMName, state.dataSurface->OSCM); if (thisDomain.BasementZone.WallBoundaryOSCMIndex <= 0) { IssueSevereInputFieldError(state, RoutineName, @@ -1275,9 +1275,9 @@ namespace PlantPipingSystemsManager { // set flag for horizontal insulation // Check state.dataIPShortCut->cAlphaArgs value - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "NO")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "NO")) { thisDomain.HorizInsPresentFlag = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "YES")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "YES")) { thisDomain.HorizInsPresentFlag = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5))); @@ -1287,8 +1287,8 @@ namespace PlantPipingSystemsManager { // Get horizontal insulation material properties if (thisDomain.HorizInsPresentFlag) { - thisDomain.HorizInsMaterialNum = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(6), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + thisDomain.HorizInsMaterialNum = + Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(6), state.dataMaterial->Material, state.dataMaterial->TotMaterials); if (thisDomain.HorizInsMaterialNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(6), state.dataIPShortCut->cAlphaArgs(6))); ShowContinueError(state, format("Found in: {}", thisDomain.Name)); @@ -1306,7 +1306,7 @@ namespace PlantPipingSystemsManager { } // Set flag for horizontal insulation extents - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "PERIMETER")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "PERIMETER")) { thisDomain.FullHorizInsPresent = false; // Horizontal insulation perimeter width if (thisDomain.HorizInsWidth <= 0.0) { @@ -1314,7 +1314,7 @@ namespace PlantPipingSystemsManager { ShowContinueError(state, format("Found in: {}", thisDomain.Name)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "FULL")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "FULL")) { thisDomain.FullHorizInsPresent = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(7), state.dataIPShortCut->cAlphaArgs(7))); @@ -1324,9 +1324,9 @@ namespace PlantPipingSystemsManager { } // set flag for vertical insulation - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "NO")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "NO")) { thisDomain.VertInsPresentFlag = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "YES")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "YES")) { thisDomain.VertInsPresentFlag = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(9), state.dataIPShortCut->cAlphaArgs(9))); @@ -1342,8 +1342,8 @@ namespace PlantPipingSystemsManager { ShowContinueError(state, format("Found in: {}", thisDomain.Name)); ErrorsFound = true; } - thisDomain.VertInsMaterialNum = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(10), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + thisDomain.VertInsMaterialNum = + Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(10), state.dataMaterial->Material, state.dataMaterial->TotMaterials); if (thisDomain.VertInsMaterialNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(10), state.dataIPShortCut->cAlphaArgs(10))); ShowContinueError(state, format("Found in: {}", thisDomain.Name)); @@ -1362,9 +1362,9 @@ namespace PlantPipingSystemsManager { } // Set simulation interval flag - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(11), "TIMESTEP")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(11), "TIMESTEP")) { thisDomain.SimTimeStepFlag = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(11), "HOURLY")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(11), "HOURLY")) { thisDomain.SimHourlyFlag = true; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(11), state.dataIPShortCut->cAlphaArgs(11))); @@ -1481,7 +1481,7 @@ namespace PlantPipingSystemsManager { // Get the name, validate thisCircuit.Name = state.dataIPShortCut->cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // Read pipe thermal properties, validated by IP thisCircuit.PipeProperties.Conductivity = state.dataIPShortCut->rNumericArgs(1); @@ -1765,7 +1765,7 @@ namespace PlantPipingSystemsManager { // Get the name, validate thisSegment.Name = state.dataIPShortCut->cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // Read in the pipe location, validated as positive by IP // -- note that these values will be altered by the main GetInput routine in two ways: // 1) shift for basement wall if selected @@ -1842,7 +1842,7 @@ namespace PlantPipingSystemsManager { // Get the name, validate std::string thisTrenchName = state.dataIPShortCut->cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); int const NumPipeSegments = static_cast(state.dataIPShortCut->rNumericArgs(3)); Real64 const thisInterPipeSpacing = state.dataIPShortCut->rNumericArgs(4); diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 404a8f97cc8..7a6a2b81ed1 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -1685,7 +1685,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 (UtilityRoutines::SameString(CompName, this_component.Name)) { + if (Util::SameString(CompName, this_component.Name)) { FoundCompName = true; if (present(InletNodeNumber)) { if (InletNodeNumber > 0) { @@ -1974,8 +1974,8 @@ int MyPlantSizingIndex(EnergyPlusData &state, if (MyPltLoopNum > 0) { if (state.dataSize->NumPltSizInput > 0) { - MyPltSizNum = UtilityRoutines::FindItemInList( - state.dataPlnt->PlantLoop(MyPltLoopNum).Name, state.dataSize->PlantSizData, &PlantSizingData::PlantLoopName); + MyPltSizNum = + Util::FindItemInList(state.dataPlnt->PlantLoop(MyPltLoopNum).Name, state.dataSize->PlantSizData, &PlantSizingData::PlantLoopName); } if (MyPltSizNum == 0) { if (PrintErrorFlag) { diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 7389ba6a34a..dc55cf482d2 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -144,12 +144,12 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); - std::string const objNameUC = UtilityRoutines::makeUPPER(thisObjectName); + std::string const objNameUC = Util::makeUPPER(thisObjectName); // no need to validate name, the JSON will validate that. state.dataInputProcessing->inputProcessor->markObjectAsUsed(sOutputVariable, thisObjectName); std::string varName = fields.at("python_plugin_variable_name").get(); - std::string avgOrSum = UtilityRoutines::makeUPPER(fields.at("type_of_data_in_variable").get()); - std::string updateFreq = UtilityRoutines::makeUPPER(fields.at("update_frequency").get()); + std::string avgOrSum = Util::makeUPPER(fields.at("type_of_data_in_variable").get()); + std::string updateFreq = Util::makeUPPER(fields.at("update_frequency").get()); std::string units; if (fields.find("units") != fields.end()) { units = fields.at("units").get(); @@ -222,7 +222,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) "For metered variables, the resource type, group type, and end use category must be defined"); EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } - std::string const resourceType = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("resource_type").get()); + std::string const resourceType = EnergyPlus::Util::makeUPPER(fields.at("resource_type").get()); std::string sResourceType; if (resourceType == "WATERUSE") { sResourceType = "Water"; @@ -259,7 +259,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) "For metered variables, the resource type, group type, and end use category must be defined"); EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } - std::string const groupType = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("group_type").get()); + std::string const groupType = EnergyPlus::Util::makeUPPER(fields.at("group_type").get()); std::string sGroupType; if (groupType == "BUILDING") { sGroupType = "Building"; @@ -282,7 +282,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) "For metered variables, the resource type, group type, and end use category must be defined"); EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } - std::string const endUse = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("end_use_category").get()); + std::string const endUse = EnergyPlus::Util::makeUPPER(fields.at("end_use_category").get()); std::string sEndUse; if (endUse == "HEATING") { sEndUse = "Heating"; @@ -464,8 +464,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s state.dataInputProcessing->inputProcessor->markObjectAsUsed(sPaths, thisObjectName); std::string workingDirFlagUC = "YES"; try { - workingDirFlagUC = - EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_current_working_directory_to_search_path").get()); + workingDirFlagUC = EnergyPlus::Util::makeUPPER(fields.at("add_current_working_directory_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } @@ -474,7 +473,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s } std::string inputFileDirFlagUC = "YES"; try { - inputFileDirFlagUC = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_input_file_directory_to_search_path").get()); + inputFileDirFlagUC = EnergyPlus::Util::makeUPPER(fields.at("add_input_file_directory_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } @@ -484,7 +483,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s std::string epInDirFlagUC = "YES"; try { - epInDirFlagUC = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_epin_environment_variable_to_search_path").get()); + epInDirFlagUC = EnergyPlus::Util::makeUPPER(fields.at("add_epin_environment_variable_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } @@ -553,7 +552,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s state.dataInputProcessing->inputProcessor->markObjectAsUsed(sPlugins, thisObjectName); fs::path modulePath(fields.at("python_module_name").get()); std::string className = fields.at("plugin_class_name").get(); - std::string const sWarmup = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("run_during_warmup_days").get()); + std::string const sWarmup = EnergyPlus::Util::makeUPPER(fields.at("run_during_warmup_days").get()); bool const warmup = (sWarmup == "YES"); state.dataPluginManager->plugins.emplace_back(modulePath, className, thisObjectName, warmup); } @@ -615,7 +614,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - std::string const &thisObjectName = EnergyPlus::UtilityRoutines::makeUPPER(instance.key()); + std::string const &thisObjectName = EnergyPlus::Util::makeUPPER(instance.key()); state.dataInputProcessing->inputProcessor->markObjectAsUsed(sGlobals, thisObjectName); std::string variableName = fields.at("name_of_a_python_plugin_variable").get(); int variableIndex = EnergyPlus::PluginManagement::PluginManager::getGlobalVariableHandle(state, variableName); @@ -1166,7 +1165,7 @@ void PluginManager::addToPythonPath([[maybe_unused]] EnergyPlusData &state, #if LINK_WITH_PYTHON void PluginManager::addGlobalVariable(EnergyPlusData &state, const std::string &name) { - std::string const varNameUC = EnergyPlus::UtilityRoutines::makeUPPER(name); + std::string const varNameUC = EnergyPlus::Util::makeUPPER(name); state.dataPluginManager->globalVariableNames.push_back(varNameUC); state.dataPluginManager->globalVariableValues.push_back(Real64()); this->maxGlobalVariableIndex++; @@ -1180,7 +1179,7 @@ void PluginManager::addGlobalVariable([[maybe_unused]] EnergyPlusData &state, [[ #if LINK_WITH_PYTHON int PluginManager::getGlobalVariableHandle(EnergyPlusData &state, const std::string &name, bool const suppress_warning) { // note zero is a valid handle - std::string const varNameUC = EnergyPlus::UtilityRoutines::makeUPPER(name); + std::string const varNameUC = EnergyPlus::Util::makeUPPER(name); auto const it = std::find(state.dataPluginManager->globalVariableNames.begin(), state.dataPluginManager->globalVariableNames.end(), varNameUC); if (it != state.dataPluginManager->globalVariableNames.end()) { return std::distance(state.dataPluginManager->globalVariableNames.begin(), it); @@ -1210,7 +1209,7 @@ int PluginManager::getGlobalVariableHandle([[maybe_unused]] EnergyPlusData &stat #if LINK_WITH_PYTHON int PluginManager::getTrendVariableHandle(EnergyPlusData &state, const std::string &name) { - std::string const varNameUC = EnergyPlus::UtilityRoutines::makeUPPER(name); + std::string const varNameUC = EnergyPlus::Util::makeUPPER(name); for (size_t i = 0; i < state.dataPluginManager->trends.size(); i++) { auto &thisTrend = state.dataPluginManager->trends[i]; if (thisTrend.name == varNameUC) { @@ -1407,7 +1406,7 @@ int PluginManager::getLocationOfUserDefinedPlugin(EnergyPlusData &state, std::st { for (size_t handle = 0; handle < state.dataPluginManager->plugins.size(); handle++) { auto const &thisPlugin = state.dataPluginManager->plugins[handle]; - if (UtilityRoutines::makeUPPER(thisPlugin.emsAlias) == UtilityRoutines::makeUPPER(_programName)) { + if (Util::makeUPPER(thisPlugin.emsAlias) == Util::makeUPPER(_programName)) { return handle; } } diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index a95d71b30db..b35399af228 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -277,7 +277,7 @@ void GetPollutionFactorInput(EnergyPlusData &state) state.dataIPShortCut->cNumericFieldNames); FuelType.FuelTypeNames(Loop) = - static_cast(getEnumValue(Constant::eFuelNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); + static_cast(getEnumValue(Constant::eFuelNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); switch (FuelType.FuelTypeNames(Loop)) { case Constant::eFuel::NaturalGas: { diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index f13eca75d5b..aa6e4bc2f15 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -553,8 +553,8 @@ Real64 PondGroundHeatExchangerData::CalcTotalFLux(EnergyPlusData &state, Real64 } // absolute temperatures - Real64 SurfTempAbs = PondBulkTemp + Constant::KelvinConv; // absolute value of surface temp - Real64 SkyTempAbs = state.dataEnvrn->SkyTemp + Constant::KelvinConv; // absolute value of sky temp + Real64 SurfTempAbs = PondBulkTemp + Constant::Kelvin; // absolute value of surface temp + Real64 SkyTempAbs = state.dataEnvrn->SkyTemp + Constant::Kelvin; // absolute value of sky temp // ASHRAE simple convection coefficient model for external surfaces. Real64 ConvCoef = Convect::CalcASHRAESimpExtConvCoeff(Material::SurfaceRoughness::VeryRough, DataEnvironment::WindSpeedAt(state, PondHeight)); diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 537827e7551..fbd68daec25 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -152,7 +152,7 @@ void SimPIU(EnergyPlusData &state, // Get the powered induction unit index if (CompIndex == 0) { - PIUNum = UtilityRoutines::FindItemInList(CompName, state.dataPowerInductionUnits->PIU); + PIUNum = Util::FindItemInList(CompName, state.dataPowerInductionUnits->PIU); if (PIUNum == 0) { ShowFatalError(state, format("SimPIU: PIU Unit not found={}", CompName)); } @@ -316,8 +316,7 @@ void GetPIUs(EnergyPlusData &state) thisPIU.MaxTotAirVolFlow = state.dataIPShortCut->rNumericArgs(1); thisPIU.MaxPriAirVolFlow = state.dataIPShortCut->rNumericArgs(2); thisPIU.MinPriAirFlowFrac = state.dataIPShortCut->rNumericArgs(3); - - thisPIU.HCoilType = static_cast(getEnumValue(HCoilNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + thisPIU.HCoilType = static_cast(getEnumValue(HCoilNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); switch (thisPIU.HCoilType) { case HtgCoilType::SimpleHeating: { thisPIU.HCoil_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; @@ -553,12 +552,12 @@ void GetPIUs(EnergyPlusData &state) thisPIU.MaxSecAirVolFlow = state.dataIPShortCut->rNumericArgs(2); thisPIU.MinPriAirFlowFrac = state.dataIPShortCut->rNumericArgs(3); thisPIU.FanOnFlowFrac = state.dataIPShortCut->rNumericArgs(4); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:WATER")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:WATER")) { thisPIU.HCoilType = HtgCoilType::SimpleHeating; thisPIU.HCoil_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:FUEL")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:FUEL")) { thisPIU.HCoilType = HtgCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:STEAM")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:STEAM")) { thisPIU.HCoilType = HtgCoilType::SteamAirHeating; thisPIU.HCoil_PlantType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; thisPIU.HCoil_FluidIndex = FindRefrigerant(state, "Steam"); @@ -570,7 +569,7 @@ void GetPIUs(EnergyPlusData &state) ErrorsFound = true; SteamMessageNeeded = false; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:ELECTRIC")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:ELECTRIC")) { thisPIU.HCoilType = HtgCoilType::Electric; } else { ShowSevereError(state, format("Illegal {} = {}", state.dataIPShortCut->cAlphaFieldNames(9), state.dataIPShortCut->cAlphaArgs(9))); @@ -1117,7 +1116,7 @@ void SizePIU(EnergyPlusData &state, int const PIUNum) // get system sizing id if a sizing run has been done for this system if (SizingDesRunThisAirSys) { - SysSizNum = UtilityRoutines::FindItemInList( + SysSizNum = Util::FindItemInList( state.dataSize->FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) { SysSizNum = 1; // use first when none applicable @@ -1322,7 +1321,7 @@ void SizePIU(EnergyPlusData &state, int const PIUNum) } } else { CheckZoneSizing(state, thisPIU.UnitType, thisPIU.Name); - if (UtilityRoutines::SameString(HCoilNamesUC[static_cast(thisPIU.HCoilType)], "Coil:Heating:Water")) { + 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); @@ -1422,7 +1421,7 @@ 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 (UtilityRoutines::SameString(HCoilNames[static_cast(thisPIU.HCoilType)], "Coil:Heating:Steam")) { + 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); @@ -2119,7 +2118,7 @@ bool PIUnitHasMixer(EnergyPlusData &state, std::string_view CompName) // compone } if (state.dataPowerInductionUnits->NumPIUs > 0) { - int const ItemNum = UtilityRoutines::FindItemInList(CompName, state.dataPowerInductionUnits->PIU, &PowIndUnitData::MixerName); + int const ItemNum = Util::FindItemInList(CompName, state.dataPowerInductionUnits->PIU, &PowIndUnitData::MixerName); if (ItemNum > 0) { YesNo = true; } diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 0134ab9f98c..f6dd0315fd9 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -742,7 +742,7 @@ namespace Psychrometrics { #endif // Convert temperature from Centigrade to Kelvin. - Real64 const Tkel(T + Constant::KelvinConv); // Dry-bulb in REAL(r64) for function passing + Real64 const Tkel(T + Constant::Kelvin); // Dry-bulb in REAL(r64) for function passing // If below -100C,set value of Pressure corresponding to Saturation Temperature of -100C. if (Tkel < 173.15) { diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index b8778a96823..ad8b6b6d3f9 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -537,7 +537,7 @@ namespace Psychrometrics { // Wylan & Sontag, Fundamentals of Classical Thermodynamics. // ASHRAE handbook 1985 Fundamentals, Ch. 6, eqn. (6),(26) - Real64 const rhoair(pb / (287.0 * (tdb + Constant::KelvinConv) * (1.0 + 1.6077687 * max(dw, 1.0e-5)))); + Real64 const rhoair(pb / (287.0 * (tdb + Constant::Kelvin) * (1.0 + 1.6077687 * max(dw, 1.0e-5)))); #ifdef EP_psych_errors if (rhoair < 0.0) PsyRhoAirFnPbTdbW_error(state, pb, tdb, dw, rhoair, CalledFrom); #endif @@ -568,7 +568,7 @@ namespace Psychrometrics { // Wylan & Sontag, Fundamentals of Classical Thermodynamics. // ASHRAE handbook 1985 Fundamentals, Ch. 6, eqn. (6),(26) - return (pb / (287.0 * (tdb + Constant::KelvinConv) * (1.0 + 1.6077687 * std::max(dw, 1.0e-5)))); + return (pb / (287.0 * (tdb + Constant::Kelvin) * (1.0 + 1.6077687 * std::max(dw, 1.0e-5)))); } inline Real64 PsyRhoAirFnPbTdbW_fast([[maybe_unused]] EnergyPlusData &state, @@ -579,7 +579,7 @@ namespace Psychrometrics { { // Faster version with humidity ratio already adjusted assert(dw >= 1.0e-5); - Real64 const rhoair(pb / (287.0 * (tdb + Constant::KelvinConv) * (1.0 + 1.6077687 * dw))); + Real64 const rhoair(pb / (287.0 * (tdb + Constant::Kelvin) * (1.0 + 1.6077687 * dw))); #ifdef EP_psych_errors if (rhoair < 0.0) PsyRhoAirFnPbTdbW_error(state, pb, tdb, dw, rhoair); #endif @@ -775,8 +775,7 @@ namespace Psychrometrics { // REFERENCES: // ASHRAE handbook 1993 Fundamentals, - return RH / (461.52 * (Tdb + Constant::KelvinConv)) * - std::exp(23.7093 - 4111.0 / ((Tdb + Constant::KelvinConv) - 35.45)); // Vapor density in air + return RH / (461.52 * (Tdb + Constant::Kelvin)) * std::exp(23.7093 - 4111.0 / ((Tdb + Constant::Kelvin) - 35.45)); // Vapor density in air } inline Real64 PsyRhovFnTdbWPb(Real64 const Tdb, // dry-bulb temperature {C} @@ -802,7 +801,7 @@ namespace Psychrometrics { // ASHRAE handbook 1993 Fundamentals, Real64 const W(max(dW, 1.0e-5)); // humidity ratio - return W * PB / (461.52 * (Tdb + Constant::KelvinConv) * (W + 0.62198)); + return W * PB / (461.52 * (Tdb + Constant::Kelvin) * (W + 0.62198)); } inline Real64 PsyRhovFnTdbWPb_fast(Real64 const Tdb, // dry-bulb temperature {C} @@ -812,7 +811,7 @@ namespace Psychrometrics { { // Faster version with humidity ratio already adjusted assert(dW >= 1.0e-5); - return dW * PB / (461.52 * (Tdb + Constant::KelvinConv) * (dW + 0.62198)); + return dW * PB / (461.52 * (Tdb + Constant::Kelvin) * (dW + 0.62198)); } #ifdef EP_psych_errors @@ -853,9 +852,8 @@ namespace Psychrometrics { ++state.dataPsychCache->NumTimesCalled[static_cast(PsychrometricFunction::RhFnTdbRhovLBnd0C)]; #endif - Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + Constant::KelvinConv) * - std::exp(-23.7093 + 4111.0 / ((Tdb + Constant::KelvinConv) - 35.45)) - : 0.0); + Real64 const RHValue( + Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + Constant::Kelvin) * std::exp(-23.7093 + 4111.0 / ((Tdb + Constant::Kelvin) - 35.45)) : 0.0); if ((RHValue < 0.0) || (RHValue > 1.0)) { #ifdef EP_psych_errors @@ -1147,7 +1145,7 @@ namespace Psychrometrics { // Used values from Table 2, HOF 2005, Chapter 6, to verify that these values match (at saturation) // values from PsyRhFnTdbWPb - return (PsyPsatFnTemp(state, Tdb, CalledFrom) * RH) / (461.52 * (Tdb + Constant::KelvinConv)); // Vapor density in air + return (PsyPsatFnTemp(state, Tdb, CalledFrom) * RH) / (461.52 * (Tdb + Constant::Kelvin)); // Vapor density in air } #ifdef EP_psych_errors @@ -1189,7 +1187,7 @@ namespace Psychrometrics { ++state.dataPsychCache->NumTimesCalled[static_cast(PsychrometricFunction::RhFnTdbRhov)]; #endif - Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + Constant::KelvinConv) / + Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + Constant::Kelvin) / PsyPsatFnTemp(state, Tdb, PsyRoutineNames[static_cast(PsychrometricFunction::RhFnTdbRhov)]) : 0.0); diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 075471b7345..c229f23b58c 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -149,7 +149,7 @@ void SimPumps(EnergyPlusData &state, // Setup pump component index if needed if (PumpIndex == 0) { - PumpNum = UtilityRoutines::FindItemInList(PumpName, state.dataPumps->PumpEquip); // Determine which pump to simulate + PumpNum = Util::FindItemInList(PumpName, state.dataPumps->PumpEquip); // Determine which pump to simulate if (PumpNum == 0) { ShowFatalError(state, format("ManagePumps: Pump requested not found ={}", PumpName)); // Catch any bad names before crashing } @@ -319,8 +319,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, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(4))); @@ -408,7 +407,7 @@ void GetPumpInput(EnergyPlusData &state) } else { thisPump.HasVFD = true; thisPump.VFD.VFDControlType = - static_cast(getEnumValue(controlTypeVFDNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(7)))); + static_cast(getEnumValue(controlTypeVFDNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(7)))); switch (thisPump.VFD.VFDControlType) { case ControlTypeVFD::VFDManual: { thisPump.VFD.ManualRPMSchedIndex = GetScheduleIndex(state, thisInput->cAlphaArgs(8)); @@ -468,7 +467,7 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(13)) { // zone named for pump skin losses - thisPump.ZoneNum = UtilityRoutines::FindItemInList(thisInput->cAlphaArgs(13), state.dataHeatBal->Zone); + thisPump.ZoneNum = Util::FindItemInList(thisInput->cAlphaArgs(13), state.dataHeatBal->Zone); if (thisPump.ZoneNum > 0) { thisPump.HeatLossesToZone = true; if (!thisInput->lNumericFieldBlanks(12)) { @@ -486,8 +485,8 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(14)) { - thisPump.powerSizingMethod = static_cast( - getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); + thisPump.powerSizingMethod = + static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(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.", @@ -587,8 +586,8 @@ void GetPumpInput(EnergyPlusData &state) thisPump.Energy = 0.0; thisPump.Power = 0.0; - thisPump.PumpControl = - static_cast(getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(4))); @@ -637,7 +636,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.RotSpeed = thisPump.RotSpeed_RPM / 60.0; // convert input[rpm] to calculation units[rps] if (!thisInput->lAlphaFieldBlanks(7)) { // zone named for pump skin losses - thisPump.ZoneNum = UtilityRoutines::FindItemInList(thisInput->cAlphaArgs(7), state.dataHeatBal->Zone); + thisPump.ZoneNum = Util::FindItemInList(thisInput->cAlphaArgs(7), state.dataHeatBal->Zone); if (thisPump.ZoneNum > 0) { thisPump.HeatLossesToZone = true; if (!thisInput->lNumericFieldBlanks(8)) { @@ -655,8 +654,8 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(8)) { - thisPump.powerSizingMethod = static_cast( - getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + thisPump.powerSizingMethod = + static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(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.", @@ -756,7 +755,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.PartLoadCoef[3] = thisInput->rNumericArgs(9); if (!thisInput->lAlphaFieldBlanks(5)) { // zone named for pump skin losses - thisPump.ZoneNum = UtilityRoutines::FindItemInList(thisInput->cAlphaArgs(5), state.dataHeatBal->Zone); + thisPump.ZoneNum = Util::FindItemInList(thisInput->cAlphaArgs(5), state.dataHeatBal->Zone); if (thisPump.ZoneNum > 0) { thisPump.HeatLossesToZone = true; if (!thisInput->lNumericFieldBlanks(10)) { @@ -788,8 +787,8 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(6)) { - thisPump.powerSizingMethod = static_cast( - getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + thisPump.powerSizingMethod = + static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(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.", @@ -860,11 +859,11 @@ void GetPumpInput(EnergyPlusData &state) ObjectIsNotParent); TestCompSet(state, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaArgs(2), thisInput->cAlphaArgs(3), "Water Nodes"); - if (UtilityRoutines::SameString(thisInput->cAlphaArgs(4), "Optimal")) { + if (Util::SameString(thisInput->cAlphaArgs(4), "Optimal")) { thisPump.SequencingScheme = PumpBankControlSeq::OptimalScheme; - } else if (UtilityRoutines::SameString(thisInput->cAlphaArgs(4), "Sequential")) { + } else if (Util::SameString(thisInput->cAlphaArgs(4), "Sequential")) { thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; - } else if (UtilityRoutines::SameString(thisInput->cAlphaArgs(4), "SupplyEquipmentAssigned")) { + } else if (Util::SameString(thisInput->cAlphaArgs(4), "SupplyEquipmentAssigned")) { thisPump.SequencingScheme = PumpBankControlSeq::UserDefined; } else { ShowWarningError(state, @@ -875,8 +874,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; } - thisPump.PumpControl = - static_cast(getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(5))); @@ -916,7 +914,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.MinVolFlowRate = thisPump.NomVolFlowRate * thisPump.MinVolFlowRateFrac; if (!thisInput->lAlphaFieldBlanks(7)) { // zone named for pump skin losses - thisPump.ZoneNum = UtilityRoutines::FindItemInList(thisInput->cAlphaArgs(7), state.dataHeatBal->Zone); + thisPump.ZoneNum = Util::FindItemInList(thisInput->cAlphaArgs(7), state.dataHeatBal->Zone); if (thisPump.ZoneNum > 0) { thisPump.HeatLossesToZone = true; if (!thisInput->lNumericFieldBlanks(12)) { @@ -934,8 +932,8 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(8)) { - thisPump.powerSizingMethod = static_cast( - getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + thisPump.powerSizingMethod = + static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(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.", @@ -1008,9 +1006,9 @@ void GetPumpInput(EnergyPlusData &state) ObjectIsNotParent); TestCompSet(state, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaArgs(2), thisInput->cAlphaArgs(3), "Water Nodes"); - if (UtilityRoutines::SameString(thisInput->cAlphaArgs(4), "Optimal")) { + if (Util::SameString(thisInput->cAlphaArgs(4), "Optimal")) { thisPump.SequencingScheme = PumpBankControlSeq::OptimalScheme; - } else if (UtilityRoutines::SameString(thisInput->cAlphaArgs(4), "Sequential")) { + } else if (Util::SameString(thisInput->cAlphaArgs(4), "Sequential")) { thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; } else { ShowWarningError(state, @@ -1021,8 +1019,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; } - thisPump.PumpControl = - static_cast(getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + thisPump.PumpControl = static_cast(getEnumValue(pumpCtrlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, @@ -1061,7 +1058,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.PartLoadCoef[3] = 0.0; if (!thisInput->lAlphaFieldBlanks(7)) { // zone named for pump skin losses - thisPump.ZoneNum = UtilityRoutines::FindItemInList(thisInput->cAlphaArgs(7), state.dataHeatBal->Zone); + thisPump.ZoneNum = Util::FindItemInList(thisInput->cAlphaArgs(7), state.dataHeatBal->Zone); if (thisPump.ZoneNum > 0) { thisPump.HeatLossesToZone = true; if (!thisInput->lNumericFieldBlanks(7)) { @@ -1078,8 +1075,8 @@ void GetPumpInput(EnergyPlusData &state) } } if (!thisInput->lAlphaFieldBlanks(8)) { - thisPump.powerSizingMethod = static_cast( - getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + thisPump.powerSizingMethod = + static_cast(getEnumValue(powerSizingMethodNamesUC, Util::makeUPPER(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 8eefba36306..12df3567f09 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -155,7 +155,7 @@ void SimPurchasedAir(EnergyPlusData &state, // Find the correct PurchasedAir Equipment if (CompIndex == 0) { - PurchAirNum = UtilityRoutines::FindItemInList(PurchAirName, state.dataPurchasedAirMgr->PurchAir); + PurchAirNum = Util::FindItemInList(PurchAirName, state.dataPurchasedAirMgr->PurchAir); if (PurchAirNum == 0) { ShowFatalError(state, format("SimPurchasedAir: Unit not found={}", PurchAirName)); } @@ -257,7 +257,7 @@ void GetPurchasedAir(EnergyPlusData &state) state.dataPurchasedAirMgr->PurchAirNumericFields(PurchAirNum).FieldNames.allocate(NumNums); state.dataPurchasedAirMgr->PurchAirNumericFields(PurchAirNum).FieldNames = ""; state.dataPurchasedAirMgr->PurchAirNumericFields(PurchAirNum).FieldNames = state.dataIPShortCut->cNumericFieldNames; - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); PurchAir(PurchAirNum).Name = state.dataIPShortCut->cAlphaArgs(1); // get optional availability schedule @@ -338,21 +338,21 @@ void GetPurchasedAir(EnergyPlusData &state) PurchAir(PurchAirNum).MaxHeatSuppAirHumRat = state.dataIPShortCut->rNumericArgs(3); PurchAir(PurchAirNum).MinCoolSuppAirHumRat = state.dataIPShortCut->rNumericArgs(4); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "NoLimit")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "NoLimit")) { PurchAir(PurchAirNum).HeatingLimit = LimitType::NoLimit; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "LimitFlowRate")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "LimitFlowRate")) { if (state.dataIPShortCut->lNumericFieldBlanks(5)) { PurchAir(PurchAirNum).HeatingLimit = LimitType::NoLimit; } else { PurchAir(PurchAirNum).HeatingLimit = LimitType::LimitFlowRate; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "LimitCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "LimitCapacity")) { if (state.dataIPShortCut->lNumericFieldBlanks(6)) { PurchAir(PurchAirNum).HeatingLimit = LimitType::NoLimit; } else { PurchAir(PurchAirNum).HeatingLimit = LimitType::LimitCapacity; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "LimitFlowRateAndCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(6), "LimitFlowRateAndCapacity")) { if (state.dataIPShortCut->lNumericFieldBlanks(5) && state.dataIPShortCut->lNumericFieldBlanks(6)) { PurchAir(PurchAirNum).HeatingLimit = LimitType::NoLimit; } else if (state.dataIPShortCut->lNumericFieldBlanks(5)) { @@ -372,21 +372,21 @@ void GetPurchasedAir(EnergyPlusData &state) PurchAir(PurchAirNum).MaxHeatVolFlowRate = state.dataIPShortCut->rNumericArgs(5); PurchAir(PurchAirNum).MaxHeatSensCap = state.dataIPShortCut->rNumericArgs(6); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "NoLimit")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "NoLimit")) { PurchAir(PurchAirNum).CoolingLimit = LimitType::NoLimit; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "LimitFlowRate")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "LimitFlowRate")) { if (state.dataIPShortCut->lNumericFieldBlanks(7)) { PurchAir(PurchAirNum).CoolingLimit = LimitType::NoLimit; } else { PurchAir(PurchAirNum).CoolingLimit = LimitType::LimitFlowRate; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "LimitCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "LimitCapacity")) { if (state.dataIPShortCut->lNumericFieldBlanks(8)) { PurchAir(PurchAirNum).CoolingLimit = LimitType::NoLimit; } else { PurchAir(PurchAirNum).CoolingLimit = LimitType::LimitCapacity; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "LimitFlowRateAndCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(7), "LimitFlowRateAndCapacity")) { if (state.dataIPShortCut->lNumericFieldBlanks(7) && state.dataIPShortCut->lNumericFieldBlanks(8)) { PurchAir(PurchAirNum).CoolingLimit = LimitType::NoLimit; } else if (state.dataIPShortCut->lNumericFieldBlanks(7)) { @@ -435,13 +435,13 @@ void GetPurchasedAir(EnergyPlusData &state) } } // get Dehumidification control type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "None")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "None")) { PurchAir(PurchAirNum).DehumidCtrlType = HumControl::None; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "ConstantSensibleHeatRatio")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "ConstantSensibleHeatRatio")) { PurchAir(PurchAirNum).DehumidCtrlType = HumControl::ConstantSensibleHeatRatio; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "Humidistat")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "Humidistat")) { PurchAir(PurchAirNum).DehumidCtrlType = HumControl::Humidistat; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "ConstantSupplyHumidityRatio")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(10), "ConstantSupplyHumidityRatio")) { PurchAir(PurchAirNum).DehumidCtrlType = HumControl::ConstantSupplyHumidityRatio; } else { ShowSevereError(state, format("{}{}=\"{} invalid data", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -453,11 +453,11 @@ void GetPurchasedAir(EnergyPlusData &state) PurchAir(PurchAirNum).CoolSHR = state.dataIPShortCut->rNumericArgs(9); // get Humidification control type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(11), "None")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(11), "None")) { PurchAir(PurchAirNum).HumidCtrlType = HumControl::None; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(11), "Humidistat")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(11), "Humidistat")) { PurchAir(PurchAirNum).HumidCtrlType = HumControl::Humidistat; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(11), "ConstantSupplyHumidityRatio")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(11), "ConstantSupplyHumidityRatio")) { PurchAir(PurchAirNum).HumidCtrlType = HumControl::ConstantSupplyHumidityRatio; } else { ShowSevereError(state, format("{}{}=\"{} invalid data", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -469,8 +469,7 @@ void GetPurchasedAir(EnergyPlusData &state) // get Design specification outdoor air object if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - PurchAir(PurchAirNum).OARequirementsPtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(12), state.dataSize->OARequirements); + PurchAir(PurchAirNum).OARequirementsPtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(12), state.dataSize->OARequirements); if (PurchAir(PurchAirNum).OARequirementsPtr == 0) { ShowSevereError(state, format("{}{}=\"{} invalid data", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError( @@ -528,11 +527,11 @@ void GetPurchasedAir(EnergyPlusData &state) if (UniqueNodeError) ErrorsFound = true; // get Demand controlled ventilation type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(14), "None")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(14), "None")) { PurchAir(PurchAirNum).DCVType = DCV::None; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(14), "OccupancySchedule")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(14), "OccupancySchedule")) { PurchAir(PurchAirNum).DCVType = DCV::OccupancySchedule; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(14), "CO2Setpoint")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(14), "CO2Setpoint")) { if (state.dataContaminantBalance->Contaminant.CO2Simulation) { PurchAir(PurchAirNum).DCVType = DCV::CO2SetPoint; } else { @@ -556,11 +555,11 @@ void GetPurchasedAir(EnergyPlusData &state) ErrorsFound = true; } // get Outdoor air economizer type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(15), "NoEconomizer")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(15), "NoEconomizer")) { PurchAir(PurchAirNum).EconomizerType = Econ::NoEconomizer; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(15), "DifferentialDryBulb")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(15), "DifferentialDryBulb")) { PurchAir(PurchAirNum).EconomizerType = Econ::DifferentialDryBulb; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(15), "DifferentialEnthalpy")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(15), "DifferentialEnthalpy")) { PurchAir(PurchAirNum).EconomizerType = Econ::DifferentialEnthalpy; } else { ShowSevereError(state, format("{}{}=\"{} invalid data", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -570,11 +569,11 @@ void GetPurchasedAir(EnergyPlusData &state) ErrorsFound = true; } // get Outdoor air heat recovery type and effectiveness - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "None")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "None")) { PurchAir(PurchAirNum).HtRecType = HeatRecovery::None; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "Sensible")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "Sensible")) { PurchAir(PurchAirNum).HtRecType = HeatRecovery::Sensible; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(16), "Enthalpy")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(16), "Enthalpy")) { PurchAir(PurchAirNum).HtRecType = HeatRecovery::Enthalpy; } else { ShowSevereError(state, format("{}{}=\"{} invalid data", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -603,8 +602,7 @@ void GetPurchasedAir(EnergyPlusData &state) PurchAir(PurchAirNum).HVACSizingIndex = 0; if (!state.dataIPShortCut->lAlphaFieldBlanks(17)) { - PurchAir(PurchAirNum).HVACSizingIndex = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(17), state.dataSize->ZoneHVACSizing); + PurchAir(PurchAirNum).HVACSizingIndex = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(17), state.dataSize->ZoneHVACSizing); if (PurchAir(PurchAirNum).HVACSizingIndex == 0) { ShowSevereError(state, format("{} = {} not found.", state.dataIPShortCut->cAlphaFieldNames(17), state.dataIPShortCut->cAlphaArgs(17))); diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index 2853be79351..f10d40e98d4 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -592,7 +592,7 @@ void GetRefrigerationInput(EnergyPlusData &state) ++NumDisplayCases; AlphaNum = 1; - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); RefrigCase(CaseNum).Name = Alphas(AlphaNum); AlphaNum = 2; @@ -624,7 +624,7 @@ void GetRefrigerationInput(EnergyPlusData &state) // Get the Zone node number from the zone name entered by the user RefrigCase(CaseNum).ZoneName = Alphas(3); - RefrigCase(CaseNum).ActualZoneNum = UtilityRoutines::FindItemInList(Alphas(3), state.dataHeatBal->Zone); + RefrigCase(CaseNum).ActualZoneNum = Util::FindItemInList(Alphas(3), state.dataHeatBal->Zone); if (RefrigCase(CaseNum).ActualZoneNum == 0) { ShowSevereError(state, @@ -722,11 +722,11 @@ void GetRefrigerationInput(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(4), "CaseTemperatureMethod")) { + if (Util::SameString(Alphas(4), "CaseTemperatureMethod")) { RefrigCase(CaseNum).LatentEnergyCurveType = EnergyEqnForm::CaseTemperatureMethod; - } else if (UtilityRoutines::SameString(Alphas(4), "RelativeHumidityMethod")) { + } else if (Util::SameString(Alphas(4), "RelativeHumidityMethod")) { RefrigCase(CaseNum).LatentEnergyCurveType = EnergyEqnForm::RHCubic; - } else if (UtilityRoutines::SameString(Alphas(4), "DewpointMethod")) { + } else if (Util::SameString(Alphas(4), "DewpointMethod")) { RefrigCase(CaseNum).LatentEnergyCurveType = EnergyEqnForm::DPCubic; } else { ShowSevereError(state, @@ -890,16 +890,16 @@ void GetRefrigerationInput(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(7), "None")) { + if (Util::SameString(Alphas(7), "None")) { RefrigCase(CaseNum).AntiSweatControlType = ASHtrCtrlType::None; RefrigCase(CaseNum).AntiSweatPower = 0.0; - } else if (UtilityRoutines::SameString(Alphas(7), "Constant")) { + } else if (Util::SameString(Alphas(7), "Constant")) { RefrigCase(CaseNum).AntiSweatControlType = ASHtrCtrlType::Constant; - } else if (UtilityRoutines::SameString(Alphas(7), "Linear")) { + } else if (Util::SameString(Alphas(7), "Linear")) { RefrigCase(CaseNum).AntiSweatControlType = ASHtrCtrlType::Linear; - } else if (UtilityRoutines::SameString(Alphas(7), "DewpointMethod")) { + } else if (Util::SameString(Alphas(7), "DewpointMethod")) { RefrigCase(CaseNum).AntiSweatControlType = ASHtrCtrlType::DewPoint; - } else if (UtilityRoutines::SameString(Alphas(7), "HeatBalanceMethod")) { + } else if (Util::SameString(Alphas(7), "HeatBalanceMethod")) { RefrigCase(CaseNum).AntiSweatControlType = ASHtrCtrlType::HeatBalance; } else { ShowSevereError(state, @@ -1005,22 +1005,22 @@ void GetRefrigerationInput(EnergyPlusData &state) ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(8), "None")) { + if (Util::SameString(Alphas(8), "None")) { RefrigCase(CaseNum).defrostType = RefCaseDefrostType::None; - } else if (UtilityRoutines::SameString(Alphas(8), "OffCycle")) { + } else if (Util::SameString(Alphas(8), "OffCycle")) { RefrigCase(CaseNum).defrostType = RefCaseDefrostType::OffCycle; - } else if ((UtilityRoutines::SameString(Alphas(8), "HotFluid")) || (UtilityRoutines::SameString(Alphas(8), "HotGas"))) { + } else if ((Util::SameString(Alphas(8), "HotFluid")) || (Util::SameString(Alphas(8), "HotGas"))) { RefrigCase(CaseNum).defrostType = RefCaseDefrostType::HotFluid; - } else if ((UtilityRoutines::SameString(Alphas(8), "HotFluidWithTemperatureTermination")) || - (UtilityRoutines::SameString(Alphas(8), "HotGasWithTemperatureTermination"))) { + } else if ((Util::SameString(Alphas(8), "HotFluidWithTemperatureTermination")) || + (Util::SameString(Alphas(8), "HotGasWithTemperatureTermination"))) { RefrigCase(CaseNum).defrostType = RefCaseDefrostType::HotFluidTerm; - // ELSEIF (UtilityRoutines::SameString(Alphas(8),'Hot-Fluid On Demand')) THEN + // ELSEIF (Util::SameString(Alphas(8),'Hot-Fluid On Demand')) THEN // RefrigCase(CaseNum)%DefrostType = DefHotFluidOnDemand - } else if (UtilityRoutines::SameString(Alphas(8), "Electric")) { + } else if (Util::SameString(Alphas(8), "Electric")) { RefrigCase(CaseNum).defrostType = RefCaseDefrostType::Electric; - } else if (UtilityRoutines::SameString(Alphas(8), "ElectricWithTemperatureTermination")) { + } else if (Util::SameString(Alphas(8), "ElectricWithTemperatureTermination")) { RefrigCase(CaseNum).defrostType = RefCaseDefrostType::ElectricTerm; - // ELSEIF (UtilityRoutines::SameString(Alphas(8),'Electric On Demand')) THEN + // ELSEIF (Util::SameString(Alphas(8),'Electric On Demand')) THEN // RefrigCase(CaseNum)%DefrostType = DefElectricOnDemand } else { ShowWarningError( @@ -1151,13 +1151,13 @@ void GetRefrigerationInput(EnergyPlusData &state) } } - if (UtilityRoutines::SameString(Alphas(11), "CaseTemperatureMethod")) { + if (Util::SameString(Alphas(11), "CaseTemperatureMethod")) { RefrigCase(CaseNum).DefrostEnergyCurveType = EnergyEqnForm::CaseTemperatureMethod; - } else if (UtilityRoutines::SameString(Alphas(11), "RelativeHumidityMethod")) { + } else if (Util::SameString(Alphas(11), "RelativeHumidityMethod")) { RefrigCase(CaseNum).DefrostEnergyCurveType = EnergyEqnForm::RHCubic; - } else if (UtilityRoutines::SameString(Alphas(11), "DewpointMethod")) { + } else if (Util::SameString(Alphas(11), "DewpointMethod")) { RefrigCase(CaseNum).DefrostEnergyCurveType = EnergyEqnForm::DPCubic; - } else if (UtilityRoutines::SameString(Alphas(11), "None")) { + } else if (Util::SameString(Alphas(11), "None")) { RefrigCase(CaseNum).DefrostEnergyCurveType = EnergyEqnForm::None; } else { ShowSevereError(state, @@ -1410,7 +1410,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); WalkIn(WalkInID).Name = Alphas(1); @@ -1565,13 +1565,13 @@ void GetRefrigerationInput(EnergyPlusData &state) // Input walk-in cooler defrost information AlphaNum = 5; - if (lAlphaBlanks(AlphaNum) || UtilityRoutines::SameString(Alphas(AlphaNum), "Electric")) { + if (lAlphaBlanks(AlphaNum) || Util::SameString(Alphas(AlphaNum), "Electric")) { WalkIn(WalkInID).defrostType = WalkinClrDefrostType::Elec; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "HotFluid")) { + } else if (Util::SameString(Alphas(AlphaNum), "HotFluid")) { WalkIn(WalkInID).defrostType = WalkinClrDefrostType::Fluid; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "None")) { + } else if (Util::SameString(Alphas(AlphaNum), "None")) { WalkIn(WalkInID).defrostType = WalkinClrDefrostType::None; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "OffCycle")) { + } else if (Util::SameString(Alphas(AlphaNum), "OffCycle")) { WalkIn(WalkInID).defrostType = WalkinClrDefrostType::OffCycle; } else { ShowSevereError(state, @@ -1585,9 +1585,9 @@ void GetRefrigerationInput(EnergyPlusData &state) } AlphaNum = 6; - if (lAlphaBlanks(AlphaNum) || UtilityRoutines::SameString(Alphas(AlphaNum), "TimeSchedule")) { + if (lAlphaBlanks(AlphaNum) || Util::SameString(Alphas(AlphaNum), "TimeSchedule")) { WalkIn(WalkInID).DefrostControlType = DefrostCtrlType::Sched; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "TemperatureTermination")) { + } else if (Util::SameString(Alphas(AlphaNum), "TemperatureTermination")) { WalkIn(WalkInID).DefrostControlType = DefrostCtrlType::TempTerm; } else { ShowSevereError(state, @@ -1770,7 +1770,7 @@ void GetRefrigerationInput(EnergyPlusData &state) // Get the Zone node number from the zone name // The Zone Node is needed to get the zone's ambient conditions, DataGlobals::NumOfZones from dataglobals WalkIn(WalkInID).ZoneName(ZoneID) = Alphas(AStart); - WalkIn(WalkInID).ZoneNum(ZoneID) = UtilityRoutines::FindItemInList(Alphas(AStart), state.dataHeatBal->Zone); + WalkIn(WalkInID).ZoneNum(ZoneID) = Util::FindItemInList(Alphas(AStart), state.dataHeatBal->Zone); if (WalkIn(WalkInID).ZoneNum(ZoneID) == 0) { ShowSevereError(state, @@ -1919,12 +1919,12 @@ void GetRefrigerationInput(EnergyPlusData &state) } // have schedule pointer } // blank on door opening schedule (AStart + 2) - if (lAlphaBlanks(AStart + 3) || UtilityRoutines::SameString(Alphas(AStart + 3), "AirCurtain")) { + if (lAlphaBlanks(AStart + 3) || Util::SameString(Alphas(AStart + 3), "AirCurtain")) { // default air curtain WalkIn(WalkInID).StockDoorProtectType(ZoneID) = WIStockDoor::AirCurtain; - } else if (UtilityRoutines::SameString(Alphas(AStart + 3), "None")) { + } else if (Util::SameString(Alphas(AStart + 3), "None")) { WalkIn(WalkInID).StockDoorProtectType(ZoneID) = WIStockDoor::None; - } else if (UtilityRoutines::SameString(Alphas(AStart + 3), "StripCurtain")) { + } else if (Util::SameString(Alphas(AStart + 3), "StripCurtain")) { WalkIn(WalkInID).StockDoorProtectType(ZoneID) = WIStockDoor::StripCurtain; } else { ShowSevereError(state, @@ -1963,7 +1963,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); WarehouseCoil(CoilID).Name = Alphas(AlphaNum); @@ -2013,29 +2013,29 @@ void GetRefrigerationInput(EnergyPlusData &state) WarehouseCoil(CoilID).Name, cAlphaFieldNames(AlphaNum))); ErrorsFound = true; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "UnitLoadFactorSensibleOnly")) { + } else if (Util::SameString(Alphas(AlphaNum), "UnitLoadFactorSensibleOnly")) { WarehouseCoil(CoilID).ratingType = RatingType::UnitLoadFactorSens; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "CapacityTotalSpecificConditions")) { + } else if (Util::SameString(Alphas(AlphaNum), "CapacityTotalSpecificConditions")) { WarehouseCoil(CoilID).ratingType = RatingType::RatedCapacityTotal; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC1Standard")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC1Standard")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC1Std; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC1NominalWet")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC1NominalWet")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC1Nom; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC2Standard")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC2Standard")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC2Std; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC2NominalWet")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC2NominalWet")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC2Nom; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC3Standard")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC3Standard")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC3Std; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC3NominalWet")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC3NominalWet")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC3Nom; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC4Standard")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC4Standard")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC4Std; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC4NominalWet")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC4NominalWet")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC4Nom; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC5Standard")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC5Standard")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC5Std; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "EuropeanSC5NominalWet")) { + } else if (Util::SameString(Alphas(AlphaNum), "EuropeanSC5NominalWet")) { WarehouseCoil(CoilID).ratingType = RatingType::EuropeanSC5Nom; } else { ShowSevereError(state, @@ -2337,7 +2337,7 @@ void GetRefrigerationInput(EnergyPlusData &state) // For RatedCapacityTotal, the manufacturer's coil performance map is required // Specify the performance map with TabularRHxDT1xTRoom WarehouseCoil(CoilID).SHRCorrType = SHRCorrectionType::TabularRH_DT1_TRoom; - if (!(UtilityRoutines::SameString(Alphas(AlphaNum), "TabularRHxDT1xTRoom"))) { + if (!(Util::SameString(Alphas(AlphaNum), "TabularRHxDT1xTRoom"))) { ShowWarningError(state, format(R"({}{}="{}", invalid {}="{}".)", RoutineName, @@ -2354,13 +2354,13 @@ void GetRefrigerationInput(EnergyPlusData &state) R"(the "TabularRHxDT1xTRoom" correction curve. Verify that a valid "TabularRHxDT1xTRoom" curve is specified in "{}".)", cAlphaFieldNames(AlphaNum + 1))); } - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "LinearSHR60")) { + } else if (Util::SameString(Alphas(AlphaNum), "LinearSHR60")) { WarehouseCoil(CoilID).SHRCorrType = SHRCorrectionType::SHR60; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "QuadraticSHR")) { + } else if (Util::SameString(Alphas(AlphaNum), "QuadraticSHR")) { WarehouseCoil(CoilID).SHRCorrType = SHRCorrectionType::QuadraticSHR; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "European")) { + } else if (Util::SameString(Alphas(AlphaNum), "European")) { WarehouseCoil(CoilID).SHRCorrType = SHRCorrectionType::European; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "TabularRHxDT1xTRoom")) { + } else if (Util::SameString(Alphas(AlphaNum), "TabularRHxDT1xTRoom")) { WarehouseCoil(CoilID).SHRCorrType = SHRCorrectionType::TabularRH_DT1_TRoom; } else { ShowSevereError(state, @@ -2496,13 +2496,13 @@ void GetRefrigerationInput(EnergyPlusData &state) // Input fan control type ++AlphaNum; // A7 - if (lAlphaBlanks(AlphaNum) || UtilityRoutines::SameString(Alphas(AlphaNum), "Fixed")) { + if (lAlphaBlanks(AlphaNum) || Util::SameString(Alphas(AlphaNum), "Fixed")) { WarehouseCoil(CoilID).FanType = FanSpeedCtrlType::ConstantSpeed; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "FixedLinear")) { + } else if (Util::SameString(Alphas(AlphaNum), "FixedLinear")) { WarehouseCoil(CoilID).FanType = FanSpeedCtrlType::ConstantSpeedLinear; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "VariableSpeed")) { + } else if (Util::SameString(Alphas(AlphaNum), "VariableSpeed")) { WarehouseCoil(CoilID).FanType = FanSpeedCtrlType::VariableSpeed; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "TwoSpeed")) { + } else if (Util::SameString(Alphas(AlphaNum), "TwoSpeed")) { WarehouseCoil(CoilID).FanType = FanSpeedCtrlType::TwoSpeed; } else { ShowSevereError(state, @@ -2546,13 +2546,13 @@ void GetRefrigerationInput(EnergyPlusData &state) // Input defrost type ++AlphaNum; // A8 - if (lAlphaBlanks(AlphaNum) || UtilityRoutines::SameString(Alphas(AlphaNum), "Electric")) { + if (lAlphaBlanks(AlphaNum) || Util::SameString(Alphas(AlphaNum), "Electric")) { WarehouseCoil(CoilID).defrostType = DefrostType::Elec; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "HotFluid")) { + } else if (Util::SameString(Alphas(AlphaNum), "HotFluid")) { WarehouseCoil(CoilID).defrostType = DefrostType::Fluid; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "None")) { + } else if (Util::SameString(Alphas(AlphaNum), "None")) { WarehouseCoil(CoilID).defrostType = DefrostType::None; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "OffCycle")) { + } else if (Util::SameString(Alphas(AlphaNum), "OffCycle")) { WarehouseCoil(CoilID).defrostType = DefrostType::OffCycle; } else { ShowSevereError(state, @@ -2566,9 +2566,9 @@ void GetRefrigerationInput(EnergyPlusData &state) } // defrost type ++AlphaNum; // A9 - if (lAlphaBlanks(AlphaNum) || UtilityRoutines::SameString(Alphas(AlphaNum), "TimeSchedule")) { + if (lAlphaBlanks(AlphaNum) || Util::SameString(Alphas(AlphaNum), "TimeSchedule")) { WarehouseCoil(CoilID).DefrostControlType = DefrostCtrlType::Sched; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "TemperatureTermination")) { + } else if (Util::SameString(Alphas(AlphaNum), "TemperatureTermination")) { WarehouseCoil(CoilID).DefrostControlType = DefrostCtrlType::TempTerm; } else { ShowSevereError(state, @@ -2668,11 +2668,11 @@ void GetRefrigerationInput(EnergyPlusData &state) } // defrost type ++AlphaNum; // A12 - if (lAlphaBlanks(AlphaNum) || UtilityRoutines::SameString(Alphas(AlphaNum), "Middle")) { + if (lAlphaBlanks(AlphaNum) || Util::SameString(Alphas(AlphaNum), "Middle")) { WarehouseCoil(CoilID).VerticalLocation = VerticalLoc::Middle; // default position - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "Ceiling")) { + } else if (Util::SameString(Alphas(AlphaNum), "Ceiling")) { WarehouseCoil(CoilID).VerticalLocation = VerticalLoc::Ceiling; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "Floor")) { + } else if (Util::SameString(Alphas(AlphaNum), "Floor")) { WarehouseCoil(CoilID).VerticalLocation = VerticalLoc::Floor; } else { ShowSevereError(state, @@ -2713,7 +2713,7 @@ void GetRefrigerationInput(EnergyPlusData &state) cAlphaFieldNames, cNumericFieldNames); AlphaNum = 1; - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); AirChillerSet(SetID).Name = Alphas(AlphaNum); @@ -2746,7 +2746,7 @@ void GetRefrigerationInput(EnergyPlusData &state) ++AlphaNum; AirChillerSet(SetID).ZoneName = Alphas(AlphaNum); - AirChillerSet(SetID).ZoneNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); + AirChillerSet(SetID).ZoneNum = Util::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); if (AirChillerSet(SetID).ZoneNum == 0) { ShowSevereError(state, @@ -2812,7 +2812,7 @@ void GetRefrigerationInput(EnergyPlusData &state) for (int ChillerIndex = 1; ChillerIndex <= NumChillersInSet; ++ChillerIndex) { int AlphaListNum = AlphaStartList + ChillerIndex; if (!lAlphaBlanks(AlphaListNum)) { - int CoilNum = UtilityRoutines::FindItemInList(Alphas(AlphaListNum), WarehouseCoil); + int CoilNum = Util::FindItemInList(Alphas(AlphaListNum), WarehouseCoil); if (CoilNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", has an invalid {} defined as {}", @@ -2849,7 +2849,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); CaseAndWalkInList(ListNum).Name = Alphas(1); // CaseAndWalkInList alphas include CaseAndWalkInList name and one name for each Case or WalkIn in list @@ -2870,10 +2870,10 @@ void GetRefrigerationInput(EnergyPlusData &state) int LoadWalkInNum = 0; int LoadCaseNum = 0; int LoadCoilNum = 0; - if (state.dataRefrigCase->NumSimulationWalkIns > 0) LoadWalkInNum = UtilityRoutines::FindItemInList(Alphas(AlphaListNum), WalkIn); - if (state.dataRefrigCase->NumSimulationCases > 0) LoadCaseNum = UtilityRoutines::FindItemInList(Alphas(AlphaListNum), RefrigCase); + if (state.dataRefrigCase->NumSimulationWalkIns > 0) LoadWalkInNum = Util::FindItemInList(Alphas(AlphaListNum), WalkIn); + if (state.dataRefrigCase->NumSimulationCases > 0) LoadCaseNum = Util::FindItemInList(Alphas(AlphaListNum), RefrigCase); if (state.dataRefrigCase->NumSimulationRefrigAirChillers > 0) - LoadCoilNum = UtilityRoutines::FindItemInList(Alphas(AlphaListNum), WarehouseCoil); + LoadCoilNum = Util::FindItemInList(Alphas(AlphaListNum), WarehouseCoil); if ((LoadWalkInNum == 0) && (LoadCaseNum == 0) && (LoadCoilNum == 0)) { ShowSevereError(state, format("{}{}=\"{}\", has an invalid value of {}", @@ -2937,15 +2937,15 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); RefrigRack(RackNum).Name = Alphas(1); RefrigRack(RackNum).MyIdx = RackNum; state.dataHeatBal->HeatReclaimRefrigeratedRack(RackNum).Name = Alphas(1); state.dataHeatBal->HeatReclaimRefrigeratedRack(RackNum).SourceType = CurrentModuleObject; - if (UtilityRoutines::SameString(Alphas(2), "Outdoors")) { + if (Util::SameString(Alphas(2), "Outdoors")) { RefrigRack(RackNum).HeatRejectionLocation = HeatRejLocation::Outdoors; - } else if (UtilityRoutines::SameString(Alphas(2), "Zone")) { + } else if (Util::SameString(Alphas(2), "Zone")) { RefrigRack(RackNum).HeatRejectionLocation = HeatRejLocation::Zone; // don't need to set RefrigPresentInZone to .TRUE. here because only allowed to reject heat to zone // holding all served cases, so already set when case read in @@ -3026,7 +3026,7 @@ void GetRefrigerationInput(EnergyPlusData &state) cAlphaFieldNames(4)); // Field Name } - if (UtilityRoutines::SameString(Alphas(5), "EvaporativelyCooled")) { + if (Util::SameString(Alphas(5), "EvaporativelyCooled")) { RefrigRack(RackNum).CondenserType = DataHeatBalance::RefrigCondenserType::Evap; if (RefrigRack(RackNum).HeatRejectionLocation == HeatRejLocation::Zone) { ShowWarningError(state, @@ -3038,7 +3038,7 @@ void GetRefrigerationInput(EnergyPlusData &state) ShowContinueError(state, format("{} reset to Air Cooled and simulation continues.", cAlphaFieldNames(5))); RefrigRack(RackNum).CondenserType = DataHeatBalance::RefrigCondenserType::Air; } - } else if (UtilityRoutines::SameString(Alphas(5), "WaterCooled")) { + } else if (Util::SameString(Alphas(5), "WaterCooled")) { RefrigRack(RackNum).CondenserType = DataHeatBalance::RefrigCondenserType::Water; if (RefrigRack(RackNum).HeatRejectionLocation == HeatRejLocation::Zone) { ShowWarningError(state, @@ -3076,9 +3076,9 @@ void GetRefrigerationInput(EnergyPlusData &state) // Check node connections BranchNodeConnections::TestCompSet(state, CurrentModuleObject, Alphas(1), Alphas(6), Alphas(7), "RefrigRack Nodes"); // Get loop flow type - if (UtilityRoutines::SameString(Alphas(8), "VariableFlow")) { + if (Util::SameString(Alphas(8), "VariableFlow")) { RefrigRack(RackNum).FlowType = CndsrFlowType::VariableFlow; - } else if (UtilityRoutines::SameString(Alphas(8), "ConstantFlow")) { + } else if (Util::SameString(Alphas(8), "ConstantFlow")) { RefrigRack(RackNum).FlowType = CndsrFlowType::ConstantFlow; } else { ShowSevereError(state, @@ -3288,11 +3288,10 @@ void GetRefrigerationInput(EnergyPlusData &state) int WalkInNum = 0; int CoilNum = 0; if (state.dataRefrigCase->NumSimulationCaseAndWalkInLists > 0) - CaseAndWalkInListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); - if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), RefrigCase); - if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WalkIn); - if (state.dataRefrigCase->NumSimulationRefrigAirChillers > 0) - CoilNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WarehouseCoil); + CaseAndWalkInListNum = Util::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); + if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = Util::FindItemInList(Alphas(AlphaNum), RefrigCase); + if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = Util::FindItemInList(Alphas(AlphaNum), WalkIn); + if (state.dataRefrigCase->NumSimulationRefrigAirChillers > 0) CoilNum = Util::FindItemInList(Alphas(AlphaNum), WarehouseCoil); int NumNameMatches = 0; if (CaseAndWalkInListNum != 0) ++NumNameMatches; if (CaseNum != 0) ++NumNameMatches; @@ -3410,7 +3409,7 @@ void GetRefrigerationInput(EnergyPlusData &state) cAlphaFieldNames(15))); ErrorsFound = true; } else { // alpha (15) not blank - RefrigRack(RackNum).HeatRejectionZoneNum = UtilityRoutines::FindItemInList(Alphas(15), state.dataHeatBal->Zone); + RefrigRack(RackNum).HeatRejectionZoneNum = Util::FindItemInList(Alphas(15), state.dataHeatBal->Zone); RefrigRack(RackNum).HeatRejectionZoneNodeNum = DataZoneEquipment::GetSystemNodeNumberForZone(state, RefrigRack(RackNum).HeatRejectionZoneNum); if (RefrigRack(RackNum).HeatRejectionZoneNum == 0) { @@ -3539,11 +3538,11 @@ void GetRefrigerationInput(EnergyPlusData &state) if (!lNumericBlanks(1)) Condenser(CondNum).RatedSubcool = Numbers(1); // Get fan control type - if (UtilityRoutines::SameString(Alphas(3), "FixedLinear")) { + if (Util::SameString(Alphas(3), "FixedLinear")) { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::ConstantSpeedLinear; - } else if (UtilityRoutines::SameString(Alphas(3), "VariableSpeed")) { + } else if (Util::SameString(Alphas(3), "VariableSpeed")) { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::VariableSpeed; - } else if (UtilityRoutines::SameString(Alphas(3), "TwoSpeed")) { + } else if (Util::SameString(Alphas(3), "TwoSpeed")) { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::TwoSpeed; } else { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::ConstantSpeed; // default @@ -3570,7 +3569,7 @@ void GetRefrigerationInput(EnergyPlusData &state) Condenser(CondNum).InletAirNodeNum = 0; } else { // see if it's an outside air node name or an indoor zone name, // have to check inside first because outside check automatically generates an error message - Condenser(CondNum).InletAirZoneNum = UtilityRoutines::FindItemInList(Alphas(4), state.dataHeatBal->Zone); + Condenser(CondNum).InletAirZoneNum = Util::FindItemInList(Alphas(4), state.dataHeatBal->Zone); // need to clearly id node number for air inlet conditions and zone number for casecredit assignment if (Condenser(CondNum).InletAirZoneNum != 0) { // set condenser flag (later used to set system flag) and zone flag @@ -3666,11 +3665,11 @@ void GetRefrigerationInput(EnergyPlusData &state) if ((!lNumericBlanks(2)) && (Numbers(2) > 0.0)) Condenser(CondNum).RatedSubcool = Numbers(2); // Get fan control type - if (UtilityRoutines::SameString(Alphas(3), "FixedLinear")) { + if (Util::SameString(Alphas(3), "FixedLinear")) { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::ConstantSpeedLinear; - } else if (UtilityRoutines::SameString(Alphas(2), "VariableSpeed")) { + } else if (Util::SameString(Alphas(2), "VariableSpeed")) { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::VariableSpeed; - } else if (UtilityRoutines::SameString(Alphas(2), "TwoSpeed")) { + } else if (Util::SameString(Alphas(2), "TwoSpeed")) { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::TwoSpeed; } else { Condenser(CondNum).FanSpeedControlType = FanSpeedCtrlType::ConstantSpeed; // default @@ -3992,9 +3991,9 @@ void GetRefrigerationInput(EnergyPlusData &state) // Check node connections BranchNodeConnections::TestCompSet(state, CurrentModuleObject, Alphas(1), Alphas(2), Alphas(3), "Water Cooled Condenser Nodes"); // Get loop flow type - if (UtilityRoutines::SameString(Alphas(4), "VariableFlow")) { // set FlowType + if (Util::SameString(Alphas(4), "VariableFlow")) { // set FlowType Condenser(CondNum).FlowType = CndsrFlowType::VariableFlow; - } else if (UtilityRoutines::SameString(Alphas(4), "ConstantFlow")) { + } else if (Util::SameString(Alphas(4), "ConstantFlow")) { Condenser(CondNum).FlowType = CndsrFlowType::ConstantFlow; } else { ShowSevereError(state, @@ -4161,9 +4160,9 @@ void GetRefrigerationInput(EnergyPlusData &state) // Get condensing temperature type, either fixed by design or allowed to float to match other loads on supply system if (!lAlphaBlanks(2)) { - if (UtilityRoutines::SameString(Alphas(2), "Fixed")) { // set Condenser Temperature Control Type + if (Util::SameString(Alphas(2), "Fixed")) { // set Condenser Temperature Control Type Condenser(CondNum).CascadeTempControl = CascadeCndsrTempCtrlType::TempSet; - } else if (UtilityRoutines::SameString(Alphas(2), "Float")) { + } else if (Util::SameString(Alphas(2), "Float")) { Condenser(CondNum).CascadeTempControl = CascadeCndsrTempCtrlType::TempFloat; } else { ShowSevereError(state, @@ -4212,7 +4211,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); GasCooler(GCNum).Name = Alphas(1); GasCooler(GCNum).CapCurvePtr = Curve::GetCurveIndex(state, Alphas(2)); // convert curve name to number @@ -4254,11 +4253,11 @@ void GetRefrigerationInput(EnergyPlusData &state) } // Get fan control type - if (UtilityRoutines::SameString(Alphas(3), "FixedLinear")) { + if (Util::SameString(Alphas(3), "FixedLinear")) { GasCooler(GCNum).FanSpeedControlType = FanSpeedCtrlType::ConstantSpeedLinear; - } else if (UtilityRoutines::SameString(Alphas(3), "VariableSpeed")) { + } else if (Util::SameString(Alphas(3), "VariableSpeed")) { GasCooler(GCNum).FanSpeedControlType = FanSpeedCtrlType::VariableSpeed; - } else if (UtilityRoutines::SameString(Alphas(3), "TwoSpeed")) { + } else if (Util::SameString(Alphas(3), "TwoSpeed")) { GasCooler(GCNum).FanSpeedControlType = FanSpeedCtrlType::TwoSpeed; } else { GasCooler(GCNum).FanSpeedControlType = FanSpeedCtrlType::ConstantSpeed; // default @@ -4358,7 +4357,7 @@ void GetRefrigerationInput(EnergyPlusData &state) GasCooler(GCNum).InletAirNodeNum = 0; } else { // see if it's an outside air node name or an indoor zone name, // have to check inside first because outside check automatically generates an error message - GasCooler(GCNum).InletAirZoneNum = UtilityRoutines::FindItemInList(Alphas(4), state.dataHeatBal->Zone); + GasCooler(GCNum).InletAirZoneNum = Util::FindItemInList(Alphas(4), state.dataHeatBal->Zone); // need to clearly id node number for air inlet conditions and zone number for casecredit assignment if (GasCooler(GCNum).InletAirZoneNum != 0) { // set condenser flag (later used to set system flag) and zone flag @@ -4422,7 +4421,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); Secondary(SecondaryNum).Name = Alphas(1); @@ -4454,11 +4453,10 @@ void GetRefrigerationInput(EnergyPlusData &state) int WalkInNum = 0; int CoilNum = 0; if (state.dataRefrigCase->NumSimulationCaseAndWalkInLists > 0) - CaseAndWalkInListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); - if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), RefrigCase); - if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WalkIn); - if (state.dataRefrigCase->NumSimulationRefrigAirChillers > 0) - CoilNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WarehouseCoil); + CaseAndWalkInListNum = Util::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); + if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = Util::FindItemInList(Alphas(AlphaNum), RefrigCase); + if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = Util::FindItemInList(Alphas(AlphaNum), WalkIn); + if (state.dataRefrigCase->NumSimulationRefrigAirChillers > 0) CoilNum = Util::FindItemInList(Alphas(AlphaNum), WarehouseCoil); int NumNameMatches = 0; if (CaseAndWalkInListNum != 0) ++NumNameMatches; if (CaseNum != 0) ++NumNameMatches; @@ -4569,9 +4567,9 @@ void GetRefrigerationInput(EnergyPlusData &state) // Get circulating fluid type AlphaNum = 3; if (!lAlphaBlanks(AlphaNum)) { - if (UtilityRoutines::SameString(Alphas(AlphaNum), "FluidAlwaysLiquid")) { + if (Util::SameString(Alphas(AlphaNum), "FluidAlwaysLiquid")) { Secondary(SecondaryNum).FluidType = SecFluidType::AlwaysLiquid; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "FluidPhaseChange")) { + } else if (Util::SameString(Alphas(AlphaNum), "FluidPhaseChange")) { Secondary(SecondaryNum).FluidType = SecFluidType::PhaseChange; } else { ShowSevereError(state, @@ -4834,9 +4832,9 @@ void GetRefrigerationInput(EnergyPlusData &state) AlphaNum = 5; Secondary(SecondaryNum).PumpControlType = SecPumpCtrl::Constant; // default if (!lAlphaBlanks(AlphaNum)) { - if (UtilityRoutines::SameString(Alphas(AlphaNum), "Constant")) { + if (Util::SameString(Alphas(AlphaNum), "Constant")) { Secondary(SecondaryNum).PumpControlType = SecPumpCtrl::Constant; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "Variable")) { + } else if (Util::SameString(Alphas(AlphaNum), "Variable")) { Secondary(SecondaryNum).PumpControlType = SecPumpCtrl::Variable; } else { ShowSevereError(state, @@ -4919,7 +4917,7 @@ void GetRefrigerationInput(EnergyPlusData &state) NumNum = 12; if (!lNumericBlanks(NumNum) && !lAlphaBlanks(AlphaNum)) { Secondary(SecondaryNum).SumUADistPiping = Numbers(NumNum); - Secondary(SecondaryNum).DistPipeZoneNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); + Secondary(SecondaryNum).DistPipeZoneNum = Util::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); Secondary(SecondaryNum).DistPipeZoneNodeNum = DataZoneEquipment::GetSystemNodeNumberForZone(state, Secondary(SecondaryNum).DistPipeZoneNum); @@ -4981,7 +4979,7 @@ void GetRefrigerationInput(EnergyPlusData &state) NumNum = 13; if (!lNumericBlanks(NumNum) && !lAlphaBlanks(AlphaNum)) { Secondary(SecondaryNum).SumUAReceiver = Numbers(NumNum); - Secondary(SecondaryNum).ReceiverZoneNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); + Secondary(SecondaryNum).ReceiverZoneNum = Util::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); Secondary(SecondaryNum).ReceiverZoneNodeNum = DataZoneEquipment::GetSystemNodeNumberForZone(state, Secondary(SecondaryNum).ReceiverZoneNum); @@ -5148,7 +5146,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); Compressor(CompNum).Name = Alphas(1); @@ -5218,7 +5216,7 @@ void GetRefrigerationInput(EnergyPlusData &state) if (!lAlphaBlanks(4)) Compressor(CompNum).EndUseSubcategory = Alphas(4); // If the compressor is a transcritical CO compressor, get transcritical power and capacity curves - if (UtilityRoutines::SameString(Alphas(5), "Transcritical")) { // Mode of Operation = Transcritical + if (Util::SameString(Alphas(5), "Transcritical")) { // Mode of Operation = Transcritical Compressor(CompNum).TransFlag = true; Compressor(CompNum).TransElecPowerCurvePtr = Curve::GetCurveIndex(state, Alphas(6)); // convert curve name to number if (lAlphaBlanks(6) && Compressor(CompNum).TransElecPowerCurvePtr == 0) { @@ -5232,7 +5230,7 @@ void GetRefrigerationInput(EnergyPlusData &state) state, format("{}{}={}: {} not found.", RoutineName, CurrentModuleObject, Compressor(CompNum).Name, cAlphaFieldNames(7))); ErrorsFound = true; } - } else if ((UtilityRoutines::SameString(Alphas(5), "Subcritical")) || (lAlphaBlanks(5))) { // Mode of Operation = Subcritical + } else if ((Util::SameString(Alphas(5), "Subcritical")) || (lAlphaBlanks(5))) { // Mode of Operation = Subcritical Compressor(CompNum).TransFlag = false; if ((!lAlphaBlanks(6)) || (!lAlphaBlanks(7))) { // Transcritical compressor curves specified for subcritical compressor ShowWarningError( @@ -5278,16 +5276,16 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); Subcooler(SubcoolerNum).Name = Alphas(1); // Get subcooler type Subcooler(SubcoolerNum).subcoolerType = SubcoolerType::LiquidSuction; // default subcooler type - if (UtilityRoutines::SameString(Alphas(2), "Mechanical")) { // set subcooler type + if (Util::SameString(Alphas(2), "Mechanical")) { // set subcooler type Subcooler(SubcoolerNum).subcoolerType = SubcoolerType::Mechanical; ++state.dataRefrigCase->NumSimulationMechSubcoolers; - } else if (UtilityRoutines::SameString(Alphas(2), "LiquidSuction")) { + } else if (Util::SameString(Alphas(2), "LiquidSuction")) { Subcooler(SubcoolerNum).subcoolerType = SubcoolerType::LiquidSuction; } else { ShowSevereError(state, @@ -5389,7 +5387,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); TransferLoadList(ListNum).Name = Alphas(1); @@ -5406,10 +5404,9 @@ void GetRefrigerationInput(EnergyPlusData &state) int AlphaListNum = 1 + NumLoad; int LoadCascadeNum = 0; int LoadSecondaryNum = 0; - if (state.dataRefrigCase->NumRefrigCondensers > 0) - LoadCascadeNum = UtilityRoutines::FindItemInList(Alphas(AlphaListNum), Condenser); + if (state.dataRefrigCase->NumRefrigCondensers > 0) LoadCascadeNum = Util::FindItemInList(Alphas(AlphaListNum), Condenser); if (state.dataRefrigCase->NumSimulationSecondarySystems > 0) - LoadSecondaryNum = UtilityRoutines::FindItemInList(Alphas(AlphaListNum), Secondary); + LoadSecondaryNum = Util::FindItemInList(Alphas(AlphaListNum), Secondary); if ((LoadCascadeNum == 0) && (LoadSecondaryNum == 0)) { ShowSevereError(state, format("{}{}=\"{}\" : has an invalid value of {}", @@ -5467,7 +5464,7 @@ void GetRefrigerationInput(EnergyPlusData &state) cAlphaFieldNames, cNumericFieldNames); CompressorLists(ListNum).NumCompressors = NumAlphas - 1; - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); CompressorLists(ListNum).Name = Alphas(1); if (!allocated(CompressorLists(ListNum).CompItemNum)) @@ -5476,7 +5473,7 @@ void GetRefrigerationInput(EnergyPlusData &state) for (int CompIndex = 1; CompIndex <= CompressorLists(ListNum).NumCompressors; ++CompIndex) { int AlphaListNum = CompIndex + 1; // same as do loop from 2 to end of list if (!lAlphaBlanks(AlphaListNum)) { - CompressorLists(ListNum).CompItemNum(CompIndex) = UtilityRoutines::FindItemInList(Alphas(AlphaListNum), Compressor); + CompressorLists(ListNum).CompItemNum(CompIndex) = Util::FindItemInList(Alphas(AlphaListNum), Compressor); if (CompressorLists(ListNum).CompItemNum(CompIndex) == 0) { ShowSevereError(state, format("{}{}=\"{}\", has an invalid {} defined as {}", @@ -5509,7 +5506,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); System(RefrigSysNum).Name = Alphas(1); @@ -5553,11 +5550,10 @@ void GetRefrigerationInput(EnergyPlusData &state) int WalkInNum = 0; int CoilNum = 0; if (state.dataRefrigCase->NumSimulationCaseAndWalkInLists > 0) - CaseAndWalkInListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); - if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), RefrigCase); - if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WalkIn); - if (state.dataRefrigCase->NumSimulationRefrigAirChillers > 0) - CoilNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WarehouseCoil); + CaseAndWalkInListNum = Util::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); + if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = Util::FindItemInList(Alphas(AlphaNum), RefrigCase); + if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = Util::FindItemInList(Alphas(AlphaNum), WalkIn); + if (state.dataRefrigCase->NumSimulationRefrigAirChillers > 0) CoilNum = Util::FindItemInList(Alphas(AlphaNum), WarehouseCoil); int NumNameMatches = 0; if (CaseAndWalkInListNum != 0) ++NumNameMatches; if (CaseNum != 0) ++NumNameMatches; @@ -5698,10 +5694,9 @@ void GetRefrigerationInput(EnergyPlusData &state) int SecondaryNum = 0; int CascadeLoadNum = 0; if (state.dataRefrigCase->NumSimulationTransferLoadLists > 0) - TransferLoadListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), TransferLoadList); - if (state.dataRefrigCase->NumSimulationSecondarySystems > 0) - SecondaryNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), Secondary); - if (state.dataRefrigCase->NumRefrigCondensers > 0) CascadeLoadNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), Condenser); + TransferLoadListNum = Util::FindItemInList(Alphas(AlphaNum), TransferLoadList); + if (state.dataRefrigCase->NumSimulationSecondarySystems > 0) SecondaryNum = Util::FindItemInList(Alphas(AlphaNum), Secondary); + if (state.dataRefrigCase->NumRefrigCondensers > 0) CascadeLoadNum = Util::FindItemInList(Alphas(AlphaNum), Condenser); int NumNameMatches = 0; if (TransferLoadListNum != 0) ++NumNameMatches; if (SecondaryNum != 0) ++NumNameMatches; @@ -5856,7 +5851,7 @@ void GetRefrigerationInput(EnergyPlusData &state) if (!allocated(System(RefrigSysNum).CondenserNum)) System(RefrigSysNum).CondenserNum.allocate(NumCondensers); System(RefrigSysNum).NumCondensers = 1; // Find condenser number, note condensers were read in one of four objects, but all read into same list - int CondNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), Condenser); + int CondNum = Util::FindItemInList(Alphas(AlphaNum), Condenser); if (CondNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", has an invalid {} defined as {}", @@ -5916,13 +5911,13 @@ void GetRefrigerationInput(EnergyPlusData &state) } else { // Entry for Alphas(AlphaNum) can be either a compressor name or a compressorlist name int ListNum; if (NumCompressorLists > 0) { - ListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CompressorLists); + ListNum = Util::FindItemInList(Alphas(AlphaNum), CompressorLists); } else { ListNum = 0; } int CompNum; if (state.dataRefrigCase->NumSimulationCompressors > 0) { - CompNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), Compressor); + CompNum = Util::FindItemInList(Alphas(AlphaNum), Compressor); } else { CompNum = 0; } @@ -5987,9 +5982,9 @@ void GetRefrigerationInput(EnergyPlusData &state) AlphaNum = 7; if (!lAlphaBlanks(AlphaNum)) { - if (UtilityRoutines::SameString(Alphas(AlphaNum), "ConstantSuctionTemperature")) { + if (Util::SameString(Alphas(AlphaNum), "ConstantSuctionTemperature")) { System(RefrigSysNum).CompSuctControl = CompressorSuctionPressureCtrl::ConstantSuctionTemperature; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "FloatSuctionTemperature")) { + } else if (Util::SameString(Alphas(AlphaNum), "FloatSuctionTemperature")) { System(RefrigSysNum).CompSuctControl = CompressorSuctionPressureCtrl::FloatSuctionTemperature; if (System(RefrigSysNum).CoilFlag) { ShowWarningError(state, @@ -6070,7 +6065,7 @@ void GetRefrigerationInput(EnergyPlusData &state) System(RefrigSysNum).SumUASuctionPiping = 0.0; if (!lNumericBlanks(2) && !lAlphaBlanks(AlphaNum)) { System(RefrigSysNum).SumUASuctionPiping = Numbers(2); - System(RefrigSysNum).SuctionPipeActualZoneNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); + System(RefrigSysNum).SuctionPipeActualZoneNum = Util::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); System(RefrigSysNum).SuctionPipeZoneNodeNum = DataZoneEquipment::GetSystemNodeNumberForZone(state, System(RefrigSysNum).SuctionPipeActualZoneNum); if (System(RefrigSysNum).SuctionPipeZoneNodeNum == 0) { @@ -6132,11 +6127,11 @@ void GetRefrigerationInput(EnergyPlusData &state) // Flash intercooler (1) or coil-and-shell intercooler (2) for two-stage compression systems AlphaNum = 12; if (!lAlphaBlanks(AlphaNum)) { - if (UtilityRoutines::SameString(Alphas(AlphaNum), "None")) { + if (Util::SameString(Alphas(AlphaNum), "None")) { System(RefrigSysNum).IntercoolerType = 0; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "Flash Intercooler")) { + } else if (Util::SameString(Alphas(AlphaNum), "Flash Intercooler")) { System(RefrigSysNum).IntercoolerType = 1; - } else if (UtilityRoutines::SameString(Alphas(AlphaNum), "Shell-and-Coil Intercooler")) { + } else if (Util::SameString(Alphas(AlphaNum), "Shell-and-Coil Intercooler")) { System(RefrigSysNum).IntercoolerType = 2; } else { ShowSevereError(state, @@ -6196,8 +6191,8 @@ void GetRefrigerationInput(EnergyPlusData &state) cAlphaFieldNames(AlphaNum))); ErrorsFound = true; } else { // Entry for Alphas(AlphaNum) can be either a compressor name or a compressorlist name - int ListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CompressorLists); - int CompNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), Compressor); + int ListNum = Util::FindItemInList(Alphas(AlphaNum), CompressorLists); + int CompNum = Util::FindItemInList(Alphas(AlphaNum), Compressor); if ((ListNum == 0) && (CompNum == 0)) { // name doesn't match either a compressor or a compressor list ShowSevereError(state, format(R"({}{}="{}", {} has an invalid or undefined value="{}".)", @@ -6467,7 +6462,7 @@ void GetRefrigerationInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); TransSystem(TransRefrigSysNum).Name = Alphas(1); @@ -6485,9 +6480,9 @@ void GetRefrigerationInput(EnergyPlusData &state) ShowContinueError(state, R"( System type must be specified as "SingleStage" or "TwoStage".)"); ErrorsFound = true; } - if (UtilityRoutines::SameString(Alphas(2), "SingleStage")) { + if (Util::SameString(Alphas(2), "SingleStage")) { TransSystem(TransRefrigSysNum).TransSysType = 1; - } else if (UtilityRoutines::SameString(Alphas(2), "TwoStage")) { + } else if (Util::SameString(Alphas(2), "TwoStage")) { TransSystem(TransRefrigSysNum).TransSysType = 2; } else { ShowSevereError(state, @@ -6554,9 +6549,9 @@ void GetRefrigerationInput(EnergyPlusData &state) int CaseNum = 0; int WalkInNum = 0; if (state.dataRefrigCase->NumSimulationCaseAndWalkInLists > 0) - CaseAndWalkInListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); - if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), RefrigCase); - if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WalkIn); + CaseAndWalkInListNum = Util::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); + if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = Util::FindItemInList(Alphas(AlphaNum), RefrigCase); + if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = Util::FindItemInList(Alphas(AlphaNum), WalkIn); int NumNameMatches = 0; if (CaseAndWalkInListNum != 0) ++NumNameMatches; if (CaseNum != 0) ++NumNameMatches; @@ -6668,9 +6663,9 @@ void GetRefrigerationInput(EnergyPlusData &state) int CaseNum = 0; int WalkInNum = 0; if (state.dataRefrigCase->NumSimulationCaseAndWalkInLists > 0) - CaseAndWalkInListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); - if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), RefrigCase); - if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), WalkIn); + CaseAndWalkInListNum = Util::FindItemInList(Alphas(AlphaNum), CaseAndWalkInList); + if (state.dataRefrigCase->NumSimulationCases > 0) CaseNum = Util::FindItemInList(Alphas(AlphaNum), RefrigCase); + if (state.dataRefrigCase->NumSimulationWalkIns > 0) WalkInNum = Util::FindItemInList(Alphas(AlphaNum), WalkIn); int NumNameMatches = 0; if (CaseAndWalkInListNum != 0) ++NumNameMatches; if (CaseNum != 0) ++NumNameMatches; @@ -6782,7 +6777,7 @@ void GetRefrigerationInput(EnergyPlusData &state) if (!allocated(TransSystem(TransRefrigSysNum).GasCoolerNum)) TransSystem(TransRefrigSysNum).GasCoolerNum.allocate(NumGasCoolers); TransSystem(TransRefrigSysNum).NumGasCoolers = 1; // Find gascooler number - int GCNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), GasCooler); + int GCNum = Util::FindItemInList(Alphas(AlphaNum), GasCooler); if (GCNum == 0) { // Invalid Gas Cooler attached to Transcritical Refrigeration System ShowSevereError(state, @@ -6812,8 +6807,8 @@ void GetRefrigerationInput(EnergyPlusData &state) ShowSevereError(state, format("{}{} {}\" : must be input.", RoutineName, CurrentModuleObject, cAlphaFieldNames(AlphaNum))); ErrorsFound = true; } else { // Entry for Alphas(AlphaNum) can be either a compressor name or a compressorlist name - int ListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CompressorLists); - int CompNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), Compressor); + int ListNum = Util::FindItemInList(Alphas(AlphaNum), CompressorLists); + int CompNum = Util::FindItemInList(Alphas(AlphaNum), Compressor); if ((ListNum == 0) && (CompNum == 0)) { // name doesn't match either a compressor or a compressor list ShowSevereError(state, format(R"({}{}, "{}", has an invalid or undefined value="{}".)", @@ -6898,8 +6893,8 @@ void GetRefrigerationInput(EnergyPlusData &state) cAlphaFieldNames(AlphaNum))); } else if ((!(lAlphaBlanks(AlphaNum))) && (TransSystem(TransRefrigSysNum).TransSysType == 2)) { // TwoStage system with low pressure compressors specified - int ListNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), CompressorLists); - int CompNum = UtilityRoutines::FindItemInList(Alphas(AlphaNum), Compressor); + int ListNum = Util::FindItemInList(Alphas(AlphaNum), CompressorLists); + int CompNum = Util::FindItemInList(Alphas(AlphaNum), Compressor); if ((ListNum == 0) && (CompNum == 0)) { // name doesn't match either a compressor or a compressor list ShowSevereError(state, format(R"({}{}, "{}", has an invalid or undefined value="{}".)", @@ -7031,8 +7026,7 @@ void GetRefrigerationInput(EnergyPlusData &state) TransSystem(TransRefrigSysNum).SumUASuctionPipingMT = 0.0; if (!lNumericBlanks(3) && !lAlphaBlanks(AlphaNum)) { TransSystem(TransRefrigSysNum).SumUASuctionPipingMT = Numbers(3); - TransSystem(TransRefrigSysNum).SuctionPipeActualZoneNumMT = - UtilityRoutines::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); + TransSystem(TransRefrigSysNum).SuctionPipeActualZoneNumMT = Util::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); TransSystem(TransRefrigSysNum).SuctionPipeZoneNodeNumMT = DataZoneEquipment::GetSystemNodeNumberForZone(state, TransSystem(TransRefrigSysNum).SuctionPipeActualZoneNumMT); if (TransSystem(TransRefrigSysNum).SuctionPipeZoneNodeNumMT == 0) { @@ -7076,8 +7070,7 @@ void GetRefrigerationInput(EnergyPlusData &state) TransSystem(TransRefrigSysNum).SumUASuctionPipingLT = 0.0; if (!lNumericBlanks(4) && !lAlphaBlanks(AlphaNum)) { TransSystem(TransRefrigSysNum).SumUASuctionPipingLT = Numbers(4); - TransSystem(TransRefrigSysNum).SuctionPipeActualZoneNumLT = - UtilityRoutines::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); + TransSystem(TransRefrigSysNum).SuctionPipeActualZoneNumLT = Util::FindItemInList(Alphas(AlphaNum), state.dataHeatBal->Zone); TransSystem(TransRefrigSysNum).SuctionPipeZoneNodeNumLT = DataZoneEquipment::GetSystemNodeNumberForZone(state, TransSystem(TransRefrigSysNum).SuctionPipeActualZoneNumLT); if (TransSystem(TransRefrigSysNum).SuctionPipeZoneNodeNumLT == 0) { @@ -14226,7 +14219,7 @@ void GetRefrigeratedRackIndex(EnergyPlusData &state, switch (SysType) { case DataHeatBalance::RefrigSystemType::Rack: { - IndexPtr = UtilityRoutines::FindItemInList(Name, RefrigRack); + IndexPtr = Util::FindItemInList(Name, RefrigRack); if (IndexPtr == 0) { if (SuppressWarning) { // No warning printed if only searching for the existence of a refrigerated rack @@ -14245,7 +14238,7 @@ void GetRefrigeratedRackIndex(EnergyPlusData &state, } } break; case DataHeatBalance::RefrigSystemType::Detailed: { - IndexPtr = UtilityRoutines::FindItemInList(Name, Condenser); + IndexPtr = Util::FindItemInList(Name, Condenser); if (IndexPtr == 0) { if (SuppressWarning) { // No warning printed if only searching for the existence of a refrigeration Condenser @@ -15826,7 +15819,7 @@ void SimAirChillerSet(EnergyPlusData &state, // Find the correct Chiller set if (AirChillerSetPtr == 0) { - ChillerSetID = UtilityRoutines::FindItemInList(AirChillerSetName, AirChillerSet); + ChillerSetID = Util::FindItemInList(AirChillerSetName, AirChillerSet); if (ChillerSetID == 0) { ShowFatalError(state, format("SimAirChillerSet: Unit not found={}", AirChillerSetName)); } // chillersetid ==0 because not in list diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index aec4ba14b77..d8945992ddc 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -971,8 +971,8 @@ int ReportCoilSelection::getIndexForOrCreateDataObjFromCoilName(EnergyPlusData & int index(-1); for (int i = 0; i < numCoilsReported_; i++) { if (coilSelectionDataObjs[i] != nullptr) { - if (UtilityRoutines::SameString(coilSelectionDataObjs[i]->coilName_, coilName)) { - if (UtilityRoutines::SameString(coilSelectionDataObjs[i]->coilObjName, coilType)) { + if (Util::SameString(coilSelectionDataObjs[i]->coilName_, coilName)) { + if (Util::SameString(coilSelectionDataObjs[i]->coilObjName, coilType)) { return index = i; } else { // throw error coil type does not match coil name, check for unique names across coil types @@ -992,10 +992,10 @@ int ReportCoilSelection::getIndexForOrCreateDataObjFromCoilName(EnergyPlusData & bool locIsCooling(false); bool locIsHeating(false); for (int loop = 1; loop <= DataHVACGlobals::NumAllCoilTypes; ++loop) { - if (UtilityRoutines::SameString(coilType, DataHVACGlobals::cAllCoilTypes(loop))) { + if (Util::SameString(coilType, DataHVACGlobals::cAllCoilTypes(loop))) { found = true; - locIsCooling = UtilityRoutines::SameString(coilType, DataHVACGlobals::cCoolingCoilTypes(loop)); - locIsHeating = UtilityRoutines::SameString(coilType, DataHVACGlobals::cHeatingCoilTypes(loop)); + locIsCooling = Util::SameString(coilType, DataHVACGlobals::cCoolingCoilTypes(loop)); + locIsHeating = Util::SameString(coilType, DataHVACGlobals::cHeatingCoilTypes(loop)); break; } } @@ -1237,8 +1237,8 @@ void ReportCoilSelection::setCoilLvgAirHumRat(EnergyPlusData &state, std::string PeakHrMinString(EnergyPlusData &state, const int designDay, const int timeStepAtPeak) { return fmt::format("{}/{} {}", - state.dataWeatherManager->DesDayInput(designDay).Month, - state.dataWeatherManager->DesDayInput(designDay).DayOfMonth, + state.dataWeather->DesDayInput(designDay).Month, + state.dataWeather->DesDayInput(designDay).DayOfMonth, ReportCoilSelection::getTimeText(state, timeStepAtPeak)); } @@ -1281,20 +1281,20 @@ void ReportCoilSelection::setCoilCoolingCapacity( // These next blocks does not always work with SizingPeriod:WeatherFileDays or SizingPeriod:WeatherFileConditionType, protect against hard // crash if (SysSizPeakDDNum(curSysNum).SensCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).SensCoolPeakDD <= state.dataEnvrn->TotDesDays) { - c->desDayNameAtSensPeak = state.dataWeatherManager->DesDayInput(SysSizPeakDDNum(curSysNum).SensCoolPeakDD).Title; + c->desDayNameAtSensPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).SensCoolPeakDD).Title; c->coilSensePeakHrMin = PeakHrMinString(state, SysSizPeakDDNum(curSysNum).SensCoolPeakDD, SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(SysSizPeakDDNum(curSysNum).SensCoolPeakDD)); } if (SysSizPeakDDNum(curSysNum).TotCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).TotCoolPeakDD <= state.dataEnvrn->TotDesDays) { - c->desDayNameAtTotalPeak = state.dataWeatherManager->DesDayInput(SysSizPeakDDNum(curSysNum).TotCoolPeakDD).Title; + c->desDayNameAtTotalPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).TotCoolPeakDD).Title; c->coilTotalPeakHrMin = PeakHrMinString(state, SysSizPeakDDNum(curSysNum).TotCoolPeakDD, SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(SysSizPeakDDNum(curSysNum).TotCoolPeakDD)); } if (SysSizPeakDDNum(curSysNum).CoolFlowPeakDD > 0 && SysSizPeakDDNum(curSysNum).CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { - c->desDayNameAtAirFlowPeak = state.dataWeatherManager->DesDayInput(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).Title; + c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).Title; c->airPeakHrMin = PeakHrMinString(state, SysSizPeakDDNum(curSysNum).CoolFlowPeakDD, SysSizPeakDDNum(curSysNum).TimeStepAtCoolFlowPk(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD)); @@ -1605,7 +1605,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->airPeakHrMin = PeakHrMinString(state, finalSysSizing.HeatDDNum, finalSysSizing.SysHeatAirTimeStepPk); - c->desDayNameAtAirFlowPeak = state.dataWeatherManager->DesDayInput(finalSysSizing.HeatDDNum).Title; + c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(finalSysSizing.HeatDDNum).Title; } // now set Coil Ent And Lvg Conditions @@ -1987,15 +1987,15 @@ bool ReportCoilSelection::isCompTypeFan(std::string const &compType // string co ) { // if compType name is one of the fan objects, then return true - if (UtilityRoutines::SameString(compType, "Fan:SystemModel")) { + if (Util::SameString(compType, "Fan:SystemModel")) { return true; - } else if (UtilityRoutines::SameString(compType, "Fan:ComponentModel")) { + } else if (Util::SameString(compType, "Fan:ComponentModel")) { return true; - } else if (UtilityRoutines::SameString(compType, "Fan:OnOff")) { + } else if (Util::SameString(compType, "Fan:OnOff")) { return true; - } else if (UtilityRoutines::SameString(compType, "Fan:ConstantVolume")) { + } else if (Util::SameString(compType, "Fan:ConstantVolume")) { return true; - } else if (UtilityRoutines::SameString(compType, "Fan:VariableVolume")) { + } else if (Util::SameString(compType, "Fan:VariableVolume")) { return true; } else { return false; @@ -2008,7 +2008,7 @@ bool ReportCoilSelection::isCompTypeCoil(std::string const &compType // string c // if compType name is one of the coil objects, then return true bool found(false); for (int loop = 1; loop <= DataHVACGlobals::NumAllCoilTypes; ++loop) { - if (UtilityRoutines::SameString(compType, DataHVACGlobals::cAllCoilTypes(loop))) { + if (Util::SameString(compType, DataHVACGlobals::cAllCoilTypes(loop))) { found = true; break; } diff --git a/src/EnergyPlus/ResultsFramework.cc b/src/EnergyPlus/ResultsFramework.cc index c8eb8d32633..01310891abb 100644 --- a/src/EnergyPlus/ResultsFramework.cc +++ b/src/EnergyPlus/ResultsFramework.cc @@ -922,9 +922,9 @@ namespace ResultsFramework { if (numAlphas > 0) { std::string option = alphas(1); - if (UtilityRoutines::SameString(option, "TimeSeries")) { + if (Util::SameString(option, "TimeSeries")) { tsEnabled = true; - } else if (UtilityRoutines::SameString(option, "TimeSeriesAndTabular")) { + } else if (Util::SameString(option, "TimeSeriesAndTabular")) { tsEnabled = true; tsAndTabularEnabled = true; } @@ -935,15 +935,15 @@ namespace ResultsFramework { outputMsgPack = false; if (numAlphas >= 2) { - outputJSON = UtilityRoutines::SameString(alphas(2), "Yes"); + outputJSON = Util::SameString(alphas(2), "Yes"); } if (numAlphas >= 3) { - outputCBOR = UtilityRoutines::SameString(alphas(3), "Yes"); + outputCBOR = Util::SameString(alphas(3), "Yes"); } if (numAlphas >= 4) { - outputMsgPack = UtilityRoutines::SameString(alphas(4), "Yes"); + outputMsgPack = Util::SameString(alphas(4), "Yes"); } } } diff --git a/src/EnergyPlus/ReturnAirPathManager.cc b/src/EnergyPlus/ReturnAirPathManager.cc index 1687ca7d4cb..815ff2de4ea 100644 --- a/src/EnergyPlus/ReturnAirPathManager.cc +++ b/src/EnergyPlus/ReturnAirPathManager.cc @@ -146,7 +146,7 @@ namespace ReturnAirPathManager { state.dataIPShortCut->rNumericArgs, NumNums, IOStat); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataZoneEquip->ReturnAirPath(PathNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataZoneEquip->ReturnAirPath(PathNum).NumOfComponents = nint((NumAlphas - 2.0) / 2.0); @@ -174,8 +174,8 @@ namespace ReturnAirPathManager { for (CompNum = 1; CompNum <= state.dataZoneEquip->ReturnAirPath(PathNum).NumOfComponents; ++CompNum) { - if ((UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(Counter), "AirLoopHVAC:ZoneMixer")) || - (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(Counter), "AirLoopHVAC:ReturnPlenum"))) { + if ((Util::SameString(state.dataIPShortCut->cAlphaArgs(Counter), "AirLoopHVAC:ZoneMixer")) || + (Util::SameString(state.dataIPShortCut->cAlphaArgs(Counter), "AirLoopHVAC:ReturnPlenum"))) { state.dataZoneEquip->ReturnAirPath(PathNum).ComponentType(CompNum) = state.dataIPShortCut->cAlphaArgs(Counter); state.dataZoneEquip->ReturnAirPath(PathNum).ComponentName(CompNum) = state.dataIPShortCut->cAlphaArgs(Counter + 1); diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index b645d9c72bb..2ca2d85fd35 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -291,7 +291,7 @@ namespace RoomAir { } } } - } else if (UtilityRoutines::SameString(zoneEquipList.EquipName(I), afnHVAC.Name)) { + } else if (Util::SameString(zoneEquipList.EquipName(I), afnHVAC.Name)) { if (afnHVAC.EquipConfigIndex == 0) { afnHVAC.EquipConfigIndex = I; } @@ -300,9 +300,8 @@ namespace RoomAir { ReturnFrac(I) += afnHVAC.ReturnFraction; } } - for (int iNode = 1; iNode <= state.dataLoopNodes->NumOfNodes; ++iNode) { // loop over all nodes to find supply node ID - if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.SupplyNodeName)) { + if (Util::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.SupplyNodeName)) { afnHVAC.SupNodeNum = iNode; break; } @@ -332,7 +331,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 (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.ReturnNodeName)) { + if (Util::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.ReturnNodeName)) { afnHVAC.RetNodeNum = iNode; break; } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 817041a80cd..ab60a784d32 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -298,7 +298,7 @@ namespace RoomAir { ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // first get zone ID - int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); if (ZoneNum == 0) { // throw error ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -429,7 +429,7 @@ namespace RoomAir { roomAirPattern.TwoGradPatrn.HiGradient = ipsc->rNumericArgs(6); roomAirPattern.TwoGradPatrn.InterpolationMode = - static_cast(getEnumValue(userDefinedPatternModeNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + static_cast(getEnumValue(userDefinedPatternModeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); if (roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -559,7 +559,7 @@ namespace RoomAir { for (int i = 1; i <= NumPairs; ++i) { roomAirPattern.MapPatrn.SurfName(i) = ipsc->cAlphaArgs(i + 1); roomAirPattern.MapPatrn.DeltaTai(i) = ipsc->rNumericArgs(i + 4); - roomAirPattern.MapPatrn.SurfID(i) = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataSurface->Surface); + roomAirPattern.MapPatrn.SurfID(i) = Util::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataSurface->Surface); if (roomAirPattern.MapPatrn.SurfID(i) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i + 1), ipsc->cAlphaArgs(i + 1)); ErrorsFound = true; @@ -592,8 +592,9 @@ namespace RoomAir { for (int i = 1; i <= state.dataGlobal->NumOfZones; ++i) { if (state.dataRoomAir->AirPatternZoneInfo(i).IsUsed) { // first get return and exhaust air node index - int found = UtilityRoutines::FindItemInList( + int found = Util::FindItemInList( state.dataRoomAir->AirPatternZoneInfo(i).ZoneName, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); + if (found != 0) { state.dataRoomAir->AirPatternZoneInfo(i).ZoneNodeID = state.dataZoneEquip->ZoneEquipConfig(found).ZoneNode; @@ -675,7 +676,7 @@ namespace RoomAir { ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, airNode.Name}; airNode.ZoneName = ipsc->cAlphaArgs(3); // Zone name - airNode.ZonePtr = UtilityRoutines::FindItemInList(airNode.ZoneName, state.dataHeatBal->Zone); + airNode.ZonePtr = Util::FindItemInList(airNode.ZoneName, state.dataHeatBal->Zone); if (airNode.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; @@ -688,7 +689,7 @@ namespace RoomAir { airNode.SurfMask.allocate(NumOfSurfs); } - airNode.ClassType = static_cast(getEnumValue(airNodeTypeNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + airNode.ClassType = static_cast(getEnumValue(airNodeTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); if (airNode.ClassType == AirNodeType::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -846,7 +847,7 @@ namespace RoomAir { ipsc->cNumericFieldNames); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ""}; - int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); if (ZoneNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; @@ -915,7 +916,7 @@ namespace RoomAir { ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name // zoneUCSDDV.ZoneName = ipsc->cAlphaArgs(1); - zoneDV3N.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + zoneDV3N.ZonePtr = Util::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); if (zoneDV3N.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; @@ -990,7 +991,7 @@ namespace RoomAir { ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name // state.dataRoomAir->ZoneUCSDCV(Loop).ZoneName = ipsc->cAlphaArgs(1); - if ((zoneCV.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone)) == 0) { + if ((zoneCV.ZonePtr = Util::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone)) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { @@ -1014,7 +1015,7 @@ namespace RoomAir { ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(3)); ErrorsFound = true; } - } else if ((zoneCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(3))))) == + } else if ((zoneCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(3))))) == Comfort::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; @@ -1024,7 +1025,7 @@ namespace RoomAir { // Following depend on valid zone - if (UtilityRoutines::FindItemInList( + if (Util::FindItemInList( state.dataHeatBal->Zone(zoneCV.ZonePtr).Name, state.afn->MultizoneZoneData, &AirflowNetwork::MultizoneZoneProp::ZoneName) == 0) { ShowSevereError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, "AirflowNetwork airflow model must be active in this zone"); @@ -1119,7 +1120,7 @@ namespace RoomAir { ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; zoneUI.ZoneName = ipsc->cAlphaArgs(1); - zoneUI.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + zoneUI.ZonePtr = Util::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); state.dataRoomAir->ZoneUFADPtr(zoneUI.ZonePtr) = Loop; if (zoneUI.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); @@ -1130,7 +1131,7 @@ namespace RoomAir { } // 2nd alpha is diffuser type - zoneUI.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + zoneUI.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); if (zoneUI.DiffuserType == Diffuser::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1181,7 +1182,7 @@ namespace RoomAir { auto &zoneUE = state.dataRoomAir->ZoneUFAD(Loop + state.dataRoomAir->TotUFADInt); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; zoneUE.ZoneName = ipsc->cAlphaArgs(1); - zoneUE.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + zoneUE.ZonePtr = Util::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); if (zoneUE.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; @@ -1189,8 +1190,7 @@ namespace RoomAir { state.dataRoomAir->IsZoneUFAD(zoneUE.ZonePtr) = true; state.dataRoomAir->ZoneUFADPtr(zoneUE.ZonePtr) = Loop + state.dataRoomAir->TotUFADInt; } - - zoneUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + zoneUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(2)))); if (zoneUE.DiffuserType == Diffuser::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1280,7 +1280,8 @@ namespace RoomAir { ipsc->cNumericFieldNames); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + int ZoneNum = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + if (ZoneNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1316,8 +1317,7 @@ namespace RoomAir { } // control point node - roomAFNZoneInfo.ControlAirNodeID = - UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(3), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); + roomAFNZoneInfo.ControlAirNodeID = Util::FindItemInList(ipsc->cAlphaArgs(3), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); if (roomAFNZoneInfo.ControlAirNodeID == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; @@ -1348,7 +1348,7 @@ namespace RoomAir { ipsc->cNumericFieldNames); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + int ZoneNum = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (ZoneNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1356,7 +1356,7 @@ namespace RoomAir { } auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - int RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); + int RAFNNodeNum = Util::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); if (RAFNNodeNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; @@ -1405,7 +1405,7 @@ namespace RoomAir { int RAFNNodeNum = 0; auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); if (roomAFNZoneInfo.NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList( + RAFNNodeNum = Util::FindItemInList( ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, &AFNAirNodeNested::NodeSurfListName, roomAFNZoneInfo.NumOfAirNodes); } @@ -1498,7 +1498,7 @@ namespace RoomAir { // find surface list int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList( + RAFNNodeNum = Util::FindItemInList( ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, &AFNAirNodeNested::NodeIntGainsListName, roomAFNZoneInfo.NumOfAirNodes); } if (RAFNNodeNum == 0) continue; @@ -1526,7 +1526,7 @@ namespace RoomAir { for (int gainsLoop = 1; gainsLoop <= numInputGains; ++gainsLoop) { auto &intGain = roomAFNZoneNode.IntGain(gainsLoop); intGain.type = static_cast( - getEnumValue(DataHeatBalance::IntGainTypeNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(gainsLoop * 2)))); + getEnumValue(DataHeatBalance::IntGainTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(gainsLoop * 2)))); if (intGain.type == DataHeatBalance::IntGainType::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(gainsLoop * 2), ipsc->cAlphaArgs(gainsLoop * 2)); @@ -1596,7 +1596,7 @@ namespace RoomAir { // find surface list int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList( + RAFNNodeNum = Util::FindItemInList( ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, &AFNAirNodeNested::NodeHVACListName, roomAFNZoneInfo.NumOfAirNodes); } @@ -1690,7 +1690,7 @@ namespace RoomAir { for (int iGain2 = 1; iGain2 <= roomAFNNode2.NumIntGains; ++iGain2) { auto &intGain2 = roomAFNNode2.IntGain(iGain2); if (intGain2.FractionCheck) continue; - if (intGain.type == intGain2.type && UtilityRoutines::SameString(intGain.Name, intGain2.Name)) { + if (intGain.type == intGain2.type && Util::SameString(intGain.Name, intGain2.Name)) { SumFraction += roomAFNNode2.IntGainsFractions(iGain2); intGain2.FractionCheck = true; } @@ -2657,7 +2657,7 @@ namespace RoomAir { for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { auto const &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(I); if (afnZoneInfo.NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(RAFNNodeName, afnZoneInfo.Node, afnZoneInfo.NumOfAirNodes); + RAFNNodeNum = Util::FindItemInList(RAFNNodeName, afnZoneInfo.Node, afnZoneInfo.NumOfAirNodes); if (RAFNNodeNum > 0) { ZoneNum = I; break; @@ -2736,7 +2736,7 @@ namespace RoomAir { for (int I = 1; I <= TotNumEquip; ++I) { state.dataInputProcessing->inputProcessor->getObjectItem(state, equipTypeName, I, Alphas, NumAlphas, Numbers, NumNumbers, Status); - if (UtilityRoutines::SameString(Alphas(1), EquipName)) { + if (Util::SameString(Alphas(1), EquipName)) { EquipFind = true; break; } diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index a1786069fd3..5627e9cbd2e 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -425,7 +425,7 @@ void ParseStack(EnergyPlusData &state, int const StackNum) } else { Remainder = stripped(Line.substr(Pos + 1)); } - // Keyword = UtilityRoutines::makeUPPER(Line(1:Pos-1)) + // Keyword = Util::makeUPPER(Line(1:Pos-1)) Keyword = Line.substr(0, Pos); // the functionality in each block of this parser structure is so different that a regular IF block seems reasonable @@ -470,8 +470,8 @@ void ParseStack(EnergyPlusData &state, int const StackNum) } else { Pos = scan(Remainder, ' '); if (Pos == std::string::npos) Pos = Remainder.length(); - Variable = UtilityRoutines::makeUPPER(stripped(Remainder.substr(0, Pos))); // really the subroutine, or reference to instruction set - StackNum2 = UtilityRoutines::FindItemInList(Variable, state.dataRuntimeLang->ErlStack); + Variable = Util::makeUPPER(stripped(Remainder.substr(0, Pos))); // really the subroutine, or reference to instruction set + StackNum2 = Util::FindItemInList(Variable, state.dataRuntimeLang->ErlStack); if (StackNum2 == 0) { AddError(state, StackNum, LineNum, "Program or Subroutine name [" + Variable + "] not found for the RUN instruction."); } else { @@ -1160,7 +1160,7 @@ void ParseExpression(EnergyPlusData &state, state.dataRuntimeLangProcessor->PEToken(NumTokens).Type = Token::Number; state.dataRuntimeLangProcessor->PEToken(NumTokens).String = StringToken; if (state.dataSysVars->DeveloperFlag) print(state.files.debug, "Number=\"{}\"\n", StringToken); - state.dataRuntimeLangProcessor->PEToken(NumTokens).Number = UtilityRoutines::ProcessNumber(StringToken, ErrorFlag); + state.dataRuntimeLangProcessor->PEToken(NumTokens).Number = Util::ProcessNumber(StringToken, ErrorFlag); if (state.dataSysVars->DeveloperFlag && ErrorFlag) print(state.files.debug, "{}\n", "Numeric error flagged"); if (MinusFound) { state.dataRuntimeLangProcessor->PEToken(NumTokens).Number = -state.dataRuntimeLangProcessor->PEToken(NumTokens).Number; @@ -1245,7 +1245,7 @@ void ParseExpression(EnergyPlusData &state, const size_t len = strlen(string); const std::string potential_match = String.substr(Pos, len); - if ((case_insensitive && UtilityRoutines::SameString(potential_match, string)) || (!case_insensitive && potential_match == string)) { + if ((case_insensitive && Util::SameString(potential_match, string)) || (!case_insensitive && potential_match == string)) { if (state.dataSysVars->DeveloperFlag) print(state.files.debug, "OPERATOR \"{}\"\n", potential_match); state.dataRuntimeLangProcessor->PEToken(NumTokens).Operator = op; state.dataRuntimeLangProcessor->PEToken(NumTokens).String = potential_match; @@ -1500,8 +1500,6 @@ int ProcessTokens( ShowFatalError(state, "Program terminates due to preceding error."); } - SetupPossibleOperators(state); // includes built-in functions - // Process operators and builtin functions // Loop thru all operators and group expressions in the order of precedence for (OperatorNum = 1; OperatorNum <= NumPossibleOperators; ++OperatorNum) { @@ -1521,7 +1519,7 @@ int ProcessTokens( if (static_cast(Token(TokenNum).Operator) > static_cast(ErlFunc::LogicalOR)) { // we have a function expression to set up ExpressionNum = NewExpression(state); state.dataRuntimeLang->ErlExpression(ExpressionNum).Operator = static_cast(OperatorNum); - NumOperands = state.dataRuntimeLang->PossibleOperators(OperatorNum).NumOperands; + NumOperands = ErlFuncNumOperands[OperatorNum]; state.dataRuntimeLang->ErlExpression(ExpressionNum).NumOperands = NumOperands; state.dataRuntimeLang->ErlExpression(ExpressionNum).Operand.allocate(NumOperands); @@ -1577,23 +1575,19 @@ int ProcessTokens( } break; } else { - ShowSevereError(state, - format("The operator \"{}\" is missing the left-hand operand!", - state.dataRuntimeLang->PossibleOperators(OperatorNum).Symbol)); + ShowSevereError(state, format("The operator \"{}\" is missing the left-hand operand!", ErlFuncNamesUC[OperatorNum])); ShowContinueError(state, format("String being parsed=\"{}\".", ParsingString)); break; } } else if (Pos == NumTokens) { - ShowSevereError( - state, - format("The operator \"{}\" is missing the right-hand operand!", state.dataRuntimeLang->PossibleOperators(OperatorNum).Symbol)); + ShowSevereError(state, format("The operator \"{}\" is missing the right-hand operand!", ErlFuncNamesUC[OperatorNum])); ShowContinueError(state, format("String being parsed=\"{}\".", ParsingString)); break; } else { ExpressionNum = NewExpression(state); state.dataRuntimeLang->ErlExpression(ExpressionNum).Operator = static_cast(OperatorNum); - NumOperands = state.dataRuntimeLang->PossibleOperators(OperatorNum).NumOperands; + NumOperands = ErlFuncNumOperands[OperatorNum]; state.dataRuntimeLang->ErlExpression(ExpressionNum).NumOperands = NumOperands; state.dataRuntimeLang->ErlExpression(ExpressionNum).Operand.allocate(NumOperands); @@ -2512,207 +2506,165 @@ ErlValueType EvaluateExpression(EnergyPlusData &state, int const ExpressionNum, break; case ErlFunc::TodayIsRain: - TodayTomorrowWeather( - state, ErlFunc::TodayIsRain, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayIsRain, ReturnValue); - break; - case ErlFunc::TodayIsSnow: - TodayTomorrowWeather( - state, ErlFunc::TodayIsSnow, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayIsSnow, ReturnValue); - break; - case ErlFunc::TodayOutDryBulbTemp: - TodayTomorrowWeather(state, - ErlFunc::TodayOutDryBulbTemp, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TodayOutDryBulbTemp, - ReturnValue); - break; - case ErlFunc::TodayOutDewPointTemp: - TodayTomorrowWeather(state, - ErlFunc::TodayOutDewPointTemp, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TodayOutDewPointTemp, - ReturnValue); - break; - case ErlFunc::TodayOutBaroPress: - TodayTomorrowWeather(state, - ErlFunc::TodayOutBaroPress, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TodayOutBaroPress, - ReturnValue); - break; - case ErlFunc::TodayOutRelHum: - TodayTomorrowWeather( - state, ErlFunc::TodayOutRelHum, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayOutRelHum, ReturnValue); - break; - case ErlFunc::TodayWindSpeed: - TodayTomorrowWeather( - state, ErlFunc::TodayWindSpeed, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayWindSpeed, ReturnValue); - break; - case ErlFunc::TodayWindDir: - TodayTomorrowWeather( - state, ErlFunc::TodayWindDir, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayWindDir, ReturnValue); - break; - case ErlFunc::TodaySkyTemp: - TodayTomorrowWeather( - state, ErlFunc::TodaySkyTemp, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodaySkyTemp, ReturnValue); - break; - case ErlFunc::TodayHorizIRSky: - TodayTomorrowWeather( - state, ErlFunc::TodayHorizIRSky, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayHorizIRSky, ReturnValue); - break; - case ErlFunc::TodayBeamSolarRad: - TodayTomorrowWeather(state, - ErlFunc::TodayBeamSolarRad, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TodayBeamSolarRad, - ReturnValue); - break; - case ErlFunc::TodayDifSolarRad: - TodayTomorrowWeather( - state, ErlFunc::TodayDifSolarRad, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayDifSolarRad, ReturnValue); - break; - case ErlFunc::TodayAlbedo: - TodayTomorrowWeather( - state, ErlFunc::TodayAlbedo, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TodayAlbedo, ReturnValue); - break; - - case ErlFunc::TodayLiquidPrecip: - TodayTomorrowWeather(state, - ErlFunc::TodayLiquidPrecip, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TodayLiquidPrecip, - ReturnValue); - break; + case ErlFunc::TodayLiquidPrecip: { + int iHour = (Operand(1).Number + 1); // Operand 1 is hour from 0:23 + int iTimeStep = Operand(2).Number; + if ((iHour > 0) && (iHour <= 24) && (iTimeStep > 0) && (iTimeStep <= state.dataGlobal->NumOfTimeStepInHour)) { + auto const &today = state.dataWeather->wvarsHrTsToday(iTimeStep, iHour); + ReturnValue.initialized = true; + ReturnValue.Type = Value::Number; + switch (state.dataRuntimeLang->ErlExpression(ExpressionNum).Operator) { + case ErlFunc::TodayIsRain: { + ReturnValue.Number = today.IsRain ? 1.0 : 0.0; + } break; + case ErlFunc::TodayIsSnow: { + ReturnValue.Number = today.IsSnow ? 1.0 : 0.0; + } break; + case ErlFunc::TodayOutDryBulbTemp: { + ReturnValue.Number = today.OutDryBulbTemp; + } break; + case ErlFunc::TodayOutDewPointTemp: { + ReturnValue.Number = today.OutDewPointTemp; + } break; + case ErlFunc::TodayOutBaroPress: { + ReturnValue.Number = today.OutBaroPress; + } break; + case ErlFunc::TodayOutRelHum: { + ReturnValue.Number = today.OutRelHum; + } break; + case ErlFunc::TodayWindSpeed: { + ReturnValue.Number = today.WindSpeed; + } break; + case ErlFunc::TodayWindDir: { + ReturnValue.Number = today.WindDir; + } break; + case ErlFunc::TodaySkyTemp: { + ReturnValue.Number = today.SkyTemp; + } break; + case ErlFunc::TodayHorizIRSky: { + ReturnValue.Number = today.HorizIRSky; + } break; + case ErlFunc::TodayBeamSolarRad: { + ReturnValue.Number = today.BeamSolarRad; + } break; + case ErlFunc::TodayDifSolarRad: { + ReturnValue.Number = today.DifSolarRad; + } break; + case ErlFunc::TodayAlbedo: { + ReturnValue.Number = today.Albedo; + } break; + case ErlFunc::TodayLiquidPrecip: { + ReturnValue.Number = today.LiquidPrecip; + } break; + default: { + assert(false); + } break; + } + } else { + ReturnValue.Type = DataRuntimeLanguage::Value::Error; + ReturnValue.Error = format("{} function called with invalid arguments: Hour={:.1R}, Timestep={:.1R}", + ErlFuncNamesUC[(int)state.dataRuntimeLang->ErlExpression(ExpressionNum).Operator], + Operand(1).Number, + Operand(2).Number); + } + } break; case ErlFunc::TomorrowIsRain: - TodayTomorrowWeather( - state, ErlFunc::TomorrowIsRain, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TomorrowIsRain, ReturnValue); - break; - case ErlFunc::TomorrowIsSnow: - TodayTomorrowWeather( - state, ErlFunc::TomorrowIsSnow, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TomorrowIsSnow, ReturnValue); - break; - case ErlFunc::TomorrowOutDryBulbTemp: - TodayTomorrowWeather(state, - ErlFunc::TomorrowOutDryBulbTemp, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowOutDryBulbTemp, - ReturnValue); - break; - case ErlFunc::TomorrowOutDewPointTemp: - TodayTomorrowWeather(state, - ErlFunc::TomorrowOutDewPointTemp, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowOutDewPointTemp, - ReturnValue); - break; - case ErlFunc::TomorrowOutBaroPress: - TodayTomorrowWeather(state, - ErlFunc::TomorrowOutBaroPress, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowOutBaroPress, - ReturnValue); - break; - case ErlFunc::TomorrowOutRelHum: - TodayTomorrowWeather(state, - ErlFunc::TomorrowOutRelHum, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowOutRelHum, - ReturnValue); - break; - case ErlFunc::TomorrowWindSpeed: - TodayTomorrowWeather(state, - ErlFunc::TomorrowWindSpeed, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowWindSpeed, - ReturnValue); - break; - case ErlFunc::TomorrowWindDir: - TodayTomorrowWeather( - state, ErlFunc::TomorrowWindDir, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TomorrowWindDir, ReturnValue); - break; - case ErlFunc::TomorrowSkyTemp: - TodayTomorrowWeather( - state, ErlFunc::TomorrowSkyTemp, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TomorrowSkyTemp, ReturnValue); - break; - case ErlFunc::TomorrowHorizIRSky: - TodayTomorrowWeather(state, - ErlFunc::TomorrowHorizIRSky, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowHorizIRSky, - ReturnValue); - break; - case ErlFunc::TomorrowBeamSolarRad: - TodayTomorrowWeather(state, - ErlFunc::TomorrowBeamSolarRad, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowBeamSolarRad, - ReturnValue); - break; - case ErlFunc::TomorrowDifSolarRad: - TodayTomorrowWeather(state, - ErlFunc::TomorrowDifSolarRad, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowDifSolarRad, - ReturnValue); - break; - case ErlFunc::TomorrowAlbedo: - TodayTomorrowWeather( - state, ErlFunc::TomorrowAlbedo, Operand(1).Number, Operand(2).Number, state.dataWeatherManager->TomorrowAlbedo, ReturnValue); - break; + case ErlFunc::TomorrowLiquidPrecip: { + int iHour = (Operand(1).Number + 1); // Operand 1 is hour from 0:23 + int iTimeStep = Operand(2).Number; + if ((iHour > 0) && (iHour <= Constant::HoursInDay) && (iTimeStep > 0) && (iTimeStep <= state.dataGlobal->NumOfTimeStepInHour)) { + auto const &tomorrow = state.dataWeather->wvarsHrTsTomorrow(iTimeStep, iHour); + ReturnValue.initialized = true; + ReturnValue.Type = Value::Number; + switch (state.dataRuntimeLang->ErlExpression(ExpressionNum).Operator) { + case ErlFunc::TomorrowIsRain: { + ReturnValue.Number = tomorrow.IsRain ? 1.0 : 0.0; + } break; + case ErlFunc::TomorrowIsSnow: { + ReturnValue.Number = tomorrow.IsSnow ? 1.0 : 0.0; + } break; + case ErlFunc::TomorrowOutDryBulbTemp: { + ReturnValue.Number = tomorrow.OutDryBulbTemp; + } break; + case ErlFunc::TomorrowOutDewPointTemp: { + ReturnValue.Number = tomorrow.OutDewPointTemp; + } break; + case ErlFunc::TomorrowOutBaroPress: { + ReturnValue.Number = tomorrow.OutBaroPress; + } break; + case ErlFunc::TomorrowOutRelHum: { + ReturnValue.Number = tomorrow.OutRelHum; + } break; + case ErlFunc::TomorrowWindSpeed: { + ReturnValue.Number = tomorrow.WindSpeed; + } break; + case ErlFunc::TomorrowWindDir: { + ReturnValue.Number = tomorrow.WindDir; + } break; + case ErlFunc::TomorrowSkyTemp: { + ReturnValue.Number = tomorrow.SkyTemp; + } break; + case ErlFunc::TomorrowHorizIRSky: { + ReturnValue.Number = tomorrow.HorizIRSky; + } break; + case ErlFunc::TomorrowBeamSolarRad: { + ReturnValue.Number = tomorrow.BeamSolarRad; + } break; + case ErlFunc::TomorrowDifSolarRad: { + ReturnValue.Number = tomorrow.DifSolarRad; + } break; + case ErlFunc::TomorrowAlbedo: { + ReturnValue.Number = tomorrow.Albedo; + } break; + case ErlFunc::TomorrowLiquidPrecip: { + ReturnValue.Number = tomorrow.LiquidPrecip; + } break; + default: { + assert(false); + } break; + } + } else { + ReturnValue.Type = DataRuntimeLanguage::Value::Error; + ReturnValue.Error = format("{} function called with invalid arguments: Hour={:.1R}, Timestep={:.1R}", + ErlFuncNamesUC[(int)state.dataRuntimeLang->ErlExpression(ExpressionNum).Operator], + Operand(1).Number, + Operand(2).Number); + } + } break; - case ErlFunc::TomorrowLiquidPrecip: - TodayTomorrowWeather(state, - ErlFunc::TomorrowLiquidPrecip, - Operand(1).Number, - Operand(2).Number, - state.dataWeatherManager->TomorrowLiquidPrecip, - ReturnValue); - break; case ErlFunc::Invalid: case ErlFunc::Null: case ErlFunc::TsatFnPb: - case ErlFunc::Num: + case ErlFunc::Num: { // throw Error, these cases are not supported -- they all make sense except TsatFnPb which was commented out above a long time ago ShowFatalError(state, "caught unexpected Expression(ExpressionNum)%Operator in EvaluateExpression"); - } + } break; + } // switch (FunctionCode) } Operand.deallocate(); } @@ -2720,77 +2672,6 @@ ErlValueType EvaluateExpression(EnergyPlusData &state, int const ExpressionNum, return ReturnValue; } -void TodayTomorrowWeather(EnergyPlusData &state, - ErlFunc const FunctionCode, - Real64 const Operand1, - Real64 const Operand2, - Array2D &TodayTomorrowWeatherSource, - ErlValueType &ReturnVal) -{ - int iHour = (Operand1 + 1); // Operand 1 is hour from 0:23 - int iTimeStep = Operand2; - if ((iHour > 0) && (iHour <= 24) && (iTimeStep > 0) && (iTimeStep <= state.dataGlobal->NumOfTimeStepInHour)) { - ReturnVal = SetErlValueNumber(TodayTomorrowWeatherSource(iTimeStep, iHour)); - } else { - ReturnVal.Type = DataRuntimeLanguage::Value::Error; - ReturnVal.Error = format("{} function called with invalid arguments: Hour={:.1R}, Timestep={:.1R}", - state.dataRuntimeLang->PossibleOperators(static_cast(FunctionCode)).Symbol, - Operand1, - Operand2); - } -} - -void TodayTomorrowWeather(EnergyPlusData &state, - ErlFunc const FunctionCode, - Real64 const Operand1, - Real64 const Operand2, - Array2D_bool &TodayTomorrowWeatherSource, - ErlValueType &ReturnVal) -{ - int iHour = (Operand1 + 1); // Operand 1 is hour from 0:23 - int iTimeStep = Operand2; - if ((iHour > 0) && (iHour <= 24) && (iTimeStep > 0) && (iTimeStep <= state.dataGlobal->NumOfTimeStepInHour)) { - // For logicals return 1 or 0 - if (TodayTomorrowWeatherSource(iTimeStep, iHour)) { - ReturnVal = SetErlValueNumber(1.0); - } else { - ReturnVal = SetErlValueNumber(0.0); - } - } else { - ReturnVal.Type = DataRuntimeLanguage::Value::Error; - ReturnVal.Error = format("{} function called with invalid arguments: Hour={:.1R}, Timestep={:.1R}", - state.dataRuntimeLang->PossibleOperators(static_cast(FunctionCode)).Symbol, - Operand1, - Operand2); - } -} - -int TodayTomorrowWeather(EnergyPlusData &state, int hour, int timestep, Array2D &TodayTomorrowWeatherSource, Real64 &value) -{ - int iHour = hour + 1; - if ((iHour > 0) && (iHour <= 24) && (timestep > 0) && (timestep <= state.dataGlobal->NumOfTimeStepInHour)) { - value = TodayTomorrowWeatherSource(timestep, iHour); - return 0; - } else { - return 1; - } -} - -int TodayTomorrowWeather(EnergyPlusData &state, int hour, int timestep, Array2D &TodayTomorrowWeatherSource, int &value) -{ - int iHour = hour + 1; - if ((iHour > 0) && (iHour <= 24) && (timestep > 0) && (timestep <= state.dataGlobal->NumOfTimeStepInHour)) { - if (TodayTomorrowWeatherSource(timestep, iHour)) { - value = 1.0; - } else { - value = 0.0; - } - return 0; - } else { - return 1; - } -} - void GetRuntimeLanguageUserInput(EnergyPlusData &state) { @@ -3159,7 +3040,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) continue; } - ConstructNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); + ConstructNum = Util::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); if (ConstructNum == 0) { if (lAlphaFieldBlanks(2)) { @@ -3272,7 +3153,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); ValidateEMSVariableName(state, cCurrentModuleObject, cAlphaArgs(1), cAlphaFieldNames(1), errFlag, ErrorsFound); if (!errFlag) { @@ -3895,40 +3776,9 @@ ErlValueType SetErlValueNumber(Real64 const Number, ObjexxFCL::Optional - - // METHODOLOGY EMPLOYED: - // - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Return value ErlValueType newValue; - // Locals - // FUNCTION ARGUMENT DEFINITIONS: - // na - - // FUNCTION PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // FUNCTION LOCAL VARIABLE DECLARATIONS: - // na - if (present(OrigValue)) { // preserve other parts of structure and only updated Value%Number newValue = OrigValue; newValue.Number = Number; @@ -4063,7 +3913,7 @@ int FindEMSVariable(EnergyPlusData &state, int TrendVarNum; Found = false; - std::string const UppercaseName = UtilityRoutines::makeUPPER(VariableName); + std::string const UppercaseName = Util::makeUPPER(VariableName); // check in ErlVariables for (VariableNum = 1; VariableNum <= state.dataRuntimeLang->NumErlVariables; ++VariableNum) { @@ -4117,7 +3967,7 @@ int NewEMSVariable(EnergyPlusData &state, std::string const &VariableName, int c // Add the new variable VariableNum = state.dataRuntimeLang->NumErlVariables; - state.dataRuntimeLang->ErlVariable(VariableNum).Name = UtilityRoutines::makeUPPER(VariableName); + state.dataRuntimeLang->ErlVariable(VariableNum).Name = Util::makeUPPER(VariableName); state.dataRuntimeLang->ErlVariable(VariableNum).StackNum = StackNum; state.dataRuntimeLang->ErlVariable(VariableNum).Value.Type = Value::Number; // ErlVariable values are numbers } @@ -4127,437 +3977,6 @@ int NewEMSVariable(EnergyPlusData &state, std::string const &VariableName, int c return VariableNum; } -void SetupPossibleOperators(EnergyPlusData &state) -{ - - // SUBROUTINE INFORMATION: - // AUTHOR Brent Griffith - // DATE WRITTEN May 2009 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // setup hard coded list of possible operands - - // METHODOLOGY EMPLOYED: - // Allocate structure and fill basic info on opertors and operands - // operators include built-in functions where operands are function arguments - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // na - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - - if (state.dataRuntimeLangProcessor->AlreadyDidOnce) return; - - state.dataRuntimeLang->PossibleOperators.allocate(NumPossibleOperators); - - // Build operator table - // Order in this table is the order of precedence - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Literal)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Literal)).Code = ErlFunc::Literal; - - // not sure how to distinguish from subtract in parsing of tokens, not yet available - // PossibleOperators(OperatorNegative)%NumOperands = 1 - // PossibleOperators(OperatorNegative)%Code = OperatorNegative - // PossibleOperators(OperatorNegative)%Symbol = '-' - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Divide)).Symbol = "/"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Divide)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Divide)).Code = ErlFunc::Divide; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Multiply)).Symbol = "*"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Multiply)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Multiply)).Code = ErlFunc::Multiply; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Subtract)).Symbol = "-"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Subtract)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Subtract)).Code = ErlFunc::Subtract; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Add)).Symbol = "+"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Add)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Add)).Code = ErlFunc::Add; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Equal)).Symbol = "=="; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Equal)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Equal)).Code = ErlFunc::Equal; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::NotEqual)).Symbol = "<>"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::NotEqual)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::NotEqual)).Code = ErlFunc::NotEqual; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LessOrEqual)).Symbol = "<="; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LessOrEqual)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LessOrEqual)).Code = ErlFunc::LessOrEqual; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::GreaterOrEqual)).Symbol = ">="; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::GreaterOrEqual)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::GreaterOrEqual)).Code = ErlFunc::GreaterOrEqual; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LessThan)).Symbol = "<"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LessThan)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LessThan)).Code = ErlFunc::LessThan; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::GreaterThan)).Symbol = ">"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::GreaterThan)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::GreaterThan)).Code = ErlFunc::GreaterThan; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RaiseToPower)).Symbol = "^"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RaiseToPower)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RaiseToPower)).Code = ErlFunc::RaiseToPower; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LogicalAND)).Symbol = "&&"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LogicalAND)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LogicalAND)).Code = ErlFunc::LogicalAND; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LogicalOR)).Symbol = "||"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LogicalOR)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::LogicalOR)).Code = ErlFunc::LogicalOR; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Round)).Symbol = "@ROUND"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Round)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Round)).Code = ErlFunc::Round; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Mod)).Symbol = "@MOD"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Mod)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Mod)).Code = ErlFunc::Mod; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Sin)).Symbol = "@SIN"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Sin)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Sin)).Code = ErlFunc::Sin; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Cos)).Symbol = "@COS"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Cos)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Cos)).Code = ErlFunc::Cos; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ArcSin)).Symbol = "@ARCSIN"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ArcSin)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ArcSin)).Code = ErlFunc::ArcSin; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ArcCos)).Symbol = "@ARCCOS"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ArcCos)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ArcCos)).Code = ErlFunc::ArcCos; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::DegToRad)).Symbol = "@DEGTORAD"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::DegToRad)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::DegToRad)).Code = ErlFunc::DegToRad; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RadToDeg)).Symbol = "@RADTODEG"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RadToDeg)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RadToDeg)).Code = ErlFunc::RadToDeg; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Exp)).Symbol = "@EXP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Exp)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Exp)).Code = ErlFunc::Exp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Ln)).Symbol = "@LN"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Ln)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Ln)).Code = ErlFunc::Ln; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Max)).Symbol = "@MAX"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Max)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Max)).Code = ErlFunc::Max; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Min)).Symbol = "@MIN"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Min)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::Min)).Code = ErlFunc::Min; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ABS)).Symbol = "@ABS"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ABS)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::ABS)).Code = ErlFunc::ABS; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandU)).Symbol = "@RANDOMUNIFORM"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandU)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandU)).Code = ErlFunc::RandU; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandG)).Symbol = "@RANDOMNORMAL"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandG)).NumOperands = 4; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandG)).Code = ErlFunc::RandG; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandSeed)).Symbol = "@SEEDRANDOM"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandSeed)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RandSeed)).Code = ErlFunc::RandSeed; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhoAirFnPbTdbW)).Symbol = "@RHOAIRFNPBTDBW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhoAirFnPbTdbW)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhoAirFnPbTdbW)).Code = ErlFunc::RhoAirFnPbTdbW; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpAirFnW)).Symbol = "@CPAIRFNW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpAirFnW)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpAirFnW)).Code = ErlFunc::CpAirFnW; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HfgAirFnWTdb)).Symbol = "@HFGAIRFNWTDB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HfgAirFnWTdb)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HfgAirFnWTdb)).Code = ErlFunc::HfgAirFnWTdb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HgAirFnWTdb)).Symbol = "@HGAIRFNWTDB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HgAirFnWTdb)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HgAirFnWTdb)).Code = ErlFunc::HgAirFnWTdb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdpFnTdbTwbPb)).Symbol = "@TDPFNTDBTWBPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdpFnTdbTwbPb)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdpFnTdbTwbPb)).Code = ErlFunc::TdpFnTdbTwbPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdpFnWPb)).Symbol = "@TDPFNWPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdpFnWPb)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdpFnWPb)).Code = ErlFunc::TdpFnWPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HFnTdbW)).Symbol = "@HFNTDBW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HFnTdbW)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HFnTdbW)).Code = ErlFunc::HFnTdbW; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HFnTdbRhPb)).Symbol = "@HFNTDBRHPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HFnTdbRhPb)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::HFnTdbRhPb)).Code = ErlFunc::HFnTdbRhPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdbFnHW)).Symbol = "@TDBFNHW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdbFnHW)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TdbFnHW)).Code = ErlFunc::TdbFnHW; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbRh)).Symbol = "@RHOVFNTDBR"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbRh)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbRh)).Code = ErlFunc::RhovFnTdbRh; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbRhLBnd0C)).Symbol = "@RhovFnTdbRhLBnd0C"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbRhLBnd0C)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbRhLBnd0C)).Code = ErlFunc::RhovFnTdbRhLBnd0C; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbWPb)).Symbol = "@RHOVFNTDBWPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbWPb)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhovFnTdbWPb)).Code = ErlFunc::RhovFnTdbWPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbRhov)).Symbol = "@RHFNTDBRHOV"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbRhov)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbRhov)).Code = ErlFunc::RhFnTdbRhov; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbRhovLBnd0C)).Symbol = "@RHFNTDBRHOVLBND0C"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbRhovLBnd0C)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbRhovLBnd0C)).Code = ErlFunc::RhFnTdbRhovLBnd0C; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbWPb)).Symbol = "@RHFNTDBWPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbWPb)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhFnTdbWPb)).Code = ErlFunc::RhFnTdbWPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TwbFnTdbWPb)).Symbol = "@TWBFNTDBWPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TwbFnTdbWPb)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TwbFnTdbWPb)).Code = ErlFunc::TwbFnTdbWPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::VFnTdbWPb)).Symbol = "@VFNTDBWPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::VFnTdbWPb)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::VFnTdbWPb)).Code = ErlFunc::VFnTdbWPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdpPb)).Symbol = "@WFNTDPPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdpPb)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdpPb)).Code = ErlFunc::WFnTdpPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbH)).Symbol = "@WFNTDBH"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbH)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbH)).Code = ErlFunc::WFnTdbH; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbTwbPb)).Symbol = "@WFNTDBTWBPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbTwbPb)).NumOperands = 3; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbTwbPb)).Code = ErlFunc::WFnTdbTwbPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbRhPb)).Symbol = "@WFNTDBRHPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbRhPb)).NumOperands = 4; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WFnTdbRhPb)).Code = ErlFunc::WFnTdbRhPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::PsatFnTemp)).Symbol = "@PSATFNTEMP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::PsatFnTemp)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::PsatFnTemp)).Code = ErlFunc::PsatFnTemp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TsatFnHPb)).Symbol = "@TSATFNHPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TsatFnHPb)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TsatFnHPb)).Code = ErlFunc::TsatFnHPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TsatFnPb)).Symbol = "@TSATFNPB"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TsatFnPb)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TsatFnPb)).Code = ErlFunc::TsatFnPb; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpCW)).Symbol = "@CPCW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpCW)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpCW)).Code = ErlFunc::CpCW; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpHW)).Symbol = "@CPHW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpHW)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CpHW)).Code = ErlFunc::CpHW; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhoH2O)).Symbol = "@RHOH2O"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhoH2O)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::RhoH2O)).Code = ErlFunc::RhoH2O; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::FatalHaltEp)).Symbol = "@FATALHALTEP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::FatalHaltEp)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::FatalHaltEp)).Code = ErlFunc::FatalHaltEp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::SevereWarnEp)).Symbol = "@SEVEREWARNEP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::SevereWarnEp)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::SevereWarnEp)).Code = ErlFunc::SevereWarnEp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WarnEp)).Symbol = "@WARNEP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WarnEp)).NumOperands = 1; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::WarnEp)).Code = ErlFunc::WarnEp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendValue)).Symbol = "@TRENDVALUE"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendValue)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendValue)).Code = ErlFunc::TrendValue; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendAverage)).Symbol = "@TRENDAVERAGE"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendAverage)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendAverage)).Code = ErlFunc::TrendAverage; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendMax)).Symbol = "@TRENDMAX"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendMax)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendMax)).Code = ErlFunc::TrendMax; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendMin)).Symbol = "@TRENDMIN"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendMin)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendMin)).Code = ErlFunc::TrendMin; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendDirection)).Symbol = "@TRENDDIRECTION"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendDirection)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendDirection)).Code = ErlFunc::TrendDirection; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendSum)).Symbol = "@TRENDSUM"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendSum)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TrendSum)).Code = ErlFunc::TrendSum; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CurveValue)).Symbol = "@CURVEVALUE"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CurveValue)).NumOperands = 6; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::CurveValue)).Code = ErlFunc::CurveValue; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayIsRain)).Symbol = "@TODAYISRAIN"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayIsRain)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayIsRain)).Code = ErlFunc::TodayIsRain; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayIsSnow)).Symbol = "@TODAYISSNOW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayIsSnow)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayIsSnow)).Code = ErlFunc::TodayIsSnow; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutDryBulbTemp)).Symbol = "@TODAYOUTDRYBULBTEMP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutDryBulbTemp)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutDryBulbTemp)).Code = ErlFunc::TodayOutDryBulbTemp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutDewPointTemp)).Symbol = "@TODAYOUTDEWPOINTTEMP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutDewPointTemp)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutDewPointTemp)).Code = ErlFunc::TodayOutDewPointTemp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutBaroPress)).Symbol = "@TODAYOUTBAROPRESS"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutBaroPress)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutBaroPress)).Code = ErlFunc::TodayOutBaroPress; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutRelHum)).Symbol = "@TODAYOUTRELHUM"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutRelHum)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayOutRelHum)).Code = ErlFunc::TodayOutRelHum; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayWindSpeed)).Symbol = "@TODAYWINDSPEED"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayWindSpeed)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayWindSpeed)).Code = ErlFunc::TodayWindSpeed; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayWindDir)).Symbol = "@TODAYWINDDIR"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayWindDir)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayWindDir)).Code = ErlFunc::TodayWindDir; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodaySkyTemp)).Symbol = "@TODAYSKYTEMP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodaySkyTemp)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodaySkyTemp)).Code = ErlFunc::TodaySkyTemp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayHorizIRSky)).Symbol = "@TODAYHORIZIRSKY"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayHorizIRSky)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayHorizIRSky)).Code = ErlFunc::TodayHorizIRSky; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayBeamSolarRad)).Symbol = "@TODAYBEAMSOLARRAD"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayBeamSolarRad)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayBeamSolarRad)).Code = ErlFunc::TodayBeamSolarRad; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayDifSolarRad)).Symbol = "@TODAYDIFSOLARRAD"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayDifSolarRad)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayDifSolarRad)).Code = ErlFunc::TodayDifSolarRad; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayAlbedo)).Symbol = "@TODAYALBEDO"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayAlbedo)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayAlbedo)).Code = ErlFunc::TodayAlbedo; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayLiquidPrecip)).Symbol = "@TODAYLIQUIDPRECIP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayLiquidPrecip)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TodayLiquidPrecip)).Code = ErlFunc::TodayLiquidPrecip; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowIsRain)).Symbol = "@TOMORROWISRAIN"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowIsRain)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowIsRain)).Code = ErlFunc::TomorrowIsRain; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowIsSnow)).Symbol = "@TOMORROWISSNOW"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowIsSnow)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowIsSnow)).Code = ErlFunc::TomorrowIsSnow; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutDryBulbTemp)).Symbol = "@TOMORROWOUTDRYBULBTEMP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutDryBulbTemp)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutDryBulbTemp)).Code = ErlFunc::TomorrowOutDryBulbTemp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutDewPointTemp)).Symbol = "@TOMORROWOUTDEWPOINTTEMP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutDewPointTemp)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutDewPointTemp)).Code = ErlFunc::TomorrowOutDewPointTemp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutBaroPress)).Symbol = "@TOMORROWOUTBAROPRESS"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutBaroPress)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutBaroPress)).Code = ErlFunc::TomorrowOutBaroPress; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutRelHum)).Symbol = "@TOMORROWOUTRELHUM"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutRelHum)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowOutRelHum)).Code = ErlFunc::TomorrowOutRelHum; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowWindSpeed)).Symbol = "@TOMORROWWINDSPEED"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowWindSpeed)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowWindSpeed)).Code = ErlFunc::TomorrowWindSpeed; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowWindDir)).Symbol = "@TOMORROWWINDDIR"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowWindDir)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowWindDir)).Code = ErlFunc::TomorrowWindDir; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowSkyTemp)).Symbol = "@TOMORROWSKYTEMP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowSkyTemp)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowSkyTemp)).Code = ErlFunc::TomorrowSkyTemp; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowHorizIRSky)).Symbol = "@TOMORROWHORIZIRSKY"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowHorizIRSky)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowHorizIRSky)).Code = ErlFunc::TomorrowHorizIRSky; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowBeamSolarRad)).Symbol = "@TOMORROWBEAMSOLARRAD"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowBeamSolarRad)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowBeamSolarRad)).Code = ErlFunc::TomorrowBeamSolarRad; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowDifSolarRad)).Symbol = "@TOMORROWDIFSOLARRAD"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowDifSolarRad)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowDifSolarRad)).Code = ErlFunc::TomorrowDifSolarRad; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowAlbedo)).Symbol = "@TOMORROWALBEDO"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowAlbedo)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowAlbedo)).Code = ErlFunc::TomorrowAlbedo; - - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowLiquidPrecip)).Symbol = "@TOMORROWLIQUIDPRECIP"; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowLiquidPrecip)).NumOperands = 2; - state.dataRuntimeLang->PossibleOperators(static_cast(ErlFunc::TomorrowLiquidPrecip)).Code = ErlFunc::TomorrowLiquidPrecip; - - state.dataRuntimeLangProcessor->AlreadyDidOnce = true; -} - void ExternalInterfaceSetErlVariable(EnergyPlusData &state, int const varNum, // The variable index to be written during run time Real64 const value // The real time value of the vairable to be set diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.hh b/src/EnergyPlus/RuntimeLanguageProcessor.hh index 45c740a960a..0aaac579b2d 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.hh +++ b/src/EnergyPlus/RuntimeLanguageProcessor.hh @@ -152,24 +152,6 @@ namespace RuntimeLanguageProcessor { ErlValueType EvaluateExpression(EnergyPlusData &state, int ExpressionNum, bool &seriousErrorFound); - void TodayTomorrowWeather(EnergyPlusData &state, - ErlFunc FunctionCode, - Real64 Operand1, - Real64 Operand2, - Array2D &TodayTomorrowWeatherSource, - ErlValueType &ReturnVal); - - void TodayTomorrowWeather(EnergyPlusData &state, - ErlFunc FunctionCode, - Real64 Operand1, - Real64 Operand2, - Array2D_bool &TodayTomorrowWeatherSource, - ErlValueType &ReturnVal); - - int TodayTomorrowWeather(EnergyPlusData &state, int hour, int timestep, Array2D &TodayTomorrowWeatherSource, Real64 &value); - - int TodayTomorrowWeather(EnergyPlusData &state, int hour, int timestep, Array2D &TodayTomorrowWeatherSource, int &value); - void GetRuntimeLanguageUserInput(EnergyPlusData &state); void ReportRuntimeLanguage(EnergyPlusData &state); @@ -186,8 +168,6 @@ namespace RuntimeLanguageProcessor { int NewEMSVariable(EnergyPlusData &state, std::string const &VariableName, int StackNum, ObjexxFCL::Optional Value = _); - void SetupPossibleOperators(EnergyPlusData &state); - void ExternalInterfaceSetErlVariable(EnergyPlusData &state, int varNum, // The variable index to be written during run time Real64 value // The real time value of the vairable to be set diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc index b13ba27c876..9f923db5887 100644 --- a/src/EnergyPlus/ScheduleManager.cc +++ b/src/EnergyPlus/ScheduleManager.cc @@ -240,7 +240,7 @@ namespace ScheduleManager { int WkCount; int DyCount; int NumField; - WeatherManager::DateType PDateType; + Weather::DateType PDateType; int PWeekDay; int ThruField; int UntilFld; @@ -600,7 +600,7 @@ namespace ScheduleManager { lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataScheduleMgr->ScheduleType(LoopIndex).Name = Alphas(1); if (lNumericBlanks(1) || lNumericBlanks(2)) { @@ -695,8 +695,7 @@ namespace ScheduleManager { state.dataScheduleMgr->DaySchedule(Count).Name = Alphas(1); // Validate ScheduleType if (state.dataScheduleMgr->NumScheduleTypes > 0) { - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -783,8 +782,7 @@ namespace ScheduleManager { state.dataScheduleMgr->DaySchedule(Count).Name = Alphas(1); // Validate ScheduleType if (state.dataScheduleMgr->NumScheduleTypes > 0) { - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -903,8 +901,7 @@ namespace ScheduleManager { state.dataScheduleMgr->DaySchedule(Count).Name = Alphas(1); // Validate ScheduleType if (state.dataScheduleMgr->NumScheduleTypes > 0) { - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -928,11 +925,11 @@ namespace ScheduleManager { } // Depending on value of "Interpolate" field, the value for each time step in each hour gets processed: - if (UtilityRoutines::SameString(Alphas(3), "NO")) { + if (Util::SameString(Alphas(3), "NO")) { state.dataScheduleMgr->DaySchedule(Count).IntervalInterpolated = ScheduleInterpolation::No; - } else if (UtilityRoutines::SameString(Alphas(3), "AVERAGE")) { + } else if (Util::SameString(Alphas(3), "AVERAGE")) { state.dataScheduleMgr->DaySchedule(Count).IntervalInterpolated = ScheduleInterpolation::Average; - } else if (UtilityRoutines::SameString(Alphas(3), "LINEAR")) { + } else if (Util::SameString(Alphas(3), "LINEAR")) { state.dataScheduleMgr->DaySchedule(Count).IntervalInterpolated = ScheduleInterpolation::Linear; } else { ShowSevereError( @@ -1074,7 +1071,7 @@ namespace ScheduleManager { state.dataScheduleMgr->WeekSchedule(LoopIndex).Name = Alphas(1); // Rest of Alphas are processed into Pointers for (InLoopIndex = 1; InLoopIndex <= maxDayTypes; ++InLoopIndex) { - DayIndex = UtilityRoutines::FindItemInList(Alphas(InLoopIndex + 1), state.dataScheduleMgr->DaySchedule({1, NumRegDaySchedules})); + DayIndex = Util::FindItemInList(Alphas(InLoopIndex + 1), state.dataScheduleMgr->DaySchedule({1, NumRegDaySchedules})); if (DayIndex == 0) { ShowSevereError(state, format("{}{}=\"{}\", {} \"{}\" not Found", @@ -1116,7 +1113,7 @@ namespace ScheduleManager { AllDays = false; // Rest of Alphas are processed into Pointers for (InLoopIndex = 2; InLoopIndex <= NumAlphas; InLoopIndex += 2) { - DayIndex = UtilityRoutines::FindItemInList(Alphas(InLoopIndex + 1), state.dataScheduleMgr->DaySchedule({1, NumRegDaySchedules})); + DayIndex = Util::FindItemInList(Alphas(InLoopIndex + 1), state.dataScheduleMgr->DaySchedule({1, NumRegDaySchedules})); if (DayIndex == 0) { ShowSevereError(state, format("{}{}=\"{}\", {} \"{}\" not Found", @@ -1176,8 +1173,7 @@ namespace ScheduleManager { state.dataScheduleMgr->Schedule(LoopIndex).SchType = SchedType::ScheduleInput_year; // Validate ScheduleType if (state.dataScheduleMgr->NumScheduleTypes > 0) { - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -1203,7 +1199,7 @@ namespace ScheduleManager { DaysInYear = 0; // Rest of Alphas (Weekschedules) are processed into Pointers for (InLoopIndex = 3; InLoopIndex <= NumAlphas; ++InLoopIndex) { - WeekIndex = UtilityRoutines::FindItemInList(Alphas(InLoopIndex), state.dataScheduleMgr->WeekSchedule({1, NumRegWeekSchedules})); + WeekIndex = Util::FindItemInList(Alphas(InLoopIndex), state.dataScheduleMgr->WeekSchedule({1, NumRegWeekSchedules})); if (WeekIndex == 0) { ShowSevereError(state, format("{}{}=\"{}\", {}=\"{}\" not found.", @@ -1320,8 +1316,7 @@ namespace ScheduleManager { state.dataScheduleMgr->Schedule(SchNum).Name = Alphas(1); state.dataScheduleMgr->Schedule(SchNum).SchType = SchedType::ScheduleInput_compact; // Validate ScheduleType - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -1372,7 +1367,7 @@ namespace ScheduleManager { CurrentThrough = Alphas(NumField); ErrorHere = false; ProcessDateString(state, Alphas(NumField), EndMonth, EndDay, PWeekDay, PDateType, ErrorHere); - if (PDateType == WeatherManager::DateType::NthDayInMonth || PDateType == WeatherManager::DateType::LastDayInMonth) { + if (PDateType == Weather::DateType::NthDayInMonth || PDateType == Weather::DateType::LastDayInMonth) { ShowSevereError(state, format("{}{}=\"{}\", Invalid \"Through:\" date", RoutineName, @@ -1496,7 +1491,7 @@ namespace ScheduleManager { ++NumField; ++xxcount; ++NumNumbers; - Numbers(NumNumbers) = UtilityRoutines::ProcessNumber(Alphas(NumField), ErrorHere); + Numbers(NumNumbers) = Util::ProcessNumber(Alphas(NumField), ErrorHere); if (ErrorHere) { ShowSevereError(state, format("{}=\"{}\"", CurrentModuleObject, Alphas(1))); ShowContinueError(state, @@ -1689,8 +1684,7 @@ namespace ScheduleManager { if (state.dataScheduleMgr->NumScheduleTypes > 0) { CheckIndex = 0; if (!lAlphaBlanks(2)) - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -1723,14 +1717,14 @@ namespace ScheduleManager { continue; } - if (lAlphaBlanks(4) || UtilityRoutines::SameString(Alphas(4), "comma")) { + if (lAlphaBlanks(4) || Util::SameString(Alphas(4), "comma")) { ColumnSep = CharComma; Alphas(4) = "comma"; - } else if (UtilityRoutines::SameString(Alphas(4), "semicolon")) { + } else if (Util::SameString(Alphas(4), "semicolon")) { ColumnSep = CharSemicolon; - } else if (UtilityRoutines::SameString(Alphas(4), "tab")) { + } else if (Util::SameString(Alphas(4), "tab")) { ColumnSep = CharTab; - } else if (UtilityRoutines::SameString(Alphas(4), "space")) { + } else if (Util::SameString(Alphas(4), "space")) { ColumnSep = CharSpace; } else { ShowSevereError( @@ -2011,8 +2005,7 @@ namespace ScheduleManager { state.dataScheduleMgr->Schedule(SchNum).SchType = SchedType::ScheduleInput_constant; // Validate ScheduleType if (state.dataScheduleMgr->NumScheduleTypes > 0) { - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -2083,8 +2076,7 @@ namespace ScheduleManager { state.dataScheduleMgr->Schedule(SchNum).SchType = SchedType::ScheduleInput_external; // Validate ScheduleType - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -2161,8 +2153,7 @@ namespace ScheduleManager { state.dataScheduleMgr->Schedule(SchNum).SchType = SchedType::ScheduleInput_external; // Validate ScheduleType - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -2240,8 +2231,7 @@ namespace ScheduleManager { state.dataScheduleMgr->Schedule(SchNum).SchType = SchedType::ScheduleInput_external; // Validate ScheduleType - CheckIndex = - UtilityRoutines::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); + CheckIndex = Util::FindItemInList(Alphas(2), state.dataScheduleMgr->ScheduleType({1, state.dataScheduleMgr->NumScheduleTypes})); if (CheckIndex == 0) { if (!lAlphaBlanks(2)) { ShowWarningError(state, @@ -2861,8 +2851,7 @@ namespace ScheduleManager { } if (state.dataScheduleMgr->NumSchedules > 0) { - GetScheduleIndex = - UtilityRoutines::FindItemInList(ScheduleName, state.dataScheduleMgr->Schedule({1, state.dataScheduleMgr->NumSchedules})); + GetScheduleIndex = Util::FindItemInList(ScheduleName, state.dataScheduleMgr->Schedule({1, state.dataScheduleMgr->NumSchedules})); if (GetScheduleIndex > 0) { if (!state.dataScheduleMgr->Schedule(GetScheduleIndex).Used) { state.dataScheduleMgr->Schedule(GetScheduleIndex).Used = true; @@ -2963,8 +2952,7 @@ namespace ScheduleManager { } if (state.dataScheduleMgr->NumDaySchedules > 0) { - GetDayScheduleIndex = - UtilityRoutines::FindItemInList(ScheduleName, state.dataScheduleMgr->DaySchedule({1, state.dataScheduleMgr->NumDaySchedules})); + GetDayScheduleIndex = Util::FindItemInList(ScheduleName, state.dataScheduleMgr->DaySchedule({1, state.dataScheduleMgr->NumDaySchedules})); if (GetDayScheduleIndex > 0) { state.dataScheduleMgr->DaySchedule(GetDayScheduleIndex).Used = true; } @@ -3416,7 +3404,7 @@ namespace ScheduleManager { RetHH = 0; } else { bool error = false; - rRetHH = UtilityRoutines::ProcessNumber(String.substr(0, Pos), error); + rRetHH = Util::ProcessNumber(String.substr(0, Pos), error); RetHH = int(rRetHH); if (double(RetHH) != rRetHH || error || rRetHH < 0.0) { if (double(RetHH) != rRetHH && rRetHH >= 0.0) { @@ -3439,7 +3427,7 @@ namespace ScheduleManager { String.erase(0, Pos + 1); bool error = false; - rRetMM = UtilityRoutines::ProcessNumber(String, error); + rRetMM = Util::ProcessNumber(String, error); RetMM = int(rRetMM); if (double(RetMM) != rRetMM || error || rRetMM < 0.0) { if (double(RetMM) != rRetMM && rRetMM >= 0.0) { diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index a44fd91983d..7651b66af18 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -620,28 +620,28 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); // setup program flow control integers - if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MaxTemp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MinTemp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "HumidityRatio")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "HumidityRatio")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::HumRat; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumHumidityRatio")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumHumidityRatio")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MaxHumRat; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumHumidityRatio")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumHumidityRatio")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MinHumRat; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MassFlowRate")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MassFlowRate")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MassFlow; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumMassFlowRate")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumMassFlowRate")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MaxMassFlow; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumMassFlowRate")) { + } else if (Util::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumMassFlowRate")) { state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MinMassFlow; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -728,11 +728,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -830,17 +830,17 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &thisOASetPtMgr = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum); thisOASetPtMgr.Name = cAlphaArgs(1); thisOASetPtMgr.ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(thisOASetPtMgr.ctrlVarType, "Temperature")) { + if (Util::SameString(thisOASetPtMgr.ctrlVarType, "Temperature")) { thisOASetPtMgr.CtrlTypeMode = CtrlVarType::Temp; - } else if (UtilityRoutines::SameString(thisOASetPtMgr.ctrlVarType, "MaximumTemperature")) { + } else if (Util::SameString(thisOASetPtMgr.ctrlVarType, "MaximumTemperature")) { thisOASetPtMgr.CtrlTypeMode = CtrlVarType::MaxTemp; - } else if (UtilityRoutines::SameString(thisOASetPtMgr.ctrlVarType, "MinimumTemperature")) { + } else if (Util::SameString(thisOASetPtMgr.ctrlVarType, "MinimumTemperature")) { thisOASetPtMgr.CtrlTypeMode = CtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working @@ -961,11 +961,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -1035,8 +1035,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } // get the actual zone number of the control zone - state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataHeatBal->Zone); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneNum = Util::FindItemInList(cAlphaArgs(3), state.dataHeatBal->Zone); if (state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(3), cAlphaArgs(3))); @@ -1080,11 +1079,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -1154,8 +1153,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } // get the actual zone number of the control zone - state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataHeatBal->Zone); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneNum = Util::FindItemInList(cAlphaArgs(3), state.dataHeatBal->Zone); if (state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(3), cAlphaArgs(3))); @@ -1198,11 +1196,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -1272,8 +1270,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } // get the actual zone number of the control zone - state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataHeatBal->Zone); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum = Util::FindItemInList(cAlphaArgs(3), state.dataHeatBal->Zone); if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(3), cAlphaArgs(3))); @@ -1316,7 +1313,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ctrlVarType = "MinimumHumidityRatio"; @@ -1418,7 +1415,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ctrlVarType = "MaximumHumidityRatio"; @@ -1522,11 +1519,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -1671,14 +1668,14 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); // setup program flow control integers. state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = static_cast( - getEnumValue(controlTypeNameUC, UtilityRoutines::makeUPPER(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType))); + getEnumValue(controlTypeNameUC, Util::makeUPPER(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType))); if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == CtrlVarType::Invalid) { // should not come here if idd type choice and key list is working ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -1845,11 +1842,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -1872,7 +1869,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MinSetTemp)); } - if (UtilityRoutines::makeUPPER(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MaxTemp)]) { + if (Util::makeUPPER(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MaxTemp)]) { state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Strategy = SupplyFlowTempStrategy::MaxTemp; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -1945,11 +1942,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -1972,7 +1969,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MinSetTemp)); } - if (UtilityRoutines::makeUPPER(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MinTemp)]) { + if (Util::makeUPPER(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MinTemp)]) { state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Strategy = SupplyFlowTempStrategy::MinTemp; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -2046,11 +2043,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -2084,7 +2081,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy = - static_cast(getEnumValue(strategyNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); + static_cast(getEnumValue(strategyNamesUC, Util::makeUPPER(cAlphaArgs(4)))); if (state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy == ControlStrategy::Invalid) { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(4), cAlphaArgs(4))); @@ -2160,14 +2157,14 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).NumCtrlNodes = 1; NumNodesCtrld = 1; - if (UtilityRoutines::SameString(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).ctrlVarType, "Flow")) { + if (Util::SameString(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).ctrlVarType, "Flow")) { state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MassFlow; } else { // should not come here if idd type choice and key list is working @@ -2231,7 +2228,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); @@ -2320,7 +2317,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); @@ -2410,7 +2407,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); @@ -2500,7 +2497,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); @@ -2591,7 +2588,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); @@ -2678,7 +2675,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); @@ -2767,15 +2764,15 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MaxTemp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working @@ -2785,9 +2782,9 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) ErrorsFound = true; } state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType = cAlphaArgs(3); - if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirWetBulb")) { + if (Util::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirWetBulb")) { state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::WetBulb; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirDryBulb")) { + } else if (Util::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirDryBulb")) { state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::DryBulb; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -2880,15 +2877,15 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MaxTemp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working @@ -2908,9 +2905,9 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) NodeInputManager::CompFluidStream::Primary, ObjectIsNotParent); state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType = cAlphaArgs(4); - if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeWetBulb")) { + if (Util::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeWetBulb")) { state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::WetBulb; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeDryBulb")) { + } else if (Util::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeDryBulb")) { state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::DryBulb; } else { // should not come here if idd type choice and key list is working @@ -3006,15 +3003,15 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MaximumTemperature")) { state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MaxTemp; - } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { + } else if (Util::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).ctrlVarType, "MinimumTemperature")) { state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working @@ -3024,8 +3021,8 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) ErrorsFound = true; } state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType = cAlphaArgs(3); - if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, - "Site:GroundTemperature:BuildingSurface")) { + if (Util::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, + "Site:GroundTemperature:BuildingSurface")) { state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::BuildingSurface; if (state.dataSetPointManager->NoSurfaceGroundTempObjWarning) { if (!state.dataEnvrn->GroundTempObjInput) { @@ -3038,8 +3035,8 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } state.dataSetPointManager->NoSurfaceGroundTempObjWarning = false; } - } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, - "Site:GroundTemperature:Shallow")) { + } else if (Util::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, + "Site:GroundTemperature:Shallow")) { state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::Shallow; if (state.dataSetPointManager->NoShallowGroundTempObjWarning) { if (!state.dataEnvrn->GroundTemp_SurfaceObjInput) { @@ -3053,8 +3050,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } state.dataSetPointManager->NoShallowGroundTempObjWarning = false; } - } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, - "Site:GroundTemperature:Deep")) { + } else if (Util::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:Deep")) { state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::Deep; if (state.dataSetPointManager->NoDeepGroundTempObjWarning) { if (!state.dataEnvrn->GroundTemp_DeepObjInput) { @@ -3068,8 +3064,8 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } state.dataSetPointManager->NoDeepGroundTempObjWarning = false; } - } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, - "Site:GroundTemperature:FCfactorMethod")) { + } else if (Util::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, + "Site:GroundTemperature:FCfactorMethod")) { state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::FCFactorMethod; if (state.dataSetPointManager->NoFCGroundTempObjWarning) { if (!state.dataEnvrn->FCGroundTemps) { @@ -3194,11 +3190,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working @@ -3298,11 +3294,11 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { + if (Util::SameString(state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ctrlVarType, "Temperature")) { state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode = CtrlVarType::Temp; } else { ShowSevereError(state, format(" found invalid control type of {} in {} = {}", cAlphaArgs(2), cCurrentModuleObject, cAlphaArgs(1))); @@ -3382,7 +3378,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ctrlVarType = "Temperature"; @@ -3405,7 +3401,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); // get the actual zone number of the control zone state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); + Util::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); if (state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(2), cAlphaArgs(2))); @@ -3494,7 +3490,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ctrlVarType = "Temperature"; @@ -3517,7 +3513,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); // get the actual zone number of the control zone state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); + Util::FindItemInList(cAlphaArgs(2), state.dataHeatBal->Zone); if (state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(2), cAlphaArgs(2))); @@ -3608,7 +3604,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); @@ -3643,7 +3639,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) // process the return temperature type/value std::string returnType(cAlphaArgs(4)); - if (UtilityRoutines::SameString(returnType, "SCHEDULED")) { + if (Util::SameString(returnType, "SCHEDULED")) { state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex = GetScheduleIndex(state, cAlphaArgs(5)); if (state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex == 0) { @@ -3651,9 +3647,9 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(5), cAlphaArgs(5))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(returnType, "CONSTANT")) { + } else if (Util::SameString(returnType, "CONSTANT")) { state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureConstantTarget = rNumericArgs(3); - } else if (UtilityRoutines::SameString(returnType, "RETURNTEMPERATURESETPOINT")) { + } else if (Util::SameString(returnType, "RETURNTEMPERATURESETPOINT")) { state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).useReturnTempSetpoint = true; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -3705,7 +3701,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); @@ -3740,7 +3736,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) // process the return temperature type/value std::string returnType(cAlphaArgs(4)); - if (UtilityRoutines::SameString(returnType, "SCHEDULED")) { + if (Util::SameString(returnType, "SCHEDULED")) { state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex = GetScheduleIndex(state, cAlphaArgs(5)); if (state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex == 0) { @@ -3748,9 +3744,9 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(5), cAlphaArgs(5))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(returnType, "CONSTANT")) { + } else if (Util::SameString(returnType, "CONSTANT")) { state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureConstantTarget = rNumericArgs(3); - } else if (UtilityRoutines::SameString(returnType, "RETURNTEMPERATURESETPOINT")) { + } else if (Util::SameString(returnType, "RETURNTEMPERATURESETPOINT")) { state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).useReturnTempSetpoint = true; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -3806,7 +3802,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &setpointManager = state.dataSetPointManager->SystemNodeResetSetPtMgr(SetPtMgrNum); @@ -3926,7 +3922,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); int SetPtRstMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSystemNodeResetTempSetPtMgrs; @@ -4566,10 +4562,8 @@ void InitSetPointManagers(EnergyPlusData &state) LookForFan = true; } if (LookForFan) { - if (UtilityRoutines::SameString(CompType, "Fan:ConstantVolume") || - UtilityRoutines::SameString(CompType, "Fan:VariableVolume") || - UtilityRoutines::SameString(CompType, "Fan:OnOff") || - UtilityRoutines::SameString(CompType, "Fan:ComponentModel")) { + if (Util::SameString(CompType, "Fan:ConstantVolume") || Util::SameString(CompType, "Fan:VariableVolume") || + Util::SameString(CompType, "Fan:OnOff") || Util::SameString(CompType, "Fan:ComponentModel")) { FanNodeIn = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).NodeNumIn; FanNodeOut = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).NodeNumOut; @@ -4583,10 +4577,8 @@ void InitSetPointManagers(EnergyPlusData &state) for (CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { CompType = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf; - if (UtilityRoutines::SameString(CompType, "Fan:ConstantVolume") || - UtilityRoutines::SameString(CompType, "Fan:VariableVolume") || - UtilityRoutines::SameString(CompType, "Fan:OnOff") || - UtilityRoutines::SameString(CompType, "Fan:ComponentModel")) { + if (Util::SameString(CompType, "Fan:ConstantVolume") || Util::SameString(CompType, "Fan:VariableVolume") || + Util::SameString(CompType, "Fan:OnOff") || Util::SameString(CompType, "Fan:ComponentModel")) { FanNodeIn = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).NodeNumIn; FanNodeOut = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).NodeNumOut; } @@ -4611,9 +4603,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::Warmest)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -4649,9 +4641,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::Coldest)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumColdestSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -4689,9 +4681,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::WarmestTempFlow)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -4729,9 +4721,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::RAB)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumRABFlowSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).AirLoopNum = AirLoopNum; state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).AirLoopName = @@ -4784,9 +4776,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::MZCoolingAverage)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -4823,9 +4815,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::MZHeatingAverage)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -4858,9 +4850,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::MZMinHumAverage)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -4913,9 +4905,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::MZMaxHumAverage)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -4968,9 +4960,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::MZMinHum)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", @@ -5022,9 +5014,9 @@ void InitSetPointManagers(EnergyPlusData &state) cSetPointManagerType = managerTypeName[static_cast(SetPointManagerType::MZMaxHum)]; for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { if (state.dataHVACGlobal->NumPrimaryAirSys > 0) { - AirLoopNum = UtilityRoutines::FindItemInList(state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, - state.dataAirLoop->AirToZoneNodeInfo, - &AirLoopZoneEquipConnectData::AirLoopName); + AirLoopNum = Util::FindItemInList(state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, + state.dataAirLoop->AirToZoneNodeInfo, + &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid Air Loop specified:", diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index e5869d4b2df..f33104e7781 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -455,7 +455,7 @@ void GetAirPathData(EnergyPlusData &state) // Assign the air system data to the simulation variables. // Data needed to simulate the system goes into PrimaryAirSystem. // Data connecting the air system to the zone equipment goes into AirToZoneNodeInfo (in DataLoopNode). - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); primaryAirSystems.Name = Alphas(1); airLoopZoneInfo.AirLoopName = Alphas(1); if (NumAlphas < 9) { @@ -505,8 +505,7 @@ void GetAirPathData(EnergyPlusData &state) } // work on unique nodes - test = - UtilityRoutines::FindItemInList(Alphas(6), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); + test = Util::FindItemInList(Alphas(6), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); if (test == 0) { ++state.dataSimAirServingZones->TestUniqueNodesNum; TestUniqueNodes(state.dataSimAirServingZones->TestUniqueNodesNum).NodeName = Alphas(6); @@ -522,8 +521,7 @@ void GetAirPathData(EnergyPlusData &state) ErrorsFound = true; } if (!lAlphaBlanks(7)) { - test = UtilityRoutines::FindItemInList( - Alphas(7), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); + test = Util::FindItemInList(Alphas(7), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); if (test == 0) { ++state.dataSimAirServingZones->TestUniqueNodesNum; TestUniqueNodes(state.dataSimAirServingZones->TestUniqueNodesNum).NodeName = Alphas(7); @@ -541,8 +539,7 @@ void GetAirPathData(EnergyPlusData &state) ErrorsFound = true; } } - test = - UtilityRoutines::FindItemInList(Alphas(8), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); + test = Util::FindItemInList(Alphas(8), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); if (test == 0) { ++state.dataSimAirServingZones->TestUniqueNodesNum; TestUniqueNodes(state.dataSimAirServingZones->TestUniqueNodesNum).NodeName = Alphas(8); @@ -557,8 +554,7 @@ void GetAirPathData(EnergyPlusData &state) format("...first used in {}=\"{}\" for {}", CurrentModuleObject, TestUniqueNodes(test).AirLoopName, TestUniqueNodes(test).FieldName)); ErrorsFound = true; } - test = - UtilityRoutines::FindItemInList(Alphas(9), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); + test = Util::FindItemInList(Alphas(9), TestUniqueNodes, &AirUniqueNodes::NodeName, state.dataSimAirServingZones->TestUniqueNodesNum); if (test == 0) { ++state.dataSimAirServingZones->TestUniqueNodesNum; TestUniqueNodes(state.dataSimAirServingZones->TestUniqueNodesNum).NodeName = Alphas(9); @@ -742,7 +738,7 @@ void GetAirPathData(EnergyPlusData &state) primaryAirSystems.Branch(BranchNum).NodeNum(CompNum + 1) = OutletNodeNumbers(CompNum); // Check for Outside Air system; if there, store its connection node numbers to primary air system - if (UtilityRoutines::SameString(CompTypes(CompNum), "AirLoopHVAC:OutdoorAirSystem")) { + if (Util::SameString(CompTypes(CompNum), "AirLoopHVAC:OutdoorAirSystem")) { if (primaryAirSystems.OASysExists) { ShowSevereError( state, format("{}{}=\"{}\", too many outdoor air systems.", RoutineName, CurrentModuleObject, primaryAirSystems.Name)); @@ -876,11 +872,10 @@ void GetAirPathData(EnergyPlusData &state) if (ConListNum > 0) { state.dataInputProcessing->inputProcessor->getObjectItem( state, "ConnectorList", ConListNum, Alphas, NumAlphas, Numbers, NumNumbers, IOStat); - if ((UtilityRoutines::SameString(Alphas(2), "Connector:Splitter")) || - (UtilityRoutines::SameString(Alphas(4), "Connector:Splitter"))) { + if ((Util::SameString(Alphas(2), "Connector:Splitter")) || (Util::SameString(Alphas(4), "Connector:Splitter"))) { SplitterExists = true; } - if ((UtilityRoutines::SameString(Alphas(2), "Connector:Mixer")) || (UtilityRoutines::SameString(Alphas(4), "Connector:Mixer"))) { + if ((Util::SameString(Alphas(2), "Connector:Mixer")) || (Util::SameString(Alphas(4), "Connector:Mixer"))) { MixerExists = true; } } else { @@ -1079,7 +1074,7 @@ void GetAirPathData(EnergyPlusData &state) for (ControllerNum = 1; ControllerNum <= NumOASysControllers; ++ControllerNum) { ControllerName = Alphas(ControllerNum * 2 + 1); ControllerType = Alphas(ControllerNum * 2); - if (!UtilityRoutines::SameString(ControllerType, "Controller:OutdoorAir")) { + if (!Util::SameString(ControllerType, "Controller:OutdoorAir")) { ++OASysControllerNum; primaryAirSystems.ControllerName(OASysControllerNum) = ControllerName; primaryAirSystems.ControllerType(OASysControllerNum) = ControllerType; @@ -1093,7 +1088,7 @@ void GetAirPathData(EnergyPlusData &state) if (OANum > 0) { for (int OACompNum = 1; OACompNum <= OutsideAirSys(OANum).NumComponents; ++OACompNum) { CompType = OutsideAirSys(OANum).ComponentType(OACompNum); - if (UtilityRoutines::SameString(CompType, "Coil:Heating:Water")) { + if (Util::SameString(CompType, "Coil:Heating:Water")) { WaterCoilNodeNum = GetCoilWaterInletNode(state, CompType, OutsideAirSys(OANum).ComponentName(OACompNum), ErrorsFound); if (WaterCoilNodeNum == ActuatorNodeNum) nonLockoutCoilFound = true; break; @@ -1107,13 +1102,11 @@ void GetAirPathData(EnergyPlusData &state) // If these node numbers match, the coil is in the main air loop and the lockout flag should be reset to FALSE for (BranchNum = 1; BranchNum <= primaryAirSystems.NumBranches; ++BranchNum) { for (CompNum = 1; CompNum <= primaryAirSystems.Branch(BranchNum).TotalComponents; ++CompNum) { - if (UtilityRoutines::SameString(primaryAirSystems.Branch(BranchNum).Comp(CompNum).TypeOf, - "AirloopHVAC:OutdoorAirSystem")) + if (Util::SameString(primaryAirSystems.Branch(BranchNum).Comp(CompNum).TypeOf, "AirloopHVAC:OutdoorAirSystem")) continue; CompType = primaryAirSystems.Branch(BranchNum).Comp(CompNum).TypeOf; - if (UtilityRoutines::SameString(CompType, "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(CompType, "Coil:Heating:Water") || - UtilityRoutines::SameString(CompType, "Coil:Cooling:Water")) { + if (Util::SameString(CompType, "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(CompType, "Coil:Heating:Water") || Util::SameString(CompType, "Coil:Cooling:Water")) { WaterCoilNodeNum = GetCoilWaterInletNode(state, CompType, primaryAirSystems.Branch(BranchNum).Comp(CompNum).Name, ErrorsFound); if (WaterCoilNodeNum == ActuatorNodeNum) { @@ -1460,10 +1453,10 @@ void InitAirLoops(EnergyPlusData &state, bool const FirstHVACIteration) // TRUE // each supply air path may have up to one splitter and one plenum. Check for all combinations count // all nodes (including duplicates) for (int CompNum = 1; CompNum <= state.dataZoneEquip->SupplyAirPath(SupAirPath).NumOfComponents; ++CompNum) { - if (UtilityRoutines::SameString(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentType(CompNum), "AirLoopHVAC:ZoneSplitter")) { - int SplitterNum = UtilityRoutines::FindItemInList(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentName(CompNum), - state.dataSplitterComponent->SplitterCond, - &SplitterComponent::SplitterConditions::SplitterName); + if (Util::SameString(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentType(CompNum), "AirLoopHVAC:ZoneSplitter")) { + int SplitterNum = Util::FindItemInList(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentName(CompNum), + state.dataSplitterComponent->SplitterCond, + &SplitterComponent::SplitterConditions::SplitterName); if (SplitterNum == 0) { ShowSevereError( state, @@ -1473,11 +1466,10 @@ void InitAirLoops(EnergyPlusData &state, bool const FirstHVACIteration) // TRUE } state.dataZoneEquip->SupplyAirPath(SupAirPath).SplitterIndex(CompNum) = SplitterNum; NumAllSupAirPathNodes += state.dataSplitterComponent->SplitterCond(SplitterNum).NumOutletNodes + 1; - } else if (UtilityRoutines::SameString(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentType(CompNum), - "AirLoopHVAC:SupplyPlenum")) { - int PlenumNum = UtilityRoutines::FindItemInList(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentName(CompNum), - state.dataZonePlenum->ZoneSupPlenCond, - &ZonePlenum::ZoneSupplyPlenumConditions::ZonePlenumName); + } else if (Util::SameString(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentType(CompNum), "AirLoopHVAC:SupplyPlenum")) { + int PlenumNum = Util::FindItemInList(state.dataZoneEquip->SupplyAirPath(SupAirPath).ComponentName(CompNum), + state.dataZonePlenum->ZoneSupPlenCond, + &ZonePlenum::ZoneSupplyPlenumConditions::ZonePlenumName); if (PlenumNum == 0) { ShowSevereError( state, @@ -1823,7 +1815,7 @@ void InitAirLoops(EnergyPlusData &state, bool const FirstHVACIteration) // TRUE (thisPrimaryAirSys.Branch(BranchNum).NodeNumOut == thisPrimaryAirSys.Mixer.NodeNumIn(1) || thisPrimaryAirSys.Branch(BranchNum).NodeNumOut == thisPrimaryAirSys.Mixer.NodeNumIn(2)) && (thisPrimaryAirSys.Branch(BranchNum).TotalComponents == 1) && - (UtilityRoutines::SameString(thisPrimaryAirSys.Branch(BranchNum).Comp(1).TypeOf, "Duct"))) { + (Util::SameString(thisPrimaryAirSys.Branch(BranchNum).Comp(1).TypeOf, "Duct"))) { // set the RAB splitter outlet node and the RAB mixer inlet node thisPrimaryAirSys.RABSplitOutNode = thisPrimaryAirSys.Branch(BranchNum).NodeNumIn; thisPrimaryAirSys.RABMixInNode = thisPrimaryAirSys.Branch(BranchNum).NodeNumOut; @@ -4163,7 +4155,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) for (int SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) { auto &sysSizInput = state.dataSize->SysSizInput(SysSizIndex); - sysSizInput.AirLoopNum = UtilityRoutines::FindItemInList(sysSizInput.AirPriLoopName, state.dataAirSystemsData->PrimaryAirSystems); + sysSizInput.AirLoopNum = Util::FindItemInList(sysSizInput.AirPriLoopName, state.dataAirSystemsData->PrimaryAirSystems); if (sysSizInput.AirLoopNum == 0) { ShowSevereError(state, format("Sizing:System: {} references unknown AirLoopHVAC", sysSizInput.AirPriLoopName)); ErrorsFound = true; @@ -4180,7 +4172,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) for (int AirLoopNum = 1; AirLoopNum <= numPrimaryAirSys; ++AirLoopNum) { auto &primaryAirSystems = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum); - int SysSizNum = UtilityRoutines::FindItemInList(primaryAirSystems.Name, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); + int SysSizNum = Util::FindItemInList(primaryAirSystems.Name, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum <= 0) { SysSizNum = 1; ShowWarningError( @@ -4563,8 +4555,7 @@ void SizeSysOutdoorAir(EnergyPlusData &state) SysOAUnc = 0.0; ClgSupplyAirAdjustFactor = 1.0; HtgSupplyAirAdjustFactor = 1.0; - int SysSizNum = - UtilityRoutines::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); + int SysSizNum = Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable if (finalSysSizing.OAAutoSized) { int NumZonesCooled = airToZoneNodeInfo.NumZonesCooled; @@ -7484,7 +7475,7 @@ bool CheckWaterCoilOnPrimaryAirLoopBranch(EnergyPlusData &state, SimAirServingZo for (int BranchNum = 1; BranchNum <= PrimaryAirSystems(AirSysNum).NumBranches; ++BranchNum) { for (int CompNum = 1; CompNum <= PrimaryAirSystems(AirSysNum).Branch(BranchNum).TotalComponents; ++CompNum) { if ((CompTypeNum == PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).CompType_Num) && - UtilityRoutines::SameString(CompName, PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).Name)) { + Util::SameString(CompName, PrimaryAirSystems(AirSysNum).Branch(BranchNum).Comp(CompNum).Name)) { return true; } } @@ -7516,7 +7507,7 @@ bool CheckWaterCoilOnOASystem(EnergyPlusData &state, SimAirServingZones::CompTyp for (int OASysNum = 1; OASysNum <= NumOASys; ++OASysNum) { for (int OACompNum = 1; OACompNum <= OutsideAirSys(OASysNum).NumComponents; ++OACompNum) { if ((CompTypeNum == OutsideAirSys(OASysNum).ComponentTypeEnum(OACompNum)) && - (UtilityRoutines::SameString(CompName, OutsideAirSys(OASysNum).ComponentName(OACompNum)))) { + (Util::SameString(CompName, OutsideAirSys(OASysNum).ComponentName(OACompNum)))) { return true; } } @@ -7552,9 +7543,8 @@ bool CheckWaterCoilSystemOnAirLoopOrOASystem(EnergyPlusData &state, SimAirServin // check if the water coil is placed on 'CoilSystem:Cooling:Water:HeatExchangerAssisted' object for (int HXASSCoilNum = 1; HXASSCoilNum <= state.dataHVACAssistedCC->TotalNumHXAssistedCoils; ++HXASSCoilNum) { std::string CompType = state.dataHVACAssistedCC->HXAssistedCoil(HXASSCoilNum).CoolingCoilType; - if ((UtilityRoutines::SameString(CompType, "Coil:Cooling:Water") || - UtilityRoutines::SameString(CompType, "Coil:Cooling:Water:DetailedGeometry")) && - UtilityRoutines::SameString(CompName, state.dataHVACAssistedCC->HXAssistedCoil(HXASSCoilNum).CoolingCoilName)) { + if ((Util::SameString(CompType, "Coil:Cooling:Water") || Util::SameString(CompType, "Coil:Cooling:Water:DetailedGeometry")) && + Util::SameString(CompName, state.dataHVACAssistedCC->HXAssistedCoil(HXASSCoilNum).CoolingCoilName)) { 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 f0afb94f945..a46a679cbf6 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -159,7 +159,6 @@ namespace SimulationManager { using namespace DataSizing; using namespace DataSystemVariables; using namespace HeatBalanceManager; - using namespace WeatherManager; using namespace ExternalInterface; // MODULE PARAMETER DEFINITIONS: @@ -269,7 +268,7 @@ namespace SimulationManager { DisplayString(state, "Initializing Simulation"); state.dataGlobal->KickOffSimulation = true; - ResetEnvironmentCounter(state); + Weather::ResetEnvironmentCounter(state); SetupSimulation(state, ErrorsFound); FaultsManager::CheckAndReadFaults(state); @@ -341,7 +340,7 @@ namespace SimulationManager { EconomicLifeCycleCost::GetInputForLifeCycleCost(state); // must be prior to WriteTabularReports -- do here before big simulation stuff. // check for variable latitude/location/etc - WeatherManager::ReadVariableLocationOrientation(state); + Weather::ReadVariableLocationOrientation(state); // if user requested HVAC Sizing Simulation, call HVAC sizing simulation manager if (state.dataGlobal->DoHVACSizingSimulation) { @@ -352,7 +351,7 @@ namespace SimulationManager { ShowMessage(state, "Beginning Simulation"); DisplayString(state, "Beginning Primary Simulation"); } - ResetEnvironmentCounter(state); + Weather::ResetEnvironmentCounter(state); int EnvCount = 0; state.dataGlobal->WarmupFlag = true; @@ -360,7 +359,7 @@ namespace SimulationManager { while (Available) { if (state.dataGlobal->stopSimulation) break; - GetNextEnvironment(state, Available, ErrorsFound); + Weather::GetNextEnvironment(state, Available, ErrorsFound); if (!Available) break; if (ErrorsFound) break; @@ -464,12 +463,12 @@ namespace SimulationManager { } if (AnyUnderwaterBoundaries) { - WeatherManager::UpdateUnderwaterBoundaries(state); + Weather::UpdateUnderwaterBoundaries(state); } if (state.dataEnvrn->varyingLocationSchedIndexLat > 0 || state.dataEnvrn->varyingLocationSchedIndexLong > 0 || state.dataEnvrn->varyingOrientationSchedIndex > 0) { - WeatherManager::UpdateLocationAndOrientation(state); + Weather::UpdateLocationAndOrientation(state); } state.dataGlobal->BeginTimeStepFlag = true; @@ -492,14 +491,14 @@ namespace SimulationManager { } } - ManageWeather(state); + Weather::ManageWeather(state); ExteriorEnergyUse::ManageExteriorEnergyUse(state); ManageHeatBalance(state); if (oneTimeUnderwaterBoundaryCheck) { - AnyUnderwaterBoundaries = WeatherManager::CheckIfAnyUnderwaterBoundaries(state); + AnyUnderwaterBoundaries = Weather::CheckIfAnyUnderwaterBoundaries(state); oneTimeUnderwaterBoundaryCheck = false; } @@ -885,10 +884,10 @@ namespace SimulationManager { if (NumDebugOut > 0) { state.dataInputProcessing->inputProcessor->getObjectItem(state, CurrentModuleObject, 1, Alphas, NumAlpha, Number, NumNumber, IOStat); if (NumAlpha >= 1) { - state.dataReportFlag->DebugOutput = UtilityRoutines::SameString(Alphas(1), "Yes"); + state.dataReportFlag->DebugOutput = Util::SameString(Alphas(1), "Yes"); } if (NumAlpha >= 2) { - state.dataReportFlag->EvenDuringWarmup = UtilityRoutines::SameString(Alphas(2), "Yes"); + state.dataReportFlag->EvenDuringWarmup = Util::SameString(Alphas(2), "Yes"); } } @@ -923,47 +922,47 @@ namespace SimulationManager { } std::string diagnosticName = it->get(); - if (UtilityRoutines::SameString(diagnosticName, "DisplayExtraWarnings")) { + if (Util::SameString(diagnosticName, "DisplayExtraWarnings")) { state.dataGlobal->DisplayExtraWarnings = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DisplayAdvancedReportVariables")) { + } else if (Util::SameString(diagnosticName, "DisplayAdvancedReportVariables")) { state.dataGlobal->DisplayAdvancedReportVariables = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DisplayAllWarnings")) { + } else if (Util::SameString(diagnosticName, "DisplayAllWarnings")) { state.dataGlobal->DisplayAllWarnings = true; state.dataGlobal->DisplayExtraWarnings = true; state.dataGlobal->DisplayUnusedObjects = true; state.dataGlobal->DisplayUnusedSchedules = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DisplayUnusedObjects")) { + } else if (Util::SameString(diagnosticName, "DisplayUnusedObjects")) { state.dataGlobal->DisplayUnusedObjects = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DisplayUnusedSchedules")) { + } else if (Util::SameString(diagnosticName, "DisplayUnusedSchedules")) { state.dataGlobal->DisplayUnusedSchedules = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DisplayZoneAirHeatBalanceOffBalance")) { + } else if (Util::SameString(diagnosticName, "DisplayZoneAirHeatBalanceOffBalance")) { state.dataGlobal->DisplayZoneAirHeatBalanceOffBalance = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DoNotMirrorDetachedShading")) { + } else if (Util::SameString(diagnosticName, "DoNotMirrorDetachedShading")) { state.dataReportFlag->MakeMirroredDetachedShading = false; - } else if (UtilityRoutines::SameString(diagnosticName, "DoNotMirrorAttachedShading")) { + } else if (Util::SameString(diagnosticName, "DoNotMirrorAttachedShading")) { state.dataReportFlag->MakeMirroredAttachedShading = false; - } else if (UtilityRoutines::SameString(diagnosticName, "ReportDuringWarmup")) { + } else if (Util::SameString(diagnosticName, "ReportDuringWarmup")) { state.dataSysVars->ReportDuringWarmup = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DisplayWeatherMissingDataWarnings")) { + } else if (Util::SameString(diagnosticName, "DisplayWeatherMissingDataWarnings")) { state.dataEnvrn->DisplayWeatherMissingDataWarnings = true; - } else if (UtilityRoutines::SameString(diagnosticName, "IgnoreSolarRadiation")) { // TODO: Not a valid key choice + } else if (Util::SameString(diagnosticName, "IgnoreSolarRadiation")) { // TODO: Not a valid key choice state.dataEnvrn->IgnoreSolarRadiation = true; - } else if (UtilityRoutines::SameString(diagnosticName, "IgnoreBeamRadiation")) { // TODO: Not a valid key choice + } else if (Util::SameString(diagnosticName, "IgnoreBeamRadiation")) { // TODO: Not a valid key choice state.dataEnvrn->IgnoreBeamRadiation = true; - } else if (UtilityRoutines::SameString(diagnosticName, "IgnoreDiffuseRadiation")) { // TODO: Not a valid key choice + } else if (Util::SameString(diagnosticName, "IgnoreDiffuseRadiation")) { // TODO: Not a valid key choice state.dataEnvrn->IgnoreDiffuseRadiation = true; - } else if (UtilityRoutines::SameString(diagnosticName, "DeveloperFlag")) { // TODO: Not a valid key choice + } else if (Util::SameString(diagnosticName, "DeveloperFlag")) { // TODO: Not a valid key choice state.dataSysVars->DeveloperFlag = true; - } else if (UtilityRoutines::SameString(diagnosticName, "TimingFlag")) { // TODO: Not a valid key choice + } else if (Util::SameString(diagnosticName, "TimingFlag")) { // TODO: Not a valid key choice state.dataSysVars->TimingFlag = true; - } else if (UtilityRoutines::SameString(diagnosticName, "ReportDetailedWarmupConvergence")) { + } else if (Util::SameString(diagnosticName, "ReportDetailedWarmupConvergence")) { state.dataSysVars->ReportDetailedWarmupConvergence = true; - } else if (UtilityRoutines::SameString(diagnosticName, "ReportDuringHVACSizingSimulation")) { + } else if (Util::SameString(diagnosticName, "ReportDuringHVACSizingSimulation")) { state.dataSysVars->ReportDuringHVACSizingSimulation = true; - } else if (UtilityRoutines::SameString(diagnosticName, "CreateMinimalSurfaceVariables")) { // TODO: Not a valid key choice + } else if (Util::SameString(diagnosticName, "CreateMinimalSurfaceVariables")) { // TODO: Not a valid key choice continue; // CreateMinimalSurfaceVariables=.TRUE. - } else if (UtilityRoutines::SameString(diagnosticName, "CreateNormalSurfaceVariables")) { // TODO: Not a valid key choice + } else if (Util::SameString(diagnosticName, "CreateNormalSurfaceVariables")) { // TODO: Not a valid key choice continue; // IF (CreateMinimalSurfaceVariables) THEN // CALL ShowWarningError(state, 'GetProjectData: '//TRIM(CurrentModuleObject)//'=''// & @@ -1074,16 +1073,15 @@ namespace SimulationManager { std::string const &thisObjectName = instance.key(); state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, thisObjectName); if (fields.find("use_coil_direct_solutions") != fields.end()) { - state.dataGlobal->DoCoilDirectSolutions = - UtilityRoutines::makeUPPER(fields.at("use_coil_direct_solutions").get()) == "YES"; + state.dataGlobal->DoCoilDirectSolutions = Util::makeUPPER(fields.at("use_coil_direct_solutions").get()) == "YES"; } if (fields.find("zone_radiant_exchange_algorithm") != fields.end()) { state.dataHeatBalIntRadExchg->CarrollMethod = - UtilityRoutines::makeUPPER(fields.at("zone_radiant_exchange_algorithm").get()) == "CARROLLMRT"; + Util::makeUPPER(fields.at("zone_radiant_exchange_algorithm").get()) == "CARROLLMRT"; } if (fields.find("use_representative_surfaces_for_calculations") != fields.end()) { state.dataSurface->UseRepresentativeSurfaceCalculations = - UtilityRoutines::makeUPPER(fields.at("use_representative_surfaces_for_calculations").get()) == "YES"; + Util::makeUPPER(fields.at("use_representative_surfaces_for_calculations").get()) == "YES"; } bool overrideTimestep(false); bool overrideZoneAirHeatBalAlg(false); @@ -1095,7 +1093,7 @@ namespace SimulationManager { bool overridePsychTsatFnPb(false); state.dataZoneTempPredictorCorrector->OscillationVariablesNeeded = true; if (fields.find("override_mode") != fields.end()) { - overrideModeValue = UtilityRoutines::makeUPPER(fields.at("override_mode").get()); + overrideModeValue = Util::makeUPPER(fields.at("override_mode").get()); if (overrideModeValue == "NORMAL") { // no overrides } else if (overrideModeValue == "MODE01") { @@ -1380,22 +1378,22 @@ namespace SimulationManager { // write the input related portions of the .perflog // J.Glazer February 2020 { - UtilityRoutines::appendPerfLog(state, - "Program, Version, TimeStamp", - state.dataStrGlobals->VerStringVar); // this string already includes three portions and has commas - UtilityRoutines::appendPerfLog(state, "Use Coil Direct Solution", bool_to_string(state.dataGlobal->DoCoilDirectSolutions)); + Util::appendPerfLog(state, + "Program, Version, TimeStamp", + state.dataStrGlobals->VerStringVar); // this string already includes three portions and has commas + Util::appendPerfLog(state, "Use Coil Direct Solution", bool_to_string(state.dataGlobal->DoCoilDirectSolutions)); if (state.dataHeatBalIntRadExchg->CarrollMethod) { - UtilityRoutines::appendPerfLog(state, "Zone Radiant Exchange Algorithm", "CarrollMRT"); + Util::appendPerfLog(state, "Zone Radiant Exchange Algorithm", "CarrollMRT"); } else { - UtilityRoutines::appendPerfLog(state, "Zone Radiant Exchange Algorithm", "ScriptF"); - } - UtilityRoutines::appendPerfLog(state, "Override Mode", currentOverrideModeValue); - UtilityRoutines::appendPerfLog(state, "Number of Timesteps per Hour", fmt::to_string(state.dataGlobal->NumOfTimeStepInHour)); - UtilityRoutines::appendPerfLog(state, "Minimum Number of Warmup Days", fmt::to_string(state.dataHeatBal->MinNumberOfWarmupDays)); - UtilityRoutines::appendPerfLog(state, "SuppressAllBeginEnvironmentResets", bool_to_string(state.dataEnvrn->forceBeginEnvResetSuppress)); - UtilityRoutines::appendPerfLog(state, "Minimum System Timestep", format("{:.1R}", state.dataConvergeParams->MinTimeStepSys * 60.0)); - UtilityRoutines::appendPerfLog(state, "MaxZoneTempDiff", format("{:.2R}", state.dataConvergeParams->MaxZoneTempDiff)); - UtilityRoutines::appendPerfLog(state, "MaxAllowedDelTemp", format("{:.4R}", state.dataHeatBal->MaxAllowedDelTemp)); + Util::appendPerfLog(state, "Zone Radiant Exchange Algorithm", "ScriptF"); + } + Util::appendPerfLog(state, "Override Mode", currentOverrideModeValue); + Util::appendPerfLog(state, "Number of Timesteps per Hour", fmt::to_string(state.dataGlobal->NumOfTimeStepInHour)); + Util::appendPerfLog(state, "Minimum Number of Warmup Days", fmt::to_string(state.dataHeatBal->MinNumberOfWarmupDays)); + Util::appendPerfLog(state, "SuppressAllBeginEnvironmentResets", bool_to_string(state.dataEnvrn->forceBeginEnvResetSuppress)); + Util::appendPerfLog(state, "Minimum System Timestep", format("{:.1R}", state.dataConvergeParams->MinTimeStepSys * 60.0)); + Util::appendPerfLog(state, "MaxZoneTempDiff", format("{:.2R}", state.dataConvergeParams->MaxZoneTempDiff)); + Util::appendPerfLog(state, "MaxAllowedDelTemp", format("{:.4R}", state.dataHeatBal->MaxAllowedDelTemp)); } std::string bool_to_string(bool logical) @@ -1855,7 +1853,7 @@ namespace SimulationManager { while (Available) { // do for each environment - GetNextEnvironment(state, Available, ErrorsFound); + Weather::GetNextEnvironment(state, Available, ErrorsFound); if (!Available) break; if (ErrorsFound) break; @@ -1881,7 +1879,7 @@ namespace SimulationManager { state.dataGlobal->BeginTimeStepFlag = true; - ManageWeather(state); + Weather::ManageWeather(state); ManageExteriorEnergyUse(state); @@ -1896,7 +1894,7 @@ namespace SimulationManager { if (state.dataSysVars->DeveloperFlag) DisplayString(state, "Initializing Simulation - 2nd timestep 1:" + state.dataEnvrn->EnvironmentName); - ManageWeather(state); + Weather::ManageWeather(state); ManageExteriorEnergyUse(state); @@ -1910,7 +1908,7 @@ namespace SimulationManager { if (state.dataSysVars->DeveloperFlag) DisplayString(state, "Initializing Simulation - hour 24 timestep 1:" + state.dataEnvrn->EnvironmentName); - ManageWeather(state); + Weather::ManageWeather(state); ManageExteriorEnergyUse(state); diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index beb21896255..e584d8e97f0 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -152,7 +152,7 @@ void SimulateSingleDuct( // Find the correct SysNumber with the Component Name if (CompIndex == 0) { - SysNum = UtilityRoutines::FindItemInList(CompName, state.dataSingleDuct->sd_airterminal, &SingleDuctAirTerminal::SysName); + SysNum = Util::FindItemInList(CompName, state.dataSingleDuct->sd_airterminal, &SingleDuctAirTerminal::SysName); if (SysNum == 0) { ShowFatalError(state, format("SimulateSingleDuct: System not found={}", CompName)); } @@ -378,18 +378,15 @@ void GetSysInput(EnergyPlusData &state) state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).sysType = CurrentModuleObject; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctVAVReheat; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(7); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Electric")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Water")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Steam")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; @@ -456,11 +453,11 @@ void GetSysInput(EnergyPlusData &state) cAlphaFields(4)); state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); - if (UtilityRoutines::SameString(Alphas(5), "Constant")) { + if (Util::SameString(Alphas(5), "Constant")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Constant; - } else if (UtilityRoutines::SameString(Alphas(5), "FixedFlowRate")) { + } else if (Util::SameString(Alphas(5), "FixedFlowRate")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Fixed; - } else if (UtilityRoutines::SameString(Alphas(5), "Scheduled")) { + } else if (Util::SameString(Alphas(5), "Scheduled")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; } else { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(5), Alphas(5))); @@ -586,11 +583,11 @@ void GetSysInput(EnergyPlusData &state) if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset <= 0.0) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ControllerOffset = 0.001; } - if (UtilityRoutines::SameString(Alphas(10), "Reverse")) { + if (Util::SameString(Alphas(10), "Reverse")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::Reverse; - } else if (UtilityRoutines::SameString(Alphas(10), "Normal")) { + } else if (Util::SameString(Alphas(10), "Normal")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::Normal; - } else if (UtilityRoutines::SameString(Alphas(10), "ReverseWithLimits")) { + } else if (Util::SameString(Alphas(10), "ReverseWithLimits")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).DamperHeatingAction = Action::ReverseWithLimits; } else { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(10), Alphas(10))); @@ -708,7 +705,7 @@ void GetSysInput(EnergyPlusData &state) if (!lAlphaBlanks(11)) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr = - UtilityRoutines::FindItemInList(Alphas(11), state.dataSize->OARequirements); + Util::FindItemInList(Alphas(11), state.dataSize->OARequirements); if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(11), Alphas(11))); ShowContinueError(state, @@ -799,18 +796,15 @@ void GetSysInput(EnergyPlusData &state) state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).sysType = CurrentModuleObject; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctCBVAVReheat; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(5); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Electric")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Water")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Steam")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; @@ -1105,18 +1099,15 @@ void GetSysInput(EnergyPlusData &state) state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).sysType = CurrentModuleObject; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysType_Num = SysType::SingleDuctConstVolReheat; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(5); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Electric")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Water")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Steam")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; @@ -1486,7 +1477,7 @@ void GetSysInput(EnergyPlusData &state) state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).NoOAFlowInputFromUser = true; } else { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr = - UtilityRoutines::FindItemInList(Alphas(5), state.dataSize->OARequirements); + Util::FindItemInList(Alphas(5), state.dataSize->OARequirements); if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid data.", RoutineName, CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFields(5), Alphas(5))); @@ -1601,11 +1592,11 @@ void GetSysInput(EnergyPlusData &state) cAlphaFields(4)); state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).MaxAirVolFlowRate = Numbers(1); - if (UtilityRoutines::SameString(Alphas(5), "Constant")) { + if (Util::SameString(Alphas(5), "Constant")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Constant; - } else if (UtilityRoutines::SameString(Alphas(5), "FixedFlowRate")) { + } else if (Util::SameString(Alphas(5), "FixedFlowRate")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Fixed; - } else if (UtilityRoutines::SameString(Alphas(5), "Scheduled")) { + } else if (Util::SameString(Alphas(5), "Scheduled")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; } else { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(5), Alphas(5))); @@ -1754,7 +1745,7 @@ void GetSysInput(EnergyPlusData &state) } if (!lAlphaBlanks(7)) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr = - UtilityRoutines::FindItemInList(Alphas(7), state.dataSize->OARequirements); + Util::FindItemInList(Alphas(7), state.dataSize->OARequirements); if (state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).OARequirementsPtr == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(7), Alphas(7))); ShowContinueError(state, @@ -2024,7 +2015,7 @@ void GetSysInput(EnergyPlusData &state) state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp = Alphas(7); state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatName = Alphas(8); IsNotOK = false; - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { + if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Fuel")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Gas; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = GetHeatingCoilOutletNode(state, @@ -2041,8 +2032,7 @@ void GetSysInput(EnergyPlusData &state) format("Occurs for terminal unit {} = {}", state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).sysType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName)); - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Electric")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Electric")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::Electric; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode = GetHeatingCoilOutletNode(state, @@ -2059,13 +2049,11 @@ void GetSysInput(EnergyPlusData &state) format("Occurs for terminal unit {} = {}", state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).sysType, state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).SysName)); - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Water")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Water")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SimpleHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, - "Coil:Heating:Steam")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp, "Coil:Heating:Steam")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; @@ -2091,9 +2079,9 @@ void GetSysInput(EnergyPlusData &state) ErrorsFound = true; } state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType = Alphas(5); - if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, "Fan:VariableVolume")) { + if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, "Fan:VariableVolume")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Num = DataHVACGlobals::FanType_SimpleVAV; - } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, "Fan:SystemModel")) { + } else if (Util::SameString(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType, "Fan:SystemModel")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).Fan_Num = DataHVACGlobals::FanType_SystemModelObject; } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).FanType.empty()) { ShowSevereError( @@ -2176,7 +2164,7 @@ void GetSysInput(EnergyPlusData &state) } AirTermSysInletNodeName = state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).InletNodeNum); - if (!UtilityRoutines::SameString(Alphas(3), AirTermSysInletNodeName)) { + if (!Util::SameString(Alphas(3), AirTermSysInletNodeName)) { ShowWarningError(state, format("{}Invalid air terminal object air inlet node name in {} = {}", RoutineName, @@ -2284,7 +2272,7 @@ void GetSysInput(EnergyPlusData &state) // DataLoopNode::NodeFluidType::Air,DataLoopNode::NodeConnectionType::Outlet,1,ObjectIsParent) AirTermSysOutletNodeName = state.dataLoopNodes->NodeID(state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatAirOutletNode); - if (!UtilityRoutines::SameString(Alphas(4), AirTermSysOutletNodeName)) { + if (!Util::SameString(Alphas(4), AirTermSysOutletNodeName)) { ShowWarningError(state, format("{}Invalid air terminal object air outlet node name in {} = {}", RoutineName, @@ -3043,7 +3031,7 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state) // get system sizing id if a sizing run has been done for this system if (SizingDesRunThisAirSys) { - SysSizNum = UtilityRoutines::FindItemInList( + SysSizNum = Util::FindItemInList( state.dataSize->FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable } @@ -3548,7 +3536,7 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state) } } else { CheckZoneSizing(state, this->sysType, this->SysName); - if (UtilityRoutines::SameString(this->ReheatComp, "Coil:Heating:Water")) { + 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); if (IsAutoSize) { @@ -3667,7 +3655,7 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state) } } else { CheckZoneSizing(state, this->sysType, this->SysName); - if (UtilityRoutines::SameString(this->ReheatComp, "Coil:Heating:Steam")) { + 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); if (IsAutoSize) { @@ -5567,7 +5555,7 @@ void GetHVACSingleDuctSysIndex(EnergyPlusData &state, state.dataSingleDuct->GetInputFlag = false; } - SDSIndex = UtilityRoutines::FindItemInList(SDSName, state.dataSingleDuct->sd_airterminal, &SingleDuctAirTerminal::SysName); + SDSIndex = Util::FindItemInList(SDSName, state.dataSingleDuct->sd_airterminal, &SingleDuctAirTerminal::SysName); if (SDSIndex == 0) { if (!ThisObjectType.empty()) { ShowSevereError(state, fmt::format("{}, GetHVACSingleDuctSysIndex: Single duct system not found={}", ThisObjectType, SDSName)); @@ -5612,7 +5600,7 @@ void SimATMixer(EnergyPlusData &state, std::string const &SysName, bool const Fi } if (SysIndex == 0) { - state.dataSingleDuct->SysNumSATM = UtilityRoutines::FindItemInList(SysName, state.dataSingleDuct->SysATMixer); + state.dataSingleDuct->SysNumSATM = Util::FindItemInList(SysName, state.dataSingleDuct->SysATMixer); SysIndex = state.dataSingleDuct->SysNumSATM; if (state.dataSingleDuct->SysNumSATM == 0) { ShowFatalError(state, format("Object {} not found", SysName)); @@ -5693,7 +5681,7 @@ void GetATMixers(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSingleDuct->SysATMixer(ATMixerNum).Name = state.dataIPShortCut->cAlphaArgs(1); if (state.dataIPShortCut->cAlphaArgs(7) == "INLETSIDE") { state.dataSingleDuct->SysATMixer(ATMixerNum).MixerType = ATMixer_InletSide; // inlet side mixer @@ -5758,7 +5746,7 @@ void GetATMixers(EnergyPlusData &state) state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser = true; } else { state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(8), state.dataSize->OARequirements); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(8), state.dataSize->OARequirements); if (state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid data.", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, @@ -5870,10 +5858,9 @@ void GetATMixers(EnergyPlusData &state) bool ZoneNodeFoundAgain = false; for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { for (int Num = 1; Num <= state.dataZoneEquip->ZoneEquipList(CtrlZone).NumOfEquipTypes; ++Num) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), - state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num)) && - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), - state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipTypeName(Num))) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num)) && + Util::SameString(state.dataIPShortCut->cAlphaArgs(2), + state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipTypeName(Num))) { state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->SysATMixer(ATMixerNum).ADUNum).ZoneEqNum = CtrlZone; state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum = CtrlZone; // Must wait until InitATMixer to fill other zone equip config data because ultimate zone inlet node is not known yet @@ -6267,7 +6254,7 @@ void GetATMixer(EnergyPlusData &state, return; } - ATMixerIndex = UtilityRoutines::FindItemInList(ZoneEquipName, state.dataSingleDuct->SysATMixer, &AirTerminalMixerData::ZoneHVACUnitName); + ATMixerIndex = Util::FindItemInList(ZoneEquipName, state.dataSingleDuct->SysATMixer, &AirTerminalMixerData::ZoneHVACUnitName); if (ATMixerIndex > 0) { ATMixerNum = ATMixerIndex; ATMixerName = state.dataSingleDuct->SysATMixer(ATMixerIndex).Name; diff --git a/src/EnergyPlus/SizingAnalysisObjects.cc b/src/EnergyPlus/SizingAnalysisObjects.cc index 4b7b9887877..a6e9e014a59 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.cc +++ b/src/EnergyPlus/SizingAnalysisObjects.cc @@ -78,7 +78,7 @@ ZoneTimestepObject::ZoneTimestepObject() ZoneTimestepObject::ZoneTimestepObject( Constant::KindOfSim kindSim, // kind of simulation - int environmentNum, // index in Environment data structure, usually WeatherManager::Envrn + int environmentNum, // index in Environment data structure, usually Weather::Envrn int daySim, // days into simulation period, usually DataGlobals::DayOfSim int hourDay, // hour into day, 1-24, filled by DataGlobals::HourOfDay int timeStep, // time steps into hour, filled by DataGlobals::TimeStep @@ -308,26 +308,25 @@ int SizingLoggerFramework::SetupVariableSizingLog(EnergyPlusData &state, Real64 // search environment structure for sizing periods // this is coded to occur before the additions to Environment structure that will occur to run them as HVAC Sizing sims - for (int i = 1; i <= state.dataWeatherManager->NumOfEnvrn; ++i) { - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == Constant::KindOfSim::DesignDay) { + for (int i = 1; i <= state.dataWeather->NumOfEnvrn; ++i) { + if (state.dataWeather->Environment(i).KindOfEnvrn == Constant::KindOfSim::DesignDay) { ++tmpLog.NumOfEnvironmentsInLogSet; ++tmpLog.NumOfDesignDaysInLogSet; } - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { + if (state.dataWeather->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { ++tmpLog.NumOfEnvironmentsInLogSet; ++tmpLog.NumberOfSizingPeriodsInLogSet; } } // next fill in the count of steps into map - for (int i = 1; i <= state.dataWeatherManager->NumOfEnvrn; ++i) { + for (int i = 1; i <= state.dataWeather->NumOfEnvrn; ++i) { - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == Constant::KindOfSim::DesignDay) { + if (state.dataWeather->Environment(i).KindOfEnvrn == Constant::KindOfSim::DesignDay) { tmpLog.ztStepCountByEnvrnMap[i] = HoursPerDay * state.dataGlobal->NumOfTimeStepInHour; } - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { - tmpLog.ztStepCountByEnvrnMap[i] = - HoursPerDay * state.dataGlobal->NumOfTimeStepInHour * state.dataWeatherManager->Environment(i).TotalDays; + if (state.dataWeather->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { + tmpLog.ztStepCountByEnvrnMap[i] = HoursPerDay * state.dataGlobal->NumOfTimeStepInHour * state.dataWeather->Environment(i).TotalDays; } } @@ -353,10 +352,10 @@ int SizingLoggerFramework::SetupVariableSizingLog(EnergyPlusData &state, Real64 void SizingLoggerFramework::SetupSizingLogsNewEnvironment(EnergyPlusData &state) { - using namespace WeatherManager; + using namespace Weather; for (auto &l : logObjs) { - l.SetupNewEnvironment(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SeedEnvrnNum, state.dataWeatherManager->Envrn); + l.SetupNewEnvironment(state.dataWeather->Environment(state.dataWeather->Envrn).SeedEnvrnNum, state.dataWeather->Envrn); } } @@ -375,7 +374,7 @@ ZoneTimestepObject SizingLoggerFramework::PrepareZoneTimestepStamp(EnergyPlusDat ZoneTimestepObject tmpztStepStamp( // call constructor state.dataGlobal->KindOfSim, - state.dataWeatherManager->Envrn, + state.dataWeather->Envrn, locDayOfSim, state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, @@ -613,7 +612,7 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData &state, int PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizDesDay, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, - state.dataWeatherManager->Environment(newFoundMassFlowRateTimeStamp.envrnNum).Title); + state.dataWeather->Environment(newFoundMassFlowRateTimeStamp.envrnNum).Title); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizPkTimeDayOfSim, @@ -633,7 +632,7 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData &state, int PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizDesDay, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, - state.dataWeatherManager->Environment(NewFoundMaxDemandTimeStamp.envrnNum).Title); + state.dataWeather->Environment(NewFoundMaxDemandTimeStamp.envrnNum).Title); } PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizPkTimeDayOfSim, diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 6247f8a703a..5f440edd387 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -95,22 +95,20 @@ namespace EnergyPlus::SizingManager { // Using/Aliasing using namespace HeatBalanceManager; -using namespace WeatherManager; using namespace DataSizing; using DataStringGlobals::CharComma; using DataStringGlobals::CharSpace; using DataStringGlobals::CharTab; -constexpr std::array(DataSizing::OAFlowCalcMethod::Num)> OAFlowCalcMethodNamesUC{ - "FLOW/PERSON", - "FLOW/ZONE", - "FLOW/AREA", - "AIRCHANGES/HOUR", - "SUM", - "MAXIMUM", - "INDOORAIRQUALITYPROCEDURE", - "PROPORTIONALCONTROLBASEDONOCCUPANCYSCHEDULE", - "PROPORTIONALCONTROLBASEDONDESIGNOCCUPANCY"}; +constexpr std::array OAFlowCalcMethodNamesUC{"FLOW/PERSON", + "FLOW/ZONE", + "FLOW/AREA", + "AIRCHANGES/HOUR", + "SUM", + "MAXIMUM", + "INDOORAIRQUALITYPROCEDURE", + "PROPORTIONALCONTROLBASEDONOCCUPANCYSCHEDULE", + "PROPORTIONALCONTROLBASEDONDESIGNOCCUPANCY"}; void ManageSizing(EnergyPlusData &state) { @@ -246,7 +244,7 @@ void ManageSizing(EnergyPlusData &state) ShowMessage(state, "Beginning Zone Sizing Calculations"); - ResetEnvironmentCounter(state); + Weather::ResetEnvironmentCounter(state); state.dataGlobal->KickOffSizing = true; SetupZoneSizing(state, ErrorsFound); // Should only be done ONCE state.dataGlobal->KickOffSizing = false; @@ -266,12 +264,12 @@ void ManageSizing(EnergyPlusData &state) Available = true; - ResetEnvironmentCounter(state); + Weather::ResetEnvironmentCounter(state); state.dataSize->CurOverallSimDay = 0; NumSizingPeriodsPerformed = 0; while (Available) { // loop over environments - GetNextEnvironment(state, Available, ErrorsFound); // get an environment + Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment if (!Available) break; if (ErrorsFound) break; @@ -362,7 +360,7 @@ void ManageSizing(EnergyPlusData &state) state.dataGlobal->TimeStep, state.dataGlobal->KindOfSim); - ManageWeather(state); + Weather::ManageWeather(state); if (!state.dataGlobal->WarmupFlag) { TimeStepInDay = @@ -464,13 +462,13 @@ void ManageSizing(EnergyPlusData &state) ManageAirLoops(state, true, SimAir, SimZoneEquip); SizingManager::UpdateTermUnitFinalZoneSizing(state); // AirDistUnits have been loaded now so TermUnitSizing values are all in place SimAirServingZones::SizeSysOutdoorAir(state); // System OA can be sized now that TermUnitFinalZoneSizing is initialized - ResetEnvironmentCounter(state); + Weather::ResetEnvironmentCounter(state); state.dataSize->CurEnvirNumSimDay = 0; state.dataSize->CurOverallSimDay = 0; NumSizingPeriodsPerformed = 0; while (Available) { // loop over environments - GetNextEnvironment(state, Available, ErrorsFound); // get an environment + Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment // check that environment is one of the design days if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) { @@ -536,7 +534,7 @@ void ManageSizing(EnergyPlusData &state) } } - ManageWeather(state); + Weather::ManageWeather(state); UpdateSysSizing(state, Constant::CallIndicator::DuringDay); @@ -1205,8 +1203,8 @@ void ManageSystemVentilationAdjustments(EnergyPlusData &state) // redo 62.1 zone calculations with final (or user) zone terminal flow sizes, only redo calculations that might change with final flows for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { - int SysSizNum = UtilityRoutines::FindItemInList( - FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); + int SysSizNum = + Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable if (FinalSysSizing(AirLoopNum).OAAutoSized && (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP || @@ -1459,8 +1457,8 @@ void ManageSystemVentilationAdjustments(EnergyPlusData &state) OutputReportPredefined::PreDefTableEntry( state, state.dataOutRptPredefined->pdchS62svrClD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D // Origin of D - int SysSizNum = UtilityRoutines::FindItemInList( - FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); + int SysSizNum = + Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) { OutputReportPredefined::PreDefTableEntry( @@ -2023,8 +2021,8 @@ void DetermineSystemPopulationDiversity(EnergyPlusData &state) } // First get the design (max) level of people in all zones connected to air loop for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { - int SysSizNum = UtilityRoutines::FindItemInList( - FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); + int SysSizNum = + Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable // only retrieve data if the occupant density is set to be autosized if (FinalSysSizing(AirLoopNum).OAAutoSized && SysSizInput(SysSizNum).OccupantDiversity == AutoSize) { @@ -2056,9 +2054,9 @@ void DetermineSystemPopulationDiversity(EnergyPlusData &state) // now march through all zone timesteps for entire year to find the concurrent max int DaysInYear(366); // assume leap year int dayOfWeekType(1); // assume year starts on Sunday - WeatherManager::CalcSpecialDayTypes(state); + Weather::CalcSpecialDayTypes(state); for (int DayLoop = 1; DayLoop <= DaysInYear; ++DayLoop) { // loop over all days in year - state.dataEnvrn->HolidayIndex = state.dataWeatherManager->SpecialDayTypes(DayLoop); + state.dataEnvrn->HolidayIndex = state.dataWeather->SpecialDayTypes(DayLoop); state.dataEnvrn->DayOfYear_Schedule = DayLoop; state.dataEnvrn->DayOfWeek = dayOfWeekType; ++dayOfWeekType; @@ -2070,7 +2068,7 @@ void DetermineSystemPopulationDiversity(EnergyPlusData &state) Real64 TSfraction(0.0); if (state.dataGlobal->NumOfTimeStepInHour > 0.0) TSfraction = 1.0 / double(state.dataGlobal->NumOfTimeStepInHour); for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { // loop over all the air systems - int SysSizNum = UtilityRoutines::FindItemInList( + int SysSizNum = Util::FindItemInList( FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable if (FinalSysSizing(AirLoopNum).OAAutoSized && SysSizInput(SysSizNum).OccupantDiversity == AutoSize) { @@ -2118,8 +2116,8 @@ void DetermineSystemPopulationDiversity(EnergyPlusData &state) // compute D for standard 62.1 by system for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { - int SysSizNum = UtilityRoutines::FindItemInList( - FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); + int SysSizNum = + Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName); if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable // compute D if set to autosize @@ -2215,7 +2213,7 @@ void GetOARequirements(EnergyPlusData &state) lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataSize->OARequirements(OAIndex).Name = Alphas(1); @@ -2243,9 +2241,9 @@ void GetOARequirements(EnergyPlusData &state) auto const &objectFields = instance.value(); auto &thisOAReq = state.dataSize->OARequirements(oaIndex); ip->markObjectAsUsed(cCurrentModuleObject2, instance.key()); - std::string thisOAReqName = UtilityRoutines::makeUPPER(instance.key()); + std::string thisOAReqName = Util::makeUPPER(instance.key()); - if (UtilityRoutines::FindItemInList(thisOAReqName, state.dataSize->OARequirements) > 0) { + if (Util::FindItemInList(thisOAReqName, state.dataSize->OARequirements) > 0) { ShowSevereError( state, format("{}{}=\"{}\" is a duplicate DesignSpecification:OutdoorAir name.", RoutineName, cCurrentModuleObject2, thisOAReqName)); @@ -2265,7 +2263,7 @@ void GetOARequirements(EnergyPlusData &state) thisOAReq.dsoaSpaceNames.emplace_back(thisSpaceName); std::string thisDsoaName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_design_specification_outdoor_air_object_name"); - int thisDsoaNum = UtilityRoutines::FindItemInList(thisDsoaName, state.dataSize->OARequirements, oaIndex); + int thisDsoaNum = Util::FindItemInList(thisDsoaName, state.dataSize->OARequirements, oaIndex); if (thisDsoaNum > 0) { thisOAReq.dsoaIndexes.emplace_back(thisDsoaNum); ++thisOAReq.numDSOA; @@ -2340,7 +2338,7 @@ void ProcessInputOARequirements(EnergyPlusData &state, auto &thisOARequirements(state.dataSize->OARequirements(OAIndex)); if (NumAlphas > 1) { - thisOARequirements.OAFlowMethod = static_cast(getEnumValue(OAFlowCalcMethodNamesUC, UtilityRoutines::makeUPPER(Alphas(2)))); + thisOARequirements.OAFlowMethod = static_cast(getEnumValue(OAFlowCalcMethodNamesUC, Util::makeUPPER(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))); @@ -2505,7 +2503,7 @@ void GetZoneAirDistribution(EnergyPlusData &state) lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataSize->ZoneAirDistribution(ZADIndex).Name = Alphas(1); @@ -2779,13 +2777,13 @@ void GetZoneSizingInput(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); SizingZoneObjects(Item).Name = state.dataIPShortCut->cAlphaArgs(1); - Item1 = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, NumZones); + Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, NumZones); ZLItem = 0; - if (Item1 == 0 && NumZoneLists > 0) ZLItem = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames); + if (Item1 == 0 && NumZoneLists > 0) ZLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames); if (Item1 > 0) { SizingZoneObjects(Item).StartPtr = state.dataSize->NumZoneSizingInput + 1; ++state.dataSize->NumZoneSizingInput; @@ -2860,7 +2858,7 @@ void GetZoneSizingInput(EnergyPlusData &state) state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName = "Invalid Zone Name"; } } - bool const nameEmpty = UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + bool const nameEmpty = Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); if (nameEmpty && !SizingZoneObjects(Item).ZoneListActive) { ShowContinueError(state, "Zone may have been entered in a ZoneList assignment."); } @@ -3001,8 +2999,7 @@ void GetZoneSizingInput(EnergyPlusData &state) // Getting zone OA parameters from Design Specification object if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - OAIndex = UtilityRoutines::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName, - state.dataSize->OARequirements); + OAIndex = Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName, state.dataSize->OARequirements); if (OAIndex > 0) { state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneDesignSpecOAIndex = OAIndex; } else { @@ -3228,8 +3225,8 @@ void GetZoneSizingInput(EnergyPlusData &state) // A7, \field Zone Air Distribution Object Name and add its inputs if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) { state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName = state.dataIPShortCut->cAlphaArgs(7); - ObjIndex = UtilityRoutines::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName, - state.dataSize->ZoneAirDistribution); + ObjIndex = Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName, + state.dataSize->ZoneAirDistribution); if (ObjIndex > 0) { state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffCooling = state.dataSize->ZoneAirDistribution(ObjIndex).ZoneADEffCooling; @@ -3257,11 +3254,11 @@ 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, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod = + static_cast(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod != AirflowSizingMethod::Invalid); - state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod = static_cast( - getEnumValue(AirflowSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod = + static_cast(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod != AirflowSizingMethod::Invalid); BooleanSwitch accountForDOAS = getYesNoValue(state.dataIPShortCut->cAlphaArgs(8)); @@ -3270,8 +3267,8 @@ void GetZoneSizingInput(EnergyPlusData &state) if (state.dataSize->ZoneSizingInput(ZoneSizIndex).AccountForDOAS) { constexpr static std::array(DataSizing::DOASControl::Num)> DOASControlNamesUC = { "NEUTRALSUPPLYAIR", "NEUTRALDEHUMIDIFIEDSUPPLYAIR", "COLDSUPPLYAIR"}; - state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASControlStrategy = static_cast( - getEnumValue(DOASControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASControlStrategy = + static_cast(getEnumValue(DOASControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASLowSetpoint = state.dataIPShortCut->rNumericArgs(17); state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASHighSetpoint = state.dataIPShortCut->rNumericArgs(18); @@ -3417,7 +3414,7 @@ void GetZoneAndZoneListNames( state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); // validation, but no error - Found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, Item - 1); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, Item - 1); if (Found == 0) { ZoneNames(Item) = state.dataIPShortCut->cAlphaArgs(1); } else { @@ -3443,7 +3440,7 @@ void GetZoneAndZoneListNames( state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); // validation, but no error - Found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames, Item - 1); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames, Item - 1); if (Found == 0) { ZoneListNames(Item).Name = state.dataIPShortCut->cAlphaArgs(1); } else { @@ -3452,7 +3449,7 @@ void GetZoneAndZoneListNames( ZoneListNames(Item).Zones.allocate(NumAlphas - 1); ZoneListNames(Item).NumOfZones = NumAlphas - 1; for (Item1 = 2; Item1 <= NumAlphas; ++Item1) { - Found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(Item1), ZoneNames, NumZones); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(Item1), ZoneNames, NumZones); ZoneListNames(Item).Zones(Item1 - 1) = Found; } } @@ -3562,7 +3559,7 @@ void GetSystemSizingInput(EnergyPlusData &state) constexpr std::array(DataSizing::LoadSizing::Num)> LoadSizingNamesUC{ "SENSIBLE", "LATENT", "TOTAL", "VENTILATIONREQUIREMENT"}; SysSizInput(SysSizIndex).loadSizingType = static_cast( - getEnumValue(LoadSizingNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum)))); + getEnumValue(LoadSizingNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum)))); // assign PeakLoad based on LoadSizing for now if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Sensible) { @@ -3576,7 +3573,7 @@ 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, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum)))); + getEnumValue(CapacityControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum)))); { std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum); @@ -3841,7 +3838,7 @@ void GetSystemSizingInput(EnergyPlusData &state) } // Determine SysSizInput electric Cooling design capacity sizing method - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "COOLINGDESIGNCAPACITY")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "COOLINGDESIGNCAPACITY")) { SysSizInput(SysSizIndex).CoolingCapMethod = CoolingDesignCapacity; // SysSizInput( SysSizIndex ).ScaledCoolingCapacity = AutoSize can be set to autosize cooling capacity SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolDesignCapacityNumericNum); @@ -3853,7 +3850,7 @@ void GetSystemSizingInput(EnergyPlusData &state) state.dataIPShortCut->rNumericArgs(iCoolDesignCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "CAPACITYPERFLOORAREA")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "CAPACITYPERFLOORAREA")) { SysSizInput(SysSizIndex).CoolingCapMethod = CapacityPerFloorArea; if (!state.dataIPShortCut->lNumericFieldBlanks(iCoolCapacityPerFloorAreaNumericNum)) { SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolCapacityPerFloorAreaNumericNum); @@ -3888,7 +3885,7 @@ void GetSystemSizingInput(EnergyPlusData &state) state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "FRACTIONOFAUTOSIZEDCOOLINGCAPACITY")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "FRACTIONOFAUTOSIZEDCOOLINGCAPACITY")) { SysSizInput(SysSizIndex).CoolingCapMethod = FractionOfAutosizedCoolingCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iCoolFracOfAutosizedCapacityNumericNum)) { SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum); @@ -3911,7 +3908,7 @@ void GetSystemSizingInput(EnergyPlusData &state) format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iCoolFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "NONE")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "NONE")) { SysSizInput(SysSizIndex).CoolingCapMethod = None; SysSizInput(SysSizIndex).ScaledCoolingCapacity = 0.0; } else { @@ -3926,7 +3923,7 @@ void GetSystemSizingInput(EnergyPlusData &state) } // Determine SysSizInput electric heating design capacity sizing method - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HEATINGDESIGNCAPACITY")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HEATINGDESIGNCAPACITY")) { SysSizInput(SysSizIndex).HeatingCapMethod = HeatingDesignCapacity; // SysSizInput( SysSizIndex ).ScaledHeatingCapacity = AutoSize can be set to autosize heating capacity SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum); @@ -3938,7 +3935,7 @@ void GetSystemSizingInput(EnergyPlusData &state) state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CAPACITYPERFLOORAREA")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CAPACITYPERFLOORAREA")) { SysSizInput(SysSizIndex).HeatingCapMethod = CapacityPerFloorArea; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) { SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum); @@ -3973,7 +3970,7 @@ void GetSystemSizingInput(EnergyPlusData &state) state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FRACTIONOFAUTOSIZEDHEATINGCAPACITY")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FRACTIONOFAUTOSIZEDHEATINGCAPACITY")) { SysSizInput(SysSizIndex).HeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum); @@ -3996,7 +3993,7 @@ void GetSystemSizingInput(EnergyPlusData &state) format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "NONE")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "NONE")) { SysSizInput(SysSizIndex).HeatingCapMethod = None; SysSizInput(SysSizIndex).ScaledHeatingCapacity = 0.0; } else { @@ -4107,7 +4104,7 @@ void GetPlantSizingInput(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataSize->PlantSizData(PltSizIndex).PlantLoopName = state.dataIPShortCut->cAlphaArgs(1); state.dataSize->PlantSizData(PltSizIndex).ExitTemp = state.dataIPShortCut->rNumericArgs(1); @@ -4121,7 +4118,7 @@ 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, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + static_cast(getEnumValue(TypeOfPlantLoopNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); assert(state.dataSize->PlantSizData(PltSizIndex).LoopType != TypeOfPlantLoop::Invalid); if (NumAlphas > 2) { @@ -4189,7 +4186,7 @@ void SetupZoneSizing(EnergyPlusData &state, bool &ErrorsFound) state.dataSize->CurOverallSimDay = 0; while (Available) { // do for each environment - GetNextEnvironment(state, Available, ErrorsFound); + Weather::GetNextEnvironment(state, Available, ErrorsFound); if (!Available) break; if (ErrorsFound) break; @@ -4221,7 +4218,7 @@ void SetupZoneSizing(EnergyPlusData &state, bool &ErrorsFound) state.dataGlobal->BeginTimeStepFlag = true; - ManageWeather(state); + Weather::ManageWeather(state); ManageHeatBalance(state); @@ -4231,7 +4228,7 @@ void SetupZoneSizing(EnergyPlusData &state, bool &ErrorsFound) state.dataGlobal->BeginSimFlag = false; // ! do another timestep=1 - ManageWeather(state); + Weather::ManageWeather(state); ManageHeatBalance(state); @@ -4241,7 +4238,7 @@ void SetupZoneSizing(EnergyPlusData &state, bool &ErrorsFound) state.dataGlobal->TimeStep = state.dataGlobal->NumOfTimeStepInHour; state.dataGlobal->EndEnvrnFlag = true; - ManageWeather(state); + Weather::ManageWeather(state); ManageHeatBalance(state); @@ -4680,12 +4677,12 @@ void GetZoneHVACSizing(EnergyPlusData &state) lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataSize->ZoneHVACSizing(zSIndex).Name = Alphas(1); // Determine supply air flow rate sizing method for cooling mode - if (UtilityRoutines::SameString(Alphas(iCoolSAFMAlphaNum), "SupplyAirFlowRate")) { + if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "SupplyAirFlowRate")) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = SupplyAirFlowRate; if (!lNumericBlanks(iMaxCoolAirVolFlowNumericNum)) { @@ -4706,7 +4703,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxCoolAirVolFlowNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerFloorArea")) { + } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerFloorArea")) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FlowPerFloorArea; if (!lNumericBlanks(iCoolFlowPerFloorAreaNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerFloorAreaNumericNum); @@ -4734,7 +4731,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iCoolSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) { + } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FractionOfAutosizedCoolingAirflow; if (!lNumericBlanks(iCoolFlowPerFracCoolNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerFracCoolNumericNum); @@ -4762,7 +4759,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerFracCoolNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerCoolingCapacity")) { + } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerCoolingCapacity")) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FlowPerCoolingCapacity; if (!lNumericBlanks(iCoolFlowPerCoolCapNumericNum)) { @@ -4791,7 +4788,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerCoolCapNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iCoolSAFMAlphaNum), "None") || lAlphaBlanks(iCoolSAFMAlphaNum)) { + } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "None") || lAlphaBlanks(iCoolSAFMAlphaNum)) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = None; state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = 0.0; // cooling supply air flow rate will not be sized, may be cooling coil does not exist @@ -4801,7 +4798,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ErrorsFound = true; } // Determine supply air flow rate sizing method for heating mode - if (UtilityRoutines::SameString(Alphas(iHeatSAFMAlphaNum), "SupplyAirFlowRate")) { + if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "SupplyAirFlowRate")) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = SupplyAirFlowRate; if (!lNumericBlanks(iMaxHeatAirVolFlowNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iMaxHeatAirVolFlowNumericNum); @@ -4822,7 +4819,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxHeatAirVolFlowNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerFloorArea")) { + } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerFloorArea")) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FlowPerFloorArea; if (!lNumericBlanks(iHeatFlowPerFloorAreaNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFloorAreaNumericNum); @@ -4850,7 +4847,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) { + } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FractionOfAutosizedHeatingAirflow; if (!lNumericBlanks(iHeatFlowPerFracCoolNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFracCoolNumericNum); @@ -4878,7 +4875,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerFracCoolNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerHeatingCapacity")) { + } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerHeatingCapacity")) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FlowPerHeatingCapacity; if (!lNumericBlanks(iHeatFlowPerHeatCapNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerHeatCapNumericNum); @@ -4906,7 +4903,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerHeatCapNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatSAFMAlphaNum), "None") || lAlphaBlanks(iHeatSAFMAlphaNum)) { + } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "None") || lAlphaBlanks(iHeatSAFMAlphaNum)) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = None; state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = 0.0; } else { @@ -4916,7 +4913,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) } // Determine supply air flow rate sizing method when cooling or heating is not needed - if (UtilityRoutines::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "SupplyAirFlowRate")) { + if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "SupplyAirFlowRate")) { state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = SupplyAirFlowRate; if (!lNumericBlanks(iMaxNoCoolHeatAirVolFlowNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iMaxNoCoolHeatAirVolFlowNumericNum); @@ -4937,7 +4934,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxNoCoolHeatAirVolFlowNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FlowPerFloorArea")) { + } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FlowPerFloorArea")) { state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FlowPerFloorArea; if (!lNumericBlanks(iNoCoolHeatFlowPerFloorAreaNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum); @@ -4967,7 +4964,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) { + } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) { state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FractionOfAutosizedCoolingAirflow; if (!lNumericBlanks(iNoCoolHeatFlowPerFracCoolNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFracCoolNumericNum); @@ -4997,7 +4994,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) { + } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) { state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FractionOfAutosizedHeatingAirflow; if (!lNumericBlanks(iNoCoolHeatFlowPerFracHeatNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFracHeatNumericNum); @@ -5027,7 +5024,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "None") || lAlphaBlanks(iNoCoolHeatSAFMAlphaNum)) { + } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "None") || lAlphaBlanks(iNoCoolHeatSAFMAlphaNum)) { state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = None; state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = 0.0; } else { @@ -5037,7 +5034,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) } // Determine cooling design capacity of zoneHVAC equipment - if (UtilityRoutines::SameString(Alphas(iCoolCAPMAlphaNum), "CoolingDesignCapacity")) { + if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CoolingDesignCapacity")) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CoolingDesignCapacity; if (!lNumericBlanks(iCoolDesignCapacityNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolDesignCapacityNumericNum); @@ -5057,7 +5054,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolDesignCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iCoolCAPMAlphaNum), "CapacityPerFloorArea")) { + } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CapacityPerFloorArea")) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CapacityPerFloorArea; if (!lNumericBlanks(iCoolCapacityPerFloorAreaNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolCapacityPerFloorAreaNumericNum); @@ -5082,7 +5079,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iCoolCAPMAlphaNum), "FractionOfAutosizedCoolingCapacity")) { + } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "FractionOfAutosizedCoolingCapacity")) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = FractionOfAutosizedCoolingCapacity; if (!lNumericBlanks(iCoolFracOfAutosizedCapacityNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolFracOfAutosizedCapacityNumericNum); @@ -5103,7 +5100,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iCoolCAPMAlphaNum), "None") || lAlphaBlanks(iCoolCAPMAlphaNum)) { + } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "None") || lAlphaBlanks(iCoolCAPMAlphaNum)) { state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = None; } else { ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name)); @@ -5112,7 +5109,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) } // Determine heating design capacity of zone HVAC equipment - if (UtilityRoutines::SameString(Alphas(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { + if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = HeatingDesignCapacity; if (!lNumericBlanks(iHeatDesignCapacityNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatDesignCapacityNumericNum); @@ -5132,7 +5129,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatDesignCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { + } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = CapacityPerFloorArea; if (!lNumericBlanks(iHeatCapacityPerFloorAreaNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatCapacityPerFloorAreaNumericNum); @@ -5157,7 +5154,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { + } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!lNumericBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatFracOfAutosizedCapacityNumericNum); @@ -5178,7 +5175,7 @@ void GetZoneHVACSizing(EnergyPlusData &state) ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFracOfAutosizedCapacityNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(Alphas(iHeatCAPMAlphaNum), "None") || lAlphaBlanks(iHeatCAPMAlphaNum)) { + } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "None") || lAlphaBlanks(iHeatCAPMAlphaNum)) { state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = None; } else { ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name)); @@ -5241,7 +5238,7 @@ void GetAirTerminalSizing(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &thisATSizing = state.dataSize->AirTerminalSizingSpec(zSIndex); thisATSizing.Name = state.dataIPShortCut->cAlphaArgs(1); diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index d38c027d8c8..90e0991e4ce 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -301,7 +301,7 @@ namespace SolarCollectors { DataPlant::PlantEquipmentType::SolarCollectorFlatPlate; // parameter assigned in DataPlant // Get parameters object - int ParametersNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSolarCollectors->Parameters); + int ParametersNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSolarCollectors->Parameters); if (ParametersNum == 0) { ShowSevereError(state, @@ -316,7 +316,7 @@ namespace SolarCollectors { } // Get surface object - int SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); + int SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, @@ -451,7 +451,7 @@ namespace SolarCollectors { state.dataSolarCollectors->Parameters(ParametersNum).Name = state.dataIPShortCut->cAlphaArgs(1); // NOTE: currently the only available choice is RectangularTank. In the future progressive tube type will be // added - // if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "RectangularTank")) { + // if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "RectangularTank")) { // state.dataSolarCollectors->Parameters(ParametersNum).ICSType_Num = TankTypeEnum::ICSRectangularTank; // } else { // ShowSevereError(state, format("{}{} not found={}{} in {}{} ={}{}", //, @@ -557,7 +557,7 @@ namespace SolarCollectors { state.dataSolarCollectors->Collector(CollectorNum).InitICS = true; // Get parameters object - int ParametersNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSolarCollectors->Parameters); + int ParametersNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSolarCollectors->Parameters); if (ParametersNum == 0) { ShowSevereError(state, @@ -588,7 +588,7 @@ namespace SolarCollectors { state.dataSolarCollectors->Collector(CollectorNum).SideArea / state.dataSolarCollectors->Collector(CollectorNum).Area; } // Get surface object - int SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); + int SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, @@ -654,12 +654,12 @@ namespace SolarCollectors { } state.dataSolarCollectors->Collector(CollectorNum).BCType = state.dataIPShortCut->cAlphaArgs(4); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "AmbientAir")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "AmbientAir")) { state.dataSolarCollectors->Collector(CollectorNum).OSCMName = ""; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "OtherSideConditionsModel")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "OtherSideConditionsModel")) { state.dataSolarCollectors->Collector(CollectorNum).OSCMName = state.dataIPShortCut->cAlphaArgs(5); state.dataSolarCollectors->Collector(CollectorNum).OSCM_ON = true; - int Found = UtilityRoutines::FindItemInList(state.dataSolarCollectors->Collector(CollectorNum).OSCMName, state.dataSurface->OSCM); + int Found = Util::FindItemInList(state.dataSolarCollectors->Collector(CollectorNum).OSCMName, state.dataSurface->OSCM); if (Found == 0) { ShowSevereError(state, format("{} not found={} in {} ={}", @@ -1814,8 +1814,8 @@ namespace SolarCollectors { if (NumCovers == 1) { // calc linearized radiation coefficient - tempnom = Constant::StefanBoltzmann * ((TempAbsPlate + Constant::KelvinConv) + (TempOuterCover + Constant::KelvinConv)) * - (pow_2(TempAbsPlate + Constant::KelvinConv) + pow_2(TempOuterCover + Constant::KelvinConv)); + tempnom = Constant::StefanBoltzmann * ((TempAbsPlate + Constant::Kelvin) + (TempOuterCover + Constant::Kelvin)) * + (pow_2(TempAbsPlate + Constant::Kelvin) + pow_2(TempOuterCover + Constant::Kelvin)); tempdenom = 1.0 / EmissOfAbsPlate + 1.0 / EmissOfOuterCover - 1.0; hRadCoefA2C = tempnom / tempdenom; hRadCoefC2C = 0.0; @@ -1827,8 +1827,8 @@ namespace SolarCollectors { for (int CoverNum = 1; CoverNum <= NumCovers; ++CoverNum) { if (CoverNum == 1) { // calc linearized radiation coefficient - tempnom = Constant::StefanBoltzmann * ((TempAbsPlate + Constant::KelvinConv) + (TempInnerCover + Constant::KelvinConv)) * - (pow_2(TempAbsPlate + Constant::KelvinConv) + pow_2(TempInnerCover + Constant::KelvinConv)); + tempnom = Constant::StefanBoltzmann * ((TempAbsPlate + Constant::Kelvin) + (TempInnerCover + Constant::Kelvin)) * + (pow_2(TempAbsPlate + Constant::Kelvin) + pow_2(TempInnerCover + Constant::Kelvin)); tempdenom = 1.0 / EmissOfAbsPlate + 1.0 / EmissOfInnerCover - 1.0; hRadCoefA2C = tempnom / tempdenom; // Calc convection heat transfer coefficient: @@ -1836,8 +1836,8 @@ namespace SolarCollectors { TempAbsPlate, TempOuterCover, AirGapDepth, this->CosTilt, this->SinTilt); } else { // calculate the linearized radiation coeff. - tempnom = Constant::StefanBoltzmann * ((TempInnerCover + Constant::KelvinConv) + (TempOuterCover + Constant::KelvinConv)) * - (pow_2(TempInnerCover + Constant::KelvinConv) + pow_2(TempOuterCover + Constant::KelvinConv)); + tempnom = Constant::StefanBoltzmann * ((TempInnerCover + Constant::Kelvin) + (TempOuterCover + Constant::Kelvin)) * + (pow_2(TempInnerCover + Constant::Kelvin) + pow_2(TempOuterCover + Constant::Kelvin)); tempdenom = 1.0 / EmissOfInnerCover + 1.0 / EmissOfOuterCover - 1.0; hRadCoefC2C = tempnom / tempdenom; // Calc convection heat transfer coefficient: @@ -1852,8 +1852,8 @@ namespace SolarCollectors { // Calc linearized radiation coefficient between outer cover and the surrounding: tempnom = state.dataSurface->Surface(SurfNum).ViewFactorSky * EmissOfOuterCover * Constant::StefanBoltzmann * - ((TempOuterCover + Constant::KelvinConv) + state.dataEnvrn->SkyTempKelvin) * - (pow_2(TempOuterCover + Constant::KelvinConv) + pow_2(state.dataEnvrn->SkyTempKelvin)); + ((TempOuterCover + Constant::Kelvin) + state.dataEnvrn->SkyTempKelvin) * + (pow_2(TempOuterCover + Constant::Kelvin) + pow_2(state.dataEnvrn->SkyTempKelvin)); tempdenom = (TempOuterCover - TempOutdoorAir) / (TempOuterCover - state.dataEnvrn->SkyTemp); if (tempdenom < 0.0) { // use approximate linearized radiation coefficient @@ -1866,8 +1866,8 @@ namespace SolarCollectors { } tempnom = state.dataSurface->Surface(SurfNum).ViewFactorGround * EmissOfOuterCover * Constant::StefanBoltzmann * - ((TempOuterCover + Constant::KelvinConv) + state.dataEnvrn->GroundTempKelvin) * - (pow_2(TempOuterCover + Constant::KelvinConv) + pow_2(state.dataEnvrn->GroundTempKelvin)); + ((TempOuterCover + Constant::Kelvin) + state.dataEnvrn->GroundTempKelvin) * + (pow_2(TempOuterCover + Constant::Kelvin) + pow_2(state.dataEnvrn->GroundTempKelvin)); tempdenom = (TempOuterCover - TempOutdoorAir) / (TempOuterCover - state.dataEnvrn->GroundTemp); if (tempdenom < 0.0) { // use approximate linearized radiation coefficient @@ -2001,7 +2001,7 @@ namespace SolarCollectors { DensOfAir = Density[Index - 1] + InterpFrac * (Density[Index] - Density[Index - 1]); } - VolExpAir = 1.0 / (Tref + Constant::KelvinConv); + VolExpAir = 1.0 / (Tref + Constant::Kelvin); // Rayleigh number Real64 RaNum = gravity * pow_2(DensOfAir) * VolExpAir * PrOfAir * DeltaT * pow_3(AirGap) / pow_2(VisDOfAir); diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index e4af169c443..0f711479f5f 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -461,11 +461,11 @@ void GetShadowingInput(EnergyPlusData &state) int aNum = 1; unsigned pixelRes = 512u; if (NumAlphas >= aNum) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Scheduled")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Scheduled")) { state.dataSysVars->shadingMethod = ShadingMethod::Scheduled; state.dataIPShortCut->cAlphaArgs(aNum) = "Scheduled"; checkScheduledSurfacePresent(state); - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Imported")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Imported")) { if (state.dataScheduleMgr->ScheduleFileShadingProcessed) { state.dataSysVars->shadingMethod = ShadingMethod::Imported; state.dataIPShortCut->cAlphaArgs(aNum) = "Imported"; @@ -475,10 +475,10 @@ void GetShadowingInput(EnergyPlusData &state) format("Value entered=\"{}\" while no Schedule:File:Shading object is defined, InternalCalculation will be used.", state.dataIPShortCut->cAlphaArgs(aNum))); } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "PolygonClipping")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "PolygonClipping")) { state.dataSysVars->shadingMethod = ShadingMethod::PolygonClipping; state.dataIPShortCut->cAlphaArgs(aNum) = "PolygonClipping"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "PixelCounting")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "PixelCounting")) { state.dataSysVars->shadingMethod = ShadingMethod::PixelCounting; state.dataIPShortCut->cAlphaArgs(aNum) = "PixelCounting"; if (NumNumbers >= 3) { @@ -526,10 +526,10 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; if (NumAlphas >= aNum) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Periodic")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Periodic")) { state.dataSysVars->DetailedSolarTimestepIntegration = false; state.dataIPShortCut->cAlphaArgs(aNum) = "Periodic"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Timestep")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Timestep")) { state.dataSysVars->DetailedSolarTimestepIntegration = true; state.dataIPShortCut->cAlphaArgs(aNum) = "Timestep"; } else { @@ -545,13 +545,13 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; if (NumAlphas >= aNum) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "SutherlandHodgman")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "SutherlandHodgman")) { state.dataSysVars->SutherlandHodgman = true; state.dataIPShortCut->cAlphaArgs(aNum) = "SutherlandHodgman"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "ConvexWeilerAtherton")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "ConvexWeilerAtherton")) { state.dataSysVars->SutherlandHodgman = false; state.dataIPShortCut->cAlphaArgs(aNum) = "ConvexWeilerAtherton"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "SlaterBarskyandSutherlandHodgman")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "SlaterBarskyandSutherlandHodgman")) { state.dataSysVars->SutherlandHodgman = true; state.dataSysVars->SlaterBarsky = true; state.dataIPShortCut->cAlphaArgs(aNum) = "SlaterBarskyandSutherlandHodgman"; @@ -593,10 +593,10 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; if (NumAlphas >= aNum) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "SimpleSkyDiffuseModeling")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "SimpleSkyDiffuseModeling")) { state.dataSysVars->DetailedSkyDiffuseAlgorithm = false; state.dataIPShortCut->cAlphaArgs(aNum) = "SimpleSkyDiffuseModeling"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "DetailedSkyDiffuseModeling")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "DetailedSkyDiffuseModeling")) { state.dataSysVars->DetailedSkyDiffuseAlgorithm = true; state.dataIPShortCut->cAlphaArgs(aNum) = "DetailedSkyDiffuseModeling"; } else if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { @@ -613,10 +613,10 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; if (NumAlphas >= aNum) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { state.dataSysVars->ReportExtShadingSunlitFrac = true; state.dataIPShortCut->cAlphaArgs(aNum) = "Yes"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { state.dataSysVars->ReportExtShadingSunlitFrac = false; state.dataIPShortCut->cAlphaArgs(aNum) = "No"; } else { @@ -649,10 +649,10 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; if (NumAlphas >= aNum) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { DisableSelfShadingWithinGroup = true; state.dataIPShortCut->cAlphaArgs(aNum) = "Yes"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { state.dataIPShortCut->cAlphaArgs(aNum) = "No"; } else { ShowWarningError(state, format("{}: invalid {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(aNum))); @@ -665,10 +665,10 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; if (NumAlphas >= aNum) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { DisableSelfShadingBetweenGroup = true; state.dataIPShortCut->cAlphaArgs(aNum) = "Yes"; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { state.dataIPShortCut->cAlphaArgs(aNum) = "No"; } else { ShowWarningError(state, format("{}: invalid {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(aNum))); @@ -695,7 +695,7 @@ void GetShadowingInput(EnergyPlusData &state) NumOfShadingGroups = NumAlphas - (aNum - 1); DisableSelfShadingGroups.allocate(NumOfShadingGroups); for (int i = 1; i <= NumOfShadingGroups; i++) { - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataIPShortCut->cAlphaArgs(i + (aNum - 1)), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); if (Found != 0) DisableSelfShadingGroups(i) = Found; } diff --git a/src/EnergyPlus/SplitterComponent.cc b/src/EnergyPlus/SplitterComponent.cc index 8376cace313..203eec4cfb4 100644 --- a/src/EnergyPlus/SplitterComponent.cc +++ b/src/EnergyPlus/SplitterComponent.cc @@ -105,7 +105,7 @@ namespace SplitterComponent { // Find the correct SplitterNumber if (CompIndex == 0) { - SplitterNum = UtilityRoutines::FindItemInList(CompName, state.dataSplitterComponent->SplitterCond, &SplitterConditions::SplitterName); + SplitterNum = Util::FindItemInList(CompName, state.dataSplitterComponent->SplitterCond, &SplitterConditions::SplitterName); if (SplitterNum == 0) { ShowFatalError(state, format("SimAirLoopSplitter: Splitter not found={}", CompName)); } @@ -219,7 +219,7 @@ namespace SplitterComponent { lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); state.dataSplitterComponent->SplitterCond(SplitterNum).SplitterName = AlphArray(1); state.dataSplitterComponent->SplitterCond(SplitterNum).InletNode = @@ -613,8 +613,7 @@ namespace SplitterComponent { } if (SplitterNum == 0) { - WhichSplitter = - UtilityRoutines::FindItemInList(SplitterName, state.dataSplitterComponent->SplitterCond, &SplitterConditions::SplitterName); + WhichSplitter = Util::FindItemInList(SplitterName, state.dataSplitterComponent->SplitterCond, &SplitterConditions::SplitterName); } else { WhichSplitter = SplitterNum; } @@ -664,8 +663,7 @@ namespace SplitterComponent { } if (SplitterNum == 0) { - WhichSplitter = - UtilityRoutines::FindItemInList(SplitterName, state.dataSplitterComponent->SplitterCond, &SplitterConditions::SplitterName); + WhichSplitter = Util::FindItemInList(SplitterName, state.dataSplitterComponent->SplitterCond, &SplitterConditions::SplitterName); } else { WhichSplitter = SplitterNum; } diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index 4faf4a0333d..c2deac2f39c 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -143,8 +143,7 @@ namespace SteamBaseboardRadiator { // Find the correct Baseboard Equipment if (CompIndex == 0) { - BaseboardNum = - UtilityRoutines::FindItemInList(EquipName, state.dataSteamBaseboardRadiator->SteamBaseboard, &SteamBaseboardParams::EquipID); + BaseboardNum = Util::FindItemInList(EquipName, state.dataSteamBaseboardRadiator->SteamBaseboard, &SteamBaseboardParams::EquipID); if (BaseboardNum == 0) { ShowFatalError(state, format("SimSteamBaseboard: Unit not found={}", EquipName)); } @@ -335,7 +334,7 @@ namespace SteamBaseboardRadiator { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty( + Util::IsNameEmpty( state, state.dataIPShortCut->cAlphaArgs(1), state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam_Design, ErrorsFound); state.dataSteamBaseboardRadiator->SteamBaseboardDesignNumericFields(BaseboardDesignNum).FieldNames.allocate(NumNumbers); state.dataSteamBaseboardRadiator->SteamBaseboardDesignNumericFields(BaseboardDesignNum).FieldNames = ""; @@ -355,9 +354,9 @@ namespace SteamBaseboardRadiator { state.dataIPShortCut->cAlphaArgs(1); // Add to array of design object names // Determine steam baseboard radiator system heating design capacity sizing method - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) { state.dataSteamBaseboardRadiator->SteamBaseboardDesign(BaseboardDesignNum).HeatingCapMethod = HeatingDesignCapacity; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) { state.dataSteamBaseboardRadiator->SteamBaseboardDesign(BaseboardDesignNum).HeatingCapMethod = CapacityPerFloorArea; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) { state.dataSteamBaseboardRadiator->SteamBaseboardDesign(BaseboardDesignNum).DesignScaledHeatingCapacity = @@ -403,7 +402,7 @@ namespace SteamBaseboardRadiator { format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum))); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) { state.dataSteamBaseboardRadiator->SteamBaseboardDesign(BaseboardDesignNum).HeatingCapMethod = FractionOfAutosizedHeatingCapacity; if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) { state.dataSteamBaseboardRadiator->SteamBaseboardDesign(BaseboardDesignNum).DesignScaledHeatingCapacity = @@ -519,8 +518,7 @@ namespace SteamBaseboardRadiator { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty( - state, state.dataIPShortCut->cAlphaArgs(1), state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam, ErrorsFound); state.dataSteamBaseboardRadiator->SteamBaseboardNumericFields(BaseboardNum).FieldNames.allocate(NumNumbers); state.dataSteamBaseboardRadiator->SteamBaseboardNumericFields(BaseboardNum).FieldNames = ""; state.dataSteamBaseboardRadiator->SteamBaseboardNumericFields(BaseboardNum).FieldNames = state.dataIPShortCut->cNumericFieldNames; @@ -539,8 +537,8 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).designObjectName = state.dataIPShortCut->cAlphaArgs(2); // Name of the design object for this baseboard state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).DesignObjectPtr = - UtilityRoutines::FindItemInList(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).designObjectName, - state.dataSteamBaseboardRadiator->SteamBaseboardDesignNames); + Util::FindItemInList(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).designObjectName, + state.dataSteamBaseboardRadiator->SteamBaseboardDesignNames); SteamBaseboardDesignData SteamBaseboardDesignDataObject{ state.dataSteamBaseboardRadiator->SteamBaseboardDesign(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum) .DesignObjectPtr)}; // Contains the design data for steam baseboard object @@ -1632,8 +1630,7 @@ namespace SteamBaseboardRadiator { // Find the correct baseboard if (CompIndex == 0) { - BaseboardNum = - UtilityRoutines::FindItemInList(BaseboardName, state.dataSteamBaseboardRadiator->SteamBaseboard, &SteamBaseboardParams::EquipID); + BaseboardNum = Util::FindItemInList(BaseboardName, state.dataSteamBaseboardRadiator->SteamBaseboard, &SteamBaseboardParams::EquipID); if (BaseboardNum == 0) { ShowFatalError(state, format("UpdateSteamBaseboardPlantConnection: Specified baseboard not valid ={}", BaseboardName)); } diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index e602cc04571..675bb44fe6a 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -142,7 +142,7 @@ namespace SteamCoils { // Find the correct SteamCoilNumber with the Coil Name if (CompIndex == 0) { - CoilNum = UtilityRoutines::FindItemInList(CompName, state.dataSteamCoils->SteamCoil); + CoilNum = Util::FindItemInList(CompName, state.dataSteamCoils->SteamCoil); if (CoilNum == 0) { ShowFatalError(state, format("SimulateSteamCoilComponents: Coil not found={}", CompName)); } @@ -275,7 +275,7 @@ namespace SteamCoils { lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueCoilName(state, CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); @@ -336,8 +336,9 @@ namespace SteamCoils { NodeInputManager::CompFluidStream::Primary, ObjectIsNotParent); - std::string controlMode = UtilityRoutines::makeUPPER(AlphArray(7)); + std::string controlMode = Util::makeUPPER(AlphArray(7)); state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil = static_cast(getEnumValue(coilControlTypeNames, controlMode)); + switch (state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil) { case CoilControlType::TemperatureSetPoint: state.dataSteamCoils->SteamCoil(CoilNum).TempSetPointNodeNum = GetOnlySingleNode(state, @@ -1572,7 +1573,7 @@ namespace SteamCoils { } if (CoilType == "COIL:HEATING:STEAM") { - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataSteamCoils->SteamCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataSteamCoils->SteamCoil); } else { IndexNum = 0; } @@ -1592,7 +1593,7 @@ namespace SteamCoils { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } - int indexNum = UtilityRoutines::FindItemInList(coilName, state.dataSteamCoils->SteamCoil); + int indexNum = Util::FindItemInList(coilName, state.dataSteamCoils->SteamCoil); if (indexNum == 0) { // may not find coil name ShowSevereError(state, format("GetSteamCoilIndex: Could not find CoilType = Coil:Heating:Steam with Name = \"{}\"", coilName)); @@ -1625,7 +1626,7 @@ namespace SteamCoils { // Find the correct Coil number if (CompIndex == 0) { - CoilNum = UtilityRoutines::FindItemInList(CompName, state.dataSteamCoils->SteamCoil); + CoilNum = Util::FindItemInList(CompName, state.dataSteamCoils->SteamCoil); if (CoilNum == 0) { ShowFatalError(state, format("CheckSteamCoilSchedule: Coil not found={}", CompName)); } @@ -1681,8 +1682,8 @@ namespace SteamCoils { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Steam")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataSteamCoils->SteamCoil); + if (Util::SameString(CoilType, "Coil:Heating:Steam")) { + WhichCoil = Util::FindItem(CoilName, state.dataSteamCoils->SteamCoil); if (WhichCoil != 0) { // coil does not specify MaxWaterFlowRate MaxWaterFlowRate = 0.0; @@ -1853,8 +1854,8 @@ namespace SteamCoils { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Steam")) { - IndexNum = UtilityRoutines::FindItem(CoilName, state.dataSteamCoils->SteamCoil); + if (Util::SameString(CoilType, "Coil:Heating:Steam")) { + IndexNum = Util::FindItem(CoilName, state.dataSteamCoils->SteamCoil); } else { IndexNum = 0; } @@ -1936,8 +1937,8 @@ namespace SteamCoils { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Steam")) { - IndexNum = UtilityRoutines::FindItem(CoilName, state.dataSteamCoils->SteamCoil); + if (Util::SameString(CoilType, "Coil:Heating:Steam")) { + IndexNum = Util::FindItem(CoilName, state.dataSteamCoils->SteamCoil); } else { IndexNum = 0; } @@ -2021,8 +2022,8 @@ namespace SteamCoils { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Steam")) { - IndexNum = UtilityRoutines::FindItem(CoilName, state.dataSteamCoils->SteamCoil); + if (Util::SameString(CoilType, "Coil:Heating:Steam")) { + IndexNum = Util::FindItem(CoilName, state.dataSteamCoils->SteamCoil); } else { IndexNum = 0; } @@ -2068,8 +2069,8 @@ namespace SteamCoils { state.dataSteamCoils->GetSteamCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Steam")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataSteamCoils->SteamCoil); + if (Util::SameString(CoilType, "Coil:Heating:Steam")) { + WhichCoil = Util::FindItem(CoilName, state.dataSteamCoils->SteamCoil); if (WhichCoil != 0) { // coil does not specify MaxWaterFlowRate Capacity = state.dataSteamCoils->SteamCoil(WhichCoil).OperatingCapacity; @@ -2152,8 +2153,8 @@ namespace SteamCoils { WhichCoil = 0; NodeNumber = 0; - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Steam")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataSteamCoils->SteamCoil); + if (Util::SameString(CoilType, "Coil:Heating:Steam")) { + WhichCoil = Util::FindItem(CoilName, state.dataSteamCoils->SteamCoil); if (WhichCoil != 0) { NodeNumber = state.dataSteamCoils->SteamCoil(WhichCoil).TempSetPointNodeNum; } @@ -2203,8 +2204,8 @@ namespace SteamCoils { WhichCoil = 0; AvailSchIndex = 0; - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Steam")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataSteamCoils->SteamCoil); + if (Util::SameString(CoilType, "Coil:Heating:Steam")) { + WhichCoil = Util::FindItem(CoilName, state.dataSteamCoils->SteamCoil); if (WhichCoil != 0) { AvailSchIndex = state.dataSteamCoils->SteamCoil(WhichCoil).SchedPtr; } diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 13713f5c014..845a6766e4a 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -1309,7 +1309,7 @@ namespace SurfaceGeometry { // Debug write(outputfiledebug,*) ' adding surface=',curnewsurf state.dataSurfaceGeometry->SurfaceTmp(CurNewSurf) = state.dataSurfaceGeometry->SurfaceTmp(SurfNum); // Basic parameters are the same for both surfaces. - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (Found == 0) continue; state.dataSurfaceGeometry->SurfaceTmp(CurNewSurf).Zone = Found; @@ -1402,9 +1402,9 @@ namespace SurfaceGeometry { // Debug write(outputfiledebug,*) ' basesurf, extboundcondname=',TRIM(SurfaceTmp(CurNewSurf)%ExtBoundCondName) } else { // subsurface - Found = UtilityRoutines::FindItemInList("iz-" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, - state.dataSurfaceGeometry->SurfaceTmp, - FirstTotalSurfaces + CurNewSurf - 1); + Found = Util::FindItemInList("iz-" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, + state.dataSurfaceGeometry->SurfaceTmp, + FirstTotalSurfaces + CurNewSurf - 1); if (Found > 0) { state.dataSurfaceGeometry->SurfaceTmp(CurNewSurf).BaseSurfName = "iz-" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName; @@ -1443,13 +1443,12 @@ namespace SurfaceGeometry { if (!state.dataSurfaceGeometry->SurfaceTmp(SurfNum).HeatTransSurf) continue; // why are we doing this again? this should have already been done. - if (UtilityRoutines::SameString(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name)) { + if (Util::SameString(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name)) { Found = SurfNum; } else { - Found = UtilityRoutines::FindItemInList(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, - state.dataSurfaceGeometry->SurfaceTmp, - state.dataSurface->TotSurfaces); + Found = Util::FindItemInList(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, + state.dataSurfaceGeometry->SurfaceTmp, + state.dataSurface->TotSurfaces); } if (Found > 0) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf = Found; @@ -1780,8 +1779,7 @@ namespace SurfaceGeometry { if (state.dataSurface->Surface(SurfNum).ExtBoundCondName == state.dataSurface->Surface(SurfNum).Name) { Found = SurfNum; } else { - Found = UtilityRoutines::FindItemInList( - state.dataSurface->Surface(SurfNum).ExtBoundCondName, state.dataSurface->Surface, MovedSurfs); + Found = Util::FindItemInList(state.dataSurface->Surface(SurfNum).ExtBoundCondName, state.dataSurface->Surface, MovedSurfs); } if (Found != 0) { state.dataSurface->Surface(SurfNum).ExtBoundCond = Found; @@ -3206,7 +3204,7 @@ namespace SurfaceGeometry { state.dataSurface->CCW = true; OK = false; - Found = UtilityRoutines::FindItem(GAlphas(1), FlCorners, 4); + Found = Util::FindItem(GAlphas(1), FlCorners, 4); if (Found == 0) { ShowSevereError(state, format("{}: Invalid {}={}", cCurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(1), GAlphas(1))); ErrorsFound = true; @@ -3217,12 +3215,12 @@ namespace SurfaceGeometry { } OK = false; - if (UtilityRoutines::SameString(GAlphas(2), "CCW") || UtilityRoutines::SameString(GAlphas(2), "Counterclockwise")) { + if (Util::SameString(GAlphas(2), "CCW") || Util::SameString(GAlphas(2), "Counterclockwise")) { state.dataSurface->CCW = true; OutMsg += "Counterclockwise,"; OK = true; } - if (UtilityRoutines::SameString(GAlphas(2), "CW") || UtilityRoutines::SameString(GAlphas(2), "Clockwise")) { + if (Util::SameString(GAlphas(2), "CW") || Util::SameString(GAlphas(2), "Clockwise")) { state.dataSurface->CCW = false; OutMsg += "Clockwise,"; OK = true; @@ -3233,12 +3231,12 @@ namespace SurfaceGeometry { } OK = false; - if (UtilityRoutines::SameString(GAlphas(3), "World") || UtilityRoutines::SameString(GAlphas(3), "Absolute")) { + if (Util::SameString(GAlphas(3), "World") || Util::SameString(GAlphas(3), "Absolute")) { state.dataSurface->WorldCoordSystem = true; OutMsg += "WorldCoordinateSystem,"; OK = true; } - if (UtilityRoutines::SameString(GAlphas(3), "Relative")) { + if (Util::SameString(GAlphas(3), "Relative")) { state.dataSurface->WorldCoordSystem = false; OutMsg += "RelativeCoordinateSystem,"; OK = true; @@ -3251,12 +3249,12 @@ namespace SurfaceGeometry { } OK = false; - if (UtilityRoutines::SameString(GAlphas(4), "World") || UtilityRoutines::SameString(GAlphas(4), "Absolute")) { + if (Util::SameString(GAlphas(4), "World") || Util::SameString(GAlphas(4), "Absolute")) { state.dataSurface->DaylRefWorldCoordSystem = true; OutMsg += "WorldCoordinateSystem,"; OK = true; } - if (UtilityRoutines::SameString(GAlphas(4), "Relative") || GAlphas(4).empty()) { + if (Util::SameString(GAlphas(4), "Relative") || GAlphas(4).empty()) { state.dataSurface->DaylRefWorldCoordSystem = false; OutMsg += "RelativeCoordinateSystem,"; OK = true; @@ -3269,12 +3267,12 @@ namespace SurfaceGeometry { } OK = false; - if (UtilityRoutines::SameString(GAlphas(5), "World") || UtilityRoutines::SameString(GAlphas(5), "Absolute")) { + if (Util::SameString(GAlphas(5), "World") || Util::SameString(GAlphas(5), "Absolute")) { state.dataSurfaceGeometry->RectSurfRefWorldCoordSystem = true; OutMsg += "WorldCoordinateSystem"; OK = true; } - if (UtilityRoutines::SameString(GAlphas(5), "Relative") || GAlphas(5).empty()) { + if (Util::SameString(GAlphas(5), "Relative") || GAlphas(5).empty()) { state.dataSurfaceGeometry->RectSurfRefWorldCoordSystem = false; OutMsg += "RelativeToZoneOrigin"; OK = true; @@ -3868,7 +3866,7 @@ namespace SurfaceGeometry { ArgPointer = 2; if (Item == 1) { if (state.dataIPShortCut->cAlphaArgs(2) == "CEILING") state.dataIPShortCut->cAlphaArgs(2) = "ROOF"; - ClassItem = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), BaseSurfCls, 3); + ClassItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), BaseSurfCls, 3); if (ClassItem == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}", @@ -3885,7 +3883,7 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class = BaseSurfIDs(ClassItem); } - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = UtilityRoutines::FindItemInList( + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = Util::FindItemInList( state.dataIPShortCut->cAlphaArgs(ArgPointer), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction == 0) { @@ -3921,7 +3919,7 @@ namespace SurfaceGeometry { ++ArgPointer; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName = state.dataIPShortCut->cAlphaArgs(ArgPointer); - ZoneNum = UtilityRoutines::FindItemInList( + ZoneNum = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (ZoneNum != 0) { @@ -3940,7 +3938,7 @@ namespace SurfaceGeometry { ++ArgPointer; if (!state.dataIPShortCut->lAlphaFieldBlanks(ArgPointer)) { - int spaceNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(ArgPointer), state.dataHeatBal->space); + int spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(ArgPointer), state.dataHeatBal->space); if (spaceNum != 0) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).spaceNum = spaceNum; @@ -3971,14 +3969,14 @@ namespace SurfaceGeometry { ++ArgPointer; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName = state.dataIPShortCut->cAlphaArgs(ArgPointer + 1); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Outdoors")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Outdoors")) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = ExternalEnvironment; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Adiabatic")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Adiabatic")) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = UnreconciledZoneSurface; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Ground")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Ground")) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = Ground; if (state.dataSurfaceGeometry->NoGroundTempObjWarning) { @@ -3993,7 +3991,7 @@ namespace SurfaceGeometry { } // Added for FCfactor method - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundFCfactorMethod")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundFCfactorMethod")) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = GroundFCfactorMethod; if (state.dataSurfaceGeometry->NoFCGroundTempObjWarning) { if (!state.dataEnvrn->FCGroundTemps) { @@ -4037,8 +4035,8 @@ namespace SurfaceGeometry { } } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "OtherSideCoefficients")) { - Found = UtilityRoutines::FindItemInList( + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "OtherSideCoefficients")) { + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName, state.dataSurface->OSC, state.dataSurface->TotOSC); if (Found == 0) { ShowSevereError(state, @@ -4058,7 +4056,7 @@ namespace SurfaceGeometry { } } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Surface")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Surface")) { // it has to be another surface which needs to be found // this will be found on the second pass through the surface input // for flagging, set the value to UnreconciledZoneSurface @@ -4075,12 +4073,12 @@ namespace SurfaceGeometry { ShowContinueError(state, "..This surface will become an adiabatic surface - no doors/windows allowed."); } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Zone")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Zone")) { // This is the code for an unmatched "other surface" // will be set up later. state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = UnenteredAdjacentZoneSurface; // check OutsideFaceEnvironment for legal zone - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); ++NeedToAddSurfaces; @@ -4095,9 +4093,9 @@ namespace SurfaceGeometry { ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Foundation")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "Foundation")) { - if (!state.dataWeatherManager->WeatherFileExists) { + if (!state.dataWeather->WeatherFileExists) { ShowSevereError( state, format("{}=\"{}\", using \"Foundation\" type Outside Boundary Condition requires specification of a weather file", @@ -4143,8 +4141,8 @@ namespace SurfaceGeometry { } state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = KivaFoundation; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "OtherSideConditionsModel")) { - Found = UtilityRoutines::FindItemInList( + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "OtherSideConditionsModel")) { + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName, state.dataSurface->OSCM, state.dataSurface->TotOSCM); if (Found == 0) { ShowSevereError(state, @@ -4158,13 +4156,13 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).OSCMPtr = Found; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = OtherSideCondModeledExt; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundSlabPreprocessorAverage") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundSlabPreprocessorCore") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundSlabPreprocessorPerimeter") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorAverageFloor") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorAverageWall") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorUpperWall") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorLowerWall")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundSlabPreprocessorAverage") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundSlabPreprocessorCore") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundSlabPreprocessorPerimeter") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorAverageFloor") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorAverageWall") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorUpperWall") || + Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "GroundBasementPreprocessorLowerWall")) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}\".", cCurrentModuleObject, @@ -4189,7 +4187,7 @@ namespace SurfaceGeometry { ArgPointer += 2; // Set the logical flag for the exterior solar - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "SunExposed")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "SunExposed")) { if ((state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond != ExternalEnvironment) && (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond != OtherSideCondModeledExt)) { ShowWarningError(state, @@ -4202,7 +4200,7 @@ namespace SurfaceGeometry { } else { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtSolar = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "NoSun")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "NoSun")) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtSolar = false; } else { ShowSevereError(state, @@ -4216,9 +4214,9 @@ namespace SurfaceGeometry { ++ArgPointer; // Set the logical flag for the exterior wind - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "WindExposed")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "WindExposed")) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtWind = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "NoWind")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(ArgPointer), "NoWind")) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtWind = false; } else { ShowSevereError(state, @@ -4289,7 +4287,7 @@ namespace SurfaceGeometry { } CheckConvexity(state, SurfNum, state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "Surface")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "Surface")) { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Sides != static_cast(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Vertex.size())) { ShowSevereError(state, @@ -4348,8 +4346,7 @@ namespace SurfaceGeometry { for (int i = 1; i <= SurfNum; i++) { if (state.dataSurfaceGeometry->SurfaceTmp(i).ExtBoundCond == UnreconciledZoneSurface && state.dataSurfaceGeometry->SurfaceTmp(i).ExtBoundCondName != "") { - ExtSurfNum = - UtilityRoutines::FindItemInList(state.dataSurfaceGeometry->SurfaceTmp(i).ExtBoundCondName, state.dataSurfaceGeometry->SurfaceTmp); + ExtSurfNum = Util::FindItemInList(state.dataSurfaceGeometry->SurfaceTmp(i).ExtBoundCondName, state.dataSurfaceGeometry->SurfaceTmp); // If we cannot find the referenced surface if (ExtSurfNum == 0) { ShowSevereError(state, @@ -4533,8 +4530,8 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name = state.dataIPShortCut->cAlphaArgs(1); // Set the Surface Name in the Derived Type state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class = BaseSurfIDs(ClassItem); // Set class number - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction == 0) { ErrorsFound = true; @@ -4564,7 +4561,7 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName = state.dataIPShortCut->cAlphaArgs(3); - ZoneNum = UtilityRoutines::FindItemInList( + ZoneNum = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ZoneName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (ZoneNum != 0) { @@ -4582,7 +4579,7 @@ namespace SurfaceGeometry { } if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - int spaceNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->space); + int spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->space); if (spaceNum != 0) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).spaceNum = spaceNum; @@ -4639,7 +4636,7 @@ namespace SurfaceGeometry { } else if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == UnreconciledZoneSurface) { if (GettingIZSurfaces) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName = state.dataIPShortCut->cAlphaArgs(OtherSurfaceField); - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); // see if match to zone, then it's an unentered other surface, else reconciled later if (Found > 0) { @@ -5097,7 +5094,7 @@ namespace SurfaceGeometry { ++SurfNum; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name = state.dataIPShortCut->cAlphaArgs(1); // Set the Surface Name in the Derived Type - ValidChk = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), SubSurfCls, 6); + ValidChk = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), SubSurfCls, 6); if (ValidChk == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}", @@ -5110,8 +5107,8 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class = SubSurfIDs(ValidChk); // Set class number } - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction == 0) { ShowSevereError(state, @@ -5171,7 +5168,7 @@ namespace SurfaceGeometry { // The subsurface inherits properties from the base surface // Exterior conditions, Zone, etc. // We can figure out the base surface though, because they've all been entered - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, state.dataSurfaceGeometry->SurfaceTmp, state.dataSurface->TotSurfaces); if (Found > 0) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf = Found; @@ -5253,7 +5250,7 @@ namespace SurfaceGeometry { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt || state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == OtherSideCoefCalcExt) { if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { // Otherside Coef special Name - Found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataSurface->OSC, state.dataSurface->TotOSC); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataSurface->OSC, state.dataSurface->TotOSC); if (Found == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}\".", @@ -5551,8 +5548,8 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name = state.dataIPShortCut->cAlphaArgs(1); // Set the Surface Name in the Derived Type state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class = SubSurfIDs(ClassItem); // Set class number - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction == 0) { ErrorsFound = true; @@ -5607,9 +5604,9 @@ namespace SurfaceGeometry { // The subsurface inherits properties from the base surface // Exterior conditions, Zone, etc. // We can figure out the base surface though, because they've all been entered - Found = UtilityRoutines::FindItemInList(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, - state.dataSurfaceGeometry->SurfaceTmp, - state.dataSurface->TotSurfaces); + Found = Util::FindItemInList(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, + state.dataSurfaceGeometry->SurfaceTmp, + state.dataSurface->TotSurfaces); if (Found > 0) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf = Found; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = state.dataSurfaceGeometry->SurfaceTmp(Found).ExtBoundCond; @@ -5671,7 +5668,7 @@ namespace SurfaceGeometry { if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == UnreconciledZoneSurface) { // "Surface" Base Surface if (GettingIZSurfaces) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName = state.dataIPShortCut->cAlphaArgs(OtherSurfaceField); - IZFound = UtilityRoutines::FindItemInList( + IZFound = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCondName, state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (IZFound > 0) state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond = UnenteredAdjacentZoneSurface; } else { // Interior Window @@ -6087,7 +6084,7 @@ namespace SurfaceGeometry { if (!state.dataIPShortCut->lAlphaFieldBlanks(FrameField) && state.dataSurfaceGeometry->SurfaceTmp(SurfNum).FrameDivider == 0) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).FrameDivider = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(FrameField), state.dataSurface->FrameDivider); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(FrameField), state.dataSurface->FrameDivider); if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).FrameDivider == 0) { if (!state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).WindowTypeEQL) { ShowSevereError(state, @@ -6268,7 +6265,7 @@ namespace SurfaceGeometry { .ExtBoundCondName)) { // Base surface is an interzone surface // Lookup interzone surface of the base surface // (Interzone surfaces have not been assigned yet, but all base surfaces should already be loaded.) - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurf).ExtBoundCondName, state.dataSurfaceGeometry->SurfaceTmp, SurfNum); @@ -6548,7 +6545,7 @@ namespace SurfaceGeometry { // The subsurface inherits properties from the base surface // Exterior conditions, Zone, etc. // We can figure out the base surface though, because they've all been entered - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName, state.dataSurfaceGeometry->SurfaceTmp, state.dataSurface->TotSurfaces); if (Found > 0) { // SurfaceTmp(SurfNum)%BaseSurf=Found @@ -6784,8 +6781,8 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class = SurfaceClass::Shading; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).HeatTransSurf = false; // this object references a window or door.... - Found = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataSurfaceGeometry->SurfaceTmp, state.dataSurface->TotSurfaces); + Found = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurfaceGeometry->SurfaceTmp, state.dataSurface->TotSurfaces); if (Found > 0) { BaseSurfNum = state.dataSurfaceGeometry->SurfaceTmp(Found).BaseSurf; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).BaseSurfName = state.dataSurfaceGeometry->SurfaceTmp(Found).BaseSurfName; @@ -7226,13 +7223,13 @@ namespace SurfaceGeometry { state.dataSurface->IntMassObjects(Item).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataSurface->IntMassObjects(Item).GrossArea = state.dataIPShortCut->rNumericArgs(1); - state.dataSurface->IntMassObjects(Item).Construction = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + state.dataSurface->IntMassObjects(Item).Construction = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); state.dataSurface->IntMassObjects(Item).ZoneOrZoneListName = state.dataIPShortCut->cAlphaArgs(3); - int Item1 = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + int Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); int ZLItem = 0; if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->ZoneList); + ZLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->ZoneList); if (Item1 > 0) { if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { ++NumIntMassSurfaces; @@ -7261,10 +7258,10 @@ namespace SurfaceGeometry { if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { state.dataSurface->IntMassObjects(Item).spaceOrSpaceListName = state.dataIPShortCut->cAlphaArgs(4); - int Item1 = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->space); + int Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->space); int SLItem = 0; if (Item1 == 0 && int(state.dataHeatBal->spaceList.size()) > 0) - SLItem = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->spaceList); + SLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->spaceList); if (Item1 > 0) { ++NumIntMassSurfaces; state.dataSurface->IntMassObjects(Item).numOfSpaces = 1; @@ -7449,10 +7446,10 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int Item1 = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + int Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); int ZLItem = 0; if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) - ZLItem = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->ZoneList); + ZLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->ZoneList); if (Item1 > 0) { if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { ++NumIntMassSurf; @@ -7462,10 +7459,10 @@ namespace SurfaceGeometry { } if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - int Item1 = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->space); + int Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->space); int SLItem = 0; if (Item1 == 0 && int(state.dataHeatBal->spaceList.size()) > 0) - SLItem = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->spaceList); + SLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataHeatBal->spaceList); if (Item1 > 0) { ++NumIntMassSurf; } else if (SLItem > 0) { @@ -7539,8 +7536,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - SurfNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (SurfNum == 0) { ShowWarningError(state, format("{}=\"{}\", invalid specification", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, @@ -7575,8 +7571,8 @@ namespace SurfaceGeometry { state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = (1.0 - state.dataIPShortCut->rNumericArgs(3)) * state.dataIPShortCut->rNumericArgs(2); if (state.dataIPShortCut->rNumericArgs(3) > 0.0) { - GlConstrNum = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + GlConstrNum = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (GlConstrNum == 0) { ShowSevereError(state, format("{}=\"{}\", {} not found={}", @@ -7590,8 +7586,7 @@ namespace SurfaceGeometry { } state.dataSurface->SurfShadowGlazingConstruct(SurfNum) = GlConstrNum; } - SurfNum = UtilityRoutines::FindItemInList( - "Mir-" + state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + SurfNum = Util::FindItemInList("Mir-" + state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (SurfNum == 0) continue; state.dataSurface->SurfShadowGlazingFrac(SurfNum) = state.dataIPShortCut->rNumericArgs(3); state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum) = @@ -7599,8 +7594,8 @@ namespace SurfaceGeometry { state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = (1.0 - state.dataIPShortCut->rNumericArgs(3)) * state.dataIPShortCut->rNumericArgs(2); if (state.dataIPShortCut->rNumericArgs(3) > 0.0) { - GlConstrNum = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + GlConstrNum = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (GlConstrNum != 0) { state.dataConstruction->Construct(GlConstrNum).IsUsed = true; } @@ -7716,13 +7711,13 @@ namespace SurfaceGeometry { ErrorInName = false; IsBlank = false; - UtilityRoutines::VerifyName(state, - state.dataIPShortCut->cAlphaArgs(1), - state.dataHeatBal->ExtVentedCavity, - Item - 1, - ErrorInName, - IsBlank, - cCurrentModuleObject + " Name"); + Util::VerifyName(state, + state.dataIPShortCut->cAlphaArgs(1), + state.dataHeatBal->ExtVentedCavity, + Item - 1, + ErrorInName, + IsBlank, + cCurrentModuleObject + " Name"); if (ErrorInName) { ShowContinueError(state, "...cannot not duplicate other names"); ErrorsFound = true; @@ -7732,8 +7727,7 @@ namespace SurfaceGeometry { state.dataHeatBal->ExtVentedCavity(Item).OSCMName = state.dataIPShortCut->cAlphaArgs(2); if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - Found = UtilityRoutines::FindItemInList( - state.dataHeatBal->ExtVentedCavity(Item).OSCMName, state.dataSurface->OSCM, state.dataSurface->TotOSCM); + Found = Util::FindItemInList(state.dataHeatBal->ExtVentedCavity(Item).OSCMName, state.dataSurface->OSCM, state.dataSurface->TotOSCM); if (Found == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}\".", @@ -7756,17 +7750,17 @@ namespace SurfaceGeometry { Roughness = state.dataIPShortCut->cAlphaArgs(3); // Select the correct Number for the associated ascii name for the roughness type - if (UtilityRoutines::SameString(Roughness, "VerySmooth")) { + if (Util::SameString(Roughness, "VerySmooth")) { state.dataHeatBal->ExtVentedCavity(Item).BaffleRoughness = Material::SurfaceRoughness::VerySmooth; - } else if (UtilityRoutines::SameString(Roughness, "Smooth")) { + } else if (Util::SameString(Roughness, "Smooth")) { state.dataHeatBal->ExtVentedCavity(Item).BaffleRoughness = Material::SurfaceRoughness::Smooth; - } else if (UtilityRoutines::SameString(Roughness, "MediumSmooth")) { + } else if (Util::SameString(Roughness, "MediumSmooth")) { state.dataHeatBal->ExtVentedCavity(Item).BaffleRoughness = Material::SurfaceRoughness::MediumSmooth; - } else if (UtilityRoutines::SameString(Roughness, "MediumRough")) { + } else if (Util::SameString(Roughness, "MediumRough")) { state.dataHeatBal->ExtVentedCavity(Item).BaffleRoughness = Material::SurfaceRoughness::MediumRough; - } else if (UtilityRoutines::SameString(Roughness, "Rough")) { + } else if (Util::SameString(Roughness, "Rough")) { state.dataHeatBal->ExtVentedCavity(Item).BaffleRoughness = Material::SurfaceRoughness::Rough; - } else if (UtilityRoutines::SameString(Roughness, "VeryRough")) { + } else if (Util::SameString(Roughness, "VeryRough")) { state.dataHeatBal->ExtVentedCavity(Item).BaffleRoughness = Material::SurfaceRoughness::VeryRough; } // TODO: fix this after creating FindEnumeratedValueIndex() @@ -7794,7 +7788,7 @@ namespace SurfaceGeometry { state.dataHeatBal->ExtVentedCavity(Item).SurfPtrs.allocate(state.dataHeatBal->ExtVentedCavity(Item).NumSurfs); state.dataHeatBal->ExtVentedCavity(Item).SurfPtrs = 0; for (ThisSurf = 1; ThisSurf <= state.dataHeatBal->ExtVentedCavity(Item).NumSurfs; ++ThisSurf) { - Found = UtilityRoutines::FindItemInList( + Found = Util::FindItemInList( state.dataIPShortCut->cAlphaArgs(ThisSurf + AlphaOffset), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (Found == 0) { ShowSevereError(state, @@ -8024,8 +8018,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - int Found = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + int Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (Found == 0) { ShowSevereError(state, format("{}=\"{}\", did not find matching surface", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ErrorsFound = true; @@ -8157,9 +8150,9 @@ namespace SurfaceGeometry { ErrorsFound = true; } for (int segNum = 0; segNum < numRemainingFields; segNum++) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "YES")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "YES")) { data.isExposedPerimeter.push_back(true); - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "NO")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "NO")) { data.isExposedPerimeter.push_back(false); } else if (state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { ShowSevereError( @@ -8255,12 +8248,12 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); SurfLocalEnv.Name = state.dataIPShortCut->cAlphaArgs(1); // Assign surface number - int SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); + int SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); if (SurfNum == 0) { ShowSevereError(state, format("{} {} = \"{}\", object. Illegal value for \"{}\" has been found.", @@ -8301,8 +8294,7 @@ namespace SurfaceGeometry { // Assign surrounding surfaces object number; if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - int SurroundingSurfsNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataSurface->SurroundingSurfsProperty); + int SurroundingSurfsNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataSurface->SurroundingSurfsProperty); if (SurroundingSurfsNum == 0) { ShowSevereError(state, format("{} {} = \"{}\", object. Illegal value for \"{}\" has been found.", @@ -8351,7 +8343,7 @@ namespace SurfaceGeometry { // get ground surfaces object number; if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { - int GndSurfsNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(6), state.dataSurface->GroundSurfsProperty); + int GndSurfsNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(6), state.dataSurface->GroundSurfsProperty); if (GndSurfsNum == 0) { ShowSevereError(state, format("{} {} = \"{}\", object. Illegal value for \"{}\" has been found.", @@ -8459,7 +8451,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); // A1: Name SrdSurfsProp.Name = state.dataIPShortCut->cAlphaArgs(1); @@ -8528,7 +8520,7 @@ namespace SurfaceGeometry { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); GroundSurfacesProperty thisGndSurfsObj; - thisGndSurfsObj.Name = UtilityRoutines::makeUPPER(thisObjectName); + thisGndSurfsObj.Name = Util::makeUPPER(thisObjectName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(cCurrentModuleObject, thisObjectName); auto groundSurfaces = fields.find("ground_surfaces"); if (groundSurfaces != fields.end()) { @@ -8540,7 +8532,7 @@ namespace SurfaceGeometry { if (GndSurfName != groundSurface.end()) { std::string ground_surf_name = GndSurfName.value().get(); if (!ground_surf_name.empty()) { - thisGndSurf.Name = UtilityRoutines::makeUPPER(ground_surf_name); + thisGndSurf.Name = Util::makeUPPER(ground_surf_name); } } auto groundSurfViewFactor = groundSurface.find("ground_surface_view_factor"); @@ -8552,14 +8544,14 @@ namespace SurfaceGeometry { if (TempSchName != groundSurface.end()) { std::string gnd_surf_TempSchName = TempSchName.value().get(); if (!gnd_surf_TempSchName.empty()) { - thisGndSurf.TempSchPtr = ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_TempSchName)); + thisGndSurf.TempSchPtr = ScheduleManager::GetScheduleIndex(state, Util::makeUPPER(gnd_surf_TempSchName)); } } auto ReflSchName = groundSurface.find("ground_surface_reflectance_schedule_name"); if (ReflSchName != groundSurface.end()) { std::string gnd_surf_ReflSchName = ReflSchName.value().get(); if (!gnd_surf_ReflSchName.empty()) { - thisGndSurf.ReflSchPtr = ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_ReflSchName)); + thisGndSurf.ReflSchPtr = ScheduleManager::GetScheduleIndex(state, Util::makeUPPER(gnd_surf_ReflSchName)); } } thisGndSurfsObj.GndSurfs.push_back(thisGndSurf); @@ -8664,7 +8656,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - Found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (Found == 0) { ShowSevereError(state, @@ -8746,7 +8738,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); ErrorsFoundSingleSurf = false; - Found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (Found == 0) { ShowSevereError(state, @@ -8996,8 +8988,7 @@ namespace SurfaceGeometry { for (Item1 = 3; Item1 <= NumAlphas; ++Item1) { - Found = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(Item1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(Item1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (Found == 0) { ShowSevereError(state, @@ -9056,8 +9047,7 @@ namespace SurfaceGeometry { } } - Found = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (Found == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}", @@ -10033,13 +10023,13 @@ namespace SurfaceGeometry { ErrorInName = false; IsBlank = false; - UtilityRoutines::VerifyName(state, - state.dataIPShortCut->cAlphaArgs(1), - state.dataSurface->WindowShadingControl, - ControlNum, - ErrorInName, - IsBlank, - cCurrentModuleObject + " Name"); + Util::VerifyName(state, + state.dataIPShortCut->cAlphaArgs(1), + state.dataSurface->WindowShadingControl, + ControlNum, + ErrorInName, + IsBlank, + cCurrentModuleObject + " Name"); if (ErrorInName) { ErrorsFound = true; continue; @@ -10051,7 +10041,7 @@ namespace SurfaceGeometry { windowShadingControl.Name = state.dataIPShortCut->cAlphaArgs(1); // Set the Control Name in the Derived Type - windowShadingControl.ZoneIndex = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); + windowShadingControl.ZoneIndex = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (windowShadingControl.ZoneIndex == 0) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" not found.", @@ -10065,10 +10055,10 @@ namespace SurfaceGeometry { windowShadingControl.SequenceNumber = int(state.dataIPShortCut->rNumericArgs(1)); // WindowShadingControl().getInputShadedConstruction is only used during GetInput process and is ultimately stored in // Surface().shadedConstructionList - windowShadingControl.getInputShadedConstruction = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(4), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); - windowShadingControl.ShadingDevice = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(9), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + windowShadingControl.getInputShadedConstruction = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(4), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); + windowShadingControl.ShadingDevice = + Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(9), state.dataMaterial->Material, state.dataMaterial->TotMaterials); windowShadingControl.Schedule = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(6)); windowShadingControl.SetPoint = state.dataIPShortCut->rNumericArgs(2); windowShadingControl.SetPoint2 = state.dataIPShortCut->rNumericArgs(3); @@ -10079,8 +10069,8 @@ namespace SurfaceGeometry { // store the string for now and associate it after daylighting control objects are read windowShadingControl.DaylightingControlName = state.dataIPShortCut->cAlphaArgs(12); - windowShadingControl.multiSurfaceControl = static_cast( - getEnumValue(MultiSurfaceControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(13)))); + windowShadingControl.multiSurfaceControl = + static_cast(getEnumValue(MultiSurfaceControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(13)))); if (windowShadingControl.multiSurfaceControl == MultiSurfaceControl::Invalid) { windowShadingControl.multiSurfaceControl = MultiSurfaceControl::Sequential; @@ -10107,7 +10097,7 @@ namespace SurfaceGeometry { } windowShadingControl.shadingControlType = static_cast( - getEnumValue(WindowShadingControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + getEnumValue(WindowShadingControlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (windowShadingControl.ShadingDevice > 0) { if (state.dataMaterial->Material(windowShadingControl.ShadingDevice)->group == Material::Group::Screen && @@ -10200,7 +10190,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaFieldNames(5))); } windowShadingControl.slatAngleControl = - static_cast(getEnumValue(SlatAngleNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); + static_cast(getEnumValue(SlatAngleNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); // For upward compatibility change old "noninsulating" and "insulating" shade types to // INTERIORSHADE or EXTERIORSHADE @@ -10243,7 +10233,7 @@ namespace SurfaceGeometry { } // Check for illegal shading type name - Found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), cValidShadingTypes, NumValidShadingTypes); + Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), cValidShadingTypes, NumValidShadingTypes); if (Found <= 1) { ErrorsFound = true; ShowSevereError(state, @@ -10517,8 +10507,8 @@ namespace SurfaceGeometry { for (int iShadeCtrl = 1; iShadeCtrl <= state.dataSurface->TotWinShadingControl; ++iShadeCtrl) { int curShadedConstruction = state.dataSurface->WindowShadingControl(iShadeCtrl).getInputShadedConstruction; for (int jFeneRef = 1; jFeneRef <= state.dataSurface->WindowShadingControl(iShadeCtrl).FenestrationCount; ++jFeneRef) { - if (UtilityRoutines::SameString(state.dataSurface->WindowShadingControl(iShadeCtrl).FenestrationName(jFeneRef), - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name)) { + if (Util::SameString(state.dataSurface->WindowShadingControl(iShadeCtrl).FenestrationName(jFeneRef), + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name)) { state.dataGlobal->AndShadingControlInModel = true; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).HasShadeControl = true; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).windowShadingControlList.push_back(iShadeCtrl); @@ -10560,10 +10550,9 @@ namespace SurfaceGeometry { // J.Glazer 2018 - operates on Surface array after final indices are known for windows and checks to make sure it is correct for (int iShadeCtrl = 1; iShadeCtrl <= state.dataSurface->TotWinShadingControl; ++iShadeCtrl) { for (int jFeneRef = 1; jFeneRef <= state.dataSurface->WindowShadingControl(iShadeCtrl).FenestrationCount; ++jFeneRef) { - int fenestrationIndex = - UtilityRoutines::FindItemInList(state.dataSurface->WindowShadingControl(iShadeCtrl).FenestrationName(jFeneRef), - state.dataSurface->Surface, - state.dataSurface->TotSurfaces); + int fenestrationIndex = Util::FindItemInList(state.dataSurface->WindowShadingControl(iShadeCtrl).FenestrationName(jFeneRef), + state.dataSurface->Surface, + state.dataSurface->TotSurfaces); if (std::find(state.dataSurface->Surface(fenestrationIndex).windowShadingControlList.begin(), state.dataSurface->Surface(fenestrationIndex).windowShadingControlList.end(), iShadeCtrl) != state.dataSurface->Surface(fenestrationIndex).windowShadingControlList.end()) { @@ -10679,9 +10668,9 @@ namespace SurfaceGeometry { state.dataIPShortCut->cNumericFieldNames); ++StormWinNum; state.dataSurface->StormWindow(StormWinNum).BaseWindowNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); - state.dataSurface->StormWindow(StormWinNum).StormWinMaterialNum = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(2), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + state.dataSurface->StormWindow(StormWinNum).StormWinMaterialNum = + Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(2), state.dataMaterial->Material, state.dataMaterial->TotMaterials); state.dataSurface->StormWindow(StormWinNum).StormWinDistance = state.dataIPShortCut->rNumericArgs(1); state.dataSurface->StormWindow(StormWinNum).MonthOn = state.dataIPShortCut->rNumericArgs(2); state.dataSurface->StormWindow(StormWinNum).DayOfMonthOn = state.dataIPShortCut->rNumericArgs(3); @@ -10888,8 +10877,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - SurfNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (SurfNum == 0) { ShowSevereError(state, format("{}=\"{}\" not found.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ErrorsFound = true; @@ -11056,11 +11044,11 @@ namespace SurfaceGeometry { ErrorsFound = true; } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "AlwaysOnAtMaximumFlow")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "AlwaysOnAtMaximumFlow")) { state.dataSurface->SurfWinAirflowControlType(SurfNum) = WindowAirFlowControlType::MaxFlow; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "AlwaysOff")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "AlwaysOff")) { state.dataSurface->SurfWinAirflowControlType(SurfNum) = WindowAirFlowControlType::AlwaysOff; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "ScheduledOnly")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(4), "ScheduledOnly")) { state.dataSurface->SurfWinAirflowControlType(SurfNum) = WindowAirFlowControlType::Schedule; } state.dataSurface->SurfWinMaxAirflow(SurfNum) = state.dataIPShortCut->rNumericArgs(1); @@ -11209,11 +11197,11 @@ namespace SurfaceGeometry { numF++; if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "ZeroFlux")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "ZeroFlux")) { state.dataSurfaceGeometry->kivaManager.settings.deepGroundBoundary = HeatBalanceKivaManager::KivaManager::Settings::ZERO_FLUX; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "GroundWater")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "GroundWater")) { state.dataSurfaceGeometry->kivaManager.settings.deepGroundBoundary = HeatBalanceKivaManager::KivaManager::Settings::GROUNDWATER; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "Autoselect")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "Autoselect")) { state.dataSurfaceGeometry->kivaManager.settings.deepGroundBoundary = HeatBalanceKivaManager::KivaManager::Settings::AUTO; } else { ErrorsFound = true; @@ -11253,10 +11241,10 @@ namespace SurfaceGeometry { numF++; if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "Hourly")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(alpF), "Hourly")) { state.dataSurfaceGeometry->kivaManager.settings.timestepType = HeatBalanceKivaManager::KivaManager::Settings::HOURLY; state.dataSurfaceGeometry->kivaManager.timestep = 3600.; // seconds - } else { // if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs( alpF ), "Timestep")) + } else { // if (Util::SameString(state.dataIPShortCut->cAlphaArgs( alpF ), "Timestep")) state.dataSurfaceGeometry->kivaManager.settings.timestepType = HeatBalanceKivaManager::KivaManager::Settings::TIMESTEP; state.dataSurfaceGeometry->kivaManager.timestep = state.dataGlobal->MinutesPerTimeStep * 60.; } @@ -11299,7 +11287,7 @@ namespace SurfaceGeometry { fndInput.name = state.dataIPShortCut->cAlphaArgs(alpF); alpF++; - UtilityRoutines::IsNameEmpty(state, fndInput.name, cCurrentModuleObject, ErrorInName); + Util::IsNameEmpty(state, fndInput.name, cCurrentModuleObject, ErrorInName); if (ErrorInName) { ErrorsFound = true; continue; @@ -11319,7 +11307,7 @@ namespace SurfaceGeometry { // Interior horizontal insulation if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - int index = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); + int index = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); if (index == 0) { ErrorsFound = true; ShowSevereError(state, @@ -11389,7 +11377,7 @@ namespace SurfaceGeometry { // Interior vertical insulation if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - int index = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); + int index = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); if (index == 0) { ErrorsFound = true; ShowSevereError(state, @@ -11446,7 +11434,7 @@ namespace SurfaceGeometry { // Exterior horizontal insulation if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - int index = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); + int index = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); if (index == 0) { ErrorsFound = true; ShowSevereError(state, @@ -11516,7 +11504,7 @@ namespace SurfaceGeometry { // Exterior vertical insulation if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - int index = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); + int index = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); if (index == 0) { ErrorsFound = true; ShowSevereError(state, @@ -11583,8 +11571,7 @@ namespace SurfaceGeometry { numF++; if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - fndInput.wallConstructionIndex = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataConstruction->Construct); + fndInput.wallConstructionIndex = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataConstruction->Construct); if (fndInput.wallConstructionIndex == 0) { ErrorsFound = true; ShowSevereError(state, @@ -11615,7 +11602,7 @@ namespace SurfaceGeometry { // Footing if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - int index = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); + int index = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); if (index == 0) { ErrorsFound = true; ShowSevereError(state, @@ -11684,7 +11671,7 @@ namespace SurfaceGeometry { for (int blockNum = 0; blockNum < numBlocks; blockNum++) { Kiva::InputBlock block; if (!state.dataIPShortCut->lAlphaFieldBlanks(alpF)) { - int index = UtilityRoutines::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); + int index = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(alpF), state.dataMaterial->Material); if (index == 0) { ErrorsFound = true; ShowSevereError(state, @@ -11871,7 +11858,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->cNumericFieldNames); ErrorInName = false; IsBlank = false; - UtilityRoutines::VerifyName( + Util::VerifyName( state, state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->OSC, OSCNum, ErrorInName, IsBlank, cCurrentModuleObject + " Name"); if (ErrorInName) { ErrorsFound = true; @@ -11909,9 +11896,9 @@ namespace SurfaceGeometry { if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "No")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "No")) { state.dataSurface->OSC(OSCNum).SinusoidalConstTempCoef = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "Yes")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(3), "Yes")) { state.dataSurface->OSC(OSCNum).SinusoidalConstTempCoef = true; } else { ShowSevereError(state, @@ -12073,7 +12060,7 @@ namespace SurfaceGeometry { state, cCurrentModuleObject, Loop, state.dataIPShortCut->cAlphaArgs, NumAlphas, state.dataIPShortCut->rNumericArgs, NumProps, IOStat); ErrorInName = false; IsBlank = false; - UtilityRoutines::VerifyName( + Util::VerifyName( state, state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->OSCM, OSCMNum, ErrorInName, IsBlank, cCurrentModuleObject + " Name"); if (ErrorInName) { ErrorsFound = true; @@ -12231,10 +12218,8 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - SurfNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface, state.dataSurface->TotSurfaces); - MaterNum = UtilityRoutines::FindItemInPtrList( - state.dataIPShortCut->cAlphaArgs(3), state.dataMaterial->Material, state.dataMaterial->TotMaterials); + SurfNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + MaterNum = Util::FindItemInPtrList(state.dataIPShortCut->cAlphaArgs(3), state.dataMaterial->Material, state.dataMaterial->TotMaterials); auto *thisMaterial = state.dataMaterial->Material(MaterNum); SchNum = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); InsulationType insulationType = static_cast(getEnumValue(insulationTypeNamesUC, state.dataIPShortCut->cAlphaArgs(1))); @@ -13936,7 +13921,7 @@ namespace SurfaceGeometry { // If this construction name already exists, set the surface's shaded construction number to it - ConstrNewSh = UtilityRoutines::FindItemInList(ConstrNameSh, state.dataConstruction->Construct); + ConstrNewSh = Util::FindItemInList(ConstrNameSh, state.dataConstruction->Construct); if (ConstrNewSh > 0) { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).shadedConstructionList[shadeControlIndex] = ConstrNewSh; @@ -14072,10 +14057,9 @@ namespace SurfaceGeometry { const std::string ChrNum = fmt::to_string(StormWinNum); std::string ConstrNameSt = "BARECONSTRUCTIONWITHSTORMWIN:" + ChrNum; // Name of unshaded construction with storm window // If this construction name already exists, set the surface's storm window construction number to it - int ConstrNewSt = - UtilityRoutines::FindItemInList(ConstrNameSt, - state.dataConstruction->Construct, - state.dataHeatBal->TotConstructs); // Number of unshaded storm window construction that is created + int ConstrNewSt = Util::FindItemInList(ConstrNameSt, + state.dataConstruction->Construct, + state.dataHeatBal->TotConstructs); // Number of unshaded storm window construction that is created // If necessary, create new material corresponding to the air layer between the storm winddow and the rest of the window int MatNewStAir = createAirMaterialFromDistance(state, state.dataSurface->StormWindow(StormWinNum).StormWinDistance, "AIR:STORMWIN:"); if (ConstrNewSt == 0) { @@ -14133,7 +14117,7 @@ namespace SurfaceGeometry { { int mmDistance = int(1000 * distance); // Thickness of air gap in mm (usually between storm window and rest of window) std::string MatNameStAir = format("{}{}MM", namePrefix, mmDistance); // Name of created air layer material - int newAirMaterial = UtilityRoutines::FindItemInPtrList(MatNameStAir, state.dataMaterial->Material, state.dataMaterial->TotMaterials); + int newAirMaterial = Util::FindItemInPtrList(MatNameStAir, state.dataMaterial->Material, state.dataMaterial->TotMaterials); if (newAirMaterial == 0) { // Create new material state.dataMaterial->TotMaterials = state.dataMaterial->TotMaterials + 1; @@ -14205,10 +14189,9 @@ namespace SurfaceGeometry { // create a new construction with storm based on an old construction and storm and gap materials int createConstructionWithStorm(EnergyPlusData &state, int oldConstruction, std::string name, int stormMaterial, int gapMaterial) { - int newConstruct = - UtilityRoutines::FindItemInList(name, - state.dataConstruction->Construct, - state.dataHeatBal->TotConstructs); // Number of shaded storm window construction that is created + int newConstruct = Util::FindItemInList(name, + state.dataConstruction->Construct, + state.dataHeatBal->TotConstructs); // Number of shaded storm window construction that is created if (newConstruct == 0) { state.dataHeatBal->TotConstructs = state.dataHeatBal->TotConstructs + 1; newConstruct = state.dataHeatBal->TotConstructs; @@ -14381,7 +14364,7 @@ namespace SurfaceGeometry { w1 = state.dataConstruction->Construct(IConst).W5FileGlazingSysWidth; Const2Name = state.dataConstruction->Construct(IConst).Name + ":2"; - IConst2 = UtilityRoutines::FindItemInList(Const2Name, state.dataConstruction->Construct); + IConst2 = Util::FindItemInList(Const2Name, state.dataConstruction->Construct); if (IConst2 == 0) { // Only one glazing system on Window5 Data File for this window. @@ -14559,7 +14542,7 @@ namespace SurfaceGeometry { w1 = state.dataConstruction->Construct(IConst).W5FileGlazingSysWidth; Const2Name = state.dataConstruction->Construct(IConst).Name + ":2"; - IConst2 = UtilityRoutines::FindItemInList(Const2Name, state.dataConstruction->Construct); + IConst2 = Util::FindItemInList(Const2Name, state.dataConstruction->Construct); ++AddedSubSurfaces; state.dataSurfaceGeometry->SurfaceTmp.redimension(++state.dataSurface->TotSurfaces); @@ -15310,7 +15293,7 @@ namespace SurfaceGeometry { // loop through all the surfaces for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - Found = UtilityRoutines::FindItemInList(state.dataSurface->Surface(SurfNum).Name, TmpCandidateSurfaceNames, NumCandidateNames); + Found = Util::FindItemInList(state.dataSurface->Surface(SurfNum).Name, TmpCandidateSurfaceNames, NumCandidateNames); if (Found > 0) { if (!state.dataSurface->Surface(SurfNum).HeatTransSurf) { // not BIPV, must be a shading surf with solar device // Setup missing values to allow shading surfaces to model incident solar and wind @@ -15322,8 +15305,8 @@ namespace SurfaceGeometry { // boundary condition if (NumOfICSUnits > 0) { for (CollectorNum = 1; CollectorNum <= NumOfCollectors; ++CollectorNum) { - if (UtilityRoutines::SameString(state.dataSurface->Surface(SurfNum).Name, TmpCandidateICSSurfaceNames(CollectorNum)) && - UtilityRoutines::SameString(TmpCandidateICSBCTypeNames(CollectorNum), "OTHERSIDECONDITIONSMODEL")) { + if (Util::SameString(state.dataSurface->Surface(SurfNum).Name, TmpCandidateICSSurfaceNames(CollectorNum)) && + Util::SameString(TmpCandidateICSBCTypeNames(CollectorNum), "OTHERSIDECONDITIONSMODEL")) { state.dataSurface->SurfIsICS(SurfNum) = true; state.dataSurface->SurfICSPtr(SurfNum) = CollectorNum; } @@ -15603,9 +15586,9 @@ namespace SurfaceGeometry { spaceEnclosureNum = curSpace.solarEnclosureNum; } if (spaceEnclosureNum == 0) { - if (UtilityRoutines::SameString(curSpace.Name, state.dataHeatBal->Zone(curSpace.zoneNum).Name + "-REMAINDER")) { + if (Util::SameString(curSpace.Name, state.dataHeatBal->Zone(curSpace.zoneNum).Name + "-REMAINDER")) { // Search for existing enclosure with same name as the zone - spaceEnclosureNum = UtilityRoutines::FindItemInList(state.dataHeatBal->Zone(curSpace.zoneNum).Name, Enclosures); + spaceEnclosureNum = Util::FindItemInList(state.dataHeatBal->Zone(curSpace.zoneNum).Name, Enclosures); } if (spaceEnclosureNum == 0) { // Otherwise add a new one named for the space diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index 52edf4b5f6e..9f6dbdf68b0 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -230,7 +230,7 @@ namespace SurfaceGroundHeatExchanger { state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).ConstructionName = state.dataIPShortCut->cAlphaArgs(2); state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).ConstructionNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct); if (state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).ConstructionNum == 0) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); @@ -329,9 +329,9 @@ namespace SurfaceGroundHeatExchanger { } // get lower b.c. type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "GROUND")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "GROUND")) { state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).LowerSurfCond = SurfCond_Ground; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "EXPOSED")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "EXPOSED")) { state.dataSurfaceGroundHeatExchangers->SurfaceGHE(Item).LowerSurfCond = SurfCond_Exposed; } else { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5))); @@ -477,7 +477,7 @@ namespace SurfaceGroundHeatExchanger { // get QTF data - only once if (this->InitQTF) { for (Cons = 1; Cons <= state.dataHeatBal->TotConstructs; ++Cons) { - if (UtilityRoutines::SameString(state.dataConstruction->Construct(Cons).Name, this->ConstructionName)) { + if (Util::SameString(state.dataConstruction->Construct(Cons).Name, this->ConstructionName)) { // some error checking ?? // CTF stuff LayerNum = state.dataConstruction->Construct(Cons).TotLayers; @@ -1244,8 +1244,8 @@ namespace SurfaceGroundHeatExchanger { // set previous surface temp OldSurfTemp = this->TtopHistory[1]; // absolute temperatures - SurfTempAbs = OldSurfTemp + Constant::KelvinConv; - SkyTempAbs = ThisSkyTemp + Constant::KelvinConv; + SurfTempAbs = OldSurfTemp + Constant::Kelvin; + SkyTempAbs = ThisSkyTemp + Constant::Kelvin; // ASHRAE simple convection coefficient model for external surfaces. ConvCoef = Convect::CalcASHRAESimpExtConvCoeff(this->TopRoughness, ThisWindSpeed); @@ -1296,8 +1296,8 @@ namespace SurfaceGroundHeatExchanger { // make a surface heat balance and solve for temperature OldSurfTemp = this->TbtmHistory[1]; // absolute temperatures - SurfTempAbs = OldSurfTemp + Constant::KelvinConv; - ExtTempAbs = ThisDryBulb + Constant::KelvinConv; + SurfTempAbs = OldSurfTemp + Constant::Kelvin; + ExtTempAbs = ThisDryBulb + Constant::Kelvin; // ASHRAE simple convection coefficient model for external surfaces. ConvCoef = Convect::CalcASHRAESimpExtConvCoeff(this->TopRoughness, ThisWindSpeed); diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index 4886c1edc92..b6c97bf081a 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -219,13 +219,13 @@ void GetSwimmingPool(EnergyPlusData &state) lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataSwimmingPools->Pool(Item).Name = Alphas(1); state.dataSwimmingPools->Pool(Item).SurfaceName = Alphas(2); state.dataSwimmingPools->Pool(Item).SurfacePtr = 0; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (UtilityRoutines::SameString(state.dataSurface->Surface(SurfNum).Name, state.dataSwimmingPools->Pool(Item).SurfaceName)) { + if (Util::SameString(state.dataSurface->Surface(SurfNum).Name, state.dataSwimmingPools->Pool(Item).SurfaceName)) { state.dataSwimmingPools->Pool(Item).SurfacePtr = SurfNum; break; } diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 6762649723c..e7985de2f0d 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -606,28 +606,26 @@ namespace SystemAvailabilityManager { } nightCycleMgr.nightCycleControlType = - static_cast(getEnumValue(NightCycleControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); - + static_cast(getEnumValue(NightCycleControlTypeNamesUC, Util::makeUPPER(cAlphaArgs(4)))); assert(nightCycleMgr.nightCycleControlType != NightCycleControlType::Invalid); // Cycling Run Time Control Type nightCycleMgr.cyclingRunTimeControl = - static_cast(getEnumValue(CyclingRunTimeControlNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); + static_cast(getEnumValue(CyclingRunTimeControlNamesUC, Util::makeUPPER(cAlphaArgs(5)))); assert(nightCycleMgr.cyclingRunTimeControl != CyclingRunTimeControl::Invalid); // Control zone or zonelist if (!lAlphaFieldBlanks(6)) { nightCycleMgr.CtrlZoneListName = cAlphaArgs(6); - int ZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(6), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(cAlphaArgs(6), state.dataHeatBal->Zone); if (ZoneNum > 0) { nightCycleMgr.NumOfCtrlZones = 1; nightCycleMgr.CtrlZonePtrs.allocate(1); nightCycleMgr.CtrlZonePtrs(1) = ZoneNum; } else { int zoneListNum = 0; - if (state.dataHeatBal->NumOfZoneLists > 0) - zoneListNum = UtilityRoutines::FindItemInList(cAlphaArgs(6), state.dataHeatBal->ZoneList); + if (state.dataHeatBal->NumOfZoneLists > 0) zoneListNum = Util::FindItemInList(cAlphaArgs(6), state.dataHeatBal->ZoneList); if (zoneListNum > 0) { int NumZones = state.dataHeatBal->ZoneList(zoneListNum).NumOfZones; nightCycleMgr.NumOfCtrlZones = NumZones; @@ -661,15 +659,14 @@ namespace SystemAvailabilityManager { // Cooling zone or zonelist if (!lAlphaFieldBlanks(7)) { nightCycleMgr.CoolingZoneListName = cAlphaArgs(7); - int ZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(7), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(cAlphaArgs(7), state.dataHeatBal->Zone); if (ZoneNum > 0) { nightCycleMgr.NumOfCoolingZones = 1; nightCycleMgr.CoolingZonePtrs.allocate(1); nightCycleMgr.CoolingZonePtrs(1) = ZoneNum; } else { int zoneListNum = 0; - if (state.dataHeatBal->NumOfZoneLists > 0) - zoneListNum = UtilityRoutines::FindItemInList(cAlphaArgs(7), state.dataHeatBal->ZoneList); + if (state.dataHeatBal->NumOfZoneLists > 0) zoneListNum = Util::FindItemInList(cAlphaArgs(7), state.dataHeatBal->ZoneList); if (zoneListNum > 0) { int NumZones = state.dataHeatBal->ZoneList(zoneListNum).NumOfZones; nightCycleMgr.NumOfCoolingZones = NumZones; @@ -693,15 +690,14 @@ namespace SystemAvailabilityManager { // Heating zone or zonelist if (!lAlphaFieldBlanks(8)) { nightCycleMgr.HeatingZoneListName = cAlphaArgs(8); - int ZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(8), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(cAlphaArgs(8), state.dataHeatBal->Zone); if (ZoneNum > 0) { nightCycleMgr.NumOfHeatingZones = 1; nightCycleMgr.HeatingZonePtrs.allocate(1); nightCycleMgr.HeatingZonePtrs(1) = ZoneNum; } else { int zoneListNum = 0; - if (state.dataHeatBal->NumOfZoneLists > 0) - zoneListNum = UtilityRoutines::FindItemInList(cAlphaArgs(8), state.dataHeatBal->ZoneList); + if (state.dataHeatBal->NumOfZoneLists > 0) zoneListNum = Util::FindItemInList(cAlphaArgs(8), state.dataHeatBal->ZoneList); if (zoneListNum > 0) { int NumZones = state.dataHeatBal->ZoneList(zoneListNum).NumOfZones; nightCycleMgr.NumOfHeatingZones = NumZones; @@ -725,15 +721,14 @@ namespace SystemAvailabilityManager { // HeatZnFan zone or zonelist if (!lAlphaFieldBlanks(9)) { nightCycleMgr.HeatZnFanZoneListName = cAlphaArgs(9); - int ZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(9), state.dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList(cAlphaArgs(9), state.dataHeatBal->Zone); if (ZoneNum > 0) { nightCycleMgr.NumOfHeatZnFanZones = 1; nightCycleMgr.HeatZnFanZonePtrs.allocate(1); nightCycleMgr.HeatZnFanZonePtrs(1) = ZoneNum; } else { int zoneListNum = 0; - if (state.dataHeatBal->NumOfZoneLists > 0) - zoneListNum = UtilityRoutines::FindItemInList(cAlphaArgs(9), state.dataHeatBal->ZoneList); + if (state.dataHeatBal->NumOfZoneLists > 0) zoneListNum = Util::FindItemInList(cAlphaArgs(9), state.dataHeatBal->ZoneList); if (zoneListNum > 0) { int NumZones = state.dataHeatBal->ZoneList(zoneListNum).NumOfZones; nightCycleMgr.NumOfHeatZnFanZones = NumZones; @@ -807,9 +802,8 @@ namespace SystemAvailabilityManager { } optimumStartMgr.MaxOptStartTime = rNumericArgs(1); - optimumStartMgr.optimumStartControlType = - static_cast(getEnumValue(OptimumStartControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); + static_cast(getEnumValue(OptimumStartControlTypeNamesUC, Util::makeUPPER(cAlphaArgs(4)))); if (optimumStartMgr.optimumStartControlType == OptimumStartControlType::Invalid) { optimumStartMgr.optimumStartControlType = OptimumStartControlType::ControlZone; @@ -820,7 +814,7 @@ namespace SystemAvailabilityManager { if (optimumStartMgr.optimumStartControlType == OptimumStartControlType::ControlZone) { optimumStartMgr.CtrlZoneName = cAlphaArgs(5); - optimumStartMgr.ZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); + optimumStartMgr.ZoneNum = Util::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); if (optimumStartMgr.ZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowSevereError(state, format("not found: {}=\"{}\".", cAlphaFieldNames(5), cAlphaArgs(5))); @@ -839,7 +833,7 @@ namespace SystemAvailabilityManager { } } } - optimumStartMgr.NumOfZones = UtilityRoutines::FindItemInList(cAlphaArgs(6), state.dataHeatBal->ZoneList); + optimumStartMgr.NumOfZones = Util::FindItemInList(cAlphaArgs(6), state.dataHeatBal->ZoneList); if (optimumStartMgr.NumOfZones == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowSevereError(state, format("not found: {}=\"{}\".", cAlphaFieldNames(6), cAlphaArgs(6))); @@ -848,7 +842,7 @@ namespace SystemAvailabilityManager { } optimumStartMgr.controlAlgorithm = - static_cast(getEnumValue(ControlAlgorithmNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(7)))); + static_cast(getEnumValue(ControlAlgorithmNamesUC, Util::makeUPPER(cAlphaArgs(7)))); assert(optimumStartMgr.controlAlgorithm != ControlAlgorithm::Invalid); @@ -1254,7 +1248,7 @@ namespace SystemAvailabilityManager { nightVentMgr.VentTempLowLim = rNumericArgs(2); nightVentMgr.VentFlowFrac = rNumericArgs(3); nightVentMgr.CtrlZoneName = cAlphaArgs(5); - nightVentMgr.ZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); + nightVentMgr.ZoneNum = Util::FindItemInList(cAlphaArgs(5), state.dataHeatBal->Zone); if (nightVentMgr.ZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("not found: {}=\"{}\".", cAlphaFieldNames(5), cAlphaArgs(5))); @@ -1319,7 +1313,7 @@ namespace SystemAvailabilityManager { for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { ++Item; auto const &objectFields = instance.value(); - std::string const thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + std::string const thisObjectName = Util::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); auto &mgrList = state.dataSystemAvailabilityManager->ListData(Item); mgrList.Name = thisObjectName; @@ -1345,7 +1339,7 @@ namespace SystemAvailabilityManager { std::string availManagerObjType = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_object_type"); mgrList.AvailManagerType(listItem) = static_cast( - getEnumValue(SystemAvailabilityTypeNamesUC, UtilityRoutines::makeUPPER(availManagerObjType))); + getEnumValue(SystemAvailabilityTypeNamesUC, Util::makeUPPER(availManagerObjType))); if (mgrList.AvailManagerType(listItem) == DataPlant::SystemAvailabilityType::HybridVent) mgrList.AvailManagerType(listItem) = DataPlant::SystemAvailabilityType::Invalid; // these are validated individually in the GetPlant, GetSystem and GetZoneEq lists @@ -1394,7 +1388,7 @@ namespace SystemAvailabilityManager { Found = 0; if (state.dataSystemAvailabilityManager->NumAvailManagerLists > 0) - Found = UtilityRoutines::FindItemInList(AvailabilityListName, state.dataSystemAvailabilityManager->ListData); + Found = Util::FindItemInList(AvailabilityListName, state.dataSystemAvailabilityManager->ListData); if (Found != 0) { state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers = state.dataSystemAvailabilityManager->ListData(Found).NumItems; @@ -1491,7 +1485,7 @@ namespace SystemAvailabilityManager { Found = 0; if (state.dataSystemAvailabilityManager->NumAvailManagerLists > 0) - Found = UtilityRoutines::FindItemInList(AvailabilityListName, state.dataSystemAvailabilityManager->ListData); + Found = Util::FindItemInList(AvailabilityListName, state.dataSystemAvailabilityManager->ListData); if (Found != 0) { state.dataAirLoop->PriAirSysAvailMgr(Loop).NumAvailManagers = state.dataSystemAvailabilityManager->ListData(Found).NumItems; @@ -1585,7 +1579,7 @@ namespace SystemAvailabilityManager { AvailabilityListName = ZoneComp(ZoneEquipType).ZoneCompAvailMgrs(CompNum).AvailManagerListName; Found = 0; if (state.dataSystemAvailabilityManager->NumAvailManagerLists > 0) - Found = UtilityRoutines::FindItemInList(AvailabilityListName, state.dataSystemAvailabilityManager->ListData); + Found = Util::FindItemInList(AvailabilityListName, state.dataSystemAvailabilityManager->ListData); if (Found != 0) { ZoneComp(ZoneEquipType).ZoneCompAvailMgrs(CompNum).NumAvailManagers = state.dataSystemAvailabilityManager->ListData(Found).NumItems; CompNumAvailManagers = ZoneComp(ZoneEquipType).ZoneCompAvailMgrs(CompNum).NumAvailManagers; @@ -1661,7 +1655,7 @@ namespace SystemAvailabilityManager { auto &optimumStartMgr = state.dataSystemAvailabilityManager->OptimumStartData(SysAvailNum); if (optimumStartMgr.optimumStartControlType == OptimumStartControlType::MaximumOfZoneList) { // a zone list - ZoneListNum = UtilityRoutines::FindItemInList(optimumStartMgr.ZoneListName, state.dataHeatBal->ZoneList); + ZoneListNum = Util::FindItemInList(optimumStartMgr.ZoneListName, state.dataHeatBal->ZoneList); if (ZoneListNum > 0) { optimumStartMgr.NumOfZones = state.dataHeatBal->ZoneList(ZoneListNum).NumOfZones; if (!allocated(optimumStartMgr.ZonePtrs)) { @@ -1753,7 +1747,7 @@ namespace SystemAvailabilityManager { switch (SysAvailType) { case DataPlant::SystemAvailabilityType::Scheduled: { // 'AvailabilityManager:Scheduled' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->SchedData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->SchedData); } if (SysAvailNum > 0) { CalcSchedSysAvailMgr(state, SysAvailNum, AvailStatus); @@ -1764,7 +1758,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::ScheduledOn: { // 'AvailabilityManager:ScheduledOn' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->SchedOnData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->SchedOnData); } if (SysAvailNum > 0) { CalcSchedOnSysAvailMgr(state, SysAvailNum, AvailStatus); @@ -1775,7 +1769,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::ScheduledOff: { // 'AvailabilityManager:ScheduledOff' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->SchedOffData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->SchedOffData); } if (SysAvailNum > 0) { CalcSchedOffSysAvailMgr(state, SysAvailNum, AvailStatus); @@ -1786,7 +1780,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::NightCycle: { // 'AvailabilityManager:NightCycle' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->NightCycleData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->NightCycleData); } if (SysAvailNum > 0) { CalcNCycSysAvailMgr(state, SysAvailNum, PriAirSysNum, AvailStatus, ZoneEquipType, CompNum); @@ -1797,7 +1791,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::OptimumStart: { // 'AvailabilityManager:OptimumStart' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->OptimumStartData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->OptimumStartData); } if (SysAvailNum > 0) { CalcOptStartSysAvailMgr(state, SysAvailNum, PriAirSysNum, AvailStatus, ZoneEquipType, CompNum); @@ -1808,7 +1802,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::NightVent: { // 'AvailabilityManager:NightVentilation' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->NightVentData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->NightVentData); } if (SysAvailNum > 0) { CalcNVentSysAvailMgr(state, SysAvailNum, PriAirSysNum, AvailStatus, present(ZoneEquipType)); @@ -1819,7 +1813,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::DiffThermo: { // 'AvailabilityManager:DifferentialThermostat' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->DiffThermoData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->DiffThermoData); } if (SysAvailNum > 0) { CalcDiffTSysAvailMgr(state, SysAvailNum, PreviousStatus, AvailStatus); @@ -1829,7 +1823,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::HiTempTOff: { // 'AvailabilityManager:HighTemperatureTurnOff' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->HiTurnOffData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->HiTurnOffData); } if (SysAvailNum > 0) { CalcHiTurnOffSysAvailMgr(state, SysAvailNum, AvailStatus); @@ -1839,7 +1833,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::HiTempTOn: { // 'AvailabilityManager:HighTemperatureTurnOn' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->HiTurnOnData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->HiTurnOnData); } if (SysAvailNum > 0) { CalcHiTurnOnSysAvailMgr(state, SysAvailNum, AvailStatus); @@ -1849,7 +1843,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::LoTempTOff: { // 'AvailabilityManager:LowTemperatureTurnOff' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->LoTurnOffData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->LoTurnOffData); } if (SysAvailNum > 0) { CalcLoTurnOffSysAvailMgr(state, SysAvailNum, AvailStatus); @@ -1860,7 +1854,7 @@ namespace SystemAvailabilityManager { } break; case DataPlant::SystemAvailabilityType::LoTempTOn: { // 'AvailabilityManager:LowTemperatureTurnOn' if (SysAvailNum == 0) { - SysAvailNum = UtilityRoutines::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->LoTurnOnData); + SysAvailNum = Util::FindItemInList(SysAvailName, state.dataSystemAvailabilityManager->LoTurnOnData); } if (SysAvailNum > 0) { CalcLoTurnOnSysAvailMgr(state, SysAvailNum, AvailStatus); @@ -3848,7 +3842,7 @@ namespace SystemAvailabilityManager { } hybridVentMgr.ControlZoneName = state.dataIPShortCut->cAlphaArgs(3); // Check zone number - hybridVentMgr.ControlledZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); + hybridVentMgr.ControlledZoneNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); if (hybridVentMgr.ControlledZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, @@ -3904,9 +3898,9 @@ namespace SystemAvailabilityManager { ErrorsFound = true; } // Read use weather rain indicator - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "YES")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "YES")) { hybridVentMgr.UseRainIndicator = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "NO")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(5), "NO")) { hybridVentMgr.UseRainIndicator = false; } else { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -4183,8 +4177,7 @@ namespace SystemAvailabilityManager { if (hybridVentMgr.SimpleControlTypeSchedPtr > 0) { hybridVentMgr.VentilationName = state.dataIPShortCut->cAlphaArgs(10); if (state.dataHeatBal->TotVentilation > 0) { - hybridVentMgr.VentilationPtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(10), state.dataHeatBal->Ventilation); + hybridVentMgr.VentilationPtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(10), state.dataHeatBal->Ventilation); HybridVentSysAvailMaster(SysAvailNum) = hybridVentMgr.VentilationPtr; SchedMax = GetScheduleMaxValue(state, hybridVentMgr.SimpleControlTypeSchedPtr); if (hybridVentMgr.VentilationPtr <= 0 && int(SchedMax) == 1) { @@ -4426,7 +4419,7 @@ namespace SystemAvailabilityManager { for (SysAvailNum = 1; SysAvailNum <= NumHybridVentSysAvailMgrs; ++SysAvailNum) { auto &hybridVentMgr = state.dataSystemAvailabilityManager->HybridVentData(SysAvailNum); if (hybridVentMgr.SimpleControlTypeSchedPtr > 0 && state.dataHeatBal->TotVentilation > 0 && hybridVentMgr.VentilationPtr == 0) { - hybridVentMgr.VentilationPtr = UtilityRoutines::FindItemInList(hybridVentMgr.VentilationName, state.dataHeatBal->Ventilation); + hybridVentMgr.VentilationPtr = Util::FindItemInList(hybridVentMgr.VentilationName, state.dataHeatBal->Ventilation); HybridVentSysAvailMaster(SysAvailNum) = hybridVentMgr.VentilationPtr; SchedMax = GetScheduleMaxValue(state, hybridVentMgr.SimpleControlTypeSchedPtr); if (hybridVentMgr.VentilationPtr <= 0 && int(SchedMax) == 1) { @@ -4438,7 +4431,7 @@ namespace SystemAvailabilityManager { } // Check air loop number for (AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { // loop over the primary air systems - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name, hybridVentMgr.AirLoopName)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name, hybridVentMgr.AirLoopName)) { hybridVentMgr.AirLoopNum = AirLoopNum; } } @@ -4528,8 +4521,8 @@ namespace SystemAvailabilityManager { for (AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { // loop over the primary air systems AirLoopCount = 0; for (SysAvailNum = 1; SysAvailNum <= NumHybridVentSysAvailMgrs; ++SysAvailNum) { - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name, - state.dataSystemAvailabilityManager->HybridVentData(SysAvailNum).AirLoopName)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name, + state.dataSystemAvailabilityManager->HybridVentData(SysAvailNum).AirLoopName)) { ++AirLoopCount; if (AirLoopCount > 1) SysAvailIndex = SysAvailNum; } diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 7a481321d85..07a37a65c1e 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -136,8 +136,7 @@ void InitEnergyReports(EnergyPlusData &state) for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) { auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum); if (!thisZoneEquipConfig.IsControlled) continue; - thisZoneEquipConfig.EquipListIndex = - UtilityRoutines::FindItemInList(thisZoneEquipConfig.EquipListName, state.dataZoneEquip->ZoneEquipList); + thisZoneEquipConfig.EquipListIndex = Util::FindItemInList(thisZoneEquipConfig.EquipListName, state.dataZoneEquip->ZoneEquipList); auto &thisZoneEquipList = state.dataZoneEquip->ZoneEquipList(thisZoneEquipConfig.EquipListIndex); for (int ZoneInletNodeNum = 1; ZoneInletNodeNum <= thisZoneEquipConfig.NumInletNodes; ++ZoneInletNodeNum) { int AirLoopNum = thisZoneEquipConfig.InletNodeAirLoopNum(ZoneInletNodeNum); @@ -294,8 +293,7 @@ void InitEnergyReports(EnergyPlusData &state) for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) { auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum); if (!thisZoneEquipConfig.IsControlled) continue; - thisZoneEquipConfig.EquipListIndex = - UtilityRoutines::FindItemInList(thisZoneEquipConfig.EquipListName, state.dataZoneEquip->ZoneEquipList); + thisZoneEquipConfig.EquipListIndex = Util::FindItemInList(thisZoneEquipConfig.EquipListName, state.dataZoneEquip->ZoneEquipList); int ListNum = thisZoneEquipConfig.EquipListIndex; // loop over the zone supply air path inlet nodes for (int ZoneInletNodeNum = 1; ZoneInletNodeNum <= thisZoneEquipConfig.NumInletNodes; ++ZoneInletNodeNum) { @@ -4007,8 +4005,7 @@ void CalcSystemEnergyUse(EnergyPlusData &state, default: int found = 0; if (state.dataSysRpts->NumCompTypes > 0) { - found = UtilityRoutines::FindItemInList( - CompType, state.dataSysRpts->CompTypeErrors, &CompTypeError::CompType, state.dataSysRpts->NumCompTypes); + found = Util::FindItemInList(CompType, state.dataSysRpts->CompTypeErrors, &CompTypeError::CompType, state.dataSysRpts->NumCompTypes); } if (found == 0) { state.dataSysRpts->CompTypeErrors(++state.dataSysRpts->NumCompTypes).CompType = CompType; @@ -4765,16 +4762,16 @@ void FindDemandSideMatch(EnergyPlusData &state, PassCompNum <= state.dataPlnt->VentRepPlant[static_cast(LoopSideLocation::Demand)](PassLoopNum).Branch(PassBranchNum).TotalComponents; ++PassCompNum) { - if (UtilityRoutines::SameString(CompType, - state.dataPlnt->VentRepPlant[static_cast(LoopSideLocation::Demand)](PassLoopNum) - .Branch(PassBranchNum) - .Comp(PassCompNum) - .TypeOf) && - UtilityRoutines::SameString(CompName, - state.dataPlnt->VentRepPlant[static_cast(LoopSideLocation::Demand)](PassLoopNum) - .Branch(PassBranchNum) - .Comp(PassCompNum) - .Name)) { + if (Util::SameString(CompType, + state.dataPlnt->VentRepPlant[static_cast(LoopSideLocation::Demand)](PassLoopNum) + .Branch(PassBranchNum) + .Comp(PassCompNum) + .TypeOf) && + Util::SameString(CompName, + state.dataPlnt->VentRepPlant[static_cast(LoopSideLocation::Demand)](PassLoopNum) + .Branch(PassBranchNum) + .Comp(PassCompNum) + .Name)) { // Found a match on the plant demand side--increment the counter MatchFound = true; MatchLoopType = 1; @@ -4799,16 +4796,16 @@ void FindDemandSideMatch(EnergyPlusData &state, PassCompNum <= state.dataPlnt->VentRepCond[static_cast(LoopSideLocation::Demand)](PassLoopNum).Branch(PassBranchNum).TotalComponents; ++PassCompNum) { - if (UtilityRoutines::SameString(CompType, - state.dataPlnt->VentRepCond[static_cast(LoopSideLocation::Demand)](PassLoopNum) - .Branch(PassBranchNum) - .Comp(PassCompNum) - .TypeOf) && - UtilityRoutines::SameString(CompName, - state.dataPlnt->VentRepCond[static_cast(LoopSideLocation::Demand)](PassLoopNum) - .Branch(PassBranchNum) - .Comp(PassCompNum) - .Name)) { + if (Util::SameString(CompType, + state.dataPlnt->VentRepCond[static_cast(LoopSideLocation::Demand)](PassLoopNum) + .Branch(PassBranchNum) + .Comp(PassCompNum) + .TypeOf) && + Util::SameString(CompName, + state.dataPlnt->VentRepCond[static_cast(LoopSideLocation::Demand)](PassLoopNum) + .Branch(PassBranchNum) + .Comp(PassCompNum) + .Name)) { // Found a match on the plant demand side--increment the counter MatchFound = true; MatchLoopType = 2; diff --git a/src/EnergyPlus/TARCOGOutput.cc b/src/EnergyPlus/TARCOGOutput.cc index ef772cd4360..724275adad4 100644 --- a/src/EnergyPlus/TARCOGOutput.cc +++ b/src/EnergyPlus/TARCOGOutput.cc @@ -297,9 +297,9 @@ void WriteInputArguments(EnergyPlusData &state, print(InArgumentsFile, Format_1000); print(InArgumentsFile, "\n"); print(InArgumentsFile, Format_1005); - print(InArgumentsFile, Format_1010, tout, tout - Constant::KelvinConv); - print(InArgumentsFile, Format_1015, tind, tind - Constant::KelvinConv); - print(InArgumentsFile, Format_1020, trmin, trmin - Constant::KelvinConv); + print(InArgumentsFile, Format_1010, tout, tout - Constant::Kelvin); + print(InArgumentsFile, Format_1015, tind, tind - Constant::Kelvin); + print(InArgumentsFile, Format_1020, trmin, trmin - Constant::Kelvin); print(InArgumentsFile, Format_1030, wso); if (iwd == 0) print(InArgumentsFile, Format_1032); // windward if (iwd == 1) print(InArgumentsFile, Format_1033); // leeward @@ -307,7 +307,7 @@ void WriteInputArguments(EnergyPlusData &state, print(InArgumentsFile, Format_1040, dir); print(InArgumentsFile, Format_1041, outir); print(InArgumentsFile, Format_1045, isky); - print(InArgumentsFile, Format_1050, tsky, tsky - Constant::KelvinConv); + print(InArgumentsFile, Format_1050, tsky, tsky - Constant::Kelvin); print(InArgumentsFile, Format_1055, esky); print(InArgumentsFile, Format_1060, fclr); print(InArgumentsFile, Format_1061, VacuumPressure); @@ -507,8 +507,8 @@ void WriteModifiedArguments(InputOutputFile &InArgumentsFile, print(InArgumentsFile, Format_1014); print(InArgumentsFile, "\n"); print(InArgumentsFile, Format_1055, esky); - print(InArgumentsFile, Format_1016, trmout, trmout - Constant::KelvinConv); - print(InArgumentsFile, Format_1020, trmin, trmin - Constant::KelvinConv); + print(InArgumentsFile, Format_1016, trmout, trmout - Constant::Kelvin); + print(InArgumentsFile, Format_1020, trmin, trmin - Constant::Kelvin); print(InArgumentsFile, Format_1019, ebsky); print(InArgumentsFile, Format_10191, ebroom); print(InArgumentsFile, Format_1017, Gout); @@ -678,37 +678,37 @@ void WriteOutputArguments(InputOutputFile &OutArgumentsFile, print(OutArgumentsFile, "\n"); print(OutArgumentsFile, Format_2350); print(OutArgumentsFile, "\n"); - print(OutArgumentsFile, Format_2105, tamb, tamb - Constant::KelvinConv); + print(OutArgumentsFile, Format_2105, tamb, tamb - Constant::Kelvin); print(OutArgumentsFile, Format_2180, q(1)); // bi Write out layer properties: for (i = 1; i <= nlayer; ++i) { switch (LayerType(i)) { case TARCOGLayerType::SPECULAR: { // Specular layer - print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin); print(OutArgumentsFile, Format_2190, i, q(2 * i)); - print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin); } break; case TARCOGLayerType::VENETBLIND_HORIZ: case TARCOGLayerType::VENETBLIND_VERT: { // Venetian blind - print(OutArgumentsFile, Format_2111, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2111, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin); print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i)); - print(OutArgumentsFile, Format_2111, 2 * i, theta(2 * i), theta(2 * i) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2111, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin); } break; case TARCOGLayerType::WOVSHADE: { // Venetian blind - print(OutArgumentsFile, Format_2112, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2112, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin); print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i)); - print(OutArgumentsFile, Format_2112, 2 * i, theta(2 * i), theta(2 * i) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2112, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin); } break; case TARCOGLayerType::DIFFSHADE: { // Venetian blind - print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin); print(OutArgumentsFile, Format_2190, i, q(2 * i)); - print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin); } break; default: { - print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin); print(OutArgumentsFile, Format_2199, i, q(2 * i)); - print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::KelvinConv); + print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin); } break; } @@ -730,7 +730,7 @@ void WriteOutputArguments(InputOutputFile &OutArgumentsFile, } } // i - layers - print(OutArgumentsFile, Format_2115, troom, troom - Constant::KelvinConv); + print(OutArgumentsFile, Format_2115, troom, troom - Constant::Kelvin); print(OutArgumentsFile, "\n"); diff --git a/src/EnergyPlus/TarcogShading.cc b/src/EnergyPlus/TarcogShading.cc index 5c0020cd2a8..39a70d0939c 100644 --- a/src/EnergyPlus/TarcogShading.cc +++ b/src/EnergyPlus/TarcogShading.cc @@ -706,7 +706,7 @@ namespace TarcogShading { TGapOld1 = 0.0; TGapOld2 = 0.0; tilt = Constant::Pi / 180 * (angle - 90); - T0 = 0.0 + Constant::KelvinConv; + T0 = 0.0 + Constant::Kelvin; A1eqin = 0.0; A2eqout = 0.0; A1eqout = 0.0; @@ -1028,7 +1028,7 @@ namespace TarcogShading { bool converged; tilt = Constant::Pi / 180.0 * (angle - 90.0); - T0 = 0.0 + Constant::KelvinConv; + T0 = 0.0 + Constant::Kelvin; GASSES90(state, T0, diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index b916c39c5be..334508ea762 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -188,7 +188,7 @@ namespace ThermalChimney { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - if (UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { + if (Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound)) { continue; } @@ -197,7 +197,7 @@ namespace ThermalChimney { // Second Alpha is Zone Name state.dataThermalChimneys->ThermalChimneySys(Loop).RealZonePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (state.dataThermalChimneys->ThermalChimneySys(Loop).RealZonePtr == 0) { ShowSevereError(state, format("{}=\"{} invalid Zone", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError( @@ -276,7 +276,7 @@ namespace ThermalChimney { for (TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { state.dataThermalChimneys->ThermalChimneySys(Loop).ZoneName(TCZoneNum) = state.dataIPShortCut->cAlphaArgs(TCZoneNum + 3); state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum) = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(TCZoneNum + 3), state.dataHeatBal->Zone); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(TCZoneNum + 3), state.dataHeatBal->Zone); state.dataThermalChimneys->ThermalChimneySys(Loop).DistanceThermChimInlet(TCZoneNum) = state.dataIPShortCut->rNumericArgs(3 * TCZoneNum + 1); state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) = @@ -744,7 +744,7 @@ namespace ThermalChimney { if (state.dataHeatBalSurf->SurfTempIn(SurfNum) > TemporaryWallSurfTemp) { TemporaryWallSurfTemp = state.dataHeatBalSurf->SurfTempIn(SurfNum); ConvTransCoeffWallFluid = state.dataHeatBalSurf->SurfHConvInt(SurfNum); - SurfTempAbsorberWall = state.dataHeatBalSurf->SurfTempIn(SurfNum) + Constant::KelvinConv; + SurfTempAbsorberWall = state.dataHeatBalSurf->SurfTempIn(SurfNum) + Constant::Kelvin; } } } @@ -754,7 +754,7 @@ namespace ThermalChimney { if (state.dataSurface->Surface(SurfNum).Width > TempmajorW) { TempmajorW = state.dataSurface->Surface(SurfNum).Width; ConvTransCoeffGlassFluid = state.dataHeatBalSurf->SurfHConvInt(SurfNum); - SurfTempGlassCover = state.dataHeatBalSurf->SurfTempIn(SurfNum) + Constant::KelvinConv; + SurfTempGlassCover = state.dataHeatBalSurf->SurfTempIn(SurfNum) + Constant::Kelvin; } } } @@ -781,7 +781,7 @@ namespace ThermalChimney { RoomAirTemp += state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) * state.dataZoneTempPredictorCorrector->zoneHeatBalance(TCZoneNumCounter).MAT; } - RoomAirTemp += Constant::KelvinConv; + RoomAirTemp += Constant::Kelvin; Process1 = 0.0; Process2 = 0.0; @@ -919,7 +919,7 @@ namespace ThermalChimney { state.dataThermalChimneys->ThermalChimneyReport(Loop).OverallTCMassFlow = state.dataThermalChimneys->ThermalChimneyReport(Loop).OverallTCVolumeFlow * AirDensityThermalChim; } - state.dataThermalChimneys->ThermalChimneyReport(Loop).OutletAirTempThermalChim = ThermChimSubTemp(NTC) - Constant::KelvinConv; + state.dataThermalChimneys->ThermalChimneyReport(Loop).OutletAirTempThermalChim = ThermChimSubTemp(NTC) - Constant::Kelvin; if (GetCurrentScheduleValue(state, state.dataThermalChimneys->ThermalChimneySys(Loop).SchedPtr) <= 0.0) { for (TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index f1430eea7fd..3ac9aea1198 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -1954,7 +1954,7 @@ namespace ThermalComfort { for (int SurfNum = 1; SurfNum <= thisAngFacList.TotAngleFacSurfaces; ++SurfNum) { thisAngFacList.SurfaceName(SurfNum) = state.dataIPShortCut->cAlphaArgs(SurfNum + 1); thisAngFacList.SurfacePtr(SurfNum) = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(SurfNum + 1), state.dataSurface->Surface); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(SurfNum + 1), state.dataSurface->Surface); thisAngFacList.AngleFactor(SurfNum) = state.dataIPShortCut->rNumericArgs(SurfNum); // Error trap for surfaces that do not exist or surfaces not in the zone if (thisAngFacList.SurfacePtr(SurfNum) == 0) { @@ -2011,8 +2011,7 @@ namespace ThermalComfort { for (int Item = 1; Item <= state.dataHeatBal->TotPeople; ++Item) { auto &thisPeople = state.dataHeatBal->People(Item); if (thisPeople.MRTCalcType != DataHeatBalance::CalcMRT::AngleFactor) continue; - thisPeople.AngleFactorListPtr = - UtilityRoutines::FindItemInList(thisPeople.AngleFactorListName, state.dataThermalComforts->AngleFactorList); + thisPeople.AngleFactorListPtr = Util::FindItemInList(thisPeople.AngleFactorListName, state.dataThermalComforts->AngleFactorList); int WhichAFList = thisPeople.AngleFactorListPtr; if (WhichAFList == 0 && (thisPeople.Fanger || thisPeople.Pierce || thisPeople.KSU)) { ShowSevereError(state, format("{}{}=\"{}\", invalid", routineName, cCurrentModuleObject, thisPeople.AngleFactorListName)); @@ -2056,7 +2055,7 @@ namespace ThermalComfort { auto &thisAngFacList(state.dataThermalComforts->AngleFactorList(AngleFacNum)); for (int SurfNum = 1; SurfNum <= thisAngFacList.TotAngleFacSurfaces; ++SurfNum) { - Real64 SurfaceTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(thisAngFacList.SurfacePtr(SurfNum)) + Constant::KelvinConv; + Real64 SurfaceTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(thisAngFacList.SurfacePtr(SurfNum)) + Constant::Kelvin; Real64 SurfEAF = state.dataConstruction->Construct(state.dataSurface->Surface(thisAngFacList.SurfacePtr(SurfNum)).Construction).InsideAbsorpThermal * thisAngFacList.AngleFactor(SurfNum); @@ -2064,7 +2063,7 @@ namespace ThermalComfort { SumSurfaceEmissAngleFactor += SurfEAF; } - CalcAngleFactorMRT = root_4(SurfTempEmissAngleFacSummed / SumSurfaceEmissAngleFactor) - Constant::KelvinConv; + CalcAngleFactorMRT = root_4(SurfTempEmissAngleFacSummed / SumSurfaceEmissAngleFactor) - Constant::Kelvin; return CalcAngleFactorMRT; } @@ -2251,11 +2250,11 @@ namespace ThermalComfort { state.dataHeatBalFanSys->ZoneQSteamBaseboardToPerson(state.dataThermalComforts->ZoneNum) + state.dataHeatBalFanSys->ZoneQElecBaseboardToPerson(state.dataThermalComforts->ZoneNum); if (state.dataHeatBalFanSys->ZoneQdotRadHVACToPerson(state.dataThermalComforts->ZoneNum) > 0.0) { - state.dataThermalComforts->RadTemp += Constant::KelvinConv; // Convert to Kelvin + state.dataThermalComforts->RadTemp += Constant::Kelvin; // Convert to Kelvin state.dataThermalComforts->RadTemp = root_4(pow_4(state.dataThermalComforts->RadTemp) + (state.dataHeatBalFanSys->ZoneQdotRadHVACToPerson(state.dataThermalComforts->ZoneNum) / AreaEff / StefanBoltzmannConst)); - state.dataThermalComforts->RadTemp -= Constant::KelvinConv; // Convert back to Celsius + state.dataThermalComforts->RadTemp -= Constant::Kelvin; // Convert back to Celsius } CalcRadTemp = state.dataThermalComforts->RadTemp; diff --git a/src/EnergyPlus/ThermalComfort.hh b/src/EnergyPlus/ThermalComfort.hh index cf91b22bf7a..4f0248aff29 100644 --- a/src/EnergyPlus/ThermalComfort.hh +++ b/src/EnergyPlus/ThermalComfort.hh @@ -63,12 +63,12 @@ struct EnergyPlusData; namespace ThermalComfort { - Real64 constexpr TAbsConv = Constant::KelvinConv; // Converter for absolute temperature - Real64 constexpr ActLevelConv = 58.2; // Converter for activity level (1Met = 58.2 W/m2) - Real64 constexpr BodySurfArea = 1.8; // Dubois body surface area of the human body (m2) - Real64 constexpr BodySurfAreaPierce = 1.8258; // Pierce two node body surface area of the human body (m2) - Real64 constexpr RadSurfEff = 0.72; // Fraction of surface effective for radiation - Real64 constexpr StefanBoltz = 5.6697e-8; // Stefan-Boltzmann constant (W/m2K4) + Real64 constexpr TAbsConv = Constant::Kelvin; // Converter for absolute temperature + Real64 constexpr ActLevelConv = 58.2; // Converter for activity level (1Met = 58.2 W/m2) + Real64 constexpr BodySurfArea = 1.8; // Dubois body surface area of the human body (m2) + Real64 constexpr BodySurfAreaPierce = 1.8258; // Pierce two node body surface area of the human body (m2) + Real64 constexpr RadSurfEff = 0.72; // Fraction of surface effective for radiation + Real64 constexpr StefanBoltz = 5.6697e-8; // Stefan-Boltzmann constant (W/m2K4) struct ThermalComfortDataType { diff --git a/src/EnergyPlus/ThermalISO15099Calc.cc b/src/EnergyPlus/ThermalISO15099Calc.cc index b676952e859..fbf931c5b3f 100644 --- a/src/EnergyPlus/ThermalISO15099Calc.cc +++ b/src/EnergyPlus/ThermalISO15099Calc.cc @@ -2955,10 +2955,10 @@ void storeIterationResults(EnergyPlusData &state, print(files.TarcogIterationsFile, "*************************************************************************************************\n"); print(files.TarcogIterationsFile, "Iteration number: {:5}\n", index); - print(files.TarcogIterationsFile, "Trmin = {:8.4F}\n", trmin - Constant::KelvinConv); - print(files.TarcogIterationsFile, "Troom = {:12.6F}\n", troom - Constant::KelvinConv); - print(files.TarcogIterationsFile, "Trmout = {:8.4F}\n", trmout - Constant::KelvinConv); - print(files.TarcogIterationsFile, "Tamb = {:12.6F}\n", tamb - Constant::KelvinConv); + print(files.TarcogIterationsFile, "Trmin = {:8.4F}\n", trmin - Constant::Kelvin); + print(files.TarcogIterationsFile, "Troom = {:12.6F}\n", troom - Constant::Kelvin); + print(files.TarcogIterationsFile, "Trmout = {:8.4F}\n", trmout - Constant::Kelvin); + print(files.TarcogIterationsFile, "Tamb = {:12.6F}\n", tamb - Constant::Kelvin); print(files.TarcogIterationsFile, "Ebsky = {:8.4F}\n", ebsky); print(files.TarcogIterationsFile, "Ebroom = {:8.4F}\n", ebroom); @@ -3033,9 +3033,9 @@ void storeIterationResults(EnergyPlusData &state, print(files.TarcogIterationsFile, "\n"); // write temperatures - print(files.TarcogIterationsFile, "{:16.8F} \n", theta(1) - Constant::KelvinConv); + print(files.TarcogIterationsFile, "{:16.8F} \n", theta(1) - Constant::Kelvin); for (i = 2; i <= 2 * nlayer; ++i) { - print(files.TarcogIterationsFile, " {:16.8F} \n", theta(i) - Constant::KelvinConv); + print(files.TarcogIterationsFile, " {:16.8F} \n", theta(i) - Constant::Kelvin); } print(files.TarcogIterationsFile, "\n"); @@ -3055,9 +3055,9 @@ void storeIterationResults(EnergyPlusData &state, print(files.IterationCSVFile, dynFormat); print(files.IterationCSVFile, "\n"); } - print(files.IterationCSVFile, "{:16.8F} \n", theta(1) - Constant::KelvinConv); + print(files.IterationCSVFile, "{:16.8F} \n", theta(1) - Constant::Kelvin); for (i = 2; i <= 2 * nlayer; ++i) { - print(files.IterationCSVFile, " {:16.8F} \n", theta(i) - Constant::KelvinConv); + print(files.IterationCSVFile, " {:16.8F} \n", theta(i) - Constant::Kelvin); } print(files.IterationCSVFile, "\n"); diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index fe9cfbbd01e..6e889dab3c6 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -154,7 +154,7 @@ namespace TranspiredCollector { // Find the correct transpired collector with the Component name and/or index if (CompIndex == 0) { - UTSCNum = UtilityRoutines::FindItemInList(CompName, state.dataTranspiredCollector->UTSC); + UTSCNum = Util::FindItemInList(CompName, state.dataTranspiredCollector->UTSC); if (UTSCNum == 0) { ShowFatalError(state, format("Transpired Collector not found={}", CompName)); } @@ -336,7 +336,7 @@ namespace TranspiredCollector { for (ItemSplit = 1; ItemSplit <= NumUTSCSplitter; ++ItemSplit) { state.dataInputProcessing->inputProcessor->getObjectItem( state, CurrentModuleMultiObject, ItemSplit, AlphasSplit, NumAlphasSplit, NumbersSplit, NumNumbersSplit, IOStatusSplit); - if (!(UtilityRoutines::SameString(AlphasSplit(1), Alphas(1)))) continue; + if (!(Util::SameString(AlphasSplit(1), Alphas(1)))) continue; SplitterNameOK(ItemSplit) = true; state.dataTranspiredCollector->UTSC(Item).NumOASysAttached = std::floor(NumAlphasSplit / 4.0); if (mod((NumAlphasSplit), 4) != 1) { @@ -411,7 +411,7 @@ namespace TranspiredCollector { } // any UTSC Multisystem present state.dataTranspiredCollector->UTSC(Item).OSCMName = Alphas(2); - Found = UtilityRoutines::FindItemInList(state.dataTranspiredCollector->UTSC(Item).OSCMName, state.dataSurface->OSCM); + Found = Util::FindItemInList(state.dataTranspiredCollector->UTSC(Item).OSCMName, state.dataSurface->OSCM); if (Found == 0) { ShowSevereError(state, format("{} not found={} in {} ={}", @@ -506,9 +506,9 @@ namespace TranspiredCollector { continue; } - if (UtilityRoutines::SameString(Alphas(9), "Triangle")) { + if (Util::SameString(Alphas(9), "Triangle")) { state.dataTranspiredCollector->UTSC(Item).Layout = Layout_Triangle; - } else if (UtilityRoutines::SameString(Alphas(9), "Square")) { + } else if (Util::SameString(Alphas(9), "Square")) { state.dataTranspiredCollector->UTSC(Item).Layout = Layout_Square; } else { ShowSevereError(state, @@ -521,9 +521,9 @@ namespace TranspiredCollector { continue; } - if (UtilityRoutines::SameString(Alphas(10), "Kutscher1994")) { + if (Util::SameString(Alphas(10), "Kutscher1994")) { state.dataTranspiredCollector->UTSC(Item).Correlation = Correlation_Kutscher1994; - } else if (UtilityRoutines::SameString(Alphas(10), "VanDeckerHollandsBrunger2001")) { + } else if (Util::SameString(Alphas(10), "VanDeckerHollandsBrunger2001")) { state.dataTranspiredCollector->UTSC(Item).Correlation = Correlation_VanDeckerHollandsBrunger2001; } else { ShowSevereError(state, @@ -538,17 +538,15 @@ namespace TranspiredCollector { Roughness = Alphas(11); // Select the correct Number for the associated ascii name for the roughness type - if (UtilityRoutines::SameString(Roughness, "VeryRough")) + if (Util::SameString(Roughness, "VeryRough")) state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::VeryRough; - if (UtilityRoutines::SameString(Roughness, "Rough")) - state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::Rough; - if (UtilityRoutines::SameString(Roughness, "MediumRough")) + if (Util::SameString(Roughness, "Rough")) state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::Rough; + if (Util::SameString(Roughness, "MediumRough")) state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::MediumRough; - if (UtilityRoutines::SameString(Roughness, "MediumSmooth")) + if (Util::SameString(Roughness, "MediumSmooth")) state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::MediumSmooth; - if (UtilityRoutines::SameString(Roughness, "Smooth")) - state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::Smooth; - if (UtilityRoutines::SameString(Roughness, "VerySmooth")) + if (Util::SameString(Roughness, "Smooth")) state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::Smooth; + if (Util::SameString(Roughness, "VerySmooth")) state.dataTranspiredCollector->UTSC(Item).CollRoughness = Material::SurfaceRoughness::VerySmooth; // Was it set? @@ -573,7 +571,7 @@ namespace TranspiredCollector { state.dataTranspiredCollector->UTSC(Item).SurfPtrs.allocate(state.dataTranspiredCollector->UTSC(Item).NumSurfs); state.dataTranspiredCollector->UTSC(Item).SurfPtrs = 0; for (ThisSurf = 1; ThisSurf <= state.dataTranspiredCollector->UTSC(Item).NumSurfs; ++ThisSurf) { - Found = UtilityRoutines::FindItemInList(Alphas(ThisSurf + AlphaOffset), state.dataSurface->Surface); + Found = Util::FindItemInList(Alphas(ThisSurf + AlphaOffset), state.dataSurface->Surface); if (Found == 0) { ShowSevereError(state, format("Surface Name not found={} in {} ={}", @@ -1195,8 +1193,8 @@ namespace TranspiredCollector { AbsThermSurf = dynamic_cast(state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1))) ->AbsorpThermal; - TsoK = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfPtr) + Constant::KelvinConv; - TscollK = state.dataTranspiredCollector->UTSC(UTSCNum).TcollLast + Constant::KelvinConv; + TsoK = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfPtr) + Constant::Kelvin; + TscollK = state.dataTranspiredCollector->UTSC(UTSCNum).TcollLast + Constant::Kelvin; HPlenARR(ThisSurf) = Sigma * AbsExt * AbsThermSurf * (pow_4(TscollK) - pow_4(TsoK)) / (TscollK - TsoK); } // AreaSum = sum( Surface( UTSC( UTSCNum ).SurfPtrs ).Area ); //Autodesk:F2C++ Array subscript usage: Replaced by below @@ -1637,7 +1635,7 @@ namespace TranspiredCollector { state.dataTranspiredCollector->GetInputFlag = false; } - WhichUTSC = UtilityRoutines::FindItemInList(UTSCName, state.dataTranspiredCollector->UTSC); + WhichUTSC = Util::FindItemInList(UTSCName, state.dataTranspiredCollector->UTSC); if (WhichUTSC != 0) { NodeNum = state.dataTranspiredCollector->UTSC(WhichUTSC).InletNode(1); } else { @@ -1672,7 +1670,7 @@ namespace TranspiredCollector { state.dataTranspiredCollector->GetInputFlag = false; } - WhichUTSC = UtilityRoutines::FindItemInList(UTSCName, state.dataTranspiredCollector->UTSC); + WhichUTSC = Util::FindItemInList(UTSCName, state.dataTranspiredCollector->UTSC); if (WhichUTSC != 0) { NodeNum = state.dataTranspiredCollector->UTSC(WhichUTSC).OutletNode(1); } else { @@ -1809,8 +1807,8 @@ namespace TranspiredCollector { Real64 AbsThermSurf = dynamic_cast(state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1))) ->AbsorpThermal; - Real64 TsoK = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfPtr) + Constant::KelvinConv; - Real64 TsBaffK = TmpTsBaf + Constant::KelvinConv; + Real64 TsoK = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfPtr) + Constant::Kelvin; + Real64 TsBaffK = TmpTsBaf + Constant::Kelvin; if (TsBaffK == TsoK) { // avoid divide by zero HPlenARR(ThisSurf) = 0.0; // no net heat transfer if same temperature } else { @@ -1872,7 +1870,7 @@ namespace TranspiredCollector { Real64 Isc = sum_product_sub(state.dataHeatBal->SurfQRadSWOutIncident, state.dataSurface->Surface, &DataSurfaces::SurfaceData::Area, SurfPtrARR) / A; // average of surface temps , for Beta in Grashoff no. - Real64 TmeanK = 0.5 * (TmpTsBaf + Tso) + Constant::KelvinConv; + Real64 TmeanK = 0.5 * (TmpTsBaf + Tso) + Constant::Kelvin; // Grasshof number for natural convection calc Real64 Gr = g * pow_3(GapThick) * std::abs(Tso - TmpTsBaf) * pow_2(RhoAir) / (TmeanK * pow_2(nu)); @@ -1883,14 +1881,14 @@ namespace TranspiredCollector { Real64 VdotWind = Cv * (VentArea / 2.0) * Vwind; // volume flow rate of nat. vent due to wind if (TaGap > Tamb) { - VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (TaGap - Tamb) / (TaGap + Constant::KelvinConv)); + VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (TaGap - Tamb) / (TaGap + Constant::Kelvin)); } else if (TaGap == Tamb) { VdotThermal = 0.0; } else { if ((std::abs(Tilt) < 5.0) || (std::abs(Tilt - 180.0) < 5.0)) { VdotThermal = 0.0; // stable buoyancy situation } else { - VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (Tamb - TaGap) / (Tamb + Constant::KelvinConv)); + VdotThermal = Cd * (VentArea / 2.0) * std::sqrt(2.0 * g * HdeltaNPL * (Tamb - TaGap) / (Tamb + Constant::Kelvin)); } } diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index a84a4c8bcec..1bb028d342c 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -815,7 +815,7 @@ namespace RoomAir { SumSysM += MassFlowRate; } if (TotSysFlow > 0.0) { - TSupK = TSupK / SumSysM + Constant::KelvinConv; + TSupK = TSupK / SumSysM + Constant::Kelvin; } else { TSupK = 0.0; } @@ -843,7 +843,7 @@ namespace RoomAir { Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; - if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::Kelvin) > thisZoneHB.MAT) { // The system will mix HeightFrac = 0.0; } else { @@ -1116,8 +1116,8 @@ namespace RoomAir { if (MIXFLAG) { state.dataRoomAir->Phi(ZoneNum) = 1.0; } else { - state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / - (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); + state.dataRoomAir->Phi(ZoneNum) = + (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::Kelvin)) / (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::Kelvin)); } // Mixed for reporting purposes @@ -1132,7 +1132,6 @@ namespace RoomAir { void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { - // SUBROUTINE INFORMATION: // AUTHOR Fred Buhl // DATE WRITTEN January 2006 @@ -1238,7 +1237,7 @@ namespace RoomAir { SumSysM += MassFlowRate; } if (TotSysFlow > 0.0) { - TSupK = TSupK / SumSysM + Constant::KelvinConv; + TSupK = TSupK / SumSysM + Constant::Kelvin; } else { TSupK = 0.0; } @@ -1271,7 +1270,7 @@ namespace RoomAir { Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; - if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::Kelvin) > thisZoneHB.MAT) { // The system will mix HeightFrac = 0.0; } else { @@ -1576,8 +1575,8 @@ namespace RoomAir { if (MIXFLAG) { state.dataRoomAir->Phi(ZoneNum) = 1.0; } else { - state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / - (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); + state.dataRoomAir->Phi(ZoneNum) = + (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::Kelvin)) / (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::Kelvin)); } // Mixed for reporting purposes diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index d36031eef59..11ff5102a02 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -156,7 +156,7 @@ namespace UnitHeater { // Find the correct Unit Heater Equipment if (CompIndex == 0) { - UnitHeatNum = UtilityRoutines::FindItemInList(CompName, state.dataUnitHeaters->UnitHeat); + UnitHeatNum = Util::FindItemInList(CompName, state.dataUnitHeaters->UnitHeat); if (UnitHeatNum == 0) { ShowFatalError(state, format("SimUnitHeater: Unit not found={}", CompName)); } @@ -297,7 +297,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeatNumericFields(UnitHeatNum).FieldNames.allocate(NumNumbers); state.dataUnitHeaters->UnitHeatNumericFields(UnitHeatNum).FieldNames = ""; state.dataUnitHeaters->UnitHeatNumericFields(UnitHeatNum).FieldNames = cNumericFields; - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name = Alphas(1); state.dataUnitHeaters->UnitHeat(UnitHeatNum).SchedName = Alphas(2); @@ -354,7 +354,7 @@ namespace UnitHeater { ShowContinueError(state, format("specified in {} = \"{}\".", CurrentModuleObject, state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name)); ErrorsFound = true; } else { - if (!UtilityRoutines::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanType, "Fan:SystemModel")) { + if (!Util::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanType, "Fan:SystemModel")) { GetFanType(state, state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanName, state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanType_Num, @@ -427,7 +427,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanName, errFlag); } - } else if (UtilityRoutines::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanType, "Fan:SystemModel")) { + } else if (Util::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanType, "Fan:SystemModel")) { state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back( new HVACFan::FanSystem(state, state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanName)); // call constructor @@ -469,7 +469,7 @@ namespace UnitHeater { // Heating coil information: { state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type = - static_cast(getEnumValue(HCoilTypeNamesUC, UtilityRoutines::makeUPPER(Alphas(7)))); + static_cast(getEnumValue(HCoilTypeNamesUC, Util::makeUPPER(Alphas(7)))); switch (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type) { case HCoilType::WaterHeatingCoil: state.dataUnitHeaters->UnitHeat(UnitHeatNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; @@ -559,12 +559,12 @@ namespace UnitHeater { } state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOperatesDuringNoHeating = Alphas(10); - if ((!UtilityRoutines::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOperatesDuringNoHeating, "Yes")) && - (!UtilityRoutines::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOperatesDuringNoHeating, "No"))) { + if ((!Util::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOperatesDuringNoHeating, "Yes")) && + (!Util::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOperatesDuringNoHeating, "No"))) { ErrorsFound = true; ShowSevereError(state, format("Illegal {} = {}", cAlphaFields(10), Alphas(10))); ShowContinueError(state, format("Occurs in {}={}", CurrentModuleObject, state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name)); - } else if (UtilityRoutines::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOperatesDuringNoHeating, "No")) { + } else if (Util::SameString(state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOperatesDuringNoHeating, "No")) { state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOffNoHeating = true; } @@ -585,8 +585,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeat(UnitHeatNum).HVACSizingIndex = 0; if (!lAlphaBlanks(12)) { - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HVACSizingIndex = - UtilityRoutines::FindItemInList(Alphas(12), state.dataSize->ZoneHVACSizing); + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HVACSizingIndex = Util::FindItemInList(Alphas(12), state.dataSize->ZoneHVACSizing); if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HVACSizingIndex == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(12), Alphas(12))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name)); diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index cb6da9c0af0..1ac010a21f8 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -155,7 +155,7 @@ namespace UnitVentilator { // Find the correct Unit Ventilator Equipment if (CompIndex == 0) { - UnitVentNum = UtilityRoutines::FindItemInList(CompName, state.dataUnitVentilators->UnitVent); + UnitVentNum = Util::FindItemInList(CompName, state.dataUnitVentilators->UnitVent); if (UnitVentNum == 0) { ShowFatalError(state, format("SimUnitVentilator: Unit not found={}", CompName)); } @@ -275,7 +275,7 @@ namespace UnitVentilator { state.dataUnitVentilators->UnitVentNumericFields(UnitVentNum).FieldNames.allocate(NumNumbers); state.dataUnitVentilators->UnitVentNumericFields(UnitVentNum).FieldNames = ""; state.dataUnitVentilators->UnitVentNumericFields(UnitVentNum).FieldNames = cNumericFields; - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); unitVent.Name = Alphas(1); if (lAlphaBlanks(2)) { @@ -401,7 +401,7 @@ namespace UnitVentilator { ShowContinueError(state, format("specified in {} = \"{}\".", CurrentModuleObject, unitVent.Name)); ErrorsFound = true; } else { - if (!UtilityRoutines::SameString(Alphas(11), "Fan:SystemModel")) { + if (!Util::SameString(Alphas(11), "Fan:SystemModel")) { Fans::GetFanType(state, unitVent.FanName, unitVent.FanType_Num, errFlag, CurrentModuleObject, unitVent.Name); { @@ -451,7 +451,7 @@ namespace UnitVentilator { ErrorsFound = true; } } - } else if (UtilityRoutines::SameString(Alphas(11), "Fan:SystemModel")) { + } else if (Util::SameString(Alphas(11), "Fan:SystemModel")) { unitVent.FanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, unitVent.FanName)); // call constructor unitVent.Fan_Index = HVACFan::getFanObjectVectorIndex(state, unitVent.FanName); // zero-based @@ -583,7 +583,7 @@ namespace UnitVentilator { unitVent.HVACSizingIndex = 0; if (!lAlphaBlanks(20)) { - unitVent.HVACSizingIndex = UtilityRoutines::FindItemInList(Alphas(20), state.dataSize->ZoneHVACSizing); + unitVent.HVACSizingIndex = Util::FindItemInList(Alphas(20), state.dataSize->ZoneHVACSizing); if (unitVent.HVACSizingIndex == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(20), Alphas(20))); ShowContinueError(state, format("Occurs in {} = \"{}\".", CurrentModuleObject, unitVent.Name)); @@ -682,9 +682,9 @@ namespace UnitVentilator { unitVent.CCoilType = CoolCoilType::HXAssisted; HVACHXAssistedCoolingCoil::GetHXCoilTypeAndName( state, cCoolingCoilType, Alphas(18), ErrorsFound, unitVent.CCoilPlantType, unitVent.CCoilPlantName); - if (UtilityRoutines::SameString(unitVent.CCoilPlantType, "Coil:Cooling:Water")) { + if (Util::SameString(unitVent.CCoilPlantType, "Coil:Cooling:Water")) { unitVent.CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; - } else if (UtilityRoutines::SameString(unitVent.CCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { + } else if (Util::SameString(unitVent.CCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { unitVent.CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } else { ShowSevereError(state, format("{}{}=\"{}\".", RoutineName, CurrentModuleObject, unitVent.Name)); diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 8bdb78d9288..9d8a50a558f 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -199,7 +199,7 @@ namespace UnitarySystems { state.dataUnitarySystems->getMSHPInputOnceFlag = false; } for (auto &dSpec : state.dataUnitarySystems->designSpecMSHP) { - if (UtilityRoutines::SameString(dSpec.name, objectName) && dSpec.m_DesignSpecMSHPType_Num == object_type_of_num) { + if (Util::SameString(dSpec.name, objectName) && dSpec.m_DesignSpecMSHPType_Num == object_type_of_num) { return &dSpec; } } @@ -260,15 +260,15 @@ namespace UnitarySystems { std::string const &thisObjectName = instance.key(); DesignSpecMSHP thisDesignSpec; - thisDesignSpec.name = UtilityRoutines::makeUPPER(thisObjectName); + thisDesignSpec.name = Util::makeUPPER(thisObjectName); thisDesignSpec.numOfSpeedHeating = fields.at("number_of_speeds_for_heating").get(); // required field thisDesignSpec.numOfSpeedCooling = fields.at("number_of_speeds_for_cooling").get(); // required field int maxSpeeds = max(thisDesignSpec.numOfSpeedHeating, thisDesignSpec.numOfSpeedCooling); thisDesignSpec.m_DesignSpecMSHPType_Num = 1; // add global int value for factory if (fields.find("single_mode_operation") != fields.end()) { // not required field - std::string loc_m_SingleModeOp = UtilityRoutines::makeUPPER(fields.at("single_mode_operation").get()); - if (UtilityRoutines::SameString(loc_m_SingleModeOp, "Yes")) thisDesignSpec.m_SingleModeFlag = true; + std::string loc_m_SingleModeOp = Util::makeUPPER(fields.at("single_mode_operation").get()); + if (Util::SameString(loc_m_SingleModeOp, "Yes")) thisDesignSpec.m_SingleModeFlag = true; } if (fields.find("no_load_supply_air_flow_rate_ratio") != fields.end()) { // not required field @@ -325,7 +325,7 @@ namespace UnitarySystems { int sysNum = -1; for (auto &sys : state.dataUnitarySystems->unitarySys) { ++sysNum; - if (UtilityRoutines::SameString(sys.Name, objectName) && object_type_of_num == DataHVACGlobals::UnitarySys_AnyCoilType) { + if (Util::SameString(sys.Name, objectName) && object_type_of_num == DataHVACGlobals::UnitarySys_AnyCoilType) { state.dataUnitarySystems->unitarySys[sysNum].m_UnitarySysNum = sysNum; return &sys; } @@ -346,7 +346,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 (UtilityRoutines::SameString(objectName, thisDesignSpecMSHPObjec->name)) { + if (Util::SameString(objectName, thisDesignSpecMSHPObjec->name)) { index = loop; return index; } @@ -363,7 +363,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 (UtilityRoutines::SameString(objectName, thisUnitarySysObjec->Name)) { + if (Util::SameString(objectName, thisUnitarySysObjec->Name)) { index = loop; break; } @@ -2178,11 +2178,8 @@ namespace UnitarySystems { this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWaterDetailed) { WaterCoils::SimulateWaterCoilComponents( state, this->m_CoolingCoilName, FirstHVACIteration, this->m_CoolingCoilIndex, QActual, this->m_FanOpMode, 1.0); - EqSizing.DesCoolingLoad = - WaterCoils::GetWaterCoilCapacity(state, - UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), - this->m_CoolingCoilName, - ErrFound); + EqSizing.DesCoolingLoad = WaterCoils::GetWaterCoilCapacity( + state, Util::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), this->m_CoolingCoilName, ErrFound); } } this->m_MaxNoCoolHeatAirVolFlow *= EqSizing.DesCoolingLoad; @@ -2195,11 +2192,8 @@ namespace UnitarySystems { if (this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { WaterCoils::SimulateWaterCoilComponents( state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex, QActual, this->m_FanOpMode, 1.0); - EqSizing.DesHeatingLoad = - WaterCoils::GetWaterCoilCapacity(state, - UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), - this->m_HeatingCoilName, - ErrFound); + EqSizing.DesHeatingLoad = WaterCoils::GetWaterCoilCapacity( + state, Util::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), this->m_HeatingCoilName, ErrFound); } } this->m_MaxNoCoolHeatAirVolFlow *= EqSizing.DesHeatingLoad; @@ -3031,11 +3025,8 @@ namespace UnitarySystems { this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWaterDetailed) { WaterCoils::SimulateWaterCoilComponents( state, this->m_CoolingCoilName, FirstHVACIteration, this->m_CoolingCoilIndex, QActual, this->m_FanOpMode, 1.0); - state.dataSize->DataConstantUsedForSizing = - WaterCoils::GetWaterCoilCapacity(state, - UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), - this->m_CoolingCoilName, - ErrFound); + state.dataSize->DataConstantUsedForSizing = WaterCoils::GetWaterCoilCapacity( + state, Util::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), this->m_CoolingCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; state.dataSize->DataFractionUsedForSizing = 1.0; SizingMethod = DataHVACGlobals::AutoCalculateSizing; @@ -3048,7 +3039,7 @@ namespace UnitarySystems { HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil( state, blankString, true, DataHVACGlobals::CompressorOperation::On, 1.0, this->m_CoolingCoilIndex, 1, false, 1.0, false); state.dataSize->DataConstantUsedForSizing = WaterCoils::GetWaterCoilCapacity( - state, UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(ActualCoolCoilType)), HXCoilName, ErrFound); + state, Util::makeUPPER(DataHVACGlobals::cAllCoilTypes(ActualCoolCoilType)), HXCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; state.dataSize->DataFractionUsedForSizing = 1.0; SizingMethod = DataHVACGlobals::AutoCalculateSizing; @@ -3142,11 +3133,8 @@ namespace UnitarySystems { if (this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { WaterCoils::SimulateWaterCoilComponents( state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex, QActual, this->m_FanOpMode, 1.0); - state.dataSize->DataConstantUsedForSizing = - WaterCoils::GetWaterCoilCapacity(state, - UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), - this->m_HeatingCoilName, - ErrFound); + state.dataSize->DataConstantUsedForSizing = WaterCoils::GetWaterCoilCapacity( + state, Util::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), this->m_HeatingCoilName, ErrFound); EqSizing.DesHeatingLoad = state.dataSize->DataConstantUsedForSizing; state.dataSize->DataFractionUsedForSizing = 1.0; SizingMethod = DataHVACGlobals::AutoCalculateSizing; @@ -3455,9 +3443,9 @@ namespace UnitarySystems { std::string const &cCurrentModuleObject = input_data.system_type; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(input_data.system_type))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(input_data.system_type))); std::string const &thisObjectName = input_data.name; - this->Name = UtilityRoutines::makeUPPER(thisObjectName); + this->Name = Util::makeUPPER(thisObjectName); sysNum = getUnitarySystemIndex(state, thisObjectName); this->m_UnitarySysNum = sysNum; @@ -3475,7 +3463,7 @@ namespace UnitarySystems { NodeInputManager::CompFluidStream::Primary, DataLoopNode::ObjectIsParent); } else { - this->AirInNode = UtilityRoutines::FindItemInList(input_data.air_inlet_node_name, state.dataLoopNodes->NodeID); + this->AirInNode = Util::FindItemInList(input_data.air_inlet_node_name, state.dataLoopNodes->NodeID); } if (state.dataUnitarySystems->getInputOnceFlag) { @@ -3489,7 +3477,7 @@ namespace UnitarySystems { NodeInputManager::CompFluidStream::Primary, DataLoopNode::ObjectIsParent); } else { - this->AirOutNode = UtilityRoutines::FindItemInList(input_data.air_outlet_node_name, state.dataLoopNodes->NodeID); + this->AirOutNode = Util::FindItemInList(input_data.air_outlet_node_name, state.dataLoopNodes->NodeID); } // need to read in all information needed to SetupOutputVariable in setupAllOutputVars @@ -3516,11 +3504,11 @@ namespace UnitarySystems { this->m_HeatCoilExists = true; } if (this->m_HeatCoilExists && this->m_HeatingCoilType_Num == 0) { - if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:DX:VariableSpeed")) { + if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:DX:VariableSpeed")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingAirToAirVariableSpeed; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:DX:MultiSpeed")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:DX:MultiSpeed")) { this->m_HeatingCoilType_Num = DataHVACGlobals::CoilDX_MultiSpeedHeating; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Water")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Water")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingWater; if (this->m_DesignSpecMSHPIndex > -1) { this->m_NumOfSpeedHeating = this->m_CompPointerMSHP->numOfSpeedHeating; @@ -3529,24 +3517,24 @@ namespace UnitarySystems { this->m_MultiOrVarSpeedHeatCoil = true; } } - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Steam")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Steam")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:WaterToAirHeatPump:EquationFit")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:WaterToAirHeatPump:EquationFit")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingWaterToAirHPSimple; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:WaterToAirHeatPump:ParameterEstimation")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:WaterToAirHeatPump:ParameterEstimation")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingWaterToAirHP; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Electric:MultiStage")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Electric:MultiStage")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingElectric_MultiStage; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Gas:MultiStage")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Gas:MultiStage")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_HeatingGas_MultiStage; - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Electric") || - UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Desuperheater")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Fuel") || + Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Electric") || + Util::SameString(this->m_HeatingCoilTypeName, "Coil:Heating:Desuperheater")) { this->m_HeatingCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, this->m_HeatingCoilTypeName, this->m_HeatingCoilName, errFlag); - } else if (UtilityRoutines::SameString(this->m_HeatingCoilTypeName, "Coil:UserDefined")) { + } else if (Util::SameString(this->m_HeatingCoilTypeName, "Coil:UserDefined")) { this->m_HeatingCoilType_Num = DataHVACGlobals::Coil_UserDefined; } else if (this->m_HeatCoilExists) { this->m_HeatingCoilType_Num = @@ -3570,11 +3558,11 @@ namespace UnitarySystems { // Find the type of coil. do not print message since this may not be the correct coil type. errFlag = false; if (this->m_CoolCoilExists && this->m_CoolingCoilType_Num == 0) { - if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:VariableSpeed")) { + if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:VariableSpeed")) { this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:MultiSpeed")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:MultiSpeed")) { this->m_CoolingCoilType_Num = DataHVACGlobals::CoilDX_MultiSpeedCooling; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:Water")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:Water")) { this->m_IsDXCoil = false; this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWater; this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWater; @@ -3585,7 +3573,7 @@ namespace UnitarySystems { this->m_MultiOrVarSpeedCoolCoil = true; } } - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:Water:DetailedGeometry")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:Water:DetailedGeometry")) { this->m_IsDXCoil = false; this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWaterDetailed; if (this->m_DesignSpecMSHPIndex > -1) { @@ -3595,31 +3583,31 @@ namespace UnitarySystems { this->m_MultiOrVarSpeedCoolCoil = true; } } - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { this->m_CoolingCoilType_Num = DataHVACGlobals::CoilDX_CoolingTwoStageWHumControl; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { this->m_CoolingCoilType_Num = HVACHXAssistedCoolingCoil::GetCoilGroupTypeNum( state, input_data.cooling_coil_object_type, this->m_CoolingCoilName, errFlag, PrintMessage); - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { this->m_IsDXCoil = false; this->m_CoolingCoilType_Num = HVACHXAssistedCoolingCoil::GetCoilGroupTypeNum( state, input_data.cooling_coil_object_type, this->m_CoolingCoilName, errFlag, PrintMessage); - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:WaterToAirHeatPump:EquationFit")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:WaterToAirHeatPump:EquationFit")) { this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWaterToAirHPSimple; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:WaterToAirHeatPump:ParameterEstimation")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:WaterToAirHeatPump:ParameterEstimation")) { this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWaterToAirHP; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit")) { this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:SingleSpeed")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:SingleSpeed")) { this->m_CoolingCoilType_Num = DataHVACGlobals::CoilDX_CoolingSingleSpeed; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:TwoSpeed")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:TwoSpeed")) { this->m_CoolingCoilType_Num = DataHVACGlobals::CoilDX_CoolingTwoSpeed; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:UserDefined")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:UserDefined")) { this->m_IsDXCoil = false; this->m_CoolingCoilType_Num = DataHVACGlobals::Coil_UserDefined; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:SingleSpeed:ThermalStorage")) { + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX:SingleSpeed:ThermalStorage")) { this->m_CoolingCoilType_Num = DataHVACGlobals::CoilDX_PackagedThermalStorageCooling; - } else if (UtilityRoutines::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX")) { // CoilCoolingDX + } else if (Util::SameString(input_data.cooling_coil_object_type, "Coil:Cooling:DX")) { // CoilCoolingDX this->m_CoolingCoilType_Num = DataHVACGlobals::CoilDX_Cooling; this->m_CoolingCoilIndex = CoilCoolingDX::factory(state, this->m_CoolingCoilName); if (this->m_CoolingCoilIndex == -1) { @@ -3657,8 +3645,7 @@ namespace UnitarySystems { constexpr static std::array(UnitarySysCtrlType::Num)> UnitarySysCtrlTypeNamesUC = { "NONE", "LOAD", "SETPOINT", "SINGLEZONEVAV"}; - this->m_ControlType = - static_cast(getEnumValue(UnitarySysCtrlTypeNamesUC, UtilityRoutines::makeUPPER(input_data.control_type))); + this->m_ControlType = static_cast(getEnumValue(UnitarySysCtrlTypeNamesUC, Util::makeUPPER(input_data.control_type))); if (this->m_ControlType == UnitarySysCtrlType::CCMASHRAE) { this->m_ValidASHRAECoolCoil = true; this->m_ValidASHRAEHeatCoil = true; @@ -3766,7 +3753,7 @@ namespace UnitarySystems { } if (!input_data.controlling_zone_or_thermostat_location.empty()) { // not required field - this->ControlZoneNum = UtilityRoutines::FindItemInList(input_data.controlling_zone_or_thermostat_location, state.dataHeatBal->Zone); + this->ControlZoneNum = Util::FindItemInList(input_data.controlling_zone_or_thermostat_location, state.dataHeatBal->Zone); } else if (this->m_ControlType == UnitarySysCtrlType::Load || this->m_ControlType == UnitarySysCtrlType::CCMASHRAE) { if (this->m_sysType == SysType::Unitary) { ShowSevereError(state, format("Input errors for {}:{}", cCurrentModuleObject, thisObjectName)); @@ -3789,13 +3776,13 @@ namespace UnitarySystems { } } - if (UtilityRoutines::SameString(input_data.dehumidification_control_type, "None")) { + if (Util::SameString(input_data.dehumidification_control_type, "None")) { this->m_DehumidControlType_Num = DehumCtrlType::None; this->m_Humidistat = false; - } else if (UtilityRoutines::SameString(input_data.dehumidification_control_type, "CoolReheat")) { + } else if (Util::SameString(input_data.dehumidification_control_type, "CoolReheat")) { this->m_DehumidControlType_Num = DehumCtrlType::CoolReheat; this->m_Humidistat = true; - } else if (UtilityRoutines::SameString(input_data.dehumidification_control_type, "Multimode")) { + } else if (Util::SameString(input_data.dehumidification_control_type, "Multimode")) { this->m_DehumidControlType_Num = DehumCtrlType::Multimode; this->m_Humidistat = true; } @@ -4023,8 +4010,8 @@ namespace UnitarySystems { if (!AirLoopFound && state.dataAirLoop->NumOASystems > 0) { for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; ++OASysNum) { for (int OACompNum = 1; OACompNum <= state.dataAirLoop->OutsideAirSys(OASysNum).NumComponents; ++OACompNum) { - if (!UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentName(OACompNum), thisObjectName) || - !UtilityRoutines::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentType(OACompNum), cCurrentModuleObject)) + if (!Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentName(OACompNum), thisObjectName) || + !Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ComponentType(OACompNum), cCurrentModuleObject)) continue; AirLoopNumber = OASysNum; OASysFound = true; @@ -4065,8 +4052,7 @@ namespace UnitarySystems { this->m_AvailManagerListName = input_data.avail_manager_list_name; if (!input_data.design_spec_zonehvac_sizing_object_name.empty()) { - this->m_HVACSizingIndex = - UtilityRoutines::FindItemInList(input_data.design_spec_zonehvac_sizing_object_name, state.dataSize->ZoneHVACSizing); + this->m_HVACSizingIndex = Util::FindItemInList(input_data.design_spec_zonehvac_sizing_object_name, state.dataSize->ZoneHVACSizing); if (this->m_HVACSizingIndex == 0) { ShowSevereError( state, @@ -4079,7 +4065,7 @@ namespace UnitarySystems { if (!ZoneEquipment) BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, - UtilityRoutines::makeUPPER(thisObjectName), + Util::makeUPPER(thisObjectName), input_data.air_inlet_node_name, input_data.air_outlet_node_name, "Air Nodes"); @@ -4088,7 +4074,7 @@ namespace UnitarySystems { std::string const &loc_m_FanName = input_data.supply_fan_name; if (!loc_m_FanName.empty() && !loc_fanType.empty()) { - if (UtilityRoutines::SameString(loc_fanType, "Fan:SystemModel")) { + if (Util::SameString(loc_fanType, "Fan:SystemModel")) { if (!HVACFan::checkIfFanNameIsAFanSystem(state, loc_m_FanName)) { ShowContinueError(state, format("Occurs in {} = {}", cCurrentModuleObject, thisObjectName)); errorsFound = true; @@ -4173,7 +4159,7 @@ namespace UnitarySystems { } constexpr static std::array(FanPlace::Num)> FanPlaceNamesUC = {"NOTYETSET", "BLOWTHROUGH", "DRAWTHROUGH"}; - this->m_FanPlace = static_cast(getEnumValue(FanPlaceNamesUC, UtilityRoutines::makeUPPER(input_data.fan_placement))); + this->m_FanPlace = static_cast(getEnumValue(FanPlaceNamesUC, Util::makeUPPER(input_data.fan_placement))); if ((this->m_FanPlace == FanPlace::NotYetSet || this->m_FanPlace == FanPlace::Invalid) && this->m_FanExists) { ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); ShowContinueError(state, format("Illegal Fan Placement = {}", input_data.fan_placement)); @@ -4749,7 +4735,7 @@ namespace UnitarySystems { errorsFound = true; } - if (UtilityRoutines::SameString(ChildCoolingCoilType, "COIL:COOLING:DX")) { + if (Util::SameString(ChildCoolingCoilType, "COIL:COOLING:DX")) { int childCCIndex = CoilCoolingDX::factory(state, ChildCoolingCoilName); if (childCCIndex < 0) { @@ -4769,7 +4755,7 @@ namespace UnitarySystems { // Get Outdoor condenser node from heat exchanger assisted DX coil object this->m_CondenserNodeNum = newCoil.condInletNodeIndex; - } else if (UtilityRoutines::SameString(ChildCoolingCoilType, "COIL:COOLING:DX:SINGLESPEED")) { + } else if (Util::SameString(ChildCoolingCoilType, "COIL:COOLING:DX:SINGLESPEED")) { this->m_CoolingCoilAvailSchPtr = DXCoils::GetDXCoilAvailSchPtr(state, ChildCoolingCoilType, ChildCoolingCoilName, errFlag); if (isNotOK) { @@ -4799,7 +4785,7 @@ namespace UnitarySystems { errorsFound = true; } - } else if (UtilityRoutines::SameString(ChildCoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED")) { + } else if (Util::SameString(ChildCoolingCoilType, "COIL:COOLING:DX:VARIABLESPEED")) { this->m_CoolingCoilAvailSchPtr = ScheduleManager::ScheduleAlwaysOn; this->m_MaxCoolAirVolFlow = VariableSpeedCoils::GetCoilAirFlowRateVariableSpeed(state, ChildCoolingCoilType, ChildCoolingCoilName, errFlag); @@ -5229,11 +5215,11 @@ namespace UnitarySystems { if (this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingWaterToAirHPSimple && this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWaterToAirHPSimple) { if (!input_data.heat_pump_coil_water_flow_mode.empty()) { - if (UtilityRoutines::SameString(input_data.heat_pump_coil_water_flow_mode, "Constant")) { + if (Util::SameString(input_data.heat_pump_coil_water_flow_mode, "Constant")) { this->m_WaterCyclingMode = DataHVACGlobals::WaterConstant; - } else if (UtilityRoutines::SameString(input_data.heat_pump_coil_water_flow_mode, "Cycling")) { + } else if (Util::SameString(input_data.heat_pump_coil_water_flow_mode, "Cycling")) { this->m_WaterCyclingMode = DataHVACGlobals::WaterCycling; - } else if (UtilityRoutines::SameString(input_data.heat_pump_coil_water_flow_mode, "ConstantOnDemand")) { + } else if (Util::SameString(input_data.heat_pump_coil_water_flow_mode, "ConstantOnDemand")) { this->m_WaterCyclingMode = DataHVACGlobals::WaterConstantOnDemand; } } else { @@ -5270,10 +5256,10 @@ namespace UnitarySystems { this->m_CoolCompNotSetYet = false; } // Run as 100% DOAS DX coil - if (!UtilityRoutines::SameString(input_data.use_doas_dx_cooling_coil, "Yes")) { + if (!Util::SameString(input_data.use_doas_dx_cooling_coil, "Yes")) { this->m_ISHundredPercentDOASDXCoil = false; } else { - if (UtilityRoutines::SameString(input_data.use_doas_dx_cooling_coil, "Yes")) { + if (Util::SameString(input_data.use_doas_dx_cooling_coil, "Yes")) { this->m_ISHundredPercentDOASDXCoil = true; if (this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed) { ShowWarningError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); @@ -5281,9 +5267,9 @@ 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 (UtilityRoutines::SameString(input_data.use_doas_dx_cooling_coil, "")) { + } else if (Util::SameString(input_data.use_doas_dx_cooling_coil, "")) { this->m_ISHundredPercentDOASDXCoil = false; - } else if (UtilityRoutines::SameString(input_data.use_doas_dx_cooling_coil, "No")) { + } else if (Util::SameString(input_data.use_doas_dx_cooling_coil, "No")) { this->m_ISHundredPercentDOASDXCoil = false; } } @@ -5318,16 +5304,16 @@ namespace UnitarySystems { // Get Latent Load Control flag if (!input_data.latent_load_control.empty()) { - if (UtilityRoutines::SameString(input_data.latent_load_control, "SensibleOnlyLoadControl")) { + if (Util::SameString(input_data.latent_load_control, "SensibleOnlyLoadControl")) { this->m_RunOnSensibleLoad = true; this->m_RunOnLatentLoad = false; - } else if (UtilityRoutines::SameString(input_data.latent_load_control, "LatentOnlyLoadControl")) { + } else if (Util::SameString(input_data.latent_load_control, "LatentOnlyLoadControl")) { this->m_RunOnSensibleLoad = false; this->m_RunOnLatentLoad = true; - } else if (UtilityRoutines::SameString(input_data.latent_load_control, "LatentOrSensibleLoadControl")) { + } else if (Util::SameString(input_data.latent_load_control, "LatentOrSensibleLoadControl")) { this->m_RunOnSensibleLoad = true; this->m_RunOnLatentLoad = true; - } else if (UtilityRoutines::SameString(input_data.latent_load_control, "LatentWithSensibleLoadControl")) { + } else if (Util::SameString(input_data.latent_load_control, "LatentWithSensibleLoadControl")) { this->m_RunOnSensibleLoad = true; this->m_RunOnLatentLoad = true; this->m_RunOnLatentOnlyWithSensible = true; @@ -5356,17 +5342,17 @@ namespace UnitarySystems { this->m_SuppHeatCoilName = input_data.supplemental_heating_coil_name; this->m_SuppHeatCoilTypeName = input_data.supplemental_heating_coil_object_type; - if (UtilityRoutines::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Water")) { + if (Util::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Water")) { this->m_SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingWater; - } else if (UtilityRoutines::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Steam")) { + } else if (Util::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Steam")) { this->m_SuppHeatCoilType_Num = DataHVACGlobals::Coil_HeatingSteam; - } else if (UtilityRoutines::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Fuel") || - UtilityRoutines::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Electric") || - UtilityRoutines::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Electric:MultiStage") || - UtilityRoutines::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:DesuperHeater")) { + } else if (Util::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Fuel") || + Util::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Electric") || + Util::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:Electric:MultiStage") || + Util::SameString(this->m_SuppHeatCoilTypeName, "Coil:Heating:DesuperHeater")) { this->m_SuppHeatCoilType_Num = HeatingCoils::GetHeatingCoilTypeNum(state, this->m_SuppHeatCoilTypeName, this->m_SuppHeatCoilName, errFlag); - } else if (UtilityRoutines::SameString(this->m_SuppHeatCoilTypeName, "Coil:UserDefined")) { + } else if (Util::SameString(this->m_SuppHeatCoilTypeName, "Coil:UserDefined")) { this->m_SuppHeatCoilType_Num = DataHVACGlobals::Coil_UserDefined; } @@ -5661,7 +5647,7 @@ namespace UnitarySystems { } // Determine supply air flow rate sizing method for cooling mode - if (UtilityRoutines::SameString(loc_m_CoolingSAFMethod, "SupplyAirFlowRate")) { + if (Util::SameString(loc_m_CoolingSAFMethod, "SupplyAirFlowRate")) { this->m_CoolingSAFMethod = DataSizing::SupplyAirFlowRate; if (loc_m_CoolingSAFMethod_SAFlow != -999.0) { @@ -5685,7 +5671,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for Cooling Supply Air Flow Rate."); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_CoolingSAFMethod, "FlowPerFloorArea")) { + } else if (Util::SameString(loc_m_CoolingSAFMethod, "FlowPerFloorArea")) { this->m_CoolingSAFMethod = DataSizing::FlowPerFloorArea; if (loc_m_CoolingSAFMethod_SAFlowPerFloorArea != -999.0) { @@ -5715,7 +5701,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for Cooling Supply Air Flow Rate Per Floor Area."); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_CoolingSAFMethod, "FractionOfAutosizedCoolingValue")) { + } else if (Util::SameString(loc_m_CoolingSAFMethod, "FractionOfAutosizedCoolingValue")) { this->m_CoolingSAFMethod = DataSizing::FractionOfAutosizedCoolingAirflow; if (loc_m_CoolingSAFMethod_FracOfAutosizedCoolingSAFlow != -999.0) { @@ -5744,7 +5730,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for Cooling Fraction of Autosized Cooling Supply Air Flow Rate."); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_CoolingSAFMethod, "FlowPerCoolingCapacity")) { + } else if (Util::SameString(loc_m_CoolingSAFMethod, "FlowPerCoolingCapacity")) { this->m_CoolingSAFMethod = DataSizing::FlowPerCoolingCapacity; if (loc_m_CoolingSAFMethod_FlowPerCoolingCapacity != -999.0) { @@ -5774,7 +5760,7 @@ namespace UnitarySystems { errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_CoolingSAFMethod, "None") || loc_m_CoolingSAFMethod == "") { + } else if (Util::SameString(loc_m_CoolingSAFMethod, "None") || loc_m_CoolingSAFMethod == "") { this->m_CoolingSAFMethod = DataSizing::None; if (this->m_CoolCoilExists && this->m_MaxCoolAirVolFlow == 0) { ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); @@ -5788,7 +5774,7 @@ namespace UnitarySystems { } // Determine supply air flow rate sizing method for heating mode - if (UtilityRoutines::SameString(loc_m_HeatingSAFMethod, "SupplyAirFlowRate")) { + if (Util::SameString(loc_m_HeatingSAFMethod, "SupplyAirFlowRate")) { this->m_HeatingSAFMethod = DataSizing::SupplyAirFlowRate; if (loc_m_HeatingSAFMethod_SAFlow != -999.0) { this->m_MaxHeatAirVolFlow = loc_m_HeatingSAFMethod_SAFlow; @@ -5810,7 +5796,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for Heating Supply Air Flow Rate."); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_HeatingSAFMethod, "FlowPerFloorArea")) { + } else if (Util::SameString(loc_m_HeatingSAFMethod, "FlowPerFloorArea")) { this->m_HeatingSAFMethod = DataSizing::FlowPerFloorArea; if (loc_m_HeatingSAFMethod_SAFlowPerFloorArea != -999.0) { this->m_MaxHeatAirVolFlow = loc_m_HeatingSAFMethod_SAFlowPerFloorArea; @@ -5839,7 +5825,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for Heating Supply Air Flow Rate Per Floor Area."); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_HeatingSAFMethod, "FractionOfAutosizedHeatingValue")) { + } else if (Util::SameString(loc_m_HeatingSAFMethod, "FractionOfAutosizedHeatingValue")) { this->m_HeatingSAFMethod = DataSizing::FractionOfAutosizedHeatingAirflow; if (loc_m_HeatingSAFMethod_FracOfAutosizedHeatingSAFlow != -999.0) { this->m_MaxHeatAirVolFlow = loc_m_HeatingSAFMethod_FracOfAutosizedHeatingSAFlow; @@ -5867,7 +5853,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for Heating Fraction of Autosized Heating Supply Air Flow Rate"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_HeatingSAFMethod, "FlowPerHeatingCapacity")) { + } else if (Util::SameString(loc_m_HeatingSAFMethod, "FlowPerHeatingCapacity")) { this->m_HeatingSAFMethod = DataSizing::FlowPerHeatingCapacity; if (loc_m_HeatingSAFMethod_FlowPerHeatingCapacity != -999.0) { this->m_MaxHeatAirVolFlow = loc_m_HeatingSAFMethod_FlowPerHeatingCapacity; @@ -5895,7 +5881,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for Heating Supply Air Flow Rate Per Unit of Capacity"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_HeatingSAFMethod, "None") || loc_m_HeatingSAFMethod == "") { + } else if (Util::SameString(loc_m_HeatingSAFMethod, "None") || loc_m_HeatingSAFMethod == "") { this->m_HeatingSAFMethod = DataSizing::None; if (this->m_HeatCoilExists && this->m_MaxHeatAirVolFlow == 0) { ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); @@ -5914,7 +5900,7 @@ namespace UnitarySystems { } // Determine supply air flow rate sizing method when cooling or heating is not needed - if (UtilityRoutines::SameString(loc_m_NoCoolHeatSAFMethod, "SupplyAirFlowRate")) { + if (Util::SameString(loc_m_NoCoolHeatSAFMethod, "SupplyAirFlowRate")) { this->m_NoCoolHeatSAFMethod = DataSizing::SupplyAirFlowRate; if (loc_m_NoCoolHeatSAFMethod_SAFlow != -999.0) { this->m_MaxNoCoolHeatAirVolFlow = loc_m_NoCoolHeatSAFMethod_SAFlow; @@ -5935,7 +5921,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for No Load Supply Air Flow Rate"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_NoCoolHeatSAFMethod, "FlowPerFloorArea")) { + } else if (Util::SameString(loc_m_NoCoolHeatSAFMethod, "FlowPerFloorArea")) { this->m_NoCoolHeatSAFMethod = DataSizing::FlowPerFloorArea; if (loc_m_NoCoolHeatSAFMethod_SAFlowPerFloorArea != -999.0) { this->m_MaxNoCoolHeatAirVolFlow = loc_m_NoCoolHeatSAFMethod_SAFlowPerFloorArea; @@ -5963,7 +5949,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for No Load Supply Air Flow Rate Per Floor Area"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_NoCoolHeatSAFMethod, "FractionOfAutosizedCoolingValue")) { + } else if (Util::SameString(loc_m_NoCoolHeatSAFMethod, "FractionOfAutosizedCoolingValue")) { this->m_NoCoolHeatSAFMethod = DataSizing::FractionOfAutosizedCoolingAirflow; if (loc_m_NoCoolHeatSAFMethod_FracOfAutosizedCoolingSAFlow != -999.0) { this->m_MaxNoCoolHeatAirVolFlow = loc_m_NoCoolHeatSAFMethod_FracOfAutosizedCoolingSAFlow; @@ -5992,7 +5978,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_NoCoolHeatSAFMethod, "FractionOfAutosizedHeatingValue")) { + } else if (Util::SameString(loc_m_NoCoolHeatSAFMethod, "FractionOfAutosizedHeatingValue")) { this->m_NoCoolHeatSAFMethod = DataSizing::FractionOfAutosizedHeatingAirflow; if (loc_m_NoCoolHeatSAFMethod_FracOfAutosizedHeatingSAFlow != -999.0) { this->m_MaxNoCoolHeatAirVolFlow = loc_m_NoCoolHeatSAFMethod_FracOfAutosizedHeatingSAFlow; @@ -6021,7 +6007,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_NoCoolHeatSAFMethod, "FlowPerCoolingCapacity")) { + } else if (Util::SameString(loc_m_NoCoolHeatSAFMethod, "FlowPerCoolingCapacity")) { this->m_NoCoolHeatSAFMethod = DataSizing::FlowPerCoolingCapacity; if (loc_m_NoCoolHeatSAFMethod_FlowPerCoolingCapacity != -999.0) { this->m_MaxNoCoolHeatAirVolFlow = loc_m_NoCoolHeatSAFMethod_FlowPerCoolingCapacity; @@ -6049,7 +6035,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_NoCoolHeatSAFMethod, "FlowPerHeatingCapacity")) { + } else if (Util::SameString(loc_m_NoCoolHeatSAFMethod, "FlowPerHeatingCapacity")) { this->m_NoCoolHeatSAFMethod = DataSizing::FlowPerHeatingCapacity; if (loc_m_NoCoolHeatSAFMethod_FlowPerHeatingCapacity != -999.0) { this->m_MaxNoCoolHeatAirVolFlow = loc_m_NoCoolHeatSAFMethod_FlowPerHeatingCapacity; @@ -6077,7 +6063,7 @@ namespace UnitarySystems { ShowContinueError(state, "Blank field not allowed for No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation"); errorsFound = true; } - } else if (UtilityRoutines::SameString(loc_m_NoCoolHeatSAFMethod, "None") || loc_m_NoCoolHeatSAFMethod == "") { + } else if (Util::SameString(loc_m_NoCoolHeatSAFMethod, "None") || loc_m_NoCoolHeatSAFMethod == "") { this->m_NoCoolHeatSAFMethod = DataSizing::None; if (this->m_ControlType == UnitarySysCtrlType::CCMASHRAE) { if (loc_m_NoCoolHeatSAFMethod_SAFlow == -99999.0) { // no load air flow is autosized @@ -7042,11 +7028,10 @@ namespace UnitarySystems { int numCoilSystemDX = 0; for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { - std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - + 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 curren object - if (!UtilityRoutines::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; + if (!Util::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; int sysNum = getUnitarySystemIndex(state, thisObjectName); UnitarySys thisSys; @@ -7063,39 +7048,37 @@ namespace UnitarySystems { thisSys.input_specs.name = thisObjectName; thisSys.input_specs.system_type = cCurrentModuleObject; if (fields.find("availability_schedule_name") != fields.end()) { // not required field - thisSys.input_specs.availability_schedule_name = - UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); + thisSys.input_specs.availability_schedule_name = Util::makeUPPER(fields.at("availability_schedule_name").get()); } thisSys.input_specs.air_inlet_node_name = - UtilityRoutines::makeUPPER(fields.at("dx_cooling_coil_system_inlet_node_name").get()); // required field + Util::makeUPPER(fields.at("dx_cooling_coil_system_inlet_node_name").get()); // required field thisSys.input_specs.air_outlet_node_name = - UtilityRoutines::makeUPPER(fields.at("dx_cooling_coil_system_outlet_node_name").get()); // required field + Util::makeUPPER(fields.at("dx_cooling_coil_system_outlet_node_name").get()); // required field thisSys.input_specs.dx_cooling_coil_system_sensor_node_name = - UtilityRoutines::makeUPPER(fields.at("dx_cooling_coil_system_sensor_node_name").get()); // required field + Util::makeUPPER(fields.at("dx_cooling_coil_system_sensor_node_name").get()); // required field thisSys.input_specs.cooling_coil_object_type = - UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); // required field - thisSys.input_specs.cooling_coil_name = - UtilityRoutines::makeUPPER(fields.at("cooling_coil_name").get()); // required field + Util::makeUPPER(fields.at("cooling_coil_object_type").get()); // required field + thisSys.input_specs.cooling_coil_name = Util::makeUPPER(fields.at("cooling_coil_name").get()); // required field // min-fields = 7, begin optional inputs if (fields.find("dehumidification_control_type") != fields.end()) { // not required field thisSys.input_specs.dehumidification_control_type = - UtilityRoutines::makeUPPER(fields.at("dehumidification_control_type").get()); + Util::makeUPPER(fields.at("dehumidification_control_type").get()); } else { // find default value thisSys.input_specs.dehumidification_control_type = "None"; } std::string loc_RunOnSensLoad(""); if (fields.find("run_on_sensible_load") != fields.end()) { // not required field - loc_RunOnSensLoad = UtilityRoutines::makeUPPER(fields.at("run_on_sensible_load").get()); + loc_RunOnSensLoad = Util::makeUPPER(fields.at("run_on_sensible_load").get()); } else { // find default value loc_RunOnSensLoad = "YES"; } std::string loc_RunOnLatLoad(""); if (fields.find("run_on_latent_load") != fields.end()) { // not required field - loc_RunOnLatLoad = UtilityRoutines::makeUPPER(fields.at("run_on_latent_load").get()); + loc_RunOnLatLoad = Util::makeUPPER(fields.at("run_on_latent_load").get()); } else { // find default value loc_RunOnLatLoad = "NO"; @@ -7110,8 +7093,7 @@ namespace UnitarySystems { } if (fields.find("use_outdoor_air_dx_cooling_coil") != fields.end()) { // not required field - thisSys.input_specs.use_doas_dx_cooling_coil = - UtilityRoutines::makeUPPER(fields.at("use_outdoor_air_dx_cooling_coil").get()); + thisSys.input_specs.use_doas_dx_cooling_coil = Util::makeUPPER(fields.at("use_outdoor_air_dx_cooling_coil").get()); } else { // find default value thisSys.input_specs.use_doas_dx_cooling_coil = "NO"; @@ -7173,11 +7155,10 @@ namespace UnitarySystems { auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { - std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - + 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 curren object - if (!UtilityRoutines::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; + if (!Util::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; int sysNum = getUnitarySystemIndex(state, thisObjectName); UnitarySys thisSys; @@ -7341,9 +7322,8 @@ namespace UnitarySystems { for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - - if (!UtilityRoutines::SameString(CoilSysName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; + std::string const &thisObjectName = Util::makeUPPER(instance.key()); + if (!Util::SameString(CoilSysName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; int sysNum = getUnitarySystemIndex(state, thisObjectName); UnitarySys thisSys; @@ -7358,20 +7338,20 @@ namespace UnitarySystems { thisSys.input_specs.name = thisObjectName; thisSys.input_specs.system_type = cCurrentModuleObject; thisSys.input_specs.control_type = "Setpoint"; - thisSys.input_specs.air_inlet_node_name = UtilityRoutines::makeUPPER(fields.at("air_inlet_node_name").get()); - thisSys.input_specs.air_outlet_node_name = UtilityRoutines::makeUPPER(fields.at("air_outlet_node_name").get()); + thisSys.input_specs.air_inlet_node_name = Util::makeUPPER(fields.at("air_inlet_node_name").get()); + thisSys.input_specs.air_outlet_node_name = Util::makeUPPER(fields.at("air_outlet_node_name").get()); std::string availScheduleName(""); if (fields.find("availability_schedule_name") != fields.end()) { // not required field, has default value of Always On - availScheduleName = UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); + availScheduleName = Util::makeUPPER(fields.at("availability_schedule_name").get()); } thisSys.input_specs.availability_schedule_name = availScheduleName; - thisSys.input_specs.cooling_coil_object_type = UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); - thisSys.input_specs.cooling_coil_name = UtilityRoutines::makeUPPER(fields.at("cooling_coil_name").get()); + thisSys.input_specs.cooling_coil_object_type = Util::makeUPPER(fields.at("cooling_coil_object_type").get()); + thisSys.input_specs.cooling_coil_name = Util::makeUPPER(fields.at("cooling_coil_name").get()); // 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 (UtilityRoutines::SameString(loc_cooling_coil_object_type, thisSys.input_specs.cooling_coil_object_type)) { - thisSys.input_specs.cooling_supply_air_flow_rate_method = UtilityRoutines::makeUPPER("SupplyAirFlowRate"); + if (Util::SameString(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; } // optional input fields @@ -7380,18 +7360,18 @@ namespace UnitarySystems { } if (fields.find("dehumidification_control_type") != fields.end()) { thisSys.input_specs.dehumidification_control_type = - UtilityRoutines::makeUPPER(fields.at("dehumidification_control_type").get()); + Util::makeUPPER(fields.at("dehumidification_control_type").get()); } else { thisSys.input_specs.dehumidification_control_type = "None"; } bool runOnSensibleLoad = true; if (fields.find("run_on_sensible_load") != fields.end()) { - runOnSensibleLoad = UtilityRoutines::SameString(fields.at("run_on_sensible_load").get(), "YES"); + runOnSensibleLoad = Util::SameString(fields.at("run_on_sensible_load").get(), "YES"); } bool runOnLatentLoad = false; if (fields.find("run_on_latent_load") != fields.end()) { - runOnLatentLoad = UtilityRoutines::SameString(fields.at("run_on_latent_load").get(), "YES"); + runOnLatentLoad = Util::SameString(fields.at("run_on_latent_load").get(), "YES"); } if (runOnSensibleLoad && !runOnLatentLoad) { @@ -7417,7 +7397,7 @@ namespace UnitarySystems { thisSys.m_minWaterLoopTempForHR = fields.at("minimum_water_loop_temperature_for_heat_recovery").get(); } if (fields.find("economizer_lockout") != fields.end()) { // duplicate above as default - bool econoFlag = UtilityRoutines::SameString(fields.at("economizer_lockout").get(), "YES"); + bool econoFlag = Util::SameString(fields.at("economizer_lockout").get(), "YES"); if (econoFlag) { thisSys.m_waterSideEconomizerFlag = true; } @@ -7426,7 +7406,7 @@ namespace UnitarySystems { } std::string HRWaterCoolingCoilName; if (fields.find("companion_coil_used_for_heat_recovery") != fields.end()) { - HRWaterCoolingCoilName = UtilityRoutines::makeUPPER(fields.at("companion_coil_used_for_heat_recovery").get()); + HRWaterCoolingCoilName = Util::makeUPPER(fields.at("companion_coil_used_for_heat_recovery").get()); thisSys.m_WaterHRPlantLoopModel = true; } if (thisSys.m_WaterHRPlantLoopModel) { @@ -7435,8 +7415,7 @@ namespace UnitarySystems { thisSys.m_HRcoolCoilAirInNode = WaterCoils::GetCoilInletNode(state, HRcoolingCoilType, HRWaterCoolingCoilName, errFound); thisSys.m_HRcoolCoilFluidInletNode = WaterCoils::GetCoilWaterInletNode(state, HRcoolingCoilType, HRWaterCoolingCoilName, errFound); - int HRCoilIndex = - WaterCoils::GetWaterCoilIndex(state, UtilityRoutines::makeUPPER(HRcoolingCoilType), HRWaterCoolingCoilName, errFound); + int HRCoilIndex = WaterCoils::GetWaterCoilIndex(state, Util::makeUPPER(HRcoolingCoilType), HRWaterCoolingCoilName, errFound); bool heatRecoveryCoil = true; // use local here to highlight where this parameter is set WaterCoils::SetWaterCoilData(state, HRCoilIndex, errFound, _, _, heatRecoveryCoil); if (errFound) { @@ -7488,10 +7467,10 @@ namespace UnitarySystems { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { - std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + 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 curren object - if (!UtilityRoutines::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; + if (!Util::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; int sysNum = getUnitarySystemIndex(state, thisObjectName); UnitarySys thisSys; @@ -7513,57 +7492,52 @@ namespace UnitarySystems { thisSys.input_specs.control_type = fields.at("control_type").get(); if (fields.find("controlling_zone_or_thermostat_location") != fields.end()) { // not required field thisSys.input_specs.controlling_zone_or_thermostat_location = - UtilityRoutines::makeUPPER(fields.at("controlling_zone_or_thermostat_location").get()); + Util::makeUPPER(fields.at("controlling_zone_or_thermostat_location").get()); } if (fields.find("dehumidification_control_type") != fields.end()) { // not required field, has default thisSys.input_specs.dehumidification_control_type = - UtilityRoutines::makeUPPER(fields.at("dehumidification_control_type").get()); + Util::makeUPPER(fields.at("dehumidification_control_type").get()); } else { thisSys.input_specs.dehumidification_control_type = "NONE"; // default value } if (fields.find("availability_schedule_name") != fields.end()) { // not required field - thisSys.input_specs.availability_schedule_name = - UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); + thisSys.input_specs.availability_schedule_name = Util::makeUPPER(fields.at("availability_schedule_name").get()); } - thisSys.input_specs.air_inlet_node_name = UtilityRoutines::makeUPPER(fields.at("air_inlet_node_name").get()); // required - thisSys.input_specs.air_outlet_node_name = - UtilityRoutines::makeUPPER(fields.at("air_outlet_node_name").get()); // required - if (fields.find("supply_fan_object_type") != fields.end()) { // not required field - thisSys.input_specs.supply_fan_object_type = UtilityRoutines::makeUPPER(fields.at("supply_fan_object_type").get()); + thisSys.input_specs.air_inlet_node_name = Util::makeUPPER(fields.at("air_inlet_node_name").get()); // required + thisSys.input_specs.air_outlet_node_name = Util::makeUPPER(fields.at("air_outlet_node_name").get()); // required + if (fields.find("supply_fan_object_type") != fields.end()) { // not required field + thisSys.input_specs.supply_fan_object_type = Util::makeUPPER(fields.at("supply_fan_object_type").get()); } if (fields.find("supply_fan_name") != fields.end()) { // not required field - thisSys.input_specs.supply_fan_name = UtilityRoutines::makeUPPER(fields.at("supply_fan_name").get()); + thisSys.input_specs.supply_fan_name = Util::makeUPPER(fields.at("supply_fan_name").get()); } if (fields.find("fan_placement") != fields.end()) { // not required field - thisSys.input_specs.fan_placement = UtilityRoutines::makeUPPER(fields.at("fan_placement").get()); + thisSys.input_specs.fan_placement = Util::makeUPPER(fields.at("fan_placement").get()); } if (fields.find("supply_air_fan_operating_mode_schedule_name") != fields.end()) { // not required field thisSys.input_specs.supply_air_fan_operating_mode_schedule_name = - UtilityRoutines::makeUPPER(fields.at("supply_air_fan_operating_mode_schedule_name").get()); + Util::makeUPPER(fields.at("supply_air_fan_operating_mode_schedule_name").get()); } if (fields.find("heating_coil_object_type") != fields.end()) { // not required field - thisSys.input_specs.heating_coil_object_type = - UtilityRoutines::makeUPPER(fields.at("heating_coil_object_type").get()); + thisSys.input_specs.heating_coil_object_type = Util::makeUPPER(fields.at("heating_coil_object_type").get()); thisSys.m_HeatCoilExists = true; } if (fields.find("heating_coil_name") != fields.end()) { // not required field - thisSys.input_specs.heating_coil_name = UtilityRoutines::makeUPPER(fields.at("heating_coil_name").get()); + thisSys.input_specs.heating_coil_name = Util::makeUPPER(fields.at("heating_coil_name").get()); } if (fields.find("dx_heating_coil_sizing_ratio") != fields.end()) { // not required field, has default thisSys.input_specs.dx_heating_coil_sizing_ratio = fields.at("dx_heating_coil_sizing_ratio").get(); } if (fields.find("cooling_coil_object_type") != fields.end()) { // not required field - thisSys.input_specs.cooling_coil_object_type = - UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); + thisSys.input_specs.cooling_coil_object_type = Util::makeUPPER(fields.at("cooling_coil_object_type").get()); thisSys.m_CoolCoilExists = true; } if (fields.find("cooling_coil_name") != fields.end()) { // not required field - thisSys.input_specs.cooling_coil_name = UtilityRoutines::makeUPPER(fields.at("cooling_coil_name").get()); + thisSys.input_specs.cooling_coil_name = Util::makeUPPER(fields.at("cooling_coil_name").get()); } if (fields.find("use_doas_dx_cooling_coil") != fields.end()) { // not required field, has default - thisSys.input_specs.use_doas_dx_cooling_coil = - UtilityRoutines::makeUPPER(fields.at("use_doas_dx_cooling_coil").get()); + thisSys.input_specs.use_doas_dx_cooling_coil = Util::makeUPPER(fields.at("use_doas_dx_cooling_coil").get()); } else { thisSys.input_specs.use_doas_dx_cooling_coil = "No"; } @@ -7576,21 +7550,21 @@ namespace UnitarySystems { } } if (fields.find("latent_load_control") != fields.end()) { // not required field, has default - thisSys.input_specs.latent_load_control = UtilityRoutines::makeUPPER(fields.at("latent_load_control").get()); + thisSys.input_specs.latent_load_control = Util::makeUPPER(fields.at("latent_load_control").get()); } else { thisSys.input_specs.latent_load_control = "SensibleOnlyLoadControl"; } if (fields.find("supplemental_heating_coil_object_type") != fields.end()) { // not required field thisSys.input_specs.supplemental_heating_coil_object_type = - UtilityRoutines::makeUPPER(fields.at("supplemental_heating_coil_object_type").get()); + Util::makeUPPER(fields.at("supplemental_heating_coil_object_type").get()); } if (fields.find("supplemental_heating_coil_name") != fields.end()) { // not required field thisSys.input_specs.supplemental_heating_coil_name = - UtilityRoutines::makeUPPER(fields.at("supplemental_heating_coil_name").get()); + Util::makeUPPER(fields.at("supplemental_heating_coil_name").get()); } if (fields.find("cooling_supply_air_flow_rate_method") != fields.end()) { // not required field thisSys.input_specs.cooling_supply_air_flow_rate_method = - UtilityRoutines::makeUPPER(fields.at("cooling_supply_air_flow_rate_method").get()); + Util::makeUPPER(fields.at("cooling_supply_air_flow_rate_method").get()); } if (fields.find("cooling_supply_air_flow_rate") != fields.end()) { // not required field, autosizable auto const &tempFieldVal = fields.at("cooling_supply_air_flow_rate"); @@ -7614,7 +7588,7 @@ namespace UnitarySystems { } if (fields.find("heating_supply_air_flow_rate_method") != fields.end()) { // not required field thisSys.input_specs.heating_supply_air_flow_rate_method = - UtilityRoutines::makeUPPER(fields.at("heating_supply_air_flow_rate_method").get()); + Util::makeUPPER(fields.at("heating_supply_air_flow_rate_method").get()); } if (fields.find("heating_supply_air_flow_rate") != fields.end()) { // not required field auto const &tempFieldVal = fields.at("heating_supply_air_flow_rate"); @@ -7638,7 +7612,7 @@ namespace UnitarySystems { } if (fields.find("no_load_supply_air_flow_rate_method") != fields.end()) { // not required field thisSys.input_specs.no_load_supply_air_flow_rate_method = - UtilityRoutines::makeUPPER(fields.at("no_load_supply_air_flow_rate_method").get()); + Util::makeUPPER(fields.at("no_load_supply_air_flow_rate_method").get()); } if (fields.find("no_load_supply_air_flow_rate") != fields.end()) { // not required field auto const &tempFieldVal = fields.at("no_load_supply_air_flow_rate"); @@ -7683,7 +7657,7 @@ namespace UnitarySystems { } if (fields.find("outdoor_dry_bulb_temperature_sensor_node_name") != fields.end()) { // not required field thisSys.input_specs.outdoor_dry_bulb_temperature_sensor_node_name = - UtilityRoutines::makeUPPER(fields.at("outdoor_dry_bulb_temperature_sensor_node_name").get()); + Util::makeUPPER(fields.at("outdoor_dry_bulb_temperature_sensor_node_name").get()); } if (fields.find("ancillary_on_cycle_electric_power") != fields.end()) { // not required field, has default thisSys.input_specs.ancillary_on_cycle_electric_power = fields.at("ancillary_on_cycle_electric_power").get(); @@ -7699,19 +7673,19 @@ namespace UnitarySystems { } if (fields.find("heat_recovery_water_inlet_node_name") != fields.end()) { // not required field thisSys.input_specs.heat_recovery_water_inlet_node_name = - UtilityRoutines::makeUPPER(fields.at("heat_recovery_water_inlet_node_name").get()); + Util::makeUPPER(fields.at("heat_recovery_water_inlet_node_name").get()); } if (fields.find("heat_recovery_water_outlet_node_name") != fields.end()) { // not required field thisSys.input_specs.heat_recovery_water_outlet_node_name = - UtilityRoutines::makeUPPER(fields.at("heat_recovery_water_outlet_node_name").get()); + Util::makeUPPER(fields.at("heat_recovery_water_outlet_node_name").get()); } if (fields.find("design_specification_multispeed_object_type") != fields.end()) { // not required field thisSys.input_specs.design_specification_multispeed_object_type = - UtilityRoutines::makeUPPER(fields.at("design_specification_multispeed_object_type").get()); + Util::makeUPPER(fields.at("design_specification_multispeed_object_type").get()); } if (fields.find("design_specification_multispeed_object_name") != fields.end()) { // not required field thisSys.input_specs.design_specification_multispeed_object_name = - UtilityRoutines::makeUPPER(fields.at("design_specification_multispeed_object_name").get()); + Util::makeUPPER(fields.at("design_specification_multispeed_object_name").get()); } thisSys.processInputSpec(state, thisSys.input_specs, sysNum, errorsFound, ZoneEquipment, ZoneOAUnitNum); @@ -16776,7 +16750,7 @@ namespace UnitarySystems { if (state.dataUnitarySystems->numUnitarySystems > 0) { bool UnitarySysFound = false; for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (UtilityRoutines::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { if (state.dataUnitarySystems->unitarySys[UnitarySysNum].m_ThisSysInputShouldBeGotten) getUnitarySystemInput(state, UnitarySysName, false, ZoneOAUnitNum); if (state.dataUnitarySystems->unitarySys[UnitarySysNum].m_ISHundredPercentDOASDXCoil) { @@ -16820,7 +16794,7 @@ namespace UnitarySystems { } for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (UtilityRoutines::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { if (state.dataUnitarySystems->unitarySys[UnitarySysNum].m_ThisSysInputShouldBeGotten) getUnitarySystemInput(state, UnitarySysName, false, ZoneOAUnitNum); if (state.dataUnitarySystems->unitarySys[UnitarySysNum].m_CoolCoilExists && @@ -16844,7 +16818,7 @@ namespace UnitarySystems { } int airNode = 0; for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (UtilityRoutines::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { airNode = this->AirInNode; break; } @@ -16861,7 +16835,7 @@ namespace UnitarySystems { } int airNode = 0; for (int UnitarySysNum = 0; UnitarySysNum < state.dataUnitarySystems->numUnitarySystems; ++UnitarySysNum) { - if (UtilityRoutines::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { + if (Util::SameString(UnitarySysName, state.dataUnitarySystems->unitarySys[UnitarySysNum].Name)) { airNode = this->AirOutNode; break; } @@ -16977,8 +16951,8 @@ namespace UnitarySystems { ++CompNum) { if (compTypeToFind != state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).CompType_Num) continue; - if (UtilityRoutines::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name, - objectNameToFind)) { + if (Util::SameString(state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name, + objectNameToFind)) { compIndex = CompNum; branchIndex = BranchNum; airLoopIndex = AirLoopNum; diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index 67b68a69d01..1250ce0138b 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -236,7 +236,7 @@ namespace UserDefinedComponents { // Find the correct Equipment if (CompIndex == 0) { - CompNum = UtilityRoutines::FindItemInList(EquipName, state.dataUserDefinedComponents->UserCoil); + CompNum = Util::FindItemInList(EquipName, state.dataUserDefinedComponents->UserCoil); if (CompNum == 0) { ShowFatalError(state, "SimUserDefinedPlantComponent: User Defined Coil not found"); } @@ -341,7 +341,7 @@ namespace UserDefinedComponents { // Find the correct Equipment if (CompIndex == 0) { - CompNum = UtilityRoutines::FindItemInList(CompName, state.dataUserDefinedComponents->UserZoneAirHVAC); + CompNum = Util::FindItemInList(CompName, state.dataUserDefinedComponents->UserZoneAirHVAC); if (CompNum == 0) { ShowFatalError(state, "SimUserDefinedPlantComponent: User Defined Coil not found"); } @@ -457,7 +457,7 @@ namespace UserDefinedComponents { // Find the correct Equipment if (CompIndex == 0) { - CompNum = UtilityRoutines::FindItemInList(CompName, state.dataUserDefinedComponents->UserAirTerminal); + CompNum = Util::FindItemInList(CompName, state.dataUserDefinedComponents->UserAirTerminal); if (CompNum == 0) { ShowFatalError(state, "SimUserDefinedPlantComponent: User Defined Coil not found"); } @@ -570,13 +570,13 @@ namespace UserDefinedComponents { lAlphaFieldBlanks, cAlphaFieldNames, _); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataUserDefinedComponents->UserPlantComp(CompLoop).Name = cAlphaArgs(1); // now get program manager for model simulations if (!lAlphaFieldBlanks(2)) { - int StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserPlantComp(CompLoop).ErlSimProgramMngr = StackMngrNum; } else { @@ -627,7 +627,7 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed = static_cast( - getEnumValue(DataPlant::HowMetTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(aArgCount + 2)))); + getEnumValue(DataPlant::HowMetTypeNamesUC, Util::makeUPPER(cAlphaArgs(aArgCount + 2)))); if (state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed == DataPlant::HowMet::ByNominalCapLowOutLimit) { // actuator for low out limit @@ -654,13 +654,12 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).FlowPriority = static_cast( - getEnumValue(DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(aArgCount + 3)))); + getEnumValue(DataPlant::LoopFlowStatusTypeNamesUC, Util::makeUPPER(cAlphaArgs(aArgCount + 3)))); } // find program manager for initial setup, begin environment and sizing of this plant connection if (!lAlphaFieldBlanks(aArgCount + 4)) { - int StackMngrNum = - UtilityRoutines::FindItemInList(cAlphaArgs(aArgCount + 4), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(aArgCount + 4), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).ErlInitProgramMngr = StackMngrNum; } else { @@ -678,8 +677,7 @@ namespace UserDefinedComponents { // find program to call for model simulations for just this plant connection if (!lAlphaFieldBlanks(aArgCount + 5)) { - int StackMngrNum = - UtilityRoutines::FindItemInList(cAlphaArgs(aArgCount + 5), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(aArgCount + 5), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).ErlSimProgramMngr = StackMngrNum; } else { @@ -898,7 +896,7 @@ namespace UserDefinedComponents { if (!lAlphaFieldBlanks(31)) { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Zone.ZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(31), state.dataHeatBal->Zone); + Util::FindItemInList(cAlphaArgs(31), state.dataHeatBal->Zone); if (state.dataUserDefinedComponents->UserPlantComp(CompLoop).Zone.ZoneNum == 0) { ShowSevereError(state, format("{} = {}: Ambient Zone Name not found = {}", cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(31))); @@ -1016,7 +1014,7 @@ namespace UserDefinedComponents { lAlphaFieldBlanks, cAlphaFieldNames, _); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueCoilName(state, cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); @@ -1025,7 +1023,7 @@ namespace UserDefinedComponents { // now get program manager for model simulations if (!lAlphaFieldBlanks(2)) { - int StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserCoil(CompLoop).ErlSimProgramMngr = StackMngrNum; } else { @@ -1042,7 +1040,7 @@ namespace UserDefinedComponents { // now get program manager for model initializations if (!lAlphaFieldBlanks(3)) { - int StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserCoil(CompLoop).ErlInitProgramMngr = StackMngrNum; } else { @@ -1279,7 +1277,7 @@ namespace UserDefinedComponents { if (!lAlphaFieldBlanks(13)) { state.dataUserDefinedComponents->UserCoil(CompLoop).Zone.ZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(13), state.dataHeatBal->Zone); + Util::FindItemInList(cAlphaArgs(13), state.dataHeatBal->Zone); if (state.dataUserDefinedComponents->UserCoil(CompLoop).Zone.ZoneNum == 0) { ShowSevereError( state, format("{} = {}: Ambient Zone Name not found = {}", cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(13))); @@ -1409,12 +1407,12 @@ namespace UserDefinedComponents { lAlphaFieldBlanks, cAlphaFieldNames, _); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataUserDefinedComponents->UserZoneAirHVAC(CompLoop).Name = cAlphaArgs(1); // now get program manager for model simulations if (!lAlphaFieldBlanks(2)) { - int StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserZoneAirHVAC(CompLoop).ErlSimProgramMngr = StackMngrNum; } else { @@ -1431,7 +1429,7 @@ namespace UserDefinedComponents { // now get program manager for model initializations if (!lAlphaFieldBlanks(3)) { - int StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserZoneAirHVAC(CompLoop).ErlInitProgramMngr = StackMngrNum; } else { @@ -1754,7 +1752,7 @@ namespace UserDefinedComponents { if (!lAlphaFieldBlanks(16)) { state.dataUserDefinedComponents->UserZoneAirHVAC(CompLoop).Zone.ZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(16), state.dataHeatBal->Zone); + Util::FindItemInList(cAlphaArgs(16), state.dataHeatBal->Zone); if (state.dataUserDefinedComponents->UserZoneAirHVAC(CompLoop).Zone.ZoneNum == 0) { ShowSevereError(state, format("{} = {}: Ambient Zone Name not found = {}", cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(16))); @@ -1858,12 +1856,12 @@ namespace UserDefinedComponents { lAlphaFieldBlanks, cAlphaFieldNames, _); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataUserDefinedComponents->UserAirTerminal(CompLoop).Name = cAlphaArgs(1); // now get program manager for model simulations if (!lAlphaFieldBlanks(2)) { - int StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserAirTerminal(CompLoop).ErlSimProgramMngr = StackMngrNum; } else { @@ -1880,7 +1878,7 @@ namespace UserDefinedComponents { // now get program manager for model initializations if (!lAlphaFieldBlanks(3)) { - int StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); + int StackMngrNum = Util::FindItemInList(cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it state.dataUserDefinedComponents->UserAirTerminal(CompLoop).ErlInitProgramMngr = StackMngrNum; } else { @@ -2260,7 +2258,7 @@ namespace UserDefinedComponents { if (!lAlphaFieldBlanks(14)) { state.dataUserDefinedComponents->UserAirTerminal(CompLoop).Zone.ZoneNum = - UtilityRoutines::FindItemInList(cAlphaArgs(14), state.dataHeatBal->Zone); + Util::FindItemInList(cAlphaArgs(14), state.dataHeatBal->Zone); if (state.dataUserDefinedComponents->UserAirTerminal(CompLoop).Zone.ZoneNum == 0) { ShowSevereError(state, format("{} = {}: Ambient Zone Name not found = {}", cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(14))); @@ -2862,7 +2860,7 @@ namespace UserDefinedComponents { } if (state.dataUserDefinedComponents->NumUserCoils > 0) { - CoilIndex = UtilityRoutines::FindItem(CoilName, state.dataUserDefinedComponents->UserCoil, state.dataUserDefinedComponents->NumUserCoils); + CoilIndex = Util::FindItem(CoilName, state.dataUserDefinedComponents->UserCoil, state.dataUserDefinedComponents->NumUserCoils); } else { CoilIndex = 0; } @@ -2896,7 +2894,7 @@ namespace UserDefinedComponents { } if (state.dataUserDefinedComponents->NumUserCoils > 0) { - CoilIndex = UtilityRoutines::FindItem(CoilName, state.dataUserDefinedComponents->UserCoil, state.dataUserDefinedComponents->NumUserCoils); + CoilIndex = Util::FindItem(CoilName, state.dataUserDefinedComponents->UserCoil, state.dataUserDefinedComponents->NumUserCoils); } else { CoilIndex = 0; } @@ -2933,7 +2931,7 @@ namespace UserDefinedComponents { } if (state.dataUserDefinedComponents->NumUserCoils > 0) { - CoilIndex = UtilityRoutines::FindItem(CoilName, state.dataUserDefinedComponents->UserCoil, state.dataUserDefinedComponents->NumUserCoils); + CoilIndex = Util::FindItem(CoilName, state.dataUserDefinedComponents->UserCoil, state.dataUserDefinedComponents->NumUserCoils); } else { CoilIndex = 0; } diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index 660a5c9169e..5ce44d01e08 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -93,7 +93,7 @@ extern "C" { namespace EnergyPlus { -namespace UtilityRoutines { +namespace Util { Real64 ProcessNumber(std::string_view String, bool &ErrorFlag) { @@ -273,7 +273,7 @@ namespace UtilityRoutines { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int FindItem = UtilityRoutines::FindItemInList(String, ListOfItems, NumItems); + int FindItem = Util::FindItemInList(String, ListOfItems, NumItems); if (FindItem != 0) return FindItem; for (int Count = 1; Count <= NumItems; ++Count) { @@ -298,7 +298,7 @@ namespace UtilityRoutines { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int FindItem = UtilityRoutines::FindItemInList(String, ListOfItems, NumItems); + int FindItem = Util::FindItemInList(String, ListOfItems, NumItems); if (FindItem != 0) return FindItem; for (int Count = 1; Count <= NumItems; ++Count) { @@ -485,7 +485,7 @@ namespace UtilityRoutines { return calctime; } -} // namespace UtilityRoutines +} // namespace Util int AbortEnergyPlus(EnergyPlusData &state) { @@ -587,7 +587,7 @@ int AbortEnergyPlus(EnergyPlusData &state) NumSevereDuringSizing = fmt::to_string(state.dataErrTracking->TotalSevereErrorsDuringSizing); // catch up with timings if in middle - state.dataSysVars->Time_Finish = UtilityRoutines::epElapsedTime(); + state.dataSysVars->Time_Finish = Util::epElapsedTime(); if (state.dataSysVars->Time_Finish < state.dataSysVars->Time_Start) state.dataSysVars->Time_Finish += 24.0 * 3600.0; state.dataSysVars->Elapsed_Time = state.dataSysVars->Time_Finish - state.dataSysVars->Time_Start; if (state.dataSysVars->Elapsed_Time < 0.0) state.dataSysVars->Elapsed_Time = 0.0; @@ -727,11 +727,11 @@ int EndEnergyPlus(EnergyPlusData &state) NumSevereDuringSizing = fmt::to_string(state.dataErrTracking->TotalSevereErrorsDuringSizing); strip(NumSevereDuringSizing); - state.dataSysVars->Time_Finish = UtilityRoutines::epElapsedTime(); + state.dataSysVars->Time_Finish = Util::epElapsedTime(); if (state.dataSysVars->Time_Finish < state.dataSysVars->Time_Start) state.dataSysVars->Time_Finish += 24.0 * 3600.0; state.dataSysVars->Elapsed_Time = state.dataSysVars->Time_Finish - state.dataSysVars->Time_Start; if (state.dataGlobal->createPerfLog) { - UtilityRoutines::appendPerfLog(state, "Run Time [seconds]", format("{:.2R}", state.dataSysVars->Elapsed_Time)); + Util::appendPerfLog(state, "Run Time [seconds]", format("{:.2R}", state.dataSysVars->Elapsed_Time)); } Hours = state.dataSysVars->Elapsed_Time / 3600.0; state.dataSysVars->Elapsed_Time -= Hours * 3600.0; @@ -747,9 +747,9 @@ int EndEnergyPlus(EnergyPlusData &state) state.dataResultsFramework->resultsFramework->SimulationInformation.setNumErrorsSummary(NumWarnings, NumSevere); if (state.dataGlobal->createPerfLog) { - UtilityRoutines::appendPerfLog(state, "Run Time [string]", Elapsed); - UtilityRoutines::appendPerfLog(state, "Number of Warnings", NumWarnings); - UtilityRoutines::appendPerfLog(state, "Number of Severe", NumSevere, true); // last item so write the perfLog file + Util::appendPerfLog(state, "Run Time [string]", Elapsed); + Util::appendPerfLog(state, "Number of Warnings", NumWarnings); + Util::appendPerfLog(state, "Number of Severe", NumSevere, true); // last item so write the perfLog file } ShowMessage( state, @@ -1267,7 +1267,7 @@ void ShowRecurringSevereErrorAtEnd(EnergyPlusData &state, } bool bNewMessageFound = true; for (int Loop = 1; Loop <= state.dataErrTracking->NumRecurringErrors; ++Loop) { - if (UtilityRoutines::SameString(state.dataErrTracking->RecurringErrors(Loop).Message, " ** Severe ** " + Message)) { + if (Util::SameString(state.dataErrTracking->RecurringErrors(Loop).Message, " ** Severe ** " + Message)) { bNewMessageFound = false; MsgIndex = Loop; break; @@ -1322,7 +1322,7 @@ void ShowRecurringWarningErrorAtEnd(EnergyPlusData &state, } bool bNewMessageFound = true; for (int Loop = 1; Loop <= state.dataErrTracking->NumRecurringErrors; ++Loop) { - if (UtilityRoutines::SameString(state.dataErrTracking->RecurringErrors(Loop).Message, " ** Warning ** " + Message)) { + if (Util::SameString(state.dataErrTracking->RecurringErrors(Loop).Message, " ** Warning ** " + Message)) { bNewMessageFound = false; MsgIndex = Loop; break; @@ -1377,7 +1377,7 @@ void ShowRecurringContinueErrorAtEnd(EnergyPlusData &state, } bool bNewMessageFound = true; for (int Loop = 1; Loop <= state.dataErrTracking->NumRecurringErrors; ++Loop) { - if (UtilityRoutines::SameString(state.dataErrTracking->RecurringErrors(Loop).Message, " ** ~~~ ** " + Message)) { + if (Util::SameString(state.dataErrTracking->RecurringErrors(Loop).Message, " ** ~~~ ** " + Message)) { bNewMessageFound = false; MsgIndex = Loop; break; @@ -1648,16 +1648,27 @@ void ShowRecurringErrors(EnergyPlusData &state) } } +void ShowSevereDuplicateName(EnergyPlusData &state, ErrorObjectHeader const &eoh) +{ + ShowSevereError(state, format("{}: {} = {}, duplicate name.", eoh.routineName, eoh.objectType, eoh.objectName)); +} + void ShowSevereItemNotFound(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldVal) { ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); - ShowContinueError(state, format("{} = {}, item not found", fieldName, fieldVal)); + ShowContinueError(state, format("{} = {}, item not found.", fieldName, fieldVal)); } void ShowSevereInvalidKey(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldVal) { ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); - ShowContinueError(state, format("{} = {}, invalid key", fieldName, fieldVal)); + ShowContinueError(state, format("{} = {}, invalid key.", fieldName, fieldVal)); +} + +void ShowSevereInvalidBool(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldVal) +{ + ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); + ShowContinueError(state, format("{} = {}, invalid boolean (\"Yes\"/\"No\").", fieldName, fieldVal)); } void ShowSevereEmptyField( @@ -1668,4 +1679,40 @@ void ShowSevereEmptyField( format("{} cannot be empty{}.", fieldName, depFieldName.empty() ? "" : format(" when {} = {}", depFieldName, depFieldVal))); } +void ShowWarningInvalidKey( + EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldVal, std::string_view defaultVal) +{ + ShowWarningError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); + ShowContinueError(state, format("{} = {}, invalid key, {} will be used.", fieldName, fieldVal, defaultVal)); +} + +void ShowWarningInvalidBool( + EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldVal, std::string_view defaultVal) +{ + ShowWarningError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); + ShowContinueError(state, format("{} = {}, invalid boolean (\"Yes\"/\"No\"), {} will be used.", fieldName, fieldVal, defaultVal)); +} + +void ShowWarningEmptyField(EnergyPlusData &state, + ErrorObjectHeader const &eoh, + std::string_view fieldName, + std::string_view defaultVal, + std::string_view depFieldName, + std::string_view depFieldVal) +{ + ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); + ShowContinueError(state, + format("{} cannot be empty{}, {} will be used.", + fieldName, + depFieldName.empty() ? "" : format(" when {} = {}", depFieldName, depFieldVal), + defaultVal)); +} + +void ShowWarningItemNotFound( + EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldVal, std::string_view defaultVal) +{ + ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); + ShowContinueError(state, format("{} = {}, item not found, {} will be used.", fieldName, fieldVal, defaultVal)); +} + } // namespace EnergyPlus diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index f1cac345051..a566f3dd6f3 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -227,15 +227,38 @@ struct ErrorObjectHeader std::string_view objectName; }; -void ShowSevereItemNotFound(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); -void ShowSevereInvalidKey(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); +// Wrappers for common errors +void ShowSevereDuplicateName(EnergyPlusData &state, ErrorObjectHeader const &eoh); + void ShowSevereEmptyField(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view depFieldName = {}, - std::string_view depFieldVal = {}); + std::string_view depFieldValue = {}); + +void ShowSevereItemNotFound(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); + +void ShowSevereInvalidKey(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); + +void ShowSevereInvalidBool(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); + +void ShowWarningEmptyField(EnergyPlusData &state, + ErrorObjectHeader const &eoh, + std::string_view fieldName, + std::string_view defaultValue, + std::string_view depFieldName = {}, + std::string_view depFieldValue = {}); + +void ShowWarningItemNotFound( + EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue, std::string_view defaultValue); + +void ShowWarningInvalidBool( + EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue, std::string_view defaultValue); + +void ShowWarningInvalidKey( + EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue, std::string_view defaultValue); -namespace UtilityRoutines { +namespace Util { static constexpr std::array MonthNamesCC{ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; @@ -258,7 +281,7 @@ namespace UtilityRoutines { inline int FindItemInList(std::string_view const String, Array1_string const &ListOfItems) { - return UtilityRoutines::FindItemInList(String, ListOfItems, ListOfItems.isize()); + return Util::FindItemInList(String, ListOfItems, ListOfItems.isize()); } int FindItemInList(std::string_view const String, Array1S_string const ListOfItems, int NumItems); @@ -275,7 +298,7 @@ namespace UtilityRoutines { inline int FindItemInList(std::string_view const String, Array1S_string const ListOfItems) { - return UtilityRoutines::FindItemInList(String, ListOfItems, ListOfItems.isize()); + return Util::FindItemInList(String, ListOfItems, ListOfItems.isize()); } template inline int FindItemInList(std::string_view const String, MArray1 const &ListOfItems, int const NumItems) @@ -288,7 +311,7 @@ namespace UtilityRoutines { template inline int FindItemInList(std::string_view const String, MArray1 const &ListOfItems) { - return UtilityRoutines::FindItemInList(String, ListOfItems, ListOfItems.isize()); + return Util::FindItemInList(String, ListOfItems, ListOfItems.isize()); } template ::value>::type> @@ -315,14 +338,14 @@ namespace UtilityRoutines { // Container needs and operator[i] and elements need Name inline int FindItemInPtrList(std::string_view const String, Container const &ListOfItems) { - return UtilityRoutines::FindItemInPtrList(String, ListOfItems, ListOfItems.isize()); + return Util::FindItemInPtrList(String, ListOfItems, ListOfItems.isize()); } template ::value>::type> // Container needs isize() and operator[i] and elements need Name inline int FindItemInList(std::string_view const String, Container const &ListOfItems) { - return UtilityRoutines::FindItemInList(String, ListOfItems, ListOfItems.isize()); + return Util::FindItemInList(String, ListOfItems, ListOfItems.isize()); } template ::value>::type> @@ -340,7 +363,7 @@ namespace UtilityRoutines { // Container needs isize() and operator[i] and value_type inline int FindItemInList(std::string_view const String, Container const &ListOfItems, std::string Container::value_type::*name_p) { - return UtilityRoutines::FindItemInList(String, ListOfItems, name_p, ListOfItems.isize()); + return Util::FindItemInList(String, ListOfItems, name_p, ListOfItems.isize()); } int FindItemInSortedList(std::string_view const string, Array1S_string const ListOfItems, int NumItems); @@ -429,7 +452,7 @@ namespace UtilityRoutines { template inline int FindItem(std::string_view const String, MArray1 const &ListOfItems, int const NumItems) { - int const item_number(UtilityRoutines::FindItemInList(String, ListOfItems, NumItems)); + int const item_number(Util::FindItemInList(String, ListOfItems, NumItems)); if (item_number != 0) return item_number; for (int Count = 1; Count <= NumItems; ++Count) { if (equali(String, ListOfItems(Count))) return Count; @@ -446,7 +469,7 @@ namespace UtilityRoutines { // Container needs size() and operator[i] and elements need Name inline int FindItem(std::string_view const String, Container const &ListOfItems, int const NumItems) { - int const item_number(UtilityRoutines::FindItemInList(String, ListOfItems, NumItems)); + int const item_number(Util::FindItemInList(String, ListOfItems, NumItems)); if (item_number != 0) return item_number; for (typename Container::size_type i = 0, e = NumItems; i < e; ++i) { if (equali(String, ListOfItems[i].Name)) return i + 1; // 1-based return index @@ -465,7 +488,7 @@ namespace UtilityRoutines { // Container needs size() and operator[i] and value_type inline int FindItem(std::string_view const String, Container const &ListOfItems, std::string Container::value_type::*name_p, int const NumItems) { - int const item_number(UtilityRoutines::FindItemInList(String, ListOfItems, name_p, NumItems)); + int const item_number(Util::FindItemInList(String, ListOfItems, name_p, NumItems)); if (item_number != 0) return item_number; for (typename Container::size_type i = 0, e = NumItems; i < e; ++i) { if (equali(String, ListOfItems[i].*name_p)) return i + 1; // 1-based return index @@ -662,7 +685,7 @@ namespace UtilityRoutines { void appendPerfLog(EnergyPlusData &state, std::string const &colHeader, std::string const &colValue, bool finalColumn = false); -} // namespace UtilityRoutines +} // namespace Util constexpr int getEnumValue(const gsl::span sList, const std::string_view s) { diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 9cbb17f7d1b..7f65a7237fa 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -155,7 +155,7 @@ namespace VariableSpeedCoils { } if (CompIndex == 0) { - DXCoilNum = UtilityRoutines::FindItemInList(CompName, state.dataVariableSpeedCoils->VarSpeedCoil); + DXCoilNum = Util::FindItemInList(CompName, state.dataVariableSpeedCoils->VarSpeedCoil); if (DXCoilNum == 0) { ShowFatalError(state, format("WaterToAirHPVSWEquationFit not found={}", CompName)); } @@ -1026,9 +1026,9 @@ namespace VariableSpeedCoils { } } - if ((UtilityRoutines::SameString(AlphArray(6), "AirCooled")) || lAlphaBlanks(6)) { + if ((Util::SameString(AlphArray(6), "AirCooled")) || lAlphaBlanks(6)) { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType = DataHeatBalance::RefrigCondenserType::Air; - } else if (UtilityRoutines::SameString(AlphArray(6), "EvaporativelyCooled")) { + } else if (Util::SameString(AlphArray(6), "EvaporativelyCooled")) { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondenserType = DataHeatBalance::RefrigCondenserType::Evap; state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).ReportEvapCondVars = true; } else { @@ -2091,7 +2091,7 @@ namespace VariableSpeedCoils { cAlphaFields(6)); // Field Name } - if (UtilityRoutines::SameString(AlphArray(7), "ReverseCycle")) { + if (Util::SameString(AlphArray(7), "ReverseCycle")) { if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostEIRFT == 0) { if (lAlphaBlanks(5)) { ShowSevereError(state, @@ -2122,10 +2122,8 @@ namespace VariableSpeedCoils { } } - if (UtilityRoutines::SameString(AlphArray(7), "ReverseCycle")) - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy = ReverseCycle; - if (UtilityRoutines::SameString(AlphArray(7), "Resistive")) - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy = Resistive; + if (Util::SameString(AlphArray(7), "ReverseCycle")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy = ReverseCycle; + if (Util::SameString(AlphArray(7), "Resistive")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy = Resistive; if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostStrategy == 0) { ShowSevereError( state, @@ -2135,9 +2133,8 @@ namespace VariableSpeedCoils { ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(8), "Timed")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl = Timed; - if (UtilityRoutines::SameString(AlphArray(8), "OnDemand")) - state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl = OnDemand; + if (Util::SameString(AlphArray(8), "Timed")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl = Timed; + if (Util::SameString(AlphArray(8), "OnDemand")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl = OnDemand; if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).DefrostControl == 0) { ShowSevereError( state, @@ -2545,9 +2542,9 @@ namespace VariableSpeedCoils { } } - if (UtilityRoutines::SameString(AlphArray(2), "Yes") || UtilityRoutines::SameString(AlphArray(2), "No")) { + if (Util::SameString(AlphArray(2), "Yes") || Util::SameString(AlphArray(2), "No")) { // initialized to TRUE on allocate - if (UtilityRoutines::SameString(AlphArray(2), "No")) + if (Util::SameString(AlphArray(2), "No")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP = false; else state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).FanPowerIncludedInCOP = true; @@ -2560,9 +2557,9 @@ namespace VariableSpeedCoils { ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(3), "Yes") || UtilityRoutines::SameString(AlphArray(3), "No")) { + if (Util::SameString(AlphArray(3), "Yes") || Util::SameString(AlphArray(3), "No")) { // initialized to FALSE on allocate - if (UtilityRoutines::SameString(AlphArray(3), "Yes")) + if (Util::SameString(AlphArray(3), "Yes")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP = true; else state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpPowerInCOP = false; @@ -2575,9 +2572,9 @@ namespace VariableSpeedCoils { ErrorsFound = true; } - if (UtilityRoutines::SameString(AlphArray(4), "Yes") || UtilityRoutines::SameString(AlphArray(4), "No")) { + if (Util::SameString(AlphArray(4), "Yes") || Util::SameString(AlphArray(4), "No")) { // initialized to FALSE on allocate - if (UtilityRoutines::SameString(AlphArray(4), "Yes")) + if (Util::SameString(AlphArray(4), "Yes")) state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity = true; else state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CondPumpHeatInCapacity = false; @@ -2688,9 +2685,9 @@ namespace VariableSpeedCoils { cAlphaFields(9)); // Field Name } - if (UtilityRoutines::SameString(AlphArray(10), "DryBulbTemperature")) { + if (Util::SameString(AlphArray(10), "DryBulbTemperature")) { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirTemperatureType = DryBulbIndicator; - } else if (UtilityRoutines::SameString(AlphArray(10), "WetBulbTemperature")) { + } else if (Util::SameString(AlphArray(10), "WetBulbTemperature")) { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirTemperatureType = WetBulbIndicator; } else { // wrong temperature type selection @@ -7800,17 +7797,16 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || - UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || - UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED") || - UtilityRoutines::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED") || - UtilityRoutines::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + if (Util::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || + Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || + Util::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED") || Util::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED") || + Util::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { + WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { - if (UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || - UtilityRoutines::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED")) { + if (Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || + Util::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED")) { CoilCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedCapHeat; - } else if (UtilityRoutines::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { + } else if (Util::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { CoilCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedCapWH; } else { CoilCapacity = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedCapCoolTotal; @@ -7860,7 +7856,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (IndexNum == 0) { ShowSevereError(state, format("GetCoilIndexVariableSpeed: Could not find CoilType=\"{}\" with Name=\"{}\"", CoilType, CoilName)); @@ -7901,12 +7897,11 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || - UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || - UtilityRoutines::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED") || - UtilityRoutines::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED") || - UtilityRoutines::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + if (Util::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || + Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT") || + Util::SameString(CoilType, "COIL:COOLING:DX:VARIABLESPEED") || Util::SameString(CoilType, "COIL:HEATING:DX:VARIABLESPEED") || + Util::SameString(CoilType, "COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED")) { + WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { // CoilAirFlowRate=VarSpeedCoil(WhichCoil)%RatedAirVolFlowRate if (state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).RatedAirVolFlowRate == AutoSize) { // means autosize @@ -7963,7 +7958,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { PLRNumber = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).PLFFPLR; } @@ -8047,7 +8042,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { NodeNumber = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).AirInletNodeNum; } @@ -8095,7 +8090,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { NodeNumber = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).AirOutletNodeNum; } @@ -8138,7 +8133,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { CondNode = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).CondenserInletNodeNum; } else { @@ -8199,7 +8194,7 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); + WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); if (WhichCoil != 0) { Speeds = state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).NumOfSpeeds; } else { diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index f40e956f1c9..d583c57df30 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -165,7 +165,7 @@ namespace VentilatedSlab { // Find the correct VentilatedSlabInput if (CompIndex == 0) { - Item = UtilityRoutines::FindItemInList(CompName, state.dataVentilatedSlab->VentSlab); + Item = Util::FindItemInList(CompName, state.dataVentilatedSlab->VentSlab); if (Item == 0) { ShowFatalError(state, format("SimVentilatedSlab: system not found={}", CompName)); } @@ -325,7 +325,7 @@ namespace VentilatedSlab { state.dataVentilatedSlab->VentSlabNumericFields(Item).FieldNames.allocate(NumNumbers); state.dataVentilatedSlab->VentSlabNumericFields(Item).FieldNames = cNumericFields; - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound); auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); ventSlab.Name = state.dataIPShortCut->cAlphaArgs(1); @@ -341,7 +341,7 @@ namespace VentilatedSlab { ErrorsFound = true; } - ventSlab.ZonePtr = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); + ventSlab.ZonePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->Zone); if (ventSlab.ZonePtr == 0) { if (lAlphaBlanks(3)) { ShowSevereError( @@ -359,9 +359,9 @@ namespace VentilatedSlab { ventSlab.SurfListName = state.dataIPShortCut->cAlphaArgs(4); SurfListNum = 0; - // IF (NumOfSlabLists > 0) SurfListNum = UtilityRoutines::FindItemInList(VentSlab(Item)%SurfListName, SlabList%Name, NumOfSlabLists) + // IF (NumOfSlabLists > 0) SurfListNum = Util::FindItemInList(VentSlab(Item)%SurfListName, SlabList%Name, NumOfSlabLists) if (state.dataSurfLists->NumOfSurfListVentSlab > 0) - SurfListNum = UtilityRoutines::FindItemInList(ventSlab.SurfListName, state.dataSurfLists->SlabList); + SurfListNum = Util::FindItemInList(ventSlab.SurfListName, state.dataSurfLists->SlabList); if (SurfListNum > 0) { // Found a valid surface list ventSlab.NumOfSurfaces = state.dataSurfLists->SlabList(SurfListNum).NumOfSurfaces; ventSlab.ZName.allocate(ventSlab.NumOfSurfaces); @@ -397,7 +397,7 @@ namespace VentilatedSlab { ventSlab.SurfaceFlowFrac.allocate(ventSlab.NumOfSurfaces); state.dataVentilatedSlab->MaxCloNumOfSurfaces = max(state.dataVentilatedSlab->MaxCloNumOfSurfaces, ventSlab.NumOfSurfaces); ventSlab.SurfaceName(1) = ventSlab.SurfListName; - ventSlab.SurfacePtr(1) = UtilityRoutines::FindItemInList(ventSlab.SurfaceName(1), state.dataSurface->Surface); + ventSlab.SurfacePtr(1) = Util::FindItemInList(ventSlab.SurfaceName(1), state.dataSurface->Surface); ventSlab.SurfaceFlowFrac(1) = 1.0; // Error checking for single surfaces if (ventSlab.SurfacePtr(1) == 0) { @@ -485,8 +485,8 @@ namespace VentilatedSlab { ventSlab.MinOutAirVolFlow = state.dataIPShortCut->rNumericArgs(2); ventSlab.OutAirVolFlow = state.dataIPShortCut->rNumericArgs(3); - ventSlab.outsideAirControlType = static_cast( - getEnumValue(OutsideAirControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + ventSlab.outsideAirControlType = + static_cast(getEnumValue(OutsideAirControlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); switch (ventSlab.outsideAirControlType) { case OutsideAirControlType::VariablePercent: { @@ -563,8 +563,8 @@ namespace VentilatedSlab { } // System Configuration: - ventSlab.SysConfg = static_cast( - getEnumValue(VentilatedSlabConfigNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + ventSlab.SysConfg = + static_cast(getEnumValue(VentilatedSlabConfigNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (ventSlab.SysConfg == VentilatedSlabConfig::Invalid) { ShowSevereError( @@ -579,7 +579,7 @@ namespace VentilatedSlab { ventSlab.CoreLength = state.dataIPShortCut->rNumericArgs(5); ventSlab.CoreNumbers = state.dataIPShortCut->rNumericArgs(6); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "SurfaceListNames")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), "SurfaceListNames")) { if (!lNumericBlanks(4)) { ShowWarningError(state, format("{}=\"{}\" Core Diameter is not needed for the series slabs configuration- ignored.", @@ -589,7 +589,7 @@ namespace VentilatedSlab { } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "SurfaceListNames")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), "SurfaceListNames")) { if (!lNumericBlanks(5)) { ShowWarningError(state, format("{}=\"{}\" Core Length is not needed for the series slabs configuration- ignored.", @@ -599,7 +599,7 @@ namespace VentilatedSlab { } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "SurfaceListNames")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(8), "SurfaceListNames")) { if (!lNumericBlanks(6)) { ShowWarningError(state, format("{}=\"{}\" Core Numbers is not needed for the series slabs configuration- ignored.", @@ -610,8 +610,7 @@ namespace VentilatedSlab { } // Process the temperature control type - ventSlab.controlType = - static_cast(getEnumValue(ControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + ventSlab.controlType = static_cast(getEnumValue(ControlTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); if (ventSlab.controlType == ControlType::Invalid) { ShowSevereError( @@ -986,8 +985,7 @@ namespace VentilatedSlab { // Coil options assign - ventSlab.coilOption = - static_cast(getEnumValue(CoilTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(26)))); + ventSlab.coilOption = static_cast(getEnumValue(CoilTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(26)))); if (ventSlab.coilOption == CoilType::Invalid) { ShowSevereError( @@ -1015,8 +1013,8 @@ namespace VentilatedSlab { ventSlab.heatingCoilTypeCh = state.dataIPShortCut->cAlphaArgs(27); errFlag = false; - ventSlab.hCoilType = static_cast( - getEnumValue(HeatingCoilTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(27)))); + ventSlab.hCoilType = + static_cast(getEnumValue(HeatingCoilTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(27)))); switch (ventSlab.hCoilType) { @@ -1131,9 +1129,8 @@ namespace VentilatedSlab { ventSlab.coolingCoilTypeCh = state.dataIPShortCut->cAlphaArgs(30); errFlag = false; - ventSlab.cCoilType = static_cast( - getEnumValue(CoolingCoilTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(30)))); - + ventSlab.cCoilType = + static_cast(getEnumValue(CoolingCoilTypeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(30)))); switch (ventSlab.cCoilType) { case CoolingCoilType::WaterCooling: { ventSlab.coolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; @@ -1152,9 +1149,9 @@ namespace VentilatedSlab { ErrorsFound, ventSlab.coolingCoilPlantType, ventSlab.coolingCoilPlantName); - if (UtilityRoutines::SameString(ventSlab.coolingCoilPlantType, "Coil:Cooling:Water")) { + if (Util::SameString(ventSlab.coolingCoilPlantType, "Coil:Cooling:Water")) { ventSlab.coolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; - } else if (UtilityRoutines::SameString(ventSlab.coolingCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { + } else if (Util::SameString(ventSlab.coolingCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { ventSlab.coolingCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } else { ShowSevereError(state, format("GetVentilatedSlabInput: {}=\"{}\", invalid", CurrentModuleObject, ventSlab.Name)); @@ -1235,7 +1232,7 @@ namespace VentilatedSlab { ventSlab.HVACSizingIndex = 0; if (!lAlphaBlanks(34)) { - ventSlab.HVACSizingIndex = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(34), state.dataSize->ZoneHVACSizing); + ventSlab.HVACSizingIndex = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(34), state.dataSize->ZoneHVACSizing); if (ventSlab.HVACSizingIndex == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(34), state.dataIPShortCut->cAlphaArgs(34))); ShowContinueError(state, format("Occurs in {} = {}", cMO_VentilatedSlab, ventSlab.Name)); diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index c058e1ca389..9c196e4bad1 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -166,7 +166,7 @@ void SimulateWaterCoilComponents(EnergyPlusData &state, // Find the correct WaterCoilNumber with the Coil Name if (CompIndex == 0) { - CoilNum = UtilityRoutines::FindItemInList(CompName, state.dataWaterCoils->WaterCoil); + CoilNum = Util::FindItemInList(CompName, state.dataWaterCoils->WaterCoil); if (CoilNum == 0) { ShowFatalError(state, format("SimulateWaterCoilComponents: Coil not found={}", CompName)); } @@ -327,7 +327,7 @@ void GetWaterCoilInput(EnergyPlusData &state) state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames.allocate(MaxNums); state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames = ""; state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames = cNumericFields; - UtilityRoutines::IsNameEmpty(state, AlphArray(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueCoilName(state, CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); @@ -501,7 +501,7 @@ void GetWaterCoilInput(EnergyPlusData &state) state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames.allocate(MaxNums); state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames = ""; state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames = cNumericFields; - UtilityRoutines::IsNameEmpty(state, AlphArray(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueCoilName(state, CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); @@ -720,7 +720,7 @@ void GetWaterCoilInput(EnergyPlusData &state) state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames.allocate(MaxNums); state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames = ""; state.dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames = cNumericFields; - UtilityRoutines::IsNameEmpty(state, AlphArray(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueCoilName(state, CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); @@ -5358,7 +5358,7 @@ void CheckWaterCoilSchedule(EnergyPlusData &state, std::string_view CompName, Re int CoilNum = 0; // Find the correct Coil number if (CompIndex == 0) { - CoilNum = UtilityRoutines::FindItemInList(CompName, state.dataWaterCoils->WaterCoil); + CoilNum = Util::FindItemInList(CompName, state.dataWaterCoils->WaterCoil); if (CoilNum == 0) { ShowFatalError(state, format("CheckWaterCoilSchedule: Coil not found={}", CompName)); } @@ -5413,9 +5413,9 @@ Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, } int WhichCoil = 0; - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Water") || UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(CoilType, "Coil:Cooling:Water")) { + WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { // coil does not specify MaxWaterFlowRate MaxWaterFlowRate = state.dataWaterCoils->WaterCoil(WhichCoil).MaxWaterVolFlowRate; @@ -5458,9 +5458,9 @@ int GetCoilInletNode(EnergyPlusData &state, int NodeNumber = 0; int WhichCoil = 0; - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Water") || UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(CoilType, "Coil:Cooling:Water")) { + WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { NodeNumber = state.dataWaterCoils->WaterCoil(WhichCoil).AirInletNodeNum; } @@ -5501,9 +5501,9 @@ int GetCoilOutletNode(EnergyPlusData &state, int WhichCoil = 0; int NodeNumber = 0; // returned node number of matched coil - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Water") || UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(CoilType, "Coil:Cooling:Water")) { + WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { NodeNumber = state.dataWaterCoils->WaterCoil(WhichCoil).AirOutletNodeNum; } @@ -5546,9 +5546,9 @@ int GetCoilWaterInletNode(EnergyPlusData &state, int NodeNumber = 0; // returned node number of matched coil int WhichCoil = 0; - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Water") || UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(CoilType, "Coil:Cooling:Water")) { + WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { NodeNumber = state.dataWaterCoils->WaterCoil(WhichCoil).WaterInletNodeNum; } @@ -5589,9 +5589,9 @@ int GetCoilWaterOutletNode(EnergyPlusData &state, int NodeNumber = 0; // returned node number of matched coil int WhichCoil = 0; - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Water") || UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(CoilType, "Coil:Cooling:Water")) { + WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { NodeNumber = state.dataWaterCoils->WaterCoil(WhichCoil).WaterOutletNodeNum; } @@ -5630,9 +5630,9 @@ void SetCoilDesFlow(EnergyPlusData &state, state.dataWaterCoils->GetWaterCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Water") || UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water")) { - int WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry") || + Util::SameString(CoilType, "Coil:Cooling:Water")) { + int WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { if (state.dataWaterCoils->WaterCoil(WhichCoil).DesAirVolFlowRate <= 0.0) { state.dataWaterCoils->WaterCoil(WhichCoil).DesAirVolFlowRate = CoilDesFlow; @@ -5669,8 +5669,8 @@ Real64 GetWaterCoilDesAirFlow(EnergyPlusData &state, state.dataWaterCoils->GetWaterCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water")) { - int WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Cooling:Water")) { + int WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { CoilDesAirFlow = state.dataWaterCoils->WaterCoil(WhichCoil).DesAirVolFlowRate; } else { @@ -5974,11 +5974,11 @@ int GetWaterCoilIndex(EnergyPlusData &state, IndexNum = 0; if (CoilType == "COIL:HEATING:WATER") { - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); } else if (CoilType == "COIL:COOLING:WATER") { - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); } else if (CoilType == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); } else { IndexNum = 0; } @@ -6000,7 +6000,7 @@ int GetCompIndex(EnergyPlusData &state, CoilModel compType, std::string_view con state.dataWaterCoils->GetWaterCoilsInputFlag = false; } - int index = UtilityRoutines::FindItemInList(coilName, state.dataWaterCoils->WaterCoil); + int index = Util::FindItemInList(coilName, state.dataWaterCoils->WaterCoil); if (index == 0) { // may not find coil name ShowSevereError(state, @@ -6035,13 +6035,13 @@ Real64 GetWaterCoilCapacity(EnergyPlusData &state, Real64 Capacity = -1.0; // returned coil capacity if matched coil if (CoilType == "COIL:HEATING:WATER") { - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); Capacity = state.dataWaterCoils->WaterCoil(IndexNum).DesWaterHeatingCoilRate; } else if (CoilType == "COIL:COOLING:WATER") { - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); Capacity = state.dataWaterCoils->WaterCoil(IndexNum).DesWaterCoolingCoilRate; } else if (CoilType == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); Capacity = state.dataWaterCoils->WaterCoil(IndexNum).DesWaterCoolingCoilRate; } else { IndexNum = 0; @@ -6083,7 +6083,7 @@ void UpdateWaterToAirCoilPlantConnection(EnergyPlusData &state, // Find the correct water coil if (CompIndex == 0) { - CoilNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); + CoilNum = Util::FindItemInList(CoilName, state.dataWaterCoils->WaterCoil); if (CoilNum == 0) { ShowFatalError(state, format("UpdateWaterToAirCoilPlantConnection: Specified Coil not one of Valid water coils={}", CoilName)); } @@ -6178,9 +6178,9 @@ int GetWaterCoilAvailScheduleIndex(EnergyPlusData &state, int WhichCoil = 0; int AvailSchIndex = 0; - if (UtilityRoutines::SameString(CoilType, "Coil:Heating:Water") || UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water") || - UtilityRoutines::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry")) { - WhichCoil = UtilityRoutines::FindItem(CoilName, state.dataWaterCoils->WaterCoil); + if (Util::SameString(CoilType, "Coil:Heating:Water") || Util::SameString(CoilType, "Coil:Cooling:Water") || + Util::SameString(CoilType, "Coil:Cooling:Water:DetailedGeometry")) { + WhichCoil = Util::FindItem(CoilName, state.dataWaterCoils->WaterCoil); if (WhichCoil != 0) { AvailSchIndex = state.dataWaterCoils->WaterCoil(WhichCoil).SchedPtr; } diff --git a/src/EnergyPlus/WaterManager.cc b/src/EnergyPlus/WaterManager.cc index 011cec187eb..b059546819a 100644 --- a/src/EnergyPlus/WaterManager.cc +++ b/src/EnergyPlus/WaterManager.cc @@ -244,7 +244,7 @@ namespace WaterManager { cNumericFieldNames); state.dataWaterData->AnyWaterSystemsInModel = true; state.dataWaterData->WaterStorage(Item).Name = cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); objNameMsg = cCurrentModuleObject + " = " + cAlphaArgs(1); state.dataWaterData->WaterStorage(Item).QualitySubCategoryName = cAlphaArgs(2); @@ -267,13 +267,13 @@ namespace WaterManager { state.dataWaterData->WaterStorage(Item).OverflowTankName = cAlphaArgs(3); // setup later - if (UtilityRoutines::SameString(cAlphaArgs(4), "None")) { + if (Util::SameString(cAlphaArgs(4), "None")) { state.dataWaterData->WaterStorage(Item).ControlSupply = DataWater::ControlSupplyType::NoControlLevel; - } else if (UtilityRoutines::SameString(cAlphaArgs(4), "Mains")) { + } else if (Util::SameString(cAlphaArgs(4), "Mains")) { state.dataWaterData->WaterStorage(Item).ControlSupply = DataWater::ControlSupplyType::MainsFloatValve; - } else if (UtilityRoutines::SameString(cAlphaArgs(4), "GroundwaterWell")) { + } else if (Util::SameString(cAlphaArgs(4), "GroundwaterWell")) { state.dataWaterData->WaterStorage(Item).ControlSupply = DataWater::ControlSupplyType::WellFloatValve; - } else if (UtilityRoutines::SameString(cAlphaArgs(4), "OtherTank")) { + } else if (Util::SameString(cAlphaArgs(4), "OtherTank")) { state.dataWaterData->WaterStorage(Item).ControlSupply = DataWater::ControlSupplyType::OtherTankFloatValve; } else { ShowSevereError(state, format("Invalid {}={}", cAlphaFieldNames(4), cAlphaArgs(4))); @@ -311,9 +311,9 @@ namespace WaterManager { state.dataWaterData->WaterStorage(Item).SupplyTankName = cAlphaArgs(5); // set up later - if (UtilityRoutines::SameString(cAlphaArgs(6), "ScheduledTemperature")) { + if (Util::SameString(cAlphaArgs(6), "ScheduledTemperature")) { state.dataWaterData->WaterStorage(Item).ThermalMode = DataWater::TankThermalMode::Scheduled; - } else if (UtilityRoutines::SameString(cAlphaArgs(6), "ThermalModel")) { + } else if (Util::SameString(cAlphaArgs(6), "ThermalModel")) { state.dataWaterData->WaterStorage(Item).ThermalMode = DataWater::TankThermalMode::ZoneCoupled; } else { ShowSevereError(state, format("Invalid {}={}", cAlphaFieldNames(6), cAlphaArgs(6))); @@ -344,11 +344,11 @@ namespace WaterManager { } if (state.dataWaterData->WaterStorage(Item).ThermalMode == DataWater::TankThermalMode::ZoneCoupled) { - if (UtilityRoutines::SameString(cAlphaArgs(8), "Schedule")) { + if (Util::SameString(cAlphaArgs(8), "Schedule")) { state.dataWaterData->WaterStorage(Item).AmbientTempIndicator = DataWater::AmbientTempType::Schedule; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "Zone")) { + } else if (Util::SameString(cAlphaArgs(8), "Zone")) { state.dataWaterData->WaterStorage(Item).AmbientTempIndicator = DataWater::AmbientTempType::Zone; - } else if (UtilityRoutines::SameString(cAlphaArgs(8), "Outdoors")) { + } else if (Util::SameString(cAlphaArgs(8), "Outdoors")) { state.dataWaterData->WaterStorage(Item).AmbientTempIndicator = DataWater::AmbientTempType::Exterior; } else { ShowSevereError(state, format("Invalid {}={}", cAlphaFieldNames(8), cAlphaArgs(8))); @@ -362,7 +362,7 @@ namespace WaterManager { ShowContinueError(state, format("Entered in {}={}", cCurrentModuleObject, cAlphaArgs(1))); ErrorsFound = true; } - state.dataWaterData->WaterStorage(Item).ZoneID = UtilityRoutines::FindItemInList(cAlphaArgs(10), state.dataHeatBal->Zone); + state.dataWaterData->WaterStorage(Item).ZoneID = Util::FindItemInList(cAlphaArgs(10), state.dataHeatBal->Zone); if ((state.dataWaterData->WaterStorage(Item).ZoneID == 0) && (state.dataWaterData->WaterStorage(Item).AmbientTempIndicator == DataWater::AmbientTempType::Zone)) { ShowSevereError(state, format("Invalid {}={}", cAlphaFieldNames(10), cAlphaArgs(10))); @@ -403,21 +403,20 @@ namespace WaterManager { cAlphaFieldNames, cNumericFieldNames); state.dataWaterData->RainCollector(Item).Name = cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); objNameMsg = cCurrentModuleObject + " Named " + cAlphaArgs(1); state.dataWaterData->RainCollector(Item).StorageTankName = cAlphaArgs(2); - state.dataWaterData->RainCollector(Item).StorageTankID = - UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataWaterData->WaterStorage); + state.dataWaterData->RainCollector(Item).StorageTankID = Util::FindItemInList(cAlphaArgs(2), state.dataWaterData->WaterStorage); if (state.dataWaterData->RainCollector(Item).StorageTankID == 0) { ShowSevereError(state, format("Invalid {}={}", cAlphaFieldNames(2), cAlphaArgs(2))); ShowContinueError(state, format("Entered in {}={}", cCurrentModuleObject, cAlphaArgs(1))); ErrorsFound = true; } - if (UtilityRoutines::SameString(cAlphaArgs(3), "Constant")) { + if (Util::SameString(cAlphaArgs(3), "Constant")) { state.dataWaterData->RainCollector(Item).LossFactorMode = DataWater::RainLossFactor::Constant; - } else if (UtilityRoutines::SameString(cAlphaArgs(3), "Scheduled")) { + } else if (Util::SameString(cAlphaArgs(3), "Scheduled")) { state.dataWaterData->RainCollector(Item).LossFactorMode = DataWater::RainLossFactor::Scheduled; } else { ShowSevereError(state, format("Invalid {}={}", cAlphaFieldNames(3), cAlphaArgs(3))); @@ -470,7 +469,7 @@ namespace WaterManager { for (int SurfNum = 1; SurfNum <= state.dataWaterData->RainCollector(Item).NumCollectSurfs; ++SurfNum) { state.dataWaterData->RainCollector(Item).SurfName(SurfNum) = cAlphaArgs(SurfNum + alphaOffset); state.dataWaterData->RainCollector(Item).SurfID(SurfNum) = - UtilityRoutines::FindItemInList(cAlphaArgs(SurfNum + alphaOffset), state.dataSurface->Surface); + Util::FindItemInList(cAlphaArgs(SurfNum + alphaOffset), state.dataSurface->Surface); if (state.dataWaterData->RainCollector(Item).SurfID(SurfNum) == 0) { ShowSevereError(state, format("Invalid {}={}", cAlphaFieldNames(SurfNum + alphaOffset), cAlphaArgs(SurfNum + alphaOffset))); @@ -523,7 +522,7 @@ namespace WaterManager { cAlphaFieldNames, cNumericFieldNames); state.dataWaterData->GroundwaterWell(Item).Name = cAlphaArgs(1); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); objNameMsg = cCurrentModuleObject + " Named " + cAlphaArgs(1); state.dataWaterData->GroundwaterWell(Item).StorageTankName = cAlphaArgs(2); @@ -545,9 +544,9 @@ namespace WaterManager { state.dataWaterData->GroundwaterWell(Item).PumpEfficiency = rNumericArgs(5); state.dataWaterData->GroundwaterWell(Item).WellRecoveryRate = rNumericArgs(6); state.dataWaterData->GroundwaterWell(Item).NomWellStorageVol = rNumericArgs(7); - if (UtilityRoutines::SameString(cAlphaArgs(3), "Constant")) { + if (Util::SameString(cAlphaArgs(3), "Constant")) { state.dataWaterData->GroundwaterWell(Item).GroundwaterTableMode = DataWater::GroundWaterTable::Constant; - } else if (UtilityRoutines::SameString(cAlphaArgs(3), "Scheduled")) { + } else if (Util::SameString(cAlphaArgs(3), "Scheduled")) { state.dataWaterData->GroundwaterWell(Item).GroundwaterTableMode = DataWater::GroundWaterTable::Scheduled; } else if (lAlphaFieldBlanks(3)) { state.dataWaterData->GroundwaterWell(Item).GroundwaterTableMode = DataWater::GroundWaterTable::Invalid; @@ -589,8 +588,8 @@ namespace WaterManager { // setup tanks whose level is controlled by supply from another tank if ((state.dataWaterData->WaterStorage(Item).ControlSupply == DataWater::ControlSupplyType::OtherTankFloatValve) || (state.dataWaterData->WaterStorage(Item).ControlSupply == DataWater::ControlSupplyType::TankMainsBackup)) { - state.dataWaterData->WaterStorage(Item).SupplyTankID = UtilityRoutines::FindItemInList( - state.dataWaterData->WaterStorage(Item).SupplyTankName, state.dataWaterData->WaterStorage); + state.dataWaterData->WaterStorage(Item).SupplyTankID = + Util::FindItemInList(state.dataWaterData->WaterStorage(Item).SupplyTankName, state.dataWaterData->WaterStorage); if (state.dataWaterData->WaterStorage(Item).SupplyTankID == 0) { ShowSevereError(state, format("Other tank called {} not found for {} Named {}", @@ -617,7 +616,7 @@ namespace WaterManager { } // setup overflow inputs state.dataWaterData->WaterStorage(Item).OverflowTankID = - UtilityRoutines::FindItemInList(state.dataWaterData->WaterStorage(Item).OverflowTankName, state.dataWaterData->WaterStorage); + Util::FindItemInList(state.dataWaterData->WaterStorage(Item).OverflowTankName, state.dataWaterData->WaterStorage); if (state.dataWaterData->WaterStorage(Item).OverflowTankID == 0) { // if blank, then okay it is discarded. but if not blank then error if (is_blank(state.dataWaterData->WaterStorage(Item).OverflowTankName)) { @@ -657,7 +656,7 @@ namespace WaterManager { state.dataInputProcessing->inputProcessor->getObjectItem( state, cCurrentModuleObject, 1, cAlphaArgs, NumAlphas, rNumericArgs, NumNumbers, IOStatus); - if (UtilityRoutines::SameString(cAlphaArgs(1), "ScheduleAndDesignLevel")) { + if (Util::SameString(cAlphaArgs(1), "ScheduleAndDesignLevel")) { state.dataWaterData->RainFall.ModeID = DataWater::RainfallMode::RainSchedDesign; } else { ShowSevereError(state, format("Precipitation Model Type of {} is incorrect.", cCurrentModuleObject)); @@ -692,9 +691,9 @@ namespace WaterManager { state.dataWaterData->AnyIrrigationInModel = true; state.dataInputProcessing->inputProcessor->getObjectItem( state, cCurrentModuleObject, 1, cAlphaArgs, NumAlphas, rNumericArgs, NumNumbers, IOStatus); - if (UtilityRoutines::SameString(cAlphaArgs(1), "Schedule")) { + if (Util::SameString(cAlphaArgs(1), "Schedule")) { state.dataWaterData->Irrigation.ModeID = DataWater::IrrigationMode::IrrSchedDesign; - } else if (UtilityRoutines::SameString(cAlphaArgs(1), "SmartSchedule")) { + } else if (Util::SameString(cAlphaArgs(1), "SmartSchedule")) { state.dataWaterData->Irrigation.ModeID = DataWater::IrrigationMode::IrrSmartSched; } else { ShowSevereError(state, format("Type of {} is incorrect. Options are Schedule or SmartSchedule", cCurrentModuleObject)); @@ -791,7 +790,7 @@ namespace WaterManager { state.dataWaterData->WaterStorage(Item).Name, {}, "MainsWater", - "WaterSystem", + "WaterSystems", state.dataWaterData->WaterStorage(Item).QualitySubCategoryName, "System"); SetupOutputVariable(state, @@ -1259,7 +1258,7 @@ namespace WaterManager { Array1D_string oldSupplyCompNames; Array1D_string oldSupplyCompTypes; - TankIndex = UtilityRoutines::FindItemInList(TankName, state.dataWaterData->WaterStorage); + TankIndex = Util::FindItemInList(TankName, state.dataWaterData->WaterStorage); if (TankIndex == 0) { ShowSevereError(state, format("WaterUse:Storage (Water Storage Tank) =\"{}\" not found in {} called {}", TankName, CompType, CompName)); ErrorsFound = true; @@ -1368,7 +1367,7 @@ namespace WaterManager { Array1D_string oldDemandCompNames; Array1D_string oldDemandCompTypes; - TankIndex = UtilityRoutines::FindItemInList(TankName, state.dataWaterData->WaterStorage); + TankIndex = Util::FindItemInList(TankName, state.dataWaterData->WaterStorage); if (TankIndex == 0) { ShowSevereError(state, format("WaterUse:Storage (Water Storage Tank) =\"{}\" not found in {} called {}", TankName, CompType, CompName)); ErrorsFound = true; diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 465b0e3756a..87c0dba4f03 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -203,7 +203,7 @@ int getTankIDX(EnergyPlusData &state, std::string_view CompName, int &CompIndex) int CompNum; if (CompIndex == 0) { - CompNum = UtilityRoutines::FindItem(CompName, state.dataWaterThermalTanks->WaterThermalTank); + CompNum = Util::FindItem(CompName, state.dataWaterThermalTanks->WaterThermalTank); if (CompNum == 0) { ShowFatalError(state, format("SimWaterThermalTank_WaterTank: Unit not found={}", CompName)); } @@ -242,7 +242,7 @@ int getHPTankIDX(EnergyPlusData &state, std::string_view CompName, int &CompInde int CompNum; if (CompIndex == 0) { - CompNum = UtilityRoutines::FindItem(CompName, state.dataWaterThermalTanks->HPWaterHeater); + CompNum = Util::FindItem(CompName, state.dataWaterThermalTanks->HPWaterHeater); if (CompNum == 0) { ShowFatalError(state, format("SimWaterThermalTank_HeatPump: Unit not found={}", CompName)); } @@ -539,7 +539,7 @@ void SimHeatPumpWaterHeater(EnergyPlusData &state, // Find the correct Heat Pump Water Heater int HeatPumpNum; if (CompIndex == 0) { - HeatPumpNum = UtilityRoutines::FindItemInList(CompName, state.dataWaterThermalTanks->HPWaterHeater); + HeatPumpNum = Util::FindItemInList(CompName, state.dataWaterThermalTanks->HPWaterHeater); if (HeatPumpNum == 0) { ShowFatalError(state, format("SimHeatPumpWaterHeater: Unit not found={}", CompName)); } @@ -701,7 +701,7 @@ bool getDesuperHtrInput(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueCoilName(state, cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); @@ -803,8 +803,7 @@ bool getDesuperHtrInput(EnergyPlusData &state) DesupHtr.TankType = cAlphaArgs(7); - if (!UtilityRoutines::SameString(DesupHtr.TankType, cMixedWHModuleObj) && - !UtilityRoutines::SameString(DesupHtr.TankType, cStratifiedWHModuleObj)) { + if (!Util::SameString(DesupHtr.TankType, cMixedWHModuleObj) && !Util::SameString(DesupHtr.TankType, cStratifiedWHModuleObj)) { ShowSevereError(state, format("{} = {}:", cCurrentModuleObject, state.dataWaterThermalTanks->HPWaterHeater(DesuperheaterNum).Name)); ShowContinueError(state, format("Desuperheater can only be used with {} or {}.", cMixedWHModuleObj, cStratifiedWHModuleObj)); @@ -818,9 +817,9 @@ bool getDesuperHtrInput(EnergyPlusData &state) std::string const heatSourceObjType = cAlphaArgs(9); - if ((UtilityRoutines::SameString(heatSourceObjType, "Refrigeration:Condenser:AirCooled")) || - (UtilityRoutines::SameString(heatSourceObjType, "Refrigeration:Condenser:EvaporativeCooled")) || - (UtilityRoutines::SameString(heatSourceObjType, "Refrigeration:Condenser:WaterCooled"))) { + if ((Util::SameString(heatSourceObjType, "Refrigeration:Condenser:AirCooled")) || + (Util::SameString(heatSourceObjType, "Refrigeration:Condenser:EvaporativeCooled")) || + (Util::SameString(heatSourceObjType, "Refrigeration:Condenser:WaterCooled"))) { if (lNumericFieldBlanks(2)) { DesupHtr.HeatReclaimRecoveryEff = 0.8; } else { @@ -857,10 +856,10 @@ bool getDesuperHtrInput(EnergyPlusData &state) bool errFlag = false; DesupHtr.HeatingSourceType = heatSourceObjType; DesupHtr.HeatingSourceName = cAlphaArgs(10); - if (UtilityRoutines::SameString(heatSourceObjType, "Refrigeration:CompressorRack")) { + if (Util::SameString(heatSourceObjType, "Refrigeration:CompressorRack")) { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::CompressorRackRefrigeratedCase; for (int RackNum = 1; RackNum <= state.dataRefrigCase->NumRefrigeratedRacks; ++RackNum) { - if (!UtilityRoutines::SameString(state.dataHeatBal->HeatReclaimRefrigeratedRack(RackNum).Name, cAlphaArgs(10))) continue; + if (!Util::SameString(state.dataHeatBal->HeatReclaimRefrigeratedRack(RackNum).Name, cAlphaArgs(10))) continue; DesupHtr.ReclaimHeatingSourceIndexNum = RackNum; if (allocated(state.dataHeatBal->HeatReclaimRefrigeratedRack)) { DataHeatBalance::HeatReclaimDataBase &HeatReclaim = @@ -884,12 +883,12 @@ bool getDesuperHtrInput(EnergyPlusData &state) } break; } - } else if ((UtilityRoutines::SameString(heatSourceObjType, "Refrigeration:Condenser:AirCooled")) || - (UtilityRoutines::SameString(heatSourceObjType, "Refrigeration:Condenser:EvaporativeCooled")) || - (UtilityRoutines::SameString(heatSourceObjType, "Refrigeration:Condenser:WaterCooled"))) { + } else if ((Util::SameString(heatSourceObjType, "Refrigeration:Condenser:AirCooled")) || + (Util::SameString(heatSourceObjType, "Refrigeration:Condenser:EvaporativeCooled")) || + (Util::SameString(heatSourceObjType, "Refrigeration:Condenser:WaterCooled"))) { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::CondenserRefrigeration; for (int CondNum = 1; CondNum <= state.dataRefrigCase->NumRefrigCondensers; ++CondNum) { - if (!UtilityRoutines::SameString(state.dataHeatBal->HeatReclaimRefrigCondenser(CondNum).Name, cAlphaArgs(10))) continue; + if (!Util::SameString(state.dataHeatBal->HeatReclaimRefrigCondenser(CondNum).Name, cAlphaArgs(10))) continue; DesupHtr.ReclaimHeatingSourceIndexNum = CondNum; if (allocated(state.dataHeatBal->HeatReclaimRefrigCondenser)) { DataHeatBalance::HeatReclaimDataBase &HeatReclaim = @@ -913,14 +912,14 @@ bool getDesuperHtrInput(EnergyPlusData &state) } break; } - } else if (UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX:SingleSpeed") || - UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX:TwoSpeed") || - UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX:MultiSpeed") || - UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { + } else if (Util::SameString(heatSourceObjType, "Coil:Cooling:DX:SingleSpeed") || + Util::SameString(heatSourceObjType, "Coil:Cooling:DX:TwoSpeed") || + Util::SameString(heatSourceObjType, "Coil:Cooling:DX:MultiSpeed") || + Util::SameString(heatSourceObjType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { - if (UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX:SingleSpeed")) { + if (Util::SameString(heatSourceObjType, "Coil:Cooling:DX:SingleSpeed")) { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::DXCooling; - } else if (UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { + } else if (Util::SameString(heatSourceObjType, "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::DXMultiMode; } else { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::DXMultiSpeed; @@ -944,7 +943,7 @@ bool getDesuperHtrInput(EnergyPlusData &state) ErrorsFound = true; } } - } else if (UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX:VariableSpeed")) { + } else if (Util::SameString(heatSourceObjType, "Coil:Cooling:DX:VariableSpeed")) { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::DXVariableCooling; DesupHtr.ReclaimHeatingSourceIndexNum = VariableSpeedCoils::GetCoilIndexVariableSpeed(state, heatSourceObjType, cAlphaArgs(10), errFlag); if (allocated(state.dataHeatBal->HeatReclaimVS_DXCoil)) { @@ -965,7 +964,7 @@ bool getDesuperHtrInput(EnergyPlusData &state) ErrorsFound = true; } } - } else if (UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:WaterToAirHeatPump:EquationFit")) { + } else if (Util::SameString(heatSourceObjType, "Coil:Cooling:WaterToAirHeatPump:EquationFit")) { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::AirWaterHeatPumpEQ; DesupHtr.ReclaimHeatingSourceIndexNum = WaterToAirHeatPumpSimple::GetCoilIndex(state, heatSourceObjType, cAlphaArgs(10), errFlag); if (allocated(state.dataHeatBal->HeatReclaimSimple_WAHPCoil)) { @@ -987,7 +986,7 @@ bool getDesuperHtrInput(EnergyPlusData &state) ErrorsFound = true; } } - } else if (UtilityRoutines::SameString(heatSourceObjType, "Coil:Cooling:DX")) { + } else if (Util::SameString(heatSourceObjType, "Coil:Cooling:DX")) { DesupHtr.ReclaimHeatingSource = ReclaimHeatObjectType::CoilCoolingDX; DesupHtr.ReclaimHeatingSourceIndexNum = CoilCoolingDX::factory(state, cAlphaArgs(10)); if (DesupHtr.ReclaimHeatingSourceIndexNum < 0) { @@ -1209,7 +1208,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) for (int i = NumAlphas + 1; i <= nNumPossibleAlphaArgs; ++i) { hpwhAlphaBlank[i] = true; } - UtilityRoutines::IsNameEmpty(state, hpwhAlpha[1], state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, hpwhAlpha[1], state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); // Name and type HPWH.Name = hpwhAlpha[1]; @@ -1333,8 +1332,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } // Inlet Air Configuration - HPWH.InletAirConfiguration = - static_cast(getEnumValue(HPWHAmbientTempNamesUC, UtilityRoutines::makeUPPER(hpwhAlpha[6 + nAlphaOffset]))); + HPWH.InletAirConfiguration = static_cast(getEnumValue(HPWHAmbientTempNamesUC, Util::makeUPPER(hpwhAlpha[6 + nAlphaOffset]))); switch (HPWH.InletAirConfiguration) { case WTTAmbientTemp::Schedule: { @@ -1382,7 +1380,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) // Inlet Air Zone if (!hpwhAlphaBlank[13 + nAlphaOffset]) { - HPWH.AmbientTempZone = UtilityRoutines::FindItemInList(hpwhAlpha[13 + nAlphaOffset], state.dataHeatBal->Zone); + HPWH.AmbientTempZone = Util::FindItemInList(hpwhAlpha[13 + nAlphaOffset], state.dataHeatBal->Zone); if (HPWH.AmbientTempZone == 0) { ShowSevereError(state, format("{}=\"{}\", not found", state.dataIPShortCut->cCurrentModuleObject, HPWH.Name)); ShowContinueError(state, format("{}=\"{}\".", hpwhAlphaFieldNames[13 + nAlphaOffset], hpwhAlpha[13 + nAlphaOffset])); @@ -1480,7 +1478,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } else { // this is a single speed coil DXCoils::DXCoilData &Coil = state.dataDXCoils->DXCoil(HPWH.DXCoilNum); - if (!UtilityRoutines::SameString(HPWH.DXCoilType, Coil.DXCoilType)) { + if (!Util::SameString(HPWH.DXCoilType, Coil.DXCoilType)) { ShowSevereError(state, format("{}=\"{}\", ", state.dataIPShortCut->cCurrentModuleObject, HPWH.Name)); ShowContinueError(state, format("specifies the coil {}=\"{}\".", HPWH.DXCoilType, HPWH.DXCoilName)); ShowContinueError(state, format("However, {} is a coil of type {}.", HPWH.DXCoilName, Coil.DXCoilType)); @@ -1559,8 +1557,8 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } // Compressor Location - HPWH.CrankcaseTempIndicator = static_cast( - getEnumValue(CrankcaseHeaterControlTempNamesUC, UtilityRoutines::makeUPPER(hpwhAlpha[20 + nAlphaOffset]))); + HPWH.CrankcaseTempIndicator = + static_cast(getEnumValue(CrankcaseHeaterControlTempNamesUC, Util::makeUPPER(hpwhAlpha[20 + nAlphaOffset]))); switch (HPWH.CrankcaseTempIndicator) { case CrankcaseHeaterControlTemp::Schedule: { if (!hpwhAlphaBlank[21 + nAlphaOffset]) { @@ -1628,7 +1626,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) ShowContinueError(state, format("...occurs in {}, unit=\"{}\".", state.dataIPShortCut->cCurrentModuleObject, HPWH.Name)); ErrorsFound = true; } else { - if (UtilityRoutines::SameString(HPWH.FanType, "Fan:SystemModel")) { + if (Util::SameString(HPWH.FanType, "Fan:SystemModel")) { HPWH.FanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, HPWH.FanName)); // call constructor HPWH.FanNum = HVACFan::getFanObjectVectorIndex(state, HPWH.FanName); @@ -1659,7 +1657,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) state, format(" The fan object ({}) type must be Fan:SystemModel or Fan:OnOff when used with a heat pump water heater.", HPWH.FanName)); ErrorsFound = true; - } else if (!UtilityRoutines::SameString(HPWH.FanType, "Fan:OnOff") && !UtilityRoutines::SameString(HPWH.FanType, "Fan:SystemModel")) { + } else if (!Util::SameString(HPWH.FanType, "Fan:OnOff") && !Util::SameString(HPWH.FanType, "Fan:SystemModel")) { ShowSevereError(state, format("{}=\"{}\": illegal fan type specified.", state.dataIPShortCut->cCurrentModuleObject, HPWH.Name)); ShowContinueError(state, format(" The {} must specify that the fan object", state.dataIPShortCut->cCurrentModuleObject)); ShowContinueError(state, @@ -1680,10 +1678,10 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } // Fan Placement - if (UtilityRoutines::SameString(hpwhAlpha[24 + nAlphaOffset], "BlowThrough")) { + if (Util::SameString(hpwhAlpha[24 + nAlphaOffset], "BlowThrough")) { HPWH.FanPlacement = DataHVACGlobals::BlowThru; - } else if (UtilityRoutines::SameString(hpwhAlpha[24 + nAlphaOffset], "DrawThrough")) { + } else if (Util::SameString(hpwhAlpha[24 + nAlphaOffset], "DrawThrough")) { HPWH.FanPlacement = DataHVACGlobals::DrawThru; } else { @@ -1761,7 +1759,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } // Parasitic Heat Rejection Location - if (UtilityRoutines::SameString(hpwhAlpha[25 + nAlphaOffset], "Zone")) { + if (Util::SameString(hpwhAlpha[25 + nAlphaOffset], "Zone")) { HPWH.ParasiticTempIndicator = WTTAmbientTemp::TempZone; if (HPWH.InletAirConfiguration == WTTAmbientTemp::OutsideAir || HPWH.InletAirConfiguration == WTTAmbientTemp::Schedule) { ShowSevereError(state, format("{}=\"{}\",", state.dataIPShortCut->cCurrentModuleObject, HPWH.Name)); @@ -1769,7 +1767,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) ShowContinueError(state, " when parasitic heat rejection location equals Zone."); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(hpwhAlpha[25 + nAlphaOffset], "Outdoors")) { + } else if (Util::SameString(hpwhAlpha[25 + nAlphaOffset], "Outdoors")) { HPWH.ParasiticTempIndicator = WTTAmbientTemp::OutsideAir; } else { ShowSevereError(state, format("{}=\"{}\":", state.dataIPShortCut->cCurrentModuleObject, HPWH.Name)); @@ -2268,9 +2266,9 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) // Control Logic Flag std::string CtrlLogicFlag = hpwhAlphaBlank[29 + nAlphaOffset] ? "SIMULTANEOUS" : hpwhAlpha[29 + nAlphaOffset]; - if (UtilityRoutines::SameString(CtrlLogicFlag, "SIMULTANEOUS")) { + if (Util::SameString(CtrlLogicFlag, "SIMULTANEOUS")) { HPWH.AllowHeatingElementAndHeatPumpToRunAtSameTime = true; - } else if (UtilityRoutines::SameString(CtrlLogicFlag, "MUTUALLYEXCLUSIVE")) { + } else if (Util::SameString(CtrlLogicFlag, "MUTUALLYEXCLUSIVE")) { HPWH.AllowHeatingElementAndHeatPumpToRunAtSameTime = false; } else { ShowSevereError(state, format("{}=\"{}\":", state.dataIPShortCut->cCurrentModuleObject, HPWH.Name)); @@ -2404,7 +2402,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) // Validate Heater Control Type Tank.ControlType = - static_cast(getEnumValue(HeaterControlModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + static_cast(getEnumValue(HeaterControlModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.ControlType) { case HeaterControlMode::Cycle: { Tank.MinCapacity = Tank.MaxCapacity; @@ -2544,7 +2542,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.OnCycParaFracToTank = state.dataIPShortCut->rNumericArgs(12); Tank.AmbientTempIndicator = - static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + static_cast(getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { Tank.AmbientTempSchedule = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(9)); @@ -2560,7 +2558,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) break; } case WTTAmbientTemp::TempZone: { - Tank.AmbientTempZone = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(10), state.dataHeatBal->Zone); + Tank.AmbientTempZone = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(10), state.dataHeatBal->Zone); if (Tank.AmbientTempZone == 0) { ShowSevereError(state, format("{} = {}: Ambient Temperature Zone not found = {}", @@ -2771,8 +2769,8 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) } if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { - Tank.SourceSideControlMode = static_cast( - getEnumValue(SourceSideControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(18)))); + Tank.SourceSideControlMode = + static_cast(getEnumValue(SourceSideControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(18)))); if (Tank.SourceSideControlMode == SourceSideControl::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Control Mode entered={}", @@ -2862,7 +2860,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.HeightWasAutoSized = true; } - Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -2901,8 +2899,8 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) } // Validate Heater Priority Control - Tank.StratifiedControlMode = static_cast( - getEnumValue(PriorityControlModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + Tank.StratifiedControlMode = + static_cast(getEnumValue(PriorityControlModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (Tank.StratifiedControlMode == PriorityControlMode::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Heater Priority Control entered={}", @@ -3077,7 +3075,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.OnCycParaHeight = state.dataIPShortCut->rNumericArgs(17); Tank.AmbientTempIndicator = - static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); + static_cast(getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3094,7 +3092,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) break; } case WTTAmbientTemp::TempZone: { - Tank.AmbientTempZone = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(12), state.dataHeatBal->Zone); + Tank.AmbientTempZone = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(12), state.dataHeatBal->Zone); if (Tank.AmbientTempZone == 0) { ShowSevereError(state, format("{} = {}: Ambient Temperature Zone not found = {}", @@ -3371,7 +3369,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) // Validate inlet mode Tank.InletMode = - static_cast(getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(20)))); + static_cast(getEnumValue(InletPositionModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(20)))); Tank.Nodes = state.dataIPShortCut->rNumericArgs(32); int specifiedNodes = 0; @@ -3405,8 +3403,8 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.SetupStratifiedNodes(state); if (!state.dataIPShortCut->lAlphaFieldBlanks(21)) { - Tank.SourceSideControlMode = static_cast( - getEnumValue(SourceSideControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(21)))); + Tank.SourceSideControlMode = + static_cast(getEnumValue(SourceSideControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(21)))); if (Tank.SourceSideControlMode == SourceSideControl::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Control Mode entered={}", @@ -3530,7 +3528,7 @@ bool getWaterTankMixedInput(EnergyPlusData &state) Tank.OnCycParaFracToTank = 0.0; Tank.AmbientTempIndicator = - static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + static_cast(getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3546,7 +3544,7 @@ bool getWaterTankMixedInput(EnergyPlusData &state) break; } case WTTAmbientTemp::TempZone: { - Tank.AmbientTempZone = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataHeatBal->Zone); + Tank.AmbientTempZone = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(5), state.dataHeatBal->Zone); if (Tank.AmbientTempZone == 0) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5))); ShowContinueError(state, @@ -3792,7 +3790,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) Tank.HeightWasAutoSized = true; } - Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -3866,7 +3864,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) Tank.OnCycParaHeight = 0.0; Tank.AmbientTempIndicator = - static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + static_cast(getEnumValue(TankAmbientTempNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3882,7 +3880,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) break; } case WTTAmbientTemp::TempZone: { - Tank.AmbientTempZone = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(6), state.dataHeatBal->Zone); + Tank.AmbientTempZone = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(6), state.dataHeatBal->Zone); if (Tank.AmbientTempZone == 0) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(6), state.dataIPShortCut->cAlphaArgs(6))); ShowContinueError(state, @@ -4111,7 +4109,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) // Validate inlet mode Tank.InletMode = - static_cast(getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); + static_cast(getEnumValue(InletPositionModeNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); Tank.Nodes = state.dataIPShortCut->rNumericArgs(18); Tank.AdditionalCond = state.dataIPShortCut->rNumericArgs(19); @@ -4252,8 +4250,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) auto &DesuperHtr = state.dataWaterThermalTanks->WaterHeaterDesuperheater(DesuperheaterNum); for (int WtrHtrNum = 1; WtrHtrNum <= state.dataWaterThermalTanks->numWaterThermalTank; ++WtrHtrNum) { auto &Tank = state.dataWaterThermalTanks->WaterThermalTank(WtrHtrNum); - if (!UtilityRoutines::SameString(DesuperHtr.TankName, Tank.Name) || !UtilityRoutines::SameString(DesuperHtr.TankType, Tank.Type)) - continue; + if (!Util::SameString(DesuperHtr.TankName, Tank.Name) || !Util::SameString(DesuperHtr.TankType, Tank.Type)) continue; Tank.DesuperheaterNum = DesuperheaterNum; DesuperHtr.WaterHeaterTankNum = WtrHtrNum; DesuperHtr.TankTypeNum = Tank.WaterThermalTankType; @@ -4320,7 +4317,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) auto &Tank = state.dataWaterThermalTanks->WaterThermalTank(CheckWaterHeaterNum); - if (!(UtilityRoutines::SameString(HPWH.TankName, Tank.Name) && UtilityRoutines::SameString(HPWH.TankType, Tank.Type))) continue; + if (!(Util::SameString(HPWH.TankName, Tank.Name) && Util::SameString(HPWH.TankType, Tank.Type))) continue; // save backup element and on/off-cycle parasitic properties for use during standard rating procedure HPWH.BackupElementCapacity = Tank.MaxCapacity; @@ -4403,7 +4400,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) } else { DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(Tank.Type))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, Util::makeUPPER(Tank.Type))); Tank.SourceInletNode = NodeInputManager::GetOnlySingleNode(state, HPWH.OutletNodeName1, @@ -4523,8 +4520,7 @@ bool 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 (UtilityRoutines::SameString(zoneEquipList.EquipTypeName(EquipmentTypeNum), - state.dataIPShortCut->cCurrentModuleObject)) + if (Util::SameString(zoneEquipList.EquipTypeName(EquipmentTypeNum), state.dataIPShortCut->cCurrentModuleObject)) continue; if (TankCoolingPriority > zoneEquipList.CoolingPriority(EquipmentTypeNum) || TankHeatingPriority > zoneEquipList.HeatingPriority(EquipmentTypeNum)) { @@ -4690,8 +4686,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) IOStat); // find which water heater this object is for - int WaterThermalTankNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataWaterThermalTanks->WaterThermalTank); + int WaterThermalTankNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataWaterThermalTanks->WaterThermalTank); if (WaterThermalTankNum == 0) { // did not match name throw warning. ShowSevereError(state, @@ -4703,17 +4698,17 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) } else { // we have a match // store the sizing data in "sizing" nested derived type for the correct water heater - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "PeakDraw")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "PeakDraw")) { state.dataWaterThermalTanks->WaterThermalTank(WaterThermalTankNum).Sizing.DesignMode = SizingMode::PeakDraw; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "ResidentialHUD-FHAMinimum")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "ResidentialHUD-FHAMinimum")) { state.dataWaterThermalTanks->WaterThermalTank(WaterThermalTankNum).Sizing.DesignMode = SizingMode::ResidentialMin; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerPerson")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerPerson")) { state.dataWaterThermalTanks->WaterThermalTank(WaterThermalTankNum).Sizing.DesignMode = SizingMode::PerPerson; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerFloorArea")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerFloorArea")) { state.dataWaterThermalTanks->WaterThermalTank(WaterThermalTankNum).Sizing.DesignMode = SizingMode::PerFloorArea; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerUnit")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerUnit")) { state.dataWaterThermalTanks->WaterThermalTank(WaterThermalTankNum).Sizing.DesignMode = SizingMode::PerUnit; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerSolarCollectorArea")) { + } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "PerSolarCollectorArea")) { state.dataWaterThermalTanks->WaterThermalTank(WaterThermalTankNum).Sizing.DesignMode = SizingMode::PerSolarColArea; } else { // wrong design mode entered, throw error @@ -6692,8 +6687,8 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA int VSCoilID = state.dataIntegratedHP->IntegratedHeatPumps(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilNum).SCWHCoilIndex; state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilID).NumOfSpeeds; - } else if (UtilityRoutines::SameString(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilType, - "Coil:WaterHeating:AirToWaterHeatPump:VariableSpeed") && + } else if (Util::SameString(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilType, + "Coil:WaterHeating:AirToWaterHeatPump:VariableSpeed") && (state.dataWaterThermalTanks->HPWaterHeater(HPNum).NumofSpeed == 0)) { VariableSpeedCoils::SimVariableSpeedCoils(state, std::string(), @@ -12113,8 +12108,8 @@ void WaterThermalTankData::CalcStandardRatings(EnergyPlusData &state) state.dataHVACGlobal->HPWHCrankcaseDBTemp = this->AmbientTemp; - if (UtilityRoutines::SameString(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilType, - "Coil:WaterHeating:AirToWaterHeatPump:VariableSpeed") || + if (Util::SameString(state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilType, + "Coil:WaterHeating:AirToWaterHeatPump:VariableSpeed") || (state.dataWaterThermalTanks->HPWaterHeater(HPNum).bIsIHP)) { bIsVSCoil = true; std::string VSCoilName = state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilName; diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index 586d8c81c5a..9393c433fb9 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -137,7 +137,7 @@ namespace WaterToAirHeatPump { } if (CompIndex == 0) { - HPNum = UtilityRoutines::FindItemInList(CompName, state.dataWaterToAirHeatPump->WatertoAirHP); + HPNum = Util::FindItemInList(CompName, state.dataWaterToAirHeatPump->WatertoAirHP); if (HPNum == 0) { ShowFatalError(state, format("WaterToAir HP not found={}", CompName)); } @@ -355,7 +355,7 @@ namespace WaterToAirHeatPump { heatPump.PowerLosses = NumArray(10); heatPump.LossFactor = NumArray(11); - heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); + heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, Util::makeUPPER(AlphArray(2)))); switch (heatPump.compressorType) { case CompressorType::Reciprocating: { @@ -602,7 +602,8 @@ namespace WaterToAirHeatPump { heatPump.PowerLosses = NumArray(7); heatPump.LossFactor = NumArray(8); - heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); + heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, Util::makeUPPER(AlphArray(2)))); + switch (heatPump.compressorType) { case CompressorType::Reciprocating: { heatPump.CompPistonDisp = NumArray(9); @@ -2505,7 +2506,7 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->GetCoilsInputFlag = false; } - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); if (IndexNum == 0) { ShowSevereError(state, format("Could not find CoilType=\"{}\" with Name=\"{}\"", CoilType, CoilName)); @@ -2549,11 +2550,11 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->GetCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION") || - UtilityRoutines::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION")) { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); + if (Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION") || + Util::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION")) { + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); if (WhichCoil != 0) { - if (UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION")) { + if (Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION")) { CoilCapacity = state.dataWaterToAirHeatPump->WatertoAirHP(WhichCoil).HeatingCapacity; } else { CoilCapacity = state.dataWaterToAirHeatPump->WatertoAirHP(WhichCoil).CoolingCapacity; @@ -2606,7 +2607,7 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); if (WhichCoil != 0) { NodeNumber = state.dataWaterToAirHeatPump->WatertoAirHP(WhichCoil).AirInletNodeNum; } @@ -2654,7 +2655,7 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPump->WatertoAirHP); if (WhichCoil != 0) { NodeNumber = state.dataWaterToAirHeatPump->WatertoAirHP(WhichCoil).AirOutletNodeNum; } diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index f7f12699827..fcaef0516bf 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -153,7 +153,7 @@ namespace WaterToAirHeatPumpSimple { } if (CompIndex == 0) { - HPNum = UtilityRoutines::FindItemInList(CompName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); + HPNum = Util::FindItemInList(CompName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); if (HPNum == 0) { ShowFatalError(state, format("WaterToAirHPSimple not found= {}", CompName)); } @@ -3896,7 +3896,7 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->GetCoilsInputFlag = false; } - IndexNum = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); + IndexNum = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); if (IndexNum == 0) { ShowSevereError(state, format(R"(Could not find CoilType="{}" with Name="{}")", CoilType, CoilName)); @@ -3934,11 +3934,11 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->GetCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT") || - UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT")) { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); + if (Util::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT") || + Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT")) { + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); if (WhichCoil != 0) { - if (UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT")) { + if (Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT")) { CoilCapacity = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(WhichCoil).RatedCapHeat; } else { CoilCapacity = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(WhichCoil).RatedCapCoolTotal; @@ -3997,9 +3997,9 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->GetCoilsInputFlag = false; } - if (UtilityRoutines::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT") || - UtilityRoutines::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT")) { - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); + if (Util::SameString(CoilType, "COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT") || + Util::SameString(CoilType, "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT")) { + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); if (WhichCoil != 0) { CoilAirFlowRate = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(WhichCoil).RatedAirVolFlowRate; } @@ -4044,7 +4044,7 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); if (WhichCoil != 0) { NodeNumber = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(WhichCoil).AirInletNodeNum; } @@ -4086,7 +4086,7 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->GetCoilsInputFlag = false; } - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); if (WhichCoil != 0) { NodeNumber = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(WhichCoil).AirOutletNodeNum; } @@ -4152,7 +4152,7 @@ namespace WaterToAirHeatPumpSimple { constexpr Real64 Tref(283.15); // Refrence Temperature for performance curves,10C [K] static constexpr std::string_view RoutineName("CheckSimpleWAHPRatedCurvesOutputs"); - WhichCoil = UtilityRoutines::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); + WhichCoil = Util::FindItemInList(CoilName, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP); if (WhichCoil != 0) { if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(WhichCoil).WAHPType == WatertoAirHP::Cooling) { diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh index c70666530bd..c07f2d6220c 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh @@ -329,7 +329,7 @@ struct WaterToAirHeatPumpSimpleData : BaseGlobalStruct // Default Constructor WaterToAirHeatPumpSimpleData() - : CelsiustoKelvin(Constant::KelvinConv), NumWatertoAirHPs(0), AirflowErrPointer(0), GetCoilsInputFlag(true), SourceSideMassFlowRate(0.0), + : CelsiustoKelvin(Constant::Kelvin), NumWatertoAirHPs(0), AirflowErrPointer(0), GetCoilsInputFlag(true), SourceSideMassFlowRate(0.0), SourceSideInletTemp(0.0), SourceSideInletEnth(0.0), LoadSideInletDBTemp(0.0), LoadSideInletWBTemp(0.0), LoadSideInletHumRat(0.0), LoadSideInletEnth(0.0), LoadSideOutletDBTemp(0.0), LoadSideOutletHumRat(0.0), QLatRated(0.0), QLatActual(0.0), Winput(0.0), MyOneTimeFlag(true), firstTime(true) diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index 24675ac00a6..f3c59b9f966 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -305,7 +305,7 @@ namespace WaterUse { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); thisWEq.Name = state.dataIPShortCut->cAlphaArgs(1); thisWEq.EndUseSubcatName = state.dataIPShortCut->cAlphaArgs(2); @@ -361,7 +361,7 @@ namespace WaterUse { } if ((NumAlphas > 6) && (!state.dataIPShortCut->lAlphaFieldBlanks(7))) { - thisWEq.Zone = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(7), state.dataHeatBal->Zone); + thisWEq.Zone = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(7), state.dataHeatBal->Zone); if (thisWEq.Zone == 0) { ShowSevereError(state, @@ -418,7 +418,7 @@ namespace WaterUse { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); auto &waterConnection = state.dataWaterUse->WaterConnections(WaterConnNum); waterConnection.Name = state.dataIPShortCut->cAlphaArgs(1); @@ -502,7 +502,7 @@ namespace WaterUse { if ((!state.dataIPShortCut->lAlphaFieldBlanks(8)) && (state.dataIPShortCut->cAlphaArgs(8) != "NONE")) { waterConnection.HeatRecovery = true; waterConnection.HeatRecoveryHX = - static_cast(getEnumValue(HeatRecoverHXNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + static_cast(getEnumValue(HeatRecoverHXNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (waterConnection.HeatRecoveryHX == HeatRecovHX::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), state.dataIPShortCut->cAlphaArgs(8))); @@ -510,8 +510,8 @@ namespace WaterUse { ErrorsFound = true; } - waterConnection.HeatRecoveryConfig = static_cast( - getEnumValue(HeatRecoveryConfigNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + waterConnection.HeatRecoveryConfig = + static_cast(getEnumValue(HeatRecoveryConfigNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); if (waterConnection.HeatRecoveryConfig == HeatRecovConfig::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(9), state.dataIPShortCut->cAlphaArgs(9))); @@ -525,8 +525,7 @@ namespace WaterUse { waterConnection.myWaterEquipArr.allocate(NumAlphas - 9); for (AlphaNum = 10; AlphaNum <= NumAlphas; ++AlphaNum) { - int WaterEquipNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(AlphaNum), state.dataWaterUse->WaterEquipment); + int WaterEquipNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(AlphaNum), state.dataWaterUse->WaterEquipment); if (WaterEquipNum == 0) { ShowSevereError( diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index ba7e65b6027..c4a044069f4 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -90,7 +90,7 @@ namespace EnergyPlus { -namespace WeatherManager { +namespace Weather { // MODULE INFORMATION: // AUTHOR Rick Strand @@ -103,31 +103,31 @@ namespace WeatherManager { // weather, retrieving data from weather files, and supplying the // outdoor environment for each time step. - constexpr std::array(EpwHeaderType::Num)> epwHeaders({"LOCATION", - "DESIGN CONDITIONS", - "TYPICAL/EXTREME PERIODS", - "GROUND TEMPERATURES", - "HOLIDAYS/DAYLIGHT SAVING", - "COMMENTS 1", - "COMMENTS 2", - "DATA PERIODS"}); + constexpr std::array epwHeaders = {"LOCATION", + "DESIGN CONDITIONS", + "TYPICAL/EXTREME PERIODS", + "GROUND TEMPERATURES", + "HOLIDAYS/DAYLIGHT SAVING", + "COMMENTS 1", + "COMMENTS 2", + "DATA PERIODS"}; - static constexpr std::array(WaterMainsTempCalcMethod::Num)> waterMainsCalcMethodNames{ + static constexpr std::array waterMainsCalcMethodNames{ "Schedule", "Correlation", "CorrelationFromWeatherFile", "FixedDefault"}; - static constexpr std::array(WaterMainsTempCalcMethod::Num)> waterMainsCalcMethodNamesUC{ + static constexpr std::array waterMainsCalcMethodNamesUC{ "SCHEDULE", "CORRELATION", "CORRELATIONFROMWEATHERFILE", "FIXEDDEFAULT"}; - static constexpr std::array(SkyTempCalcType::Num)> SkyTempModelInputNamesUC{ + static constexpr std::array SkyTempModelNamesUC{ "CLARKALLEN", "SCHEDULEVALUE", "DIFFERENCESCHEDULEDRYBULBVALUE", "DIFFERENCESCHEDULEDEWPOINTVALUE", "BRUNT", "IDSO", "BERDAHLMARTIN"}; - static constexpr std::array(SkyTempCalcType::Num)> SkyTempModelNames{"Clark and Allen", - "Schedule Value", - "DryBulb Difference Schedule Value", - "Dewpoint Difference Schedule Value", - "Brunt", - "Idso", - "Berdahl and Martin"}; + static constexpr std::array SkyTempModelNames{"Clark and Allen", + "Schedule Value", + "DryBulb Difference Schedule Value", + "Dewpoint Difference Schedule Value", + "Brunt", + "Idso", + "Berdahl and Martin"}; void ManageWeather(EnergyPlusData &state) { @@ -142,7 +142,7 @@ namespace WeatherManager { // It controls the assignment of weather related global variables as // well as the reads and writes for weather information. - InitializeWeather(state, state.dataWeatherManager->PrintEnvrnStamp); + InitializeWeather(state, state.dataWeather->PrintEnvrnStamp); bool anyEMSRan = false; // Cannot call this during sizing, because EMS will not initialize properly until after simulation kickoff @@ -154,59 +154,61 @@ namespace WeatherManager { } SetCurrentWeather(state); - ReportWeatherAndTimeInformation(state, state.dataWeatherManager->PrintEnvrnStamp); + ReportWeatherAndTimeInformation(state, state.dataWeather->PrintEnvrnStamp); } void ResetEnvironmentCounter(EnergyPlusData &state) { - state.dataWeatherManager->Envrn = 0; + state.dataWeather->Envrn = 0; } bool CheckIfAnyUnderwaterBoundaries(EnergyPlusData &state) { bool errorsFound = false; int NumAlpha = 0, NumNumber = 0, IOStat = 0; - state.dataIPShortCut->cCurrentModuleObject = "SurfaceProperty:Underwater"; - int Num = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + + constexpr std::string_view routineName = "CheckIfAnyUnderwaterBoundaries"; + + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "SurfaceProperty:Underwater"; + int Num = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); for (int i = 1; i <= Num; i++) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, i, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumber, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - state.dataWeatherManager->underwaterBoundaries.emplace_back(); - auto &underwaterBoundary = state.dataWeatherManager->underwaterBoundaries[i - 1]; - underwaterBoundary.Name = state.dataIPShortCut->cAlphaArgs(1); - underwaterBoundary.distanceFromLeadingEdge = state.dataIPShortCut->rNumericArgs(1); - underwaterBoundary.OSCMIndex = UtilityRoutines::FindItemInList(underwaterBoundary.Name, state.dataSurface->OSCM); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + state.dataWeather->underwaterBoundaries.emplace_back(); + auto &underwaterBoundary = state.dataWeather->underwaterBoundaries[i - 1]; + underwaterBoundary.Name = ipsc->cAlphaArgs(1); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, underwaterBoundary.Name}; + + underwaterBoundary.distanceFromLeadingEdge = ipsc->rNumericArgs(1); + underwaterBoundary.OSCMIndex = Util::FindItemInList(underwaterBoundary.Name, state.dataSurface->OSCM); if (underwaterBoundary.OSCMIndex <= 0) { - ShowSevereError(state, "Could not match underwater boundary condition object with an Other Side Conditions Model input object."); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); errorsFound = true; } - underwaterBoundary.WaterTempScheduleIndex = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2)); + underwaterBoundary.WaterTempScheduleIndex = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(2)); if (underwaterBoundary.WaterTempScheduleIndex == 0) { - ShowSevereError( - state, format(R"(Water temperature schedule for "SurfaceProperty:Underwater" named "{} not found)", underwaterBoundary.Name)); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); errorsFound = true; } - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { + + if (ipsc->lAlphaFieldBlanks(3)) { // that's OK, we can have a blank schedule, the water will just have no free stream velocity underwaterBoundary.VelocityScheduleIndex = 0; - } else { - underwaterBoundary.VelocityScheduleIndex = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); - if (underwaterBoundary.WaterTempScheduleIndex == 0) { - ShowSevereError( - state, - format(R"(Free stream velocity schedule for "SurfaceProperty:Underwater" named {} not found")", underwaterBoundary.Name)); - errorsFound = true; - } + } else if ((underwaterBoundary.VelocityScheduleIndex = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(3))) == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); + errorsFound = true; } if (errorsFound) break; } @@ -245,7 +247,7 @@ namespace WeatherManager { void UpdateUnderwaterBoundaries(EnergyPlusData &state) { - for (auto &thisBoundary : state.dataWeatherManager->underwaterBoundaries) { + for (auto &thisBoundary : state.dataWeather->underwaterBoundaries) { Real64 const curWaterTemp = ScheduleManager::GetCurrentScheduleValue(state, thisBoundary.WaterTempScheduleIndex); // C Real64 freeStreamVelocity = 0; if (thisBoundary.VelocityScheduleIndex > 0) { @@ -253,7 +255,7 @@ namespace WeatherManager { } state.dataSurface->OSCM(thisBoundary.OSCMIndex).TConv = curWaterTemp; state.dataSurface->OSCM(thisBoundary.OSCMIndex).HConv = - WeatherManager::calculateWaterBoundaryConvectionCoefficient(curWaterTemp, freeStreamVelocity, thisBoundary.distanceFromLeadingEdge); + Weather::calculateWaterBoundaryConvectionCoefficient(curWaterTemp, freeStreamVelocity, thisBoundary.distanceFromLeadingEdge); state.dataSurface->OSCM(thisBoundary.OSCMIndex).TRad = curWaterTemp; state.dataSurface->OSCM(thisBoundary.OSCMIndex).HRad = 0.0; } @@ -262,23 +264,25 @@ namespace WeatherManager { void ReadVariableLocationOrientation(EnergyPlusData &state) { int NumAlpha = 0, NumNumber = 0, IOStat = 0; - state.dataIPShortCut->cCurrentModuleObject = "Site:VariableLocation"; - if (state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject) == 0) return; + auto const &ipsc = state.dataIPShortCut; + + ipsc->cCurrentModuleObject = "Site:VariableLocation"; + if (state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject) == 0) return; state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, 1, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumber, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - state.dataEnvrn->varyingLocationSchedIndexLat = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(1)); - state.dataEnvrn->varyingLocationSchedIndexLong = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2)); - state.dataEnvrn->varyingOrientationSchedIndex = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + state.dataEnvrn->varyingLocationSchedIndexLat = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(1)); + state.dataEnvrn->varyingLocationSchedIndexLong = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(2)); + state.dataEnvrn->varyingOrientationSchedIndex = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(3)); } void UpdateLocationAndOrientation(EnergyPlusData &state) @@ -298,31 +302,23 @@ namespace WeatherManager { state.dataSurfaceGeometry->SinBldgRelNorth = std::sin(-(state.dataHeatBal->BuildingAzimuth + state.dataHeatBal->BuildingRotationAppendixG) * Constant::DegToRadians); for (size_t SurfNum = 1; SurfNum < state.dataSurface->Surface.size(); ++SurfNum) { - for (int n = 1; n <= state.dataSurface->Surface(SurfNum).Sides; ++n) { - Real64 Xb = state.dataSurface->Surface(SurfNum).Vertex(n).x; - Real64 Yb = state.dataSurface->Surface(SurfNum).Vertex(n).y; - state.dataSurface->Surface(SurfNum).NewVertex(n).x = - Xb * state.dataSurfaceGeometry->CosBldgRelNorth - Yb * state.dataSurfaceGeometry->SinBldgRelNorth; - state.dataSurface->Surface(SurfNum).NewVertex(n).y = - Xb * state.dataSurfaceGeometry->SinBldgRelNorth + Yb * state.dataSurfaceGeometry->CosBldgRelNorth; - state.dataSurface->Surface(SurfNum).NewVertex(n).z = state.dataSurface->Surface(SurfNum).Vertex(n).z; - } - Vectors::CreateNewellSurfaceNormalVector(state.dataSurface->Surface(SurfNum).NewVertex, - state.dataSurface->Surface(SurfNum).Sides, - state.dataSurface->Surface(SurfNum).NewellSurfaceNormalVector); + auto &surf = state.dataSurface->Surface(SurfNum); + for (int n = 1; n <= surf.Sides; ++n) { + Real64 Xb = surf.Vertex(n).x; + Real64 Yb = surf.Vertex(n).y; + surf.NewVertex(n).x = Xb * state.dataSurfaceGeometry->CosBldgRelNorth - Yb * state.dataSurfaceGeometry->SinBldgRelNorth; + surf.NewVertex(n).y = Xb * state.dataSurfaceGeometry->SinBldgRelNorth + Yb * state.dataSurfaceGeometry->CosBldgRelNorth; + surf.NewVertex(n).z = surf.Vertex(n).z; + } + Vectors::CreateNewellSurfaceNormalVector(surf.NewVertex, surf.Sides, surf.NewellSurfaceNormalVector); Real64 SurfWorldAz = 0.0; Real64 SurfTilt = 0.0; - Vectors::DetermineAzimuthAndTilt(state.dataSurface->Surface(SurfNum).NewVertex, - SurfWorldAz, - SurfTilt, - state.dataSurface->Surface(SurfNum).lcsx, - state.dataSurface->Surface(SurfNum).lcsy, - state.dataSurface->Surface(SurfNum).lcsz, - state.dataSurface->Surface(SurfNum).NewellSurfaceNormalVector); - state.dataSurface->Surface(SurfNum).Azimuth = SurfWorldAz; - state.dataSurface->Surface(SurfNum).SinAzim = std::sin(SurfWorldAz * Constant::DegToRadians); - state.dataSurface->Surface(SurfNum).CosAzim = std::cos(SurfWorldAz * Constant::DegToRadians); - state.dataSurface->Surface(SurfNum).OutNormVec = state.dataSurface->Surface(SurfNum).NewellSurfaceNormalVector; + Vectors::DetermineAzimuthAndTilt( + surf.NewVertex, SurfWorldAz, SurfTilt, surf.lcsx, surf.lcsy, surf.lcsz, surf.NewellSurfaceNormalVector); + surf.Azimuth = SurfWorldAz; + surf.SinAzim = std::sin(SurfWorldAz * Constant::DegToRadians); + surf.CosAzim = std::cos(SurfWorldAz * Constant::DegToRadians); + surf.OutNormVec = surf.NewellSurfaceNormalVector; } } } @@ -333,8 +329,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN August 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is called from the outer simulation manager and determines @@ -354,7 +348,7 @@ namespace WeatherManager { int DSTActEnMon; int DSTActEnDay; - if (state.dataGlobal->BeginSimFlag && state.dataWeatherManager->GetEnvironmentFirstCall) { + if (state.dataGlobal->BeginSimFlag && state.dataWeather->GetEnvironmentFirstCall) { state.dataReportFlag->PrintEndDataDictionary = true; @@ -428,7 +422,7 @@ namespace WeatherManager { SetupOutputVariable(state, "Site Horizontal Infrared Radiation Rate per Area", OutputProcessor::Unit::W_m2, - state.dataWeatherManager->HorizIRSky, + state.dataWeather->HorizIRSky, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, "Environment"); @@ -533,35 +527,35 @@ namespace WeatherManager { SetupOutputVariable(state, "Site Solar Azimuth Angle", OutputProcessor::Unit::deg, - state.dataWeatherManager->SolarAzimuthAngle, + state.dataWeather->SolarAzimuthAngle, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, "Environment"); SetupOutputVariable(state, "Site Solar Altitude Angle", OutputProcessor::Unit::deg, - state.dataWeatherManager->SolarAltitudeAngle, + state.dataWeather->SolarAltitudeAngle, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, "Environment"); SetupOutputVariable(state, "Site Solar Hour Angle", OutputProcessor::Unit::deg, - state.dataWeatherManager->HrAngle, + state.dataWeather->HrAngle, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, "Environment"); SetupOutputVariable(state, "Site Rain Status", OutputProcessor::Unit::None, - state.dataWeatherManager->RptIsRain, + state.dataWeather->RptIsRain, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, "Environment"); SetupOutputVariable(state, "Site Snow on Ground Status", OutputProcessor::Unit::None, - state.dataWeatherManager->RptIsSnow, + state.dataWeather->RptIsSnow, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, "Environment"); @@ -624,7 +618,7 @@ namespace WeatherManager { SetupOutputVariable(state, "Site Day Type Index", OutputProcessor::Unit::None, - state.dataWeatherManager->RptDayType, + state.dataWeather->RptDayType, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::State, "Environment"); @@ -687,36 +681,35 @@ namespace WeatherManager { state.dataEnvrn->EMSWindDirOverrideOn, state.dataEnvrn->EMSWindDirOverrideValue); } - state.dataWeatherManager->GetEnvironmentFirstCall = false; + state.dataWeather->GetEnvironmentFirstCall = false; } // ... end of DataGlobals::BeginSimFlag IF-THEN block. - if (state.dataWeatherManager->GetBranchInputOneTimeFlag) { + if (state.dataWeather->GetBranchInputOneTimeFlag) { SetupInterpolationValues(state); - state.dataWeatherManager->TimeStepFraction = 1.0 / double(state.dataGlobal->NumOfTimeStepInHour); + state.dataWeather->TimeStepFraction = 1.0 / double(state.dataGlobal->NumOfTimeStepInHour); state.dataEnvrn->rhoAirSTP = Psychrometrics::PsyRhoAirFnPbTdbW( state, DataEnvironment::StdPressureSeaLevel, DataPrecisionGlobals::constant_twenty, DataPrecisionGlobals::constant_zero); OpenWeatherFile(state, ErrorsFound); // moved here because of possibility of special days on EPW file CloseWeatherFile(state); ReadUserWeatherInput(state); AllocateWeatherData(state); - if (state.dataWeatherManager->NumIntervalsPerHour != 1) { - if (state.dataWeatherManager->NumIntervalsPerHour != state.dataGlobal->NumOfTimeStepInHour) { + if (state.dataWeather->NumIntervalsPerHour != 1) { + if (state.dataWeather->NumIntervalsPerHour != state.dataGlobal->NumOfTimeStepInHour) { ShowSevereError( state, format("{}Number of intervals per hour on Weather file does not match specified number of Time Steps Per Hour", RoutineName)); ErrorsFound = true; } } - state.dataWeatherManager->GetBranchInputOneTimeFlag = false; - state.dataWeatherManager->Envrn = 0; - if (state.dataWeatherManager->NumOfEnvrn > 0) { + state.dataWeather->GetBranchInputOneTimeFlag = false; + state.dataWeather->Envrn = 0; + if (state.dataWeather->NumOfEnvrn > 0) { ResolveLocationInformation(state, ErrorsFound); // Obtain weather related info from input file CheckLocationValidity(state); - if ((state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn != Constant::KindOfSim::DesignDay) && - (state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn != - Constant::KindOfSim::HVACSizeDesignDay)) { + if ((state.dataWeather->Environment(state.dataWeather->NumOfEnvrn).KindOfEnvrn != Constant::KindOfSim::DesignDay) && + (state.dataWeather->Environment(state.dataWeather->NumOfEnvrn).KindOfEnvrn != Constant::KindOfSim::HVACSizeDesignDay)) { CheckWeatherFileValidity(state); } if (ErrorsFound) { @@ -751,84 +744,84 @@ namespace WeatherManager { state.dataEnvrn->CurrentOverallSimDay = 0; state.dataEnvrn->TotalOverallSimDays = 0; state.dataEnvrn->MaxNumberSimYears = 1; - for (int i = 1; i <= state.dataWeatherManager->NumOfEnvrn; ++i) { - state.dataEnvrn->TotalOverallSimDays += state.dataWeatherManager->Environment(i).TotalDays; - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { - state.dataEnvrn->MaxNumberSimYears = - max(state.dataEnvrn->MaxNumberSimYears, state.dataWeatherManager->Environment(i).NumSimYears); + for (int i = 1; i <= state.dataWeather->NumOfEnvrn; ++i) { + state.dataEnvrn->TotalOverallSimDays += state.dataWeather->Environment(i).TotalDays; + if (state.dataWeather->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { + state.dataEnvrn->MaxNumberSimYears = max(state.dataEnvrn->MaxNumberSimYears, state.dataWeather->Environment(i).NumSimYears); } } DisplaySimDaysProgress(state, state.dataEnvrn->CurrentOverallSimDay, state.dataEnvrn->TotalOverallSimDays); } CloseWeatherFile(state); // will only close if opened. - ++state.dataWeatherManager->Envrn; - state.dataWeatherManager->DatesShouldBeReset = false; - if (state.dataWeatherManager->Envrn > state.dataWeatherManager->NumOfEnvrn) { + ++state.dataWeather->Envrn; + state.dataWeather->DatesShouldBeReset = false; + if (state.dataWeather->Envrn > state.dataWeather->NumOfEnvrn) { Available = false; - state.dataWeatherManager->Envrn = 0; + state.dataWeather->Envrn = 0; state.dataEnvrn->CurEnvirNum = 0; } else { - state.dataGlobal->KindOfSim = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn; - state.dataEnvrn->DayOfYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartJDay; - state.dataEnvrn->DayOfMonth = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay; - state.dataGlobal->CalendarYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear; + auto &envCurr = state.dataWeather->Environment(state.dataWeather->Envrn); + state.dataGlobal->KindOfSim = envCurr.KindOfEnvrn; + state.dataEnvrn->DayOfYear = envCurr.StartJDay; + state.dataEnvrn->DayOfMonth = envCurr.StartDay; + state.dataGlobal->CalendarYear = envCurr.StartYear; state.dataGlobal->CalendarYearChr = fmt::to_string(state.dataGlobal->CalendarYear); - state.dataEnvrn->Month = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth; - state.dataGlobal->NumOfDayInEnvrn = - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays; // Set day loop maximum from DataGlobals - if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation) { - if (state.dataHeatBal->AdaptiveComfortRequested_ASH55 || state.dataHeatBal->AdaptiveComfortRequested_CEN15251) { - if (state.dataGlobal->KindOfSim == Constant::KindOfSim::DesignDay) { - if (state.dataGlobal->DoDesDaySim) { - ShowWarningError(state, format("{}Adaptive Comfort being reported during design day.", RoutineName)); - Real64 GrossApproxAvgDryBulb = (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).MaxDryBulb + - (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).MaxDryBulb - - state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).DailyDBRange)) / - 2.0; - if (state.dataHeatBal->AdaptiveComfortRequested_ASH55) - ThermalComfort::CalcThermalComfortAdaptiveASH55(state, true, false, GrossApproxAvgDryBulb); - if (state.dataHeatBal->AdaptiveComfortRequested_CEN15251) - ThermalComfort::CalcThermalComfortAdaptiveCEN15251(state, true, false, GrossApproxAvgDryBulb); - } - } else { - if (state.dataGlobal->DoWeathSim || state.dataGlobal->DoDesDaySim) { - if (state.dataHeatBal->AdaptiveComfortRequested_ASH55) - ThermalComfort::CalcThermalComfortAdaptiveASH55(state, true, true, 0.0); - if (state.dataHeatBal->AdaptiveComfortRequested_CEN15251) - ThermalComfort::CalcThermalComfortAdaptiveCEN15251(state, true, true, 0.0); - } + state.dataEnvrn->Month = envCurr.StartMonth; + state.dataGlobal->NumOfDayInEnvrn = envCurr.TotalDays; // Set day loop maximum from DataGlobals + + if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation && + (state.dataHeatBal->AdaptiveComfortRequested_ASH55 || state.dataHeatBal->AdaptiveComfortRequested_CEN15251)) { + if (state.dataGlobal->KindOfSim == Constant::KindOfSim::DesignDay) { + if (state.dataGlobal->DoDesDaySim) { + ShowWarningError(state, format("{}Adaptive Comfort being reported during design day.", RoutineName)); + Real64 GrossApproxAvgDryBulb = (state.dataWeather->DesDayInput(state.dataWeather->Envrn).MaxDryBulb + + (state.dataWeather->DesDayInput(state.dataWeather->Envrn).MaxDryBulb - + state.dataWeather->DesDayInput(state.dataWeather->Envrn).DailyDBRange)) / + 2.0; + if (state.dataHeatBal->AdaptiveComfortRequested_ASH55) + ThermalComfort::CalcThermalComfortAdaptiveASH55(state, true, false, GrossApproxAvgDryBulb); + if (state.dataHeatBal->AdaptiveComfortRequested_CEN15251) + ThermalComfort::CalcThermalComfortAdaptiveCEN15251(state, true, false, GrossApproxAvgDryBulb); + } + } else { + if (state.dataGlobal->DoWeathSim || state.dataGlobal->DoDesDaySim) { + if (state.dataHeatBal->AdaptiveComfortRequested_ASH55) + ThermalComfort::CalcThermalComfortAdaptiveASH55(state, true, true, 0.0); + if (state.dataHeatBal->AdaptiveComfortRequested_CEN15251) + ThermalComfort::CalcThermalComfortAdaptiveCEN15251(state, true, true, 0.0); } } } - if (state.dataWeatherManager->Envrn > state.dataEnvrn->TotDesDays && state.dataWeatherManager->WeatherFileExists) { + + if (state.dataWeather->Envrn > state.dataEnvrn->TotDesDays && state.dataWeather->WeatherFileExists) { OpenEPlusWeatherFile(state, ErrorsFound, false); } Available = true; if ((state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) && - (!state.dataWeatherManager->WeatherFileExists && state.dataGlobal->DoWeathSim)) { + (!state.dataWeather->WeatherFileExists && state.dataGlobal->DoWeathSim)) { if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation) { ShowSevereError(state, "Weather Simulation requested, but no weather file attached."); ErrorsFound = true; } - if (!state.dataGlobal->DoingHVACSizingSimulations) state.dataWeatherManager->Envrn = 0; + if (!state.dataGlobal->DoingHVACSizingSimulations) state.dataWeather->Envrn = 0; Available = false; } else if ((state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) && - (!state.dataWeatherManager->WeatherFileExists && !state.dataGlobal->DoWeathSim)) { + (!state.dataWeather->WeatherFileExists && !state.dataGlobal->DoWeathSim)) { Available = false; - if (!state.dataGlobal->DoingHVACSizingSimulations) state.dataWeatherManager->Envrn = 0; + if (!state.dataGlobal->DoingHVACSizingSimulations) state.dataWeather->Envrn = 0; } else if ((state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) && state.dataGlobal->DoingSizing) { Available = false; - state.dataWeatherManager->Envrn = 0; + state.dataWeather->Envrn = 0; } - if (!ErrorsFound && Available && state.dataWeatherManager->Envrn > 0) { - state.dataEnvrn->EnvironmentName = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).Title; - state.dataEnvrn->CurEnvirNum = state.dataWeatherManager->Envrn; + if (!ErrorsFound && Available && state.dataWeather->Envrn > 0) { + state.dataEnvrn->EnvironmentName = envCurr.Title; + state.dataEnvrn->CurEnvirNum = state.dataWeather->Envrn; state.dataEnvrn->RunPeriodStartDayOfWeek = 0; if ((state.dataGlobal->DoDesDaySim && (state.dataGlobal->KindOfSim != Constant::KindOfSim::RunPeriodWeather)) || ((state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) && state.dataGlobal->DoWeathSim)) { - if (state.dataWeatherManager->PrntEnvHeaders && state.dataReportFlag->DoWeatherInitReporting) { + if (state.dataWeather->PrntEnvHeaders && state.dataReportFlag->DoWeatherInitReporting) { static constexpr std::string_view EnvironFormat( "! ,Environment Name,Environment Type, Start Date, End Date, Start DayOfWeek, Duration {#days}, " "Source:Start DayOfWeek, Use Daylight Saving, Use Holidays, Apply Weekend Holiday Rule, Use Rain Values, Use Snow " @@ -837,49 +830,45 @@ namespace WeatherManager { ", Daylight Saving Indicator, Source, Start Date, End Date\n! , " "NumberofWarmupDays"); print(state.files.eio, "{}\n", EnvironFormat); - state.dataWeatherManager->PrntEnvHeaders = false; + state.dataWeather->PrntEnvHeaders = false; } if ((state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) || (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodDesign)) { - std::string kindOfRunPeriod = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).cKindOfEnvrn; + std::string kindOfRunPeriod = envCurr.cKindOfEnvrn; state.dataEnvrn->RunPeriodEnvironment = state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather; - state.dataEnvrn->CurrentYearIsLeapYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).IsLeapYear; - if (state.dataEnvrn->CurrentYearIsLeapYear && state.dataWeatherManager->WFAllowsLeapYears) { - state.dataWeatherManager->LeapYearAdd = 1; + state.dataEnvrn->CurrentYearIsLeapYear = state.dataWeather->Environment(state.dataWeather->Envrn).IsLeapYear; + if (state.dataEnvrn->CurrentYearIsLeapYear && state.dataWeather->WFAllowsLeapYears) { + state.dataWeather->LeapYearAdd = 1; } else { - state.dataWeatherManager->LeapYearAdd = 0; + state.dataWeather->LeapYearAdd = 0; } if (state.dataEnvrn->CurrentYearIsLeapYear) { - state.dataWeatherManager->EndDayOfMonthWithLeapDay(2) = - state.dataWeatherManager->EndDayOfMonth(2) + state.dataWeatherManager->LeapYearAdd; + state.dataWeather->EndDayOfMonthWithLeapDay(2) = state.dataWeather->EndDayOfMonth(2) + state.dataWeather->LeapYearAdd; } - state.dataWeatherManager->UseDaylightSaving = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseDST; - state.dataWeatherManager->UseSpecialDays = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseHolidays; - state.dataWeatherManager->UseRainValues = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseRain; - state.dataWeatherManager->UseSnowValues = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseSnow; + state.dataWeather->UseDaylightSaving = envCurr.UseDST; + state.dataWeather->UseSpecialDays = envCurr.UseHolidays; + state.dataWeather->UseRainValues = envCurr.UseRain; + state.dataWeather->UseSnowValues = envCurr.UseSnow; bool missingLeap(false); // Defer acting on anything found here until after the other range checks (see below) - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).ActualWeather && - !state.dataWeatherManager->WFAllowsLeapYears) { - for (int year = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear; - year <= state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndYear; - year++) { - if (isLeapYear(year)) { - ShowSevereError(state, - format("{}Weatherfile does not support leap years but runperiod includes a leap year ({})", - RoutineName, - year)); - missingLeap = true; - } + + if (envCurr.ActualWeather && !state.dataWeather->WFAllowsLeapYears) { + for (int year = envCurr.StartYear; year <= envCurr.EndYear; year++) { + if (!isLeapYear(year)) continue; + + ShowSevereError( + state, + format("{}Weatherfile does not support leap years but runperiod includes a leap year ({})", RoutineName, year)); + missingLeap = true; } } bool OkRun = false; - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).ActualWeather) { + if (envCurr.ActualWeather) { // Actual weather - for (auto &dataperiod : state.dataWeatherManager->DataPeriods) { + for (auto &dataperiod : state.dataWeather->DataPeriods) { int runStartJulian = dataperiod.DataStJDay; int runEndJulian = dataperiod.DataEnJDay; if (!dataperiod.HasYearData) { @@ -888,66 +877,45 @@ namespace WeatherManager { "year included in start/end date.", RoutineName)); ShowContinueError(state, "...to match the RunPeriod, the DATA PERIOD should be mm/dd/yyyy for both, or"); - ShowContinueError(state, R"(...set "Treat Weather as Actual" to "No".)"); + ShowContinueError(state, "(...set \"Treat Weather as Actual\" to \"No\".)"); } - if (!General::BetweenDates(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDate, - runStartJulian, - runEndJulian)) - continue; - if (!General::BetweenDates( - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndDate, runStartJulian, runEndJulian)) - continue; + if (!General::BetweenDates(envCurr.StartDate, runStartJulian, runEndJulian)) continue; + if (!General::BetweenDates(envCurr.EndDate, runStartJulian, runEndJulian)) continue; OkRun = true; break; } } else { // Typical (or just non-actual) weather - for (auto &dataperiod : state.dataWeatherManager->DataPeriods) { + for (auto &dataperiod : state.dataWeather->DataPeriods) { // Since this is not actual weather, there may be issues with this calculation // Assume the weather data starts the same year as the simulation, so LeapYearAdd is what // should be used. - int runStartOrdinal = General::OrdinalDay(dataperiod.StMon, dataperiod.StDay, state.dataWeatherManager->LeapYearAdd); + int runStartOrdinal = General::OrdinalDay(dataperiod.StMon, dataperiod.StDay, state.dataWeather->LeapYearAdd); // This one is harder, leave as is for now. What about multiple years of data? - int runEndOrdinal = General::OrdinalDay(dataperiod.EnMon, dataperiod.EnDay, state.dataWeatherManager->LeapYearAdd); + int runEndOrdinal = General::OrdinalDay(dataperiod.EnMon, dataperiod.EnDay, state.dataWeather->LeapYearAdd); if (runStartOrdinal == 1 && (runEndOrdinal == 366 || runEndOrdinal == 365)) { // Complete year(s) of weather data, will wrap around OkRun = true; break; } - if (!General::BetweenDates(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartJDay, - runStartOrdinal, - runEndOrdinal)) - continue; - if (!General::BetweenDates(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndJDay, - runStartOrdinal, - runEndOrdinal)) - continue; + if (!General::BetweenDates(envCurr.StartJDay, runStartOrdinal, runEndOrdinal)) continue; + if (!General::BetweenDates(envCurr.EndJDay, runStartOrdinal, runEndOrdinal)) continue; OkRun = true; } } if (!OkRun) { - if (!state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).ActualWeather) { - StDate = format(DateFormat, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay); - EnDate = format(DateFormat, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndDay); + if (!envCurr.ActualWeather) { + StDate = format(DateFormat, envCurr.StartMonth, envCurr.StartDay); + EnDate = format(DateFormat, envCurr.EndMonth, envCurr.EndDay); ShowSevereError(state, format("{}Runperiod [mm/dd] (Start={},End={}) requested not within Data Period(s) from Weather File", RoutineName, StDate, EnDate)); } else { - StDate = format(DateFormatWithYear, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear); - EnDate = format(DateFormatWithYear, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndDay, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndYear); + StDate = format(DateFormatWithYear, envCurr.StartMonth, envCurr.StartDay, envCurr.StartYear); + EnDate = format(DateFormatWithYear, envCurr.EndMonth, envCurr.EndDay, envCurr.EndYear); ShowSevereError( state, format("{}Runperiod [mm/dd/yyyy] (Start={},End={}) requested not within Data Period(s) from Weather File", @@ -955,21 +923,21 @@ namespace WeatherManager { StDate, EnDate)); } - StDate = - format(DateFormat, state.dataWeatherManager->DataPeriods(1).StMon, state.dataWeatherManager->DataPeriods(1).StDay); - EnDate = - format(DateFormat, state.dataWeatherManager->DataPeriods(1).EnMon, state.dataWeatherManager->DataPeriods(1).EnDay); - if (state.dataWeatherManager->DataPeriods(1).StYear > 0) { - StDate += format("/{}", state.dataWeatherManager->DataPeriods(1).StYear); + + auto const &dataPeriod1 = state.dataWeather->DataPeriods(1); + StDate = format(DateFormat, dataPeriod1.StMon, dataPeriod1.StDay); + EnDate = format(DateFormat, dataPeriod1.EnMon, dataPeriod1.EnDay); + if (dataPeriod1.StYear > 0) { + StDate += format("/{}", dataPeriod1.StYear); } else { StDate += "/"; } - if (state.dataWeatherManager->DataPeriods(1).EnYear > 0) { - EnDate += format("/{}", state.dataWeatherManager->DataPeriods(1).EnYear); + if (dataPeriod1.EnYear > 0) { + EnDate += format("/{}", dataPeriod1.EnYear); } else { EnDate += "/"; } - if (state.dataWeatherManager->NumDataPeriods == 1) { + if (state.dataWeather->NumDataPeriods == 1) { ShowContinueError(state, format("Weather Data Period (Start={},End={})", StDate, EnDate)); } else { ShowContinueError(state, format("Multiple Weather Data Periods 1st (Start={},End={})", StDate, EnDate)); @@ -983,250 +951,199 @@ namespace WeatherManager { } // Following builds Environment start/end for ASHRAE 55 warnings - StDate = format(DateFormat, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay); - EnDate = format(DateFormat, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndDay); - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == - Constant::KindOfSim::RunPeriodWeather) { - StDate += format("/{}", state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear); - EnDate += format("/{}", state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndYear); + StDate = format(DateFormat, envCurr.StartMonth, envCurr.StartDay); + EnDate = format(DateFormat, envCurr.EndMonth, envCurr.EndDay); + if (envCurr.KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { + StDate += format("/{}", envCurr.StartYear); + EnDate += format("/{}", envCurr.EndYear); } state.dataEnvrn->EnvironmentStartEnd = StDate + " - " + EnDate; - state.dataEnvrn->StartYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartYear; - state.dataEnvrn->EndYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndYear; + state.dataEnvrn->StartYear = envCurr.StartYear; + state.dataEnvrn->EndYear = envCurr.EndYear; - int TWeekDay = (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DayOfWeek == 0) - ? 1 - : state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DayOfWeek; - auto const &MonWeekDay = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).MonWeekDay; + int TWeekDay = (envCurr.DayOfWeek == 0) ? 1 : envCurr.DayOfWeek; + auto const &MonWeekDay = envCurr.MonWeekDay; if (state.dataReportFlag->DoWeatherInitReporting) { - std::string const AlpUseDST = - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseDST) ? "Yes" : "No"; - std::string const AlpUseSpec = - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseHolidays) ? "Yes" : "No"; - std::string const ApWkRule = - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).ApplyWeekendRule) ? "Yes" : "No"; - std::string const AlpUseRain = - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseRain) ? "Yes" : "No"; - std::string const AlpUseSnow = - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseSnow) ? "Yes" : "No"; + std::string_view const AlpUseDST = (envCurr.UseDST) ? "Yes" : "No"; + std::string_view const AlpUseSpec = (envCurr.UseHolidays) ? "Yes" : "No"; + std::string_view const ApWkRule = (envCurr.ApplyWeekendRule) ? "Yes" : "No"; + std::string_view const AlpUseRain = (envCurr.UseRain) ? "Yes" : "No"; + std::string_view const AlpUseSnow = (envCurr.UseSnow) ? "Yes" : "No"; print(state.files.eio, EnvNameFormat, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).Title, + envCurr.Title, kindOfRunPeriod, StDate, EnDate, ScheduleManager::dayTypeNames[TWeekDay], - fmt::to_string(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays), + fmt::to_string(envCurr.TotalDays), "Use RunPeriod Specified Day", AlpUseDST, AlpUseSpec, ApWkRule, AlpUseRain, AlpUseSnow, - SkyTempModelNames[static_cast( - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel)]); + SkyTempModelNames[(int)envCurr.skyTempModel]); } - if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation) { - if ((state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather && state.dataGlobal->DoWeathSim)) { - if (state.dataHeatBal->AdaptiveComfortRequested_ASH55 || state.dataHeatBal->AdaptiveComfortRequested_CEN15251) { - if (state.dataWeatherManager->WFAllowsLeapYears) { - ShowSevereError( - state, - format("{}AdaptiveComfort Reporting does not work correctly with leap years in weather files.", - RoutineName)); - ErrorsFound = true; - } - if (state.dataWeatherManager->NumDataPeriods != 1) { - ShowSevereError( - state, - format("{}AdaptiveComfort Reporting does not work correctly with multiple dataperiods in weather files.", - RoutineName)); - ErrorsFound = true; - } - if (state.dataWeatherManager->DataPeriods(1).StMon == 1 && state.dataWeatherManager->DataPeriods(1).StDay == 1) { - int RunStJDay = General::OrdinalDay(state.dataWeatherManager->DataPeriods(1).StMon, - state.dataWeatherManager->DataPeriods(1).StDay, - state.dataWeatherManager->LeapYearAdd); - int RunEnJDay = General::OrdinalDay(state.dataWeatherManager->DataPeriods(1).EnMon, - state.dataWeatherManager->DataPeriods(1).EnDay, - state.dataWeatherManager->LeapYearAdd); - if (RunEnJDay - RunStJDay + 1 != 365) { - ShowSevereError(state, - format("{}AdaptiveComfort Reporting does not work correctly with weather files that do " - "not contain 365 days.", - RoutineName)); - ErrorsFound = true; - } - } else { - ShowSevereError(state, - format("{}AdaptiveComfort Reporting does not work correctly with weather files that do not " - "start on 1 January.", - RoutineName)); - ErrorsFound = true; - } - if (state.dataWeatherManager->NumIntervalsPerHour != 1) { - ShowSevereError(state, - format("{}AdaptiveComfort Reporting does not work correctly with weather files that have " - "multiple interval records per hour.", - RoutineName)); - ErrorsFound = true; - } + if (!state.dataGlobal->DoingSizing && !state.dataGlobal->KickOffSimulation && + (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather && state.dataGlobal->DoWeathSim) && + (state.dataHeatBal->AdaptiveComfortRequested_ASH55 || state.dataHeatBal->AdaptiveComfortRequested_CEN15251)) { + if (state.dataWeather->WFAllowsLeapYears) { + ShowSevereError( + state, + format("{}AdaptiveComfort Reporting does not work correctly with leap years in weather files.", RoutineName)); + ErrorsFound = true; + } + if (state.dataWeather->NumDataPeriods != 1) { + ShowSevereError( + state, + format("{}AdaptiveComfort Reporting does not work correctly with multiple dataperiods in weather files.", + RoutineName)); + ErrorsFound = true; + } + auto const &dataPeriod1 = state.dataWeather->DataPeriods(1); + if (dataPeriod1.StMon == 1 && dataPeriod1.StDay == 1) { + int RunStJDay = General::OrdinalDay(dataPeriod1.StMon, dataPeriod1.StDay, state.dataWeather->LeapYearAdd); + int RunEnJDay = General::OrdinalDay(dataPeriod1.EnMon, dataPeriod1.EnDay, state.dataWeather->LeapYearAdd); + if (RunEnJDay - RunStJDay + 1 != 365) { + ShowSevereError(state, + format("{}AdaptiveComfort Reporting does not work correctly with weather files that do " + "not contain 365 days.", + RoutineName)); + ErrorsFound = true; } + } else { + ShowSevereError(state, + format("{}AdaptiveComfort Reporting does not work correctly with weather files that do not " + "start on 1 January.", + RoutineName)); + ErrorsFound = true; } - } + if (state.dataWeather->NumIntervalsPerHour != 1) { + ShowSevereError(state, + format("{}AdaptiveComfort Reporting does not work correctly with weather files that have " + "multiple interval records per hour.", + RoutineName)); + ErrorsFound = true; + } + } // if // Only need to set Week days for Run Days state.dataEnvrn->RunPeriodStartDayOfWeek = TWeekDay; - state.dataWeatherManager->WeekDayTypes = 0; - int JDay5Start = General::OrdinalDay(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay, - state.dataWeatherManager->LeapYearAdd); - int JDay5End = General::OrdinalDay(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndMonth, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).EndDay, - state.dataWeatherManager->LeapYearAdd); - - state.dataWeatherManager->curSimDayForEndOfRunPeriod = - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).TotalDays; - - { - int i = JDay5Start; - while (true) { - state.dataWeatherManager->WeekDayTypes(i) = TWeekDay; - TWeekDay = mod(TWeekDay, 7) + 1; - ++i; - if (i > 366) i = 1; - if (i == JDay5End) break; - } + state.dataWeather->WeekDayTypes = 0; + int JDay5Start = General::OrdinalDay(envCurr.StartMonth, envCurr.StartDay, state.dataWeather->LeapYearAdd); + int JDay5End = General::OrdinalDay(envCurr.EndMonth, envCurr.EndDay, state.dataWeather->LeapYearAdd); + + state.dataWeather->curSimDayForEndOfRunPeriod = envCurr.TotalDays; + + int i = JDay5Start; + while (true) { + state.dataWeather->WeekDayTypes(i) = TWeekDay; + TWeekDay = mod(TWeekDay, 7) + 1; + ++i; + if (i > 366) i = 1; + if (i == JDay5End) break; } - if (state.dataWeatherManager->UseDaylightSaving) { - if (state.dataWeatherManager->EPWDaylightSaving) { - state.dataWeatherManager->DaylightSavingIsActive = true; - } - } else { - state.dataWeatherManager->DaylightSavingIsActive = false; - } - if (state.dataWeatherManager->IDFDaylightSaving) { - state.dataWeatherManager->DaylightSavingIsActive = true; - } - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SetWeekDays = false; + state.dataWeather->DaylightSavingIsActive = + (state.dataWeather->UseDaylightSaving && state.dataWeather->EPWDaylightSaving) || state.dataWeather->IDFDaylightSaving; + + envCurr.SetWeekDays = false; - if (state.dataWeatherManager->DaylightSavingIsActive) { - SetDSTDateRanges( - state, MonWeekDay, state.dataWeatherManager->DSTIndex, DSTActStMon, DSTActStDay, DSTActEnMon, DSTActEnDay); + if (state.dataWeather->DaylightSavingIsActive) { + SetDSTDateRanges(state, MonWeekDay, state.dataWeather->DSTIndex, DSTActStMon, DSTActStDay, DSTActEnMon, DSTActEnDay); } SetSpecialDayDates(state, MonWeekDay); - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth != 1 || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay != 1) { - state.dataWeatherManager->StartDatesCycleShouldBeReset = true; - state.dataWeatherManager->Jan1DatesShouldBeReset = true; + if (envCurr.StartMonth != 1 || envCurr.StartDay != 1) { + state.dataWeather->StartDatesCycleShouldBeReset = true; + state.dataWeather->Jan1DatesShouldBeReset = true; } - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth == 1 && - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay == 1) { - state.dataWeatherManager->StartDatesCycleShouldBeReset = false; - state.dataWeatherManager->Jan1DatesShouldBeReset = true; + if (envCurr.StartMonth == 1 && envCurr.StartDay == 1) { + state.dataWeather->StartDatesCycleShouldBeReset = false; + state.dataWeather->Jan1DatesShouldBeReset = true; } - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).ActualWeather) { - state.dataWeatherManager->StartDatesCycleShouldBeReset = false; - state.dataWeatherManager->Jan1DatesShouldBeReset = true; + if (envCurr.ActualWeather) { + state.dataWeather->StartDatesCycleShouldBeReset = false; + state.dataWeather->Jan1DatesShouldBeReset = true; } // Report Actual Dates for Daylight Saving and Special Days if (!state.dataGlobal->KickOffSimulation) { std::string Source; - if (state.dataWeatherManager->UseDaylightSaving) { - if (state.dataWeatherManager->EPWDaylightSaving) { + if (state.dataWeather->UseDaylightSaving) { + if (state.dataWeather->EPWDaylightSaving) { Source = "WeatherFile"; } } else { Source = "RunPeriod Object"; } - if (state.dataWeatherManager->IDFDaylightSaving) { + if (state.dataWeather->IDFDaylightSaving) { Source = "InputFile"; } - if (state.dataWeatherManager->DaylightSavingIsActive && state.dataReportFlag->DoWeatherInitReporting) { + if (state.dataWeather->DaylightSavingIsActive && state.dataReportFlag->DoWeatherInitReporting) { StDate = format(DateFormat, DSTActStMon, DSTActStDay); EnDate = format(DateFormat, DSTActEnMon, DSTActEnDay); print(state.files.eio, EnvDSTYFormat, Source, StDate, EnDate); } else if (state.dataGlobal->DoOutputReporting) { print(state.files.eio, EnvDSTNFormat, Source); } - for (int i = 1; i <= state.dataWeatherManager->NumSpecialDays; ++i) { + for (int i = 1; i <= state.dataWeather->NumSpecialDays; ++i) { + auto &specialDay = state.dataWeather->SpecialDays(i); static constexpr std::string_view EnvSpDyFormat("Environment:Special Days,{},{},{},{},{:3}\n"); - if (state.dataWeatherManager->SpecialDays(i).WthrFile && state.dataWeatherManager->UseSpecialDays && - state.dataReportFlag->DoWeatherInitReporting) { - StDate = format(DateFormat, - state.dataWeatherManager->SpecialDays(i).ActStMon, - state.dataWeatherManager->SpecialDays(i).ActStDay); + if (specialDay.WthrFile && state.dataWeather->UseSpecialDays && state.dataReportFlag->DoWeatherInitReporting) { + StDate = format(DateFormat, specialDay.ActStMon, specialDay.ActStDay); print(state.files.eio, EnvSpDyFormat, - state.dataWeatherManager->SpecialDays(i).Name, - ScheduleManager::dayTypeNames[state.dataWeatherManager->SpecialDays(i).DayType], + specialDay.Name, + ScheduleManager::dayTypeNames[specialDay.DayType], "WeatherFile", StDate, - state.dataWeatherManager->SpecialDays(i).Duration); + specialDay.Duration); } - if (!state.dataWeatherManager->SpecialDays(i).WthrFile && state.dataReportFlag->DoWeatherInitReporting) { - StDate = format(DateFormat, - state.dataWeatherManager->SpecialDays(i).ActStMon, - state.dataWeatherManager->SpecialDays(i).ActStDay); + if (!specialDay.WthrFile && state.dataReportFlag->DoWeatherInitReporting) { + StDate = format(DateFormat, specialDay.ActStMon, specialDay.ActStDay); print(state.files.eio, EnvSpDyFormat, - state.dataWeatherManager->SpecialDays(i).Name, - ScheduleManager::dayTypeNames[state.dataWeatherManager->SpecialDays(i).DayType], + specialDay.Name, + ScheduleManager::dayTypeNames[specialDay.DayType], "InputFile", StDate, - state.dataWeatherManager->SpecialDays(i).Duration); + specialDay.Duration); } } } } else if (state.dataGlobal->KindOfSim == Constant::KindOfSim::DesignDay || state.dataGlobal->KindOfSim == Constant::KindOfSim::HVACSizeDesignDay) { // Design Day + auto const &desDayInput = state.dataWeather->DesDayInput(envCurr.DesignDayNum); state.dataEnvrn->RunPeriodEnvironment = false; - StDate = format( - DateFormat, - state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum) - .Month, - state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum) - .DayOfMonth); + StDate = format(DateFormat, desDayInput.Month, desDayInput.DayOfMonth); EnDate = StDate; if (state.dataReportFlag->DoWeatherInitReporting) { - print( - state.files.eio, - EnvNameFormat, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).Title, - "SizingPeriod:DesignDay", - StDate, - EnDate, - ScheduleManager::dayTypeNames[state.dataWeatherManager - ->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn) - .DesignDayNum) - .DayType], - "1", - "N/A", - "N/A", - "N/A", - "N/A", - "N/A", - "N/A", - SkyTempModelNames[static_cast( - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel)]); + print(state.files.eio, + EnvNameFormat, + envCurr.Title, + "SizingPeriod:DesignDay", + StDate, + EnDate, + ScheduleManager::dayTypeNames[desDayInput.DayType], + "1", + "N/A", + "N/A", + "N/A", + "N/A", + "N/A", + "N/A", + SkyTempModelNames[(int)envCurr.skyTempModel]); } - if (state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum) - .DSTIndicator == 0 && - state.dataReportFlag->DoWeatherInitReporting) { + if (desDayInput.DSTIndicator == 0 && state.dataReportFlag->DoWeatherInitReporting) { print(state.files.eio, EnvDSTNFormat, "SizingPeriod:DesignDay"); } else if (state.dataReportFlag->DoWeatherInitReporting) { print(state.files.eio, EnvDSTYFormat, "SizingPeriod:DesignDay", StDate, EnDate); @@ -1247,28 +1164,28 @@ namespace WeatherManager { void AddDesignSetToEnvironmentStruct(EnergyPlusData &state, int const HVACSizingIterCount) { - int OrigNumOfEnvrn{state.dataWeatherManager->NumOfEnvrn}; + int OrigNumOfEnvrn = state.dataWeather->NumOfEnvrn; for (int i = 1; i <= OrigNumOfEnvrn; ++i) { - if (state.dataWeatherManager->Environment(i).KindOfEnvrn == Constant::KindOfSim::DesignDay) { - state.dataWeatherManager->Environment.redimension(++state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn) = - state.dataWeatherManager->Environment(i); // copy over seed data from current array element - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).SeedEnvrnNum = i; - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = Constant::KindOfSim::HVACSizeDesignDay; - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).Title = - format("{} HVAC Sizing Pass {}", state.dataWeatherManager->Environment(i).Title, HVACSizingIterCount); - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).HVACSizingIterationNum = HVACSizingIterCount; - } else if (state.dataWeatherManager->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { - state.dataWeatherManager->Environment.redimension(++state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn) = - state.dataWeatherManager->Environment(i); // copy over seed data - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).SeedEnvrnNum = i; - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = - Constant::KindOfSim::HVACSizeRunPeriodDesign; - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).Title = - format("{} HVAC Sizing Pass {}", state.dataWeatherManager->Environment(i).Title, HVACSizingIterCount); - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).HVACSizingIterationNum = HVACSizingIterCount; + // Gotcha: references may no longer be valid after a redimension! Cannot declare reference to Environment(i) here. + if (state.dataWeather->Environment(i).KindOfEnvrn == Constant::KindOfSim::DesignDay) { + state.dataWeather->Environment.redimension(++state.dataWeather->NumOfEnvrn); + auto &envBase = state.dataWeather->Environment(i); + auto &envNew = state.dataWeather->Environment(state.dataWeather->NumOfEnvrn); + envNew = envBase; // copy over seed data from current array element + envNew.SeedEnvrnNum = i; + envNew.KindOfEnvrn = Constant::KindOfSim::HVACSizeDesignDay; + envNew.Title = format("{} HVAC Sizing Pass {}", envBase.Title, HVACSizingIterCount); + envNew.HVACSizingIterationNum = HVACSizingIterCount; + } else if (state.dataWeather->Environment(i).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { + state.dataWeather->Environment.redimension(++state.dataWeather->NumOfEnvrn); + auto &envBase = state.dataWeather->Environment(i); + auto &envNew = state.dataWeather->Environment(state.dataWeather->NumOfEnvrn); + envNew = envBase; // copy over seed data + envNew.SeedEnvrnNum = i; + envNew.KindOfEnvrn = Constant::KindOfSim::HVACSizeRunPeriodDesign; + envNew.Title = format("{} HVAC Sizing Pass {}", envBase.Title, HVACSizingIterCount); + envNew.HVACSizingIterationNum = HVACSizingIterCount; } } // for each loop over Environment data strucure } @@ -1279,8 +1196,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN August 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine calculates the weekday for each month based on the start date and @@ -1300,19 +1215,19 @@ namespace WeatherManager { for (int i = StMon + 1; i <= 12; ++i) { if (i == 2) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(1); + CurWeekDay += state.dataWeather->EndDayOfMonth(1); while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(i) = CurWeekDay; } else if (i == 3) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(i - 1) + state.dataWeatherManager->LeapYearAdd; + CurWeekDay += state.dataWeather->EndDayOfMonth(i - 1) + state.dataWeather->LeapYearAdd; while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(i) = CurWeekDay; } else if ((i >= 4) && (i <= 12)) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(i - 1); + CurWeekDay += state.dataWeather->EndDayOfMonth(i - 1); while (CurWeekDay > 7) { CurWeekDay -= 7; } @@ -1332,19 +1247,19 @@ namespace WeatherManager { for (int i = StMon - 1; i >= 1; --i) { if (i == 1) { - CurWeekDay -= state.dataWeatherManager->EndDayOfMonth(1); + CurWeekDay -= state.dataWeather->EndDayOfMonth(1); while (CurWeekDay <= 0) { CurWeekDay += 7; } WeekDays(i) = CurWeekDay; } else if (i == 2) { - CurWeekDay = CurWeekDay - state.dataWeatherManager->EndDayOfMonth(2) + state.dataWeatherManager->LeapYearAdd; + CurWeekDay = CurWeekDay - state.dataWeather->EndDayOfMonth(2) + state.dataWeather->LeapYearAdd; while (CurWeekDay <= 0) { CurWeekDay += 7; } WeekDays(i) = CurWeekDay; } else if ((i >= 3) && (i <= 12)) { - CurWeekDay -= state.dataWeatherManager->EndDayOfMonth(i); + CurWeekDay -= state.dataWeather->EndDayOfMonth(i); while (CurWeekDay <= 0) { CurWeekDay += 7; } @@ -1369,8 +1284,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN March 2012 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine resets the weekday for each month based on the current weekday @@ -1385,7 +1298,7 @@ namespace WeatherManager { if (!MidSimReset) { if (Rollover) { if (StartMonth == 1) { - CurWeekDay = WeekDays(12) + state.dataWeatherManager->EndDayOfMonth(12) + StartMonthDay - 1; + CurWeekDay = WeekDays(12) + state.dataWeather->EndDayOfMonth(12) + StartMonthDay - 1; } else { CurWeekDay = WeekDays(EndMonth) + EndMonthDay; } @@ -1400,19 +1313,19 @@ namespace WeatherManager { WeekDays(StartMonth) = CurWeekDay; for (int i = StartMonth + 1; i <= 12; ++i) { if (i == 2) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(1); + CurWeekDay += state.dataWeather->EndDayOfMonth(1); while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(i) = CurWeekDay; } else if (i == 3) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(i - 1) + AddLeapYear; + CurWeekDay += state.dataWeather->EndDayOfMonth(i - 1) + AddLeapYear; while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(i) = CurWeekDay; } else if ((i >= 4) && (i <= 12)) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(i - 1); + CurWeekDay += state.dataWeather->EndDayOfMonth(i - 1); while (CurWeekDay > 7) { CurWeekDay -= 7; } @@ -1432,19 +1345,19 @@ namespace WeatherManager { for (int i = StartMonth - 1; i >= 1; --i) { if (i == 1) { - CurWeekDay -= state.dataWeatherManager->EndDayOfMonth(1); + CurWeekDay -= state.dataWeather->EndDayOfMonth(1); while (CurWeekDay <= 0) { CurWeekDay += 7; } WeekDays(i) = CurWeekDay; } else if (i == 2) { - CurWeekDay = CurWeekDay - state.dataWeatherManager->EndDayOfMonth(2) + AddLeapYear; + CurWeekDay = CurWeekDay - state.dataWeather->EndDayOfMonth(2) + AddLeapYear; while (CurWeekDay <= 0) { CurWeekDay += 7; } WeekDays(i) = CurWeekDay; } else if ((i >= 3) && (i <= 12)) { - CurWeekDay -= state.dataWeatherManager->EndDayOfMonth(i); + CurWeekDay -= state.dataWeather->EndDayOfMonth(i); while (CurWeekDay <= 0) { CurWeekDay += 7; } @@ -1456,7 +1369,7 @@ namespace WeatherManager { } else { if (Rollover) { if (StartMonth == 1) { - CurWeekDay = WeekDays(12) + state.dataWeatherManager->EndDayOfMonth(12) + StartMonthDay - 1; + CurWeekDay = WeekDays(12) + state.dataWeather->EndDayOfMonth(12) + StartMonthDay - 1; } else { CurWeekDay = WeekDays(EndMonth) + EndMonthDay; } @@ -1468,23 +1381,23 @@ namespace WeatherManager { } WeekDays = 0; if (StartMonth != 1) { - CurWeekDay = WeekDaysCopy(12) + state.dataWeatherManager->EndDayOfMonth(12); + CurWeekDay = WeekDaysCopy(12) + state.dataWeather->EndDayOfMonth(12); while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(1) = CurWeekDay; - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(1); + CurWeekDay += state.dataWeather->EndDayOfMonth(1); while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(2) = CurWeekDay; - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(2) + AddLeapYear; + CurWeekDay += state.dataWeather->EndDayOfMonth(2) + AddLeapYear; while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(3) = CurWeekDay; for (int i = 4; i <= 12; ++i) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(i - 1); + CurWeekDay += state.dataWeather->EndDayOfMonth(i - 1); while (CurWeekDay > 7) { CurWeekDay -= 7; } @@ -1495,19 +1408,19 @@ namespace WeatherManager { WeekDays(StartMonth) = CurWeekDay; for (int i = StartMonth + 1; i <= 12; ++i) { if (i == 2) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(1); + CurWeekDay += state.dataWeather->EndDayOfMonth(1); while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(i) = CurWeekDay; } else if (i == 3) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(i - 1) + AddLeapYear; + CurWeekDay += state.dataWeather->EndDayOfMonth(i - 1) + AddLeapYear; while (CurWeekDay > 7) { CurWeekDay -= 7; } WeekDays(i) = CurWeekDay; } else if ((i >= 4) && (i <= 12)) { - CurWeekDay += state.dataWeatherManager->EndDayOfMonth(i - 1); + CurWeekDay += state.dataWeather->EndDayOfMonth(i - 1); while (CurWeekDay > 7) { CurWeekDay -= 7; } @@ -1527,19 +1440,19 @@ namespace WeatherManager { for (int i = StartMonth - 1; i >= 1; --i) { if (i == 1) { - CurWeekDay -= state.dataWeatherManager->EndDayOfMonth(1); + CurWeekDay -= state.dataWeather->EndDayOfMonth(1); while (CurWeekDay <= 0) { CurWeekDay += 7; } WeekDays(i) = CurWeekDay; } else if (i == 2) { - CurWeekDay = CurWeekDay - state.dataWeatherManager->EndDayOfMonth(2) + AddLeapYear; + CurWeekDay = CurWeekDay - state.dataWeather->EndDayOfMonth(2) + AddLeapYear; while (CurWeekDay <= 0) { CurWeekDay += 7; } WeekDays(i) = CurWeekDay; } else if ((i >= 3) && (i <= 12)) { - CurWeekDay -= state.dataWeatherManager->EndDayOfMonth(i); + CurWeekDay -= state.dataWeather->EndDayOfMonth(i); while (CurWeekDay <= 0) { CurWeekDay += 7; } @@ -1563,8 +1476,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN March 2012 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // With multiple year weather files (or repeating weather files that rollover day), @@ -1579,55 +1490,55 @@ namespace WeatherManager { int ActEndDay; // Actual End Day of Month bool ErrorsFound = false; - if (state.dataWeatherManager->DST.StDateType == DateType::MonthDay) { - ActStartMonth = state.dataWeatherManager->DST.StMon; - ActStartDay = state.dataWeatherManager->DST.StDay; - } else if (state.dataWeatherManager->DST.StDateType == DateType::NthDayInMonth) { - int ThisDay = state.dataWeatherManager->DST.StWeekDay - MonWeekDay(state.dataWeatherManager->DST.StMon) + 1; + if (state.dataWeather->DST.StDateType == DateType::MonthDay) { + ActStartMonth = state.dataWeather->DST.StMon; + ActStartDay = state.dataWeather->DST.StDay; + } else if (state.dataWeather->DST.StDateType == DateType::NthDayInMonth) { + int ThisDay = state.dataWeather->DST.StWeekDay - MonWeekDay(state.dataWeather->DST.StMon) + 1; while (ThisDay <= 0) { ThisDay += 7; } - ThisDay += 7 * (state.dataWeatherManager->DST.StDay - 1); - if (ThisDay > state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.StMon)) { + ThisDay += 7 * (state.dataWeather->DST.StDay - 1); + if (ThisDay > state.dataWeather->EndDayOfMonthWithLeapDay(state.dataWeather->DST.StMon)) { ShowSevereError(state, format("{}Determining DST: DST Start Date, Nth Day of Month, not enough Nths", RoutineName)); ErrorsFound = true; } else { - ActStartMonth = state.dataWeatherManager->DST.StMon; + ActStartMonth = state.dataWeather->DST.StMon; ActStartDay = ThisDay; } } else { // LastWeekDayInMonth - int ThisDay = state.dataWeatherManager->DST.StWeekDay - MonWeekDay(state.dataWeatherManager->DST.StMon) + 1; - while (ThisDay + 7 <= state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.StMon)) { + int ThisDay = state.dataWeather->DST.StWeekDay - MonWeekDay(state.dataWeather->DST.StMon) + 1; + while (ThisDay + 7 <= state.dataWeather->EndDayOfMonthWithLeapDay(state.dataWeather->DST.StMon)) { ThisDay += 7; } - ActStartMonth = state.dataWeatherManager->DST.StMon; + ActStartMonth = state.dataWeather->DST.StMon; ActStartDay = ThisDay; } - if (state.dataWeatherManager->DST.EnDateType == DateType::MonthDay) { - ActEndMonth = state.dataWeatherManager->DST.EnMon; - ActEndDay = state.dataWeatherManager->DST.EnDay; - } else if (state.dataWeatherManager->DST.EnDateType == DateType::NthDayInMonth) { - int ThisDay = state.dataWeatherManager->DST.EnWeekDay - MonWeekDay(state.dataWeatherManager->DST.EnMon) + 1; + if (state.dataWeather->DST.EnDateType == DateType::MonthDay) { + ActEndMonth = state.dataWeather->DST.EnMon; + ActEndDay = state.dataWeather->DST.EnDay; + } else if (state.dataWeather->DST.EnDateType == DateType::NthDayInMonth) { + int ThisDay = state.dataWeather->DST.EnWeekDay - MonWeekDay(state.dataWeather->DST.EnMon) + 1; while (ThisDay <= 0) { ThisDay += 7; } - ThisDay += 7 * (state.dataWeatherManager->DST.EnDay - 1); - if (ThisDay >> state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.EnMon)) { + ThisDay += 7 * (state.dataWeather->DST.EnDay - 1); + if (ThisDay >> state.dataWeather->EndDayOfMonthWithLeapDay(state.dataWeather->DST.EnMon)) { ActEndMonth = 0; // Suppress uninitialized warning ActEndDay = 0; // Suppress uninitialized warning ShowSevereError(state, format("{}Determining DST: DST End Date, Nth Day of Month, not enough Nths", RoutineName)); ErrorsFound = true; } else { - ActEndMonth = state.dataWeatherManager->DST.EnMon; + ActEndMonth = state.dataWeather->DST.EnMon; ActEndDay = ThisDay; } } else { // LastWeekDayInMonth - int ThisDay = state.dataWeatherManager->DST.EnWeekDay - MonWeekDay(state.dataWeatherManager->DST.EnMon) + 1; - while (ThisDay + 7 <= state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.EnMon)) { + int ThisDay = state.dataWeather->DST.EnWeekDay - MonWeekDay(state.dataWeather->DST.EnMon) + 1; + while (ThisDay + 7 <= state.dataWeather->EndDayOfMonthWithLeapDay(state.dataWeather->DST.EnMon)) { ThisDay += 7; } - ActEndMonth = state.dataWeatherManager->DST.EnMon; + ActEndMonth = state.dataWeather->DST.EnMon; ActEndDay = ThisDay; } @@ -1643,8 +1554,8 @@ namespace WeatherManager { } DSTIdx = 0; - int JDay = General::OrdinalDay(ActStartMonth, ActStartDay, state.dataWeatherManager->LeapYearAdd); - int JDay1 = General::OrdinalDay(ActEndMonth, ActEndDay, state.dataWeatherManager->LeapYearAdd); + int JDay = General::OrdinalDay(ActStartMonth, ActStartDay, state.dataWeather->LeapYearAdd); + int JDay1 = General::OrdinalDay(ActEndMonth, ActEndDay, state.dataWeather->LeapYearAdd); if (JDay1 >= JDay) { DSTIdx({JDay, JDay1}) = 1; } else { @@ -1659,8 +1570,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN March 2012 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // With multiple year weather files (or repeating weather files that rollover day), @@ -1672,72 +1581,64 @@ namespace WeatherManager { int JDay; bool ErrorsFound = false; - state.dataWeatherManager->SpecialDayTypes = 0; - for (int i = 1; i <= state.dataWeatherManager->NumSpecialDays; ++i) { - if (state.dataWeatherManager->SpecialDays(i).WthrFile && !state.dataWeatherManager->UseSpecialDays) continue; - if (state.dataWeatherManager->SpecialDays(i).DateType <= DateType::MonthDay) { - JDay = General::OrdinalDay(state.dataWeatherManager->SpecialDays(i).Month, - state.dataWeatherManager->SpecialDays(i).Day, - state.dataWeatherManager->LeapYearAdd); - if (state.dataWeatherManager->SpecialDays(i).Duration == 1 && - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).ApplyWeekendRule) { - if (state.dataWeatherManager->WeekDayTypes(JDay) == static_cast(ScheduleManager::DayType::Sunday)) { + state.dataWeather->SpecialDayTypes = 0; + for (int i = 1; i <= state.dataWeather->NumSpecialDays; ++i) { + auto &specialDay = state.dataWeather->SpecialDays(i); + if (specialDay.WthrFile && !state.dataWeather->UseSpecialDays) continue; + if (specialDay.dateType <= DateType::MonthDay) { + JDay = General::OrdinalDay(specialDay.Month, specialDay.Day, state.dataWeather->LeapYearAdd); + if (specialDay.Duration == 1 && state.dataWeather->Environment(state.dataWeather->Envrn).ApplyWeekendRule) { + if (state.dataWeather->WeekDayTypes(JDay) == static_cast(ScheduleManager::DayType::Sunday)) { // Sunday, must go to Monday ++JDay; - if (JDay == 366 && state.dataWeatherManager->LeapYearAdd == 0) JDay = 1; - } else if (state.dataWeatherManager->WeekDayTypes(JDay) == static_cast(ScheduleManager::DayType::Saturday)) { + if (JDay == 366 && state.dataWeather->LeapYearAdd == 0) JDay = 1; + } else if (state.dataWeather->WeekDayTypes(JDay) == (int)ScheduleManager::DayType::Saturday) { ++JDay; - if (JDay == 366 && state.dataWeatherManager->LeapYearAdd == 0) JDay = 1; + if (JDay == 366 && state.dataWeather->LeapYearAdd == 0) JDay = 1; ++JDay; - if (JDay == 366 && state.dataWeatherManager->LeapYearAdd == 0) JDay = 1; + if (JDay == 366 && state.dataWeather->LeapYearAdd == 0) JDay = 1; } } - General::InvOrdinalDay(JDay, - state.dataWeatherManager->SpecialDays(i).ActStMon, - state.dataWeatherManager->SpecialDays(i).ActStDay, - state.dataWeatherManager->LeapYearAdd); - } else if (state.dataWeatherManager->SpecialDays(i).DateType == DateType::NthDayInMonth) { - int ThisDay = state.dataWeatherManager->SpecialDays(i).WeekDay - MonWeekDay(state.dataWeatherManager->SpecialDays(i).Month) + 1; - if (state.dataWeatherManager->SpecialDays(i).WeekDay < MonWeekDay(state.dataWeatherManager->SpecialDays(i).Month)) { + General::InvOrdinalDay(JDay, specialDay.ActStMon, specialDay.ActStDay, state.dataWeather->LeapYearAdd); + } else if (specialDay.dateType == DateType::NthDayInMonth) { + int ThisDay = specialDay.WeekDay - MonWeekDay(specialDay.Month) + 1; + if (specialDay.WeekDay < MonWeekDay(specialDay.Month)) { ThisDay += 7; } - ThisDay += 7 * (state.dataWeatherManager->SpecialDays(i).Day - 1); - if (ThisDay > state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->SpecialDays(i).Month)) { + ThisDay += 7 * (specialDay.Day - 1); + if (ThisDay > state.dataWeather->EndDayOfMonthWithLeapDay(specialDay.Month)) { ShowSevereError(state, - format("{}Special Day Date, Nth Day of Month, not enough Nths, for SpecialDay={}", - RoutineName, - state.dataWeatherManager->SpecialDays(i).Name)); + format("{}Special Day Date, Nth Day of Month, not enough Nths, for SpecialDay={}", RoutineName, specialDay.Name)); ErrorsFound = true; continue; } - state.dataWeatherManager->SpecialDays(i).ActStMon = state.dataWeatherManager->SpecialDays(i).Month; - state.dataWeatherManager->SpecialDays(i).ActStDay = ThisDay; - JDay = General::OrdinalDay(state.dataWeatherManager->SpecialDays(i).Month, ThisDay, state.dataWeatherManager->LeapYearAdd); + specialDay.ActStMon = specialDay.Month; + specialDay.ActStDay = ThisDay; + JDay = General::OrdinalDay(specialDay.Month, ThisDay, state.dataWeather->LeapYearAdd); } else { // LastWeekDayInMonth - int ThisDay = state.dataWeatherManager->SpecialDays(i).WeekDay - MonWeekDay(state.dataWeatherManager->SpecialDays(i).Month) + 1; - while (ThisDay + 7 <= state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->SpecialDays(i).Month)) { + int ThisDay = specialDay.WeekDay - MonWeekDay(specialDay.Month) + 1; + while (ThisDay + 7 <= state.dataWeather->EndDayOfMonthWithLeapDay(specialDay.Month)) { ThisDay += 7; } - state.dataWeatherManager->SpecialDays(i).ActStMon = state.dataWeatherManager->SpecialDays(i).Month; - state.dataWeatherManager->SpecialDays(i).ActStDay = ThisDay; - JDay = General::OrdinalDay(state.dataWeatherManager->SpecialDays(i).Month, ThisDay, state.dataWeatherManager->LeapYearAdd); + specialDay.ActStMon = specialDay.Month; + specialDay.ActStDay = ThisDay; + JDay = General::OrdinalDay(specialDay.Month, ThisDay, state.dataWeather->LeapYearAdd); } - if (state.dataWeatherManager->SpecialDayTypes(JDay) != 0) { - ShowWarningError(state, - format("{}Special Day definition ({}) is overwriting previously entered special day period", - RoutineName, - state.dataWeatherManager->SpecialDays(i).Name)); - if (state.dataWeatherManager->UseSpecialDays) { + if (state.dataWeather->SpecialDayTypes(JDay) != 0) { + ShowWarningError( + state, + format("{}Special Day definition ({}) is overwriting previously entered special day period", RoutineName, specialDay.Name)); + if (state.dataWeather->UseSpecialDays) { ShowContinueError(state, "...This could be caused by definitions on the Weather File."); } ShowContinueError(state, "...This could be caused by duplicate definitions in the Input File."); } int JDay1 = JDay - 1; - for (int j = 0; j <= state.dataWeatherManager->SpecialDays(i).Duration - 1; ++j) { + for (int j = 0; j <= specialDay.Duration - 1; ++j) { ++JDay1; - if (JDay1 == 366 && state.dataWeatherManager->LeapYearAdd == 0) JDay1 = 1; + if (JDay1 == 366 && state.dataWeather->LeapYearAdd == 0) JDay1 = 1; if (JDay1 == 367) JDay1 = 1; - state.dataWeatherManager->SpecialDayTypes(JDay1) = state.dataWeatherManager->SpecialDays(i).DayType; + state.dataWeather->SpecialDayTypes(JDay1) = specialDay.DayType; } } @@ -1752,94 +1653,68 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN June 1997 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is the main driver of the weather initializations. // Most of the weather handling can be described as "initializations" // so most of the work is done via this subroutine. - if (state.dataGlobal->BeginSimFlag && state.dataWeatherManager->FirstCall) { + if (state.dataGlobal->BeginSimFlag && state.dataWeather->FirstCall) { - state.dataWeatherManager->FirstCall = false; + state.dataWeather->FirstCall = false; state.dataEnvrn->EndMonthFlag = false; } // ... end of DataGlobals::BeginSimFlag IF-THEN block. - auto &thisEnvrn = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn); + auto &envCurr = state.dataWeather->Environment(state.dataWeather->Envrn); if (state.dataGlobal->BeginEnvrnFlag) { // Call and setup the Design Day environment - if (thisEnvrn.KindOfEnvrn != Constant::KindOfSim::RunPeriodWeather) { - if (thisEnvrn.DesignDayNum > 0) { - SetUpDesignDay(state, thisEnvrn.DesignDayNum); - state.dataEnvrn->EnvironmentName = thisEnvrn.Title; + if (envCurr.KindOfEnvrn != Constant::KindOfSim::RunPeriodWeather) { + if (envCurr.DesignDayNum > 0) { + SetUpDesignDay(state, envCurr.DesignDayNum); + state.dataEnvrn->EnvironmentName = envCurr.Title; } } // Only used in Weather file environments // Start over missing values with each environment - state.dataWeatherManager->Missing.StnPres = state.dataEnvrn->StdBaroPress; // Initial "missing" value - state.dataWeatherManager->Missing.DryBulb = 6.0; // Initial "missing" value - state.dataWeatherManager->Missing.DewPoint = 3.0; // Initial "missing" value - state.dataWeatherManager->Missing.RelHumid = 50.0; // Initial "missing" value - state.dataWeatherManager->Missing.WindSpd = 2.5; // Initial "missing" value - state.dataWeatherManager->Missing.WindDir = 180; // Initial "missing" value - state.dataWeatherManager->Missing.TotSkyCvr = 5; // Initial "missing" value - state.dataWeatherManager->Missing.OpaqSkyCvr = 5; // Initial "missing" value - state.dataWeatherManager->Missing.Visibility = 777.7; // Initial "missing" value - state.dataWeatherManager->Missing.Ceiling = 77777; // Initial "missing" value - state.dataWeatherManager->Missing.PrecipWater = 0; // Initial "missing" value - state.dataWeatherManager->Missing.AerOptDepth = 0.0; // Initial "missing" value - state.dataWeatherManager->Missing.SnowDepth = 0; // Initial "missing" value - state.dataWeatherManager->Missing.DaysLastSnow = 88; // Initial "missing" value - state.dataWeatherManager->Missing.Albedo = 0.0; // Initial "missing" value - state.dataWeatherManager->Missing.LiquidPrecip = 0.0; // Initial "missing" value + state.dataWeather->wvarsMissing.OutBaroPress = state.dataEnvrn->StdBaroPress; // Initial "missing" value + state.dataWeather->wvarsMissing.OutDryBulbTemp = 6.0; // Initial "missing" value + state.dataWeather->wvarsMissing.OutDewPointTemp = 3.0; // Initial "missing" value + state.dataWeather->wvarsMissing.OutRelHum = 50.0; // Initial "missing" value + state.dataWeather->wvarsMissing.WindSpeed = 2.5; // Initial "missing" value + state.dataWeather->wvarsMissing.WindDir = 180; // Initial "missing" value + state.dataWeather->wvarsMissing.TotalSkyCover = 5; // Initial "missing" value + state.dataWeather->wvarsMissing.OpaqueSkyCover = 5; // Initial "missing" value + state.dataWeather->wvarsMissing.Visibility = 777.7; // Initial "missing" value + state.dataWeather->wvarsMissing.Ceiling = 77777; // Initial "missing" value + state.dataWeather->wvarsMissing.AerOptDepth = 0.0; // Initial "missing" value + state.dataWeather->wvarsMissing.SnowDepth = 0; // Initial "missing" value + state.dataWeather->wvarsMissing.DaysLastSnow = 88; // Initial "missing" value + state.dataWeather->wvarsMissing.Albedo = 0.0; // Initial "missing" value + state.dataWeather->wvarsMissing.LiquidPrecip = 0.0; // Initial "missing" value // Counts set to 0 for each environment - state.dataWeatherManager->Missed.StnPres = 0; - state.dataWeatherManager->Missed.DryBulb = 0; - state.dataWeatherManager->Missed.DewPoint = 0; - state.dataWeatherManager->Missed.RelHumid = 0; - state.dataWeatherManager->Missed.WindSpd = 0; - state.dataWeatherManager->Missed.WindDir = 0; - state.dataWeatherManager->Missed.TotSkyCvr = 0; - state.dataWeatherManager->Missed.OpaqSkyCvr = 0; - state.dataWeatherManager->Missed.Visibility = 0; - state.dataWeatherManager->Missed.Ceiling = 0; - state.dataWeatherManager->Missed.PrecipWater = 0; - state.dataWeatherManager->Missed.AerOptDepth = 0; - state.dataWeatherManager->Missed.SnowDepth = 0; - state.dataWeatherManager->Missed.DaysLastSnow = 0; - state.dataWeatherManager->Missed.Albedo = 0; - state.dataWeatherManager->Missed.LiquidPrecip = 0; - state.dataWeatherManager->Missed.WeathCodes = 0; - state.dataWeatherManager->Missed.DirectRad = 0; - state.dataWeatherManager->Missed.DiffuseRad = 0; + state.dataWeather->wvarsMissedCounts = Weather::WeatherVarCounts(); + // Counts set to 0 for each environment - state.dataWeatherManager->OutOfRange.StnPres = 0; - state.dataWeatherManager->OutOfRange.DryBulb = 0; - state.dataWeatherManager->OutOfRange.DewPoint = 0; - state.dataWeatherManager->OutOfRange.RelHumid = 0; - state.dataWeatherManager->OutOfRange.WindSpd = 0; - state.dataWeatherManager->OutOfRange.WindDir = 0; - state.dataWeatherManager->OutOfRange.DirectRad = 0; - state.dataWeatherManager->OutOfRange.DiffuseRad = 0; - state.dataWeatherManager->IsRainThreshold = 0.8 / double(state.dataGlobal->NumOfTimeStepInHour); // [mm] - - if (!state.dataWeatherManager->RPReadAllWeatherData) { + state.dataWeather->wvarsOutOfRangeCounts = Weather::WeatherVarCounts(); + + state.dataWeather->IsRainThreshold = 0.8 / double(state.dataGlobal->NumOfTimeStepInHour); // [mm] + + if (!state.dataWeather->RPReadAllWeatherData) { printEnvrnStamp = true; // Set this to true so that on first non-warmup day (only) the environment header will print out } - for (int i = 1; i <= state.dataWeatherManager->NumSpecialDays; ++i) { - state.dataWeatherManager->SpecialDays(i).Used = false; + for (int i = 1; i <= state.dataWeather->NumSpecialDays; ++i) { + state.dataWeather->SpecialDays(i).Used = false; } if ((state.dataGlobal->KindOfSim != Constant::KindOfSim::DesignDay) && (state.dataGlobal->KindOfSim != Constant::KindOfSim::HVACSizeDesignDay)) { - ReadWeatherForDay(state, 1, state.dataWeatherManager->Envrn, false); // Read first day's weather + ReadWeatherForDay(state, 1, state.dataWeather->Envrn, false); // Read first day's weather } else { - state.dataWeatherManager->TomorrowVariables = state.dataWeatherManager->DesignDay(thisEnvrn.DesignDayNum); + state.dataWeather->TomorrowVariables = state.dataWeather->DesignDay(envCurr.DesignDayNum); } } // ... end of DataGlobals::BeginEnvrnFlag IF-THEN block. @@ -1860,73 +1735,66 @@ namespace WeatherManager { // appropriately. if ((!state.dataGlobal->WarmupFlag) && - ((thisEnvrn.KindOfEnvrn != Constant::KindOfSim::DesignDay) && (thisEnvrn.KindOfEnvrn != Constant::KindOfSim::HVACSizeDesignDay))) { + ((envCurr.KindOfEnvrn != Constant::KindOfSim::DesignDay) && (envCurr.KindOfEnvrn != Constant::KindOfSim::HVACSizeDesignDay))) { if (state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn) { - if (state.dataGlobal->DayOfSim == state.dataWeatherManager->curSimDayForEndOfRunPeriod) { - state.dataWeatherManager->curSimDayForEndOfRunPeriod += thisEnvrn.RawSimDays; - if (state.dataWeatherManager->StartDatesCycleShouldBeReset) { + if (state.dataGlobal->DayOfSim == state.dataWeather->curSimDayForEndOfRunPeriod) { + state.dataWeather->curSimDayForEndOfRunPeriod += envCurr.RawSimDays; + if (state.dataWeather->StartDatesCycleShouldBeReset) { ResetWeekDaysByMonth(state, - thisEnvrn.MonWeekDay, - state.dataWeatherManager->LeapYearAdd, - thisEnvrn.StartMonth, - thisEnvrn.StartDay, - thisEnvrn.EndMonth, - thisEnvrn.EndDay, - thisEnvrn.RollDayTypeOnRepeat); - if (state.dataWeatherManager->DaylightSavingIsActive) { - SetDSTDateRanges(state, thisEnvrn.MonWeekDay, state.dataWeatherManager->DSTIndex); + envCurr.MonWeekDay, + state.dataWeather->LeapYearAdd, + envCurr.StartMonth, + envCurr.StartDay, + envCurr.EndMonth, + envCurr.EndDay, + envCurr.RollDayTypeOnRepeat); + if (state.dataWeather->DaylightSavingIsActive) { + SetDSTDateRanges(state, envCurr.MonWeekDay, state.dataWeather->DSTIndex); } - SetSpecialDayDates(state, thisEnvrn.MonWeekDay); + SetSpecialDayDates(state, envCurr.MonWeekDay); } - ++state.dataWeatherManager->YearOfSim; - ReadWeatherForDay(state, 1, state.dataWeatherManager->Envrn, false); // Read tomorrow's weather + ++state.dataWeather->YearOfSim; + ReadWeatherForDay(state, 1, state.dataWeather->Envrn, false); // Read tomorrow's weather } else { - ReadWeatherForDay(state, state.dataGlobal->DayOfSim + 1, state.dataWeatherManager->Envrn, false); // Read tomorrow's weather + ReadWeatherForDay(state, state.dataGlobal->DayOfSim + 1, state.dataWeather->Envrn, false); // Read tomorrow's weather } } } state.dataEnvrn->EndYearFlag = false; - if (state.dataEnvrn->DayOfMonth == state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataEnvrn->Month)) { + if (state.dataEnvrn->DayOfMonth == state.dataWeather->EndDayOfMonthWithLeapDay(state.dataEnvrn->Month)) { state.dataEnvrn->EndMonthFlag = true; state.dataEnvrn->EndYearFlag = (state.dataEnvrn->Month == 12); } // Set Tomorrow's date data - state.dataEnvrn->MonthTomorrow = state.dataWeatherManager->TomorrowVariables.Month; - state.dataEnvrn->DayOfMonthTomorrow = state.dataWeatherManager->TomorrowVariables.DayOfMonth; - state.dataEnvrn->DayOfWeekTomorrow = state.dataWeatherManager->TomorrowVariables.DayOfWeek; - state.dataEnvrn->HolidayIndexTomorrow = state.dataWeatherManager->TomorrowVariables.HolidayIndex; - state.dataEnvrn->YearTomorrow = state.dataWeatherManager->TomorrowVariables.Year; - - if (thisEnvrn.KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { - if (state.dataEnvrn->Month == 1 && state.dataEnvrn->DayOfMonth == 1 && thisEnvrn.ActualWeather) { - if (state.dataWeatherManager->DatesShouldBeReset) { - if (thisEnvrn.TreatYearsAsConsecutive) { - ++thisEnvrn.CurrentYear; - thisEnvrn.IsLeapYear = isLeapYear(thisEnvrn.CurrentYear); - state.dataEnvrn->CurrentYearIsLeapYear = thisEnvrn.IsLeapYear; - if (state.dataEnvrn->CurrentYearIsLeapYear) { - if (state.dataWeatherManager->WFAllowsLeapYears) { - state.dataWeatherManager->LeapYearAdd = 1; - } else { - state.dataWeatherManager->LeapYearAdd = 0; - } - } else { - state.dataWeatherManager->LeapYearAdd = 0; - } + state.dataEnvrn->MonthTomorrow = state.dataWeather->TomorrowVariables.Month; + state.dataEnvrn->DayOfMonthTomorrow = state.dataWeather->TomorrowVariables.DayOfMonth; + state.dataEnvrn->DayOfWeekTomorrow = state.dataWeather->TomorrowVariables.DayOfWeek; + state.dataEnvrn->HolidayIndexTomorrow = state.dataWeather->TomorrowVariables.HolidayIndex; + state.dataEnvrn->YearTomorrow = state.dataWeather->TomorrowVariables.Year; + + if (envCurr.KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { + if (state.dataEnvrn->Month == 1 && state.dataEnvrn->DayOfMonth == 1 && envCurr.ActualWeather) { + if (state.dataWeather->DatesShouldBeReset) { + if (envCurr.TreatYearsAsConsecutive) { + ++envCurr.CurrentYear; + envCurr.IsLeapYear = isLeapYear(envCurr.CurrentYear); + state.dataEnvrn->CurrentYearIsLeapYear = envCurr.IsLeapYear; + state.dataWeather->LeapYearAdd = (int)(state.dataEnvrn->CurrentYearIsLeapYear && state.dataWeather->WFAllowsLeapYears); + // need to reset MonWeekDay and WeekDayTypes - int JDay5Start = General::OrdinalDay(thisEnvrn.StartMonth, thisEnvrn.StartDay, state.dataWeatherManager->LeapYearAdd); - int JDay5End = General::OrdinalDay(thisEnvrn.EndMonth, thisEnvrn.EndDay, state.dataWeatherManager->LeapYearAdd); - if (!thisEnvrn.ActualWeather) - state.dataWeatherManager->curSimDayForEndOfRunPeriod = - state.dataGlobal->DayOfSim + thisEnvrn.RawSimDays + state.dataWeatherManager->LeapYearAdd - 1; + int JDay5Start = General::OrdinalDay(envCurr.StartMonth, envCurr.StartDay, state.dataWeather->LeapYearAdd); + int JDay5End = General::OrdinalDay(envCurr.EndMonth, envCurr.EndDay, state.dataWeather->LeapYearAdd); + if (!envCurr.ActualWeather) + state.dataWeather->curSimDayForEndOfRunPeriod = + state.dataGlobal->DayOfSim + envCurr.RawSimDays + state.dataWeather->LeapYearAdd - 1; { int i = JDay5Start; int TWeekDay = state.dataEnvrn->DayOfWeek; while (true) { - state.dataWeatherManager->WeekDayTypes(i) = TWeekDay; + state.dataWeather->WeekDayTypes(i) = TWeekDay; TWeekDay = mod(TWeekDay, 7) + 1; ++i; if (i > 366) i = 1; @@ -1934,88 +1802,81 @@ namespace WeatherManager { } } ResetWeekDaysByMonth(state, - thisEnvrn.MonWeekDay, - state.dataWeatherManager->LeapYearAdd, - thisEnvrn.StartMonth, - thisEnvrn.StartDay, - thisEnvrn.EndMonth, - thisEnvrn.EndDay, - thisEnvrn.RollDayTypeOnRepeat); - if (state.dataWeatherManager->DaylightSavingIsActive) { - SetDSTDateRanges(state, thisEnvrn.MonWeekDay, state.dataWeatherManager->DSTIndex); + envCurr.MonWeekDay, + state.dataWeather->LeapYearAdd, + envCurr.StartMonth, + envCurr.StartDay, + envCurr.EndMonth, + envCurr.EndDay, + envCurr.RollDayTypeOnRepeat); + if (state.dataWeather->DaylightSavingIsActive) { + SetDSTDateRanges(state, envCurr.MonWeekDay, state.dataWeather->DSTIndex); } - SetSpecialDayDates(state, thisEnvrn.MonWeekDay); + SetSpecialDayDates(state, envCurr.MonWeekDay); } } - } else if ((state.dataEnvrn->Month == 1 && state.dataEnvrn->DayOfMonth == 1) && state.dataWeatherManager->DatesShouldBeReset && - (state.dataWeatherManager->Jan1DatesShouldBeReset)) { - if (thisEnvrn.TreatYearsAsConsecutive) { - ++thisEnvrn.CurrentYear; - thisEnvrn.IsLeapYear = isLeapYear(thisEnvrn.CurrentYear); - state.dataEnvrn->CurrentYearIsLeapYear = thisEnvrn.IsLeapYear; - if (state.dataEnvrn->CurrentYearIsLeapYear && !state.dataWeatherManager->WFAllowsLeapYears) + } else if ((state.dataEnvrn->Month == 1 && state.dataEnvrn->DayOfMonth == 1) && state.dataWeather->DatesShouldBeReset && + (state.dataWeather->Jan1DatesShouldBeReset)) { + if (envCurr.TreatYearsAsConsecutive) { + ++envCurr.CurrentYear; + envCurr.IsLeapYear = isLeapYear(envCurr.CurrentYear); + state.dataEnvrn->CurrentYearIsLeapYear = envCurr.IsLeapYear; + if (state.dataEnvrn->CurrentYearIsLeapYear && !state.dataWeather->WFAllowsLeapYears) state.dataEnvrn->CurrentYearIsLeapYear = false; - if (state.dataGlobal->DayOfSim < state.dataWeatherManager->curSimDayForEndOfRunPeriod && - state.dataEnvrn->CurrentYearIsLeapYear) - ++state.dataWeatherManager->curSimDayForEndOfRunPeriod; - } - if (state.dataEnvrn->CurrentYearIsLeapYear) { - if (state.dataWeatherManager->WFAllowsLeapYears) { - state.dataWeatherManager->LeapYearAdd = 1; - } else { - state.dataWeatherManager->LeapYearAdd = 0; - } - } else { - state.dataWeatherManager->LeapYearAdd = 0; + if (state.dataGlobal->DayOfSim < state.dataWeather->curSimDayForEndOfRunPeriod && state.dataEnvrn->CurrentYearIsLeapYear) + ++state.dataWeather->curSimDayForEndOfRunPeriod; } - if (state.dataGlobal->DayOfSim < state.dataWeatherManager->curSimDayForEndOfRunPeriod) { + state.dataWeather->LeapYearAdd = (int)(state.dataEnvrn->CurrentYearIsLeapYear && state.dataWeather->WFAllowsLeapYears); + + if (state.dataGlobal->DayOfSim < state.dataWeather->curSimDayForEndOfRunPeriod) { ResetWeekDaysByMonth(state, - thisEnvrn.MonWeekDay, - state.dataWeatherManager->LeapYearAdd, - thisEnvrn.StartMonth, - thisEnvrn.StartDay, - thisEnvrn.EndMonth, - thisEnvrn.EndDay, - thisEnvrn.RollDayTypeOnRepeat, - thisEnvrn.RollDayTypeOnRepeat || state.dataEnvrn->CurrentYearIsLeapYear); - if (state.dataWeatherManager->DaylightSavingIsActive) { - SetDSTDateRanges(state, thisEnvrn.MonWeekDay, state.dataWeatherManager->DSTIndex); + envCurr.MonWeekDay, + state.dataWeather->LeapYearAdd, + envCurr.StartMonth, + envCurr.StartDay, + envCurr.EndMonth, + envCurr.EndDay, + envCurr.RollDayTypeOnRepeat, + envCurr.RollDayTypeOnRepeat || state.dataEnvrn->CurrentYearIsLeapYear); + if (state.dataWeather->DaylightSavingIsActive) { + SetDSTDateRanges(state, envCurr.MonWeekDay, state.dataWeather->DSTIndex); } - SetSpecialDayDates(state, thisEnvrn.MonWeekDay); + SetSpecialDayDates(state, envCurr.MonWeekDay); } } } // at the end of each day find the min/max weather used for DOAS sizing if (state.dataGlobal->AirLoopHVACDOASUsedInSim) { - if (thisEnvrn.KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign || thisEnvrn.KindOfEnvrn == Constant::KindOfSim::DesignDay) { - for (size_t i = 0; i < state.dataWeatherManager->TodayOutDryBulbTemp.size(); ++i) { - if (state.dataWeatherManager->TodayOutDryBulbTemp[i] > thisEnvrn.maxCoolingOATSizing) { - thisEnvrn.maxCoolingOATSizing = state.dataWeatherManager->TodayOutDryBulbTemp[i]; - thisEnvrn.maxCoolingOADPSizing = state.dataWeatherManager->TodayOutDewPointTemp[i]; - } - if (state.dataWeatherManager->TodayOutDryBulbTemp[i] < thisEnvrn.minHeatingOATSizing) { - thisEnvrn.minHeatingOATSizing = state.dataWeatherManager->TodayOutDryBulbTemp[i]; - thisEnvrn.minHeatingOADPSizing = state.dataWeatherManager->TodayOutDewPointTemp[i]; - } - } + if (envCurr.KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign || envCurr.KindOfEnvrn == Constant::KindOfSim::DesignDay) { + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) { + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) { + Real64 Tdb = state.dataWeather->wvarsHrTsToday(iTS, iHr).OutDryBulbTemp; + Real64 Tdp = state.dataWeather->wvarsHrTsToday(iTS, iHr).OutDewPointTemp; + if (Tdb > envCurr.maxCoolingOATSizing) { + envCurr.maxCoolingOATSizing = Tdb; + envCurr.maxCoolingOADPSizing = Tdp; + } + if (Tdb < envCurr.minHeatingOATSizing) { + envCurr.minHeatingOATSizing = Tdb; + envCurr.minHeatingOADPSizing = Tdp; + } + } // for (iTS) + } // for (iHr) } } } // ... end of DataGlobals::BeginDayFlag IF-THEN block. if (!state.dataGlobal->BeginDayFlag && !state.dataGlobal->WarmupFlag && - (state.dataEnvrn->Month != state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartMonth || - state.dataEnvrn->DayOfMonth != state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).StartDay) && - !state.dataWeatherManager->DatesShouldBeReset && - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { - state.dataWeatherManager->DatesShouldBeReset = true; + (state.dataEnvrn->Month != envCurr.StartMonth || state.dataEnvrn->DayOfMonth != envCurr.StartDay) && + !state.dataWeather->DatesShouldBeReset && envCurr.KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { + state.dataWeather->DatesShouldBeReset = true; } - if (state.dataGlobal->EndEnvrnFlag && - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != Constant::KindOfSim::DesignDay) && - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != Constant::KindOfSim::HVACSizeDesignDay)) { + if (state.dataGlobal->EndEnvrnFlag && (envCurr.KindOfEnvrn != Constant::KindOfSim::DesignDay) && + (envCurr.KindOfEnvrn != Constant::KindOfSim::HVACSizeDesignDay)) { state.files.inputWeatherFile.rewind(); SkipEPlusWFHeader(state); ReportMissing_RangeData(state); @@ -2025,9 +1886,8 @@ namespace WeatherManager { // True at the end of the last design day environment (last time step of last hour of last day of environ which is a design day) state.dataGlobal->EndDesignDayEnvrnsFlag = false; if (state.dataGlobal->EndEnvrnFlag) { - if (state.dataWeatherManager->Envrn < state.dataWeatherManager->NumOfEnvrn) { - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn + 1).KindOfEnvrn) { + if (state.dataWeather->Envrn < state.dataWeather->NumOfEnvrn) { + if (envCurr.KindOfEnvrn != state.dataWeather->Environment(state.dataWeather->Envrn + 1).KindOfEnvrn) { state.dataGlobal->EndDesignDayEnvrnsFlag = true; } } else { @@ -2036,16 +1896,16 @@ namespace WeatherManager { } } - if (state.dataWeatherManager->WaterMainsParameterReport) { + if (state.dataWeather->WaterMainsParameterReport) { // this is done only once - if (state.dataWeatherManager->WaterMainsTempsMethod == WaterMainsTempCalcMethod::CorrelationFromWeatherFile) { - if (!state.dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed) { - state.dataWeatherManager->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(state); + if (state.dataWeather->WaterMainsTempsMethod == WaterMainsTempCalcMethod::CorrelationFromWeatherFile) { + if (!state.dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed) { + state.dataWeather->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(state); } } // reports to eio file ReportWaterMainsTempParameters(state); - state.dataWeatherManager->WaterMainsParameterReport = false; + state.dataWeather->WaterMainsParameterReport = false; } } @@ -2055,8 +1915,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN June 1997 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine updates all of the daily weather data in the local @@ -2066,46 +1924,31 @@ namespace WeatherManager { // enough reengineering has taken place to eliminate the need for this // include. - state.dataWeatherManager->TodayVariables = - state.dataWeatherManager->TomorrowVariables; // Transfer Tomorrow's Daily Weather Variables to Today + state.dataWeather->TodayVariables = state.dataWeather->TomorrowVariables; // Transfer Tomorrow's Daily Weather Variables to Today if (state.dataGlobal->BeginEnvrnFlag) { state.dataGlobal->PreviousHour = 24; } - state.dataWeatherManager->TodayIsRain = state.dataWeatherManager->TomorrowIsRain; - state.dataWeatherManager->TodayIsSnow = state.dataWeatherManager->TomorrowIsSnow; - state.dataWeatherManager->TodayOutDryBulbTemp = state.dataWeatherManager->TomorrowOutDryBulbTemp; - state.dataWeatherManager->TodayOutDewPointTemp = state.dataWeatherManager->TomorrowOutDewPointTemp; - state.dataWeatherManager->TodayOutBaroPress = state.dataWeatherManager->TomorrowOutBaroPress; - state.dataWeatherManager->TodayOutRelHum = state.dataWeatherManager->TomorrowOutRelHum; - state.dataWeatherManager->TodayWindSpeed = state.dataWeatherManager->TomorrowWindSpeed; - state.dataWeatherManager->TodayWindDir = state.dataWeatherManager->TomorrowWindDir; - state.dataWeatherManager->TodaySkyTemp = state.dataWeatherManager->TomorrowSkyTemp; - state.dataWeatherManager->TodayHorizIRSky = state.dataWeatherManager->TomorrowHorizIRSky; - state.dataWeatherManager->TodayBeamSolarRad = state.dataWeatherManager->TomorrowBeamSolarRad; - state.dataWeatherManager->TodayDifSolarRad = state.dataWeatherManager->TomorrowDifSolarRad; - state.dataWeatherManager->TodayLiquidPrecip = state.dataWeatherManager->TomorrowLiquidPrecip; - state.dataWeatherManager->TodayTotalSkyCover = state.dataWeatherManager->TomorrowTotalSkyCover; - state.dataWeatherManager->TodayOpaqueSkyCover = state.dataWeatherManager->TomorrowOpaqueSkyCover; + state.dataWeather->wvarsHrTsToday = state.dataWeather->wvarsHrTsTomorrow; // What a waste // Update Global Data - state.dataEnvrn->DayOfYear = state.dataWeatherManager->TodayVariables.DayOfYear; - state.dataEnvrn->Year = state.dataWeatherManager->TodayVariables.Year; - state.dataEnvrn->Month = state.dataWeatherManager->TodayVariables.Month; - state.dataEnvrn->DayOfMonth = state.dataWeatherManager->TodayVariables.DayOfMonth; - state.dataEnvrn->DayOfWeek = state.dataWeatherManager->TodayVariables.DayOfWeek; - state.dataEnvrn->HolidayIndex = state.dataWeatherManager->TodayVariables.HolidayIndex; + state.dataEnvrn->DayOfYear = state.dataWeather->TodayVariables.DayOfYear; + state.dataEnvrn->Year = state.dataWeather->TodayVariables.Year; + state.dataEnvrn->Month = state.dataWeather->TodayVariables.Month; + state.dataEnvrn->DayOfMonth = state.dataWeather->TodayVariables.DayOfMonth; + state.dataEnvrn->DayOfWeek = state.dataWeather->TodayVariables.DayOfWeek; + state.dataEnvrn->HolidayIndex = state.dataWeather->TodayVariables.HolidayIndex; if (state.dataEnvrn->HolidayIndex > 0) { - state.dataWeatherManager->RptDayType = state.dataEnvrn->HolidayIndex; + state.dataWeather->RptDayType = state.dataEnvrn->HolidayIndex; } else { - state.dataWeatherManager->RptDayType = state.dataEnvrn->DayOfWeek; + state.dataWeather->RptDayType = state.dataEnvrn->DayOfWeek; } - state.dataEnvrn->DSTIndicator = state.dataWeatherManager->TodayVariables.DaylightSavingIndex; - state.dataEnvrn->EquationOfTime = state.dataWeatherManager->TodayVariables.EquationOfTime; - state.dataEnvrn->CosSolarDeclinAngle = state.dataWeatherManager->TodayVariables.CosSolarDeclinAngle; - state.dataEnvrn->SinSolarDeclinAngle = state.dataWeatherManager->TodayVariables.SinSolarDeclinAngle; + state.dataEnvrn->DSTIndicator = state.dataWeather->TodayVariables.DaylightSavingIndex; + state.dataEnvrn->EquationOfTime = state.dataWeather->TodayVariables.EquationOfTime; + state.dataEnvrn->CosSolarDeclinAngle = state.dataWeather->TodayVariables.CosSolarDeclinAngle; + state.dataEnvrn->SinSolarDeclinAngle = state.dataWeather->TodayVariables.SinSolarDeclinAngle; } void SetCurrentWeather(EnergyPlusData &state) @@ -2141,10 +1984,10 @@ namespace WeatherManager { static constexpr std::string_view RoutineName("SetCurrentWeather"); - state.dataWeatherManager->NextHour = state.dataGlobal->HourOfDay + 1; + state.dataWeather->NextHour = state.dataGlobal->HourOfDay + 1; if (state.dataGlobal->HourOfDay == 24) { // Should investigate whether EndDayFlag is always set here and use that instead - state.dataWeatherManager->NextHour = 1; + state.dataWeather->NextHour = 1; } if (state.dataGlobal->HourOfDay == 1) { // Should investigate whether DataGlobals::BeginDayFlag is always set here and use that instead @@ -2153,45 +1996,45 @@ namespace WeatherManager { ScheduleManager::UpdateScheduleValues(state); - state.dataEnvrn->CurMnDyHr = fmt::format( - "{:02d}/{:02d} {:02d}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, (unsigned short)(state.dataGlobal->HourOfDay - 1)); - state.dataEnvrn->CurMnDy = fmt::format("{:02d}/{:02d}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); + state.dataEnvrn->CurMnDyHr = + format("{:02d}/{:02d} {:02d}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, (unsigned short)(state.dataGlobal->HourOfDay - 1)); + state.dataEnvrn->CurMnDy = format("{:02d}/{:02d}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth); state.dataEnvrn->CurMnDyYr = - fmt::format("{:02d}/{:02d}/{:04d}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->CalendarYear); + format("{:02d}/{:02d}/{:04d}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth, state.dataGlobal->CalendarYear); - state.dataGlobal->WeightNow = state.dataWeatherManager->Interpolation(state.dataGlobal->TimeStep); + state.dataGlobal->WeightNow = state.dataWeather->Interpolation(state.dataGlobal->TimeStep); state.dataGlobal->WeightPreviousHour = 1.0 - state.dataGlobal->WeightNow; - state.dataGlobal->CurrentTime = (state.dataGlobal->HourOfDay - 1) + state.dataGlobal->TimeStep * (state.dataWeatherManager->TimeStepFraction); + state.dataGlobal->CurrentTime = (state.dataGlobal->HourOfDay - 1) + state.dataGlobal->TimeStep * (state.dataWeather->TimeStepFraction); state.dataGlobal->SimTimeSteps = (state.dataGlobal->DayOfSim - 1) * 24 * state.dataGlobal->NumOfTimeStepInHour + (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep; state.dataEnvrn->GroundTemp = - state.dataWeatherManager->siteBuildingSurfaceGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); - state.dataEnvrn->GroundTempKelvin = state.dataEnvrn->GroundTemp + Constant::KelvinConv; + state.dataWeather->siteBuildingSurfaceGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); + state.dataEnvrn->GroundTempKelvin = state.dataEnvrn->GroundTemp + Constant::Kelvin; state.dataEnvrn->GroundTempFC = - state.dataWeatherManager->siteFCFactorMethodGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); + state.dataWeather->siteFCFactorMethodGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); state.dataEnvrn->GroundTemp_Surface = - state.dataWeatherManager->siteShallowGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); - state.dataEnvrn->GroundTemp_Deep = - state.dataWeatherManager->siteDeepGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); - state.dataEnvrn->GndReflectance = state.dataWeatherManager->GroundReflectances(state.dataEnvrn->Month); + state.dataWeather->siteShallowGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); + state.dataEnvrn->GroundTemp_Deep = state.dataWeather->siteDeepGroundTempsPtr->getGroundTempAtTimeInMonths(state, 0, state.dataEnvrn->Month); + state.dataEnvrn->GndReflectance = state.dataWeather->GroundReflectances(state.dataEnvrn->Month); state.dataEnvrn->GndReflectanceForDayltg = state.dataEnvrn->GndReflectance; CalcWaterMainsTemp(state); // Determine if Sun is up or down, set Solar Cosine values for time step. DetermineSunUpDown(state, state.dataEnvrn->SOLCOS); - if (state.dataEnvrn->SunIsUp && state.dataWeatherManager->SolarAltitudeAngle < 0.0) { + if (state.dataEnvrn->SunIsUp && state.dataWeather->SolarAltitudeAngle < 0.0) { ShowFatalError(state, format("SetCurrentWeather: At {} Sun is Up but Solar Altitude Angle is < 0.0", state.dataEnvrn->CurMnDyHr)); } - state.dataEnvrn->OutDryBulbTemp = state.dataWeatherManager->TodayOutDryBulbTemp(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + auto const &today = state.dataWeather->wvarsHrTsToday(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataEnvrn->OutDryBulbTemp = today.OutDryBulbTemp; if (state.dataEnvrn->EMSOutDryBulbOverrideOn) state.dataEnvrn->OutDryBulbTemp = state.dataEnvrn->EMSOutDryBulbOverrideValue; - state.dataEnvrn->OutBaroPress = state.dataWeatherManager->TodayOutBaroPress(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); - state.dataEnvrn->OutDewPointTemp = state.dataWeatherManager->TodayOutDewPointTemp(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataEnvrn->OutBaroPress = today.OutBaroPress; + state.dataEnvrn->OutDewPointTemp = today.OutDewPointTemp; if (state.dataEnvrn->EMSOutDewPointTempOverrideOn) state.dataEnvrn->OutDewPointTemp = state.dataEnvrn->EMSOutDewPointTempOverrideValue; - state.dataEnvrn->OutRelHum = state.dataWeatherManager->TodayOutRelHum(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataEnvrn->OutRelHum = today.OutRelHum; state.dataEnvrn->OutRelHumValue = state.dataEnvrn->OutRelHum / 100.0; if (state.dataEnvrn->EMSOutRelHumOverrideOn) { state.dataEnvrn->OutRelHumValue = state.dataEnvrn->EMSOutRelHumOverrideValue / 100.0; @@ -2216,56 +2059,52 @@ namespace WeatherManager { if ((state.dataGlobal->KindOfSim == Constant::KindOfSim::DesignDay) || (state.dataGlobal->KindOfSim == Constant::KindOfSim::HVACSizeDesignDay)) { - state.dataWeatherManager->SPSiteDryBulbRangeModScheduleValue = -999.0; // N/A Drybulb Temperature Range Modifier Schedule Value - state.dataWeatherManager->SPSiteHumidityConditionScheduleValue = -999.0; // N/A Humidity Condition Schedule Value - state.dataWeatherManager->SPSiteBeamSolarScheduleValue = -999.0; // N/A Beam Solar Schedule Value - state.dataWeatherManager->SPSiteDiffuseSolarScheduleValue = -999.0; // N/A Diffuse Solar Schedule Value - state.dataWeatherManager->SPSiteSkyTemperatureScheduleValue = -999.0; // N/A SkyTemperature Modifier Schedule Value - - int const envrnDayNum(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum); - if (state.dataWeatherManager->DesDayInput(envrnDayNum).DBTempRangeType != DDDBRangeType::Default) { - state.dataWeatherManager->SPSiteDryBulbRangeModScheduleValue(envrnDayNum) = - state.dataWeatherManager->DDDBRngModifier(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, envrnDayNum); - } - DDHumIndType const &humIndType{state.dataWeatherManager->DesDayInput(envrnDayNum).HumIndType}; - if (humIndType == DDHumIndType::WBProfDef || humIndType == DDHumIndType::WBProfDif || humIndType == DDHumIndType::WBProfMul || - humIndType == DDHumIndType::RelHumSch) { - state.dataWeatherManager->SPSiteHumidityConditionScheduleValue(envrnDayNum) = - state.dataWeatherManager->DDHumIndModifier(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, envrnDayNum); - } - if (state.dataWeatherManager->DesDayInput(envrnDayNum).SolarModel == DesignDaySolarModel::SolarModel_Schedule) { - state.dataWeatherManager->SPSiteBeamSolarScheduleValue(envrnDayNum) = - state.dataWeatherManager->DDBeamSolarValues(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, envrnDayNum); - state.dataWeatherManager->SPSiteDiffuseSolarScheduleValue(envrnDayNum) = - state.dataWeatherManager->DDDiffuseSolarValues(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, envrnDayNum); - } - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::ScheduleValue || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::DryBulbDelta || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::DewPointDelta) { - state.dataWeatherManager->SPSiteSkyTemperatureScheduleValue(envrnDayNum) = - state.dataWeatherManager->DDSkyTempScheduleValues(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, envrnDayNum); + + for (int iDD = 1; iDD <= state.dataEnvrn->TotDesDays; ++iDD) { + state.dataWeather->spSiteSchedules(iDD) = {-999.0, -999.0, -999.0, -999.0, -999.0}; + } + + auto const &envCurr = state.dataWeather->Environment(state.dataWeather->Envrn); + int const envrnDayNum = envCurr.DesignDayNum; + auto &desDayInput = state.dataWeather->DesDayInput(envrnDayNum); + auto &spSiteSchedule = state.dataWeather->spSiteSchedules(envrnDayNum); + auto &desDayMod = state.dataWeather->desDayMods(envrnDayNum)(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + + if (desDayInput.dryBulbRangeType != DesDayDryBulbRangeType::Default) { + spSiteSchedule.OutDryBulbTemp = desDayMod.OutDryBulbTemp; + } + + if (desDayInput.HumIndType == DesDayHumIndType::WBProfDef || desDayInput.HumIndType == DesDayHumIndType::WBProfDif || + desDayInput.HumIndType == DesDayHumIndType::WBProfMul || desDayInput.HumIndType == DesDayHumIndType::RelHumSch) { + spSiteSchedule.OutRelHum = desDayMod.OutRelHum; + } + if (desDayInput.solarModel == DesDaySolarModel::SolarModel_Schedule) { + spSiteSchedule.BeamSolarRad = desDayMod.BeamSolarRad; + spSiteSchedule.DifSolarRad = desDayMod.DifSolarRad; + } + + if (envCurr.skyTempModel == SkyTempModel::ScheduleValue || envCurr.skyTempModel == SkyTempModel::DryBulbDelta || + envCurr.skyTempModel == SkyTempModel::DewPointDelta) { + spSiteSchedule.SkyTemp = desDayMod.SkyTemp; } } else if (state.dataEnvrn->TotDesDays > 0) { - state.dataWeatherManager->SPSiteDryBulbRangeModScheduleValue = -999.0; // N/A Drybulb Temperature Range Modifier Schedule Value - state.dataWeatherManager->SPSiteHumidityConditionScheduleValue = -999.0; // N/A Humidity Condition Schedule Value - state.dataWeatherManager->SPSiteBeamSolarScheduleValue = -999.0; // N/A Beam Solar Schedule Value - state.dataWeatherManager->SPSiteDiffuseSolarScheduleValue = -999.0; // N/A Diffuse Solar Schedule Value - state.dataWeatherManager->SPSiteSkyTemperatureScheduleValue = -999.0; // N/A SkyTemperature Modifier Schedule Value + for (int iDD = 1; iDD <= state.dataEnvrn->TotDesDays; ++iDD) { + state.dataWeather->spSiteSchedules(iDD) = {-999.0, -999.0, -999.0, -999.0, -999.0}; + } } - state.dataEnvrn->WindSpeed = state.dataWeatherManager->TodayWindSpeed(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataEnvrn->WindSpeed = today.WindSpeed; if (state.dataEnvrn->EMSWindSpeedOverrideOn) state.dataEnvrn->WindSpeed = state.dataEnvrn->EMSWindSpeedOverrideValue; - state.dataEnvrn->WindDir = state.dataWeatherManager->TodayWindDir(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataEnvrn->WindDir = today.WindDir; if (state.dataEnvrn->EMSWindDirOverrideOn) state.dataEnvrn->WindDir = state.dataEnvrn->EMSWindDirOverrideValue; - state.dataWeatherManager->HorizIRSky = state.dataWeatherManager->TodayHorizIRSky(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); - state.dataEnvrn->SkyTemp = state.dataWeatherManager->TodaySkyTemp(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); - state.dataEnvrn->SkyTempKelvin = state.dataEnvrn->SkyTemp + Constant::KelvinConv; - state.dataEnvrn->DifSolarRad = state.dataWeatherManager->TodayDifSolarRad(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataWeather->HorizIRSky = today.HorizIRSky; + state.dataEnvrn->SkyTemp = today.SkyTemp; + state.dataEnvrn->SkyTempKelvin = state.dataEnvrn->SkyTemp + Constant::Kelvin; + state.dataEnvrn->DifSolarRad = today.DifSolarRad; if (state.dataEnvrn->EMSDifSolarRadOverrideOn) state.dataEnvrn->DifSolarRad = state.dataEnvrn->EMSDifSolarRadOverrideValue; - state.dataEnvrn->BeamSolarRad = state.dataWeatherManager->TodayBeamSolarRad(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataEnvrn->BeamSolarRad = today.BeamSolarRad; if (state.dataEnvrn->EMSBeamSolarRadOverrideOn) state.dataEnvrn->BeamSolarRad = state.dataEnvrn->EMSBeamSolarRadOverrideValue; - state.dataEnvrn->LiquidPrecipitation = - state.dataWeatherManager->TodayLiquidPrecip(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay) / 1000.0; // convert from mm to m + state.dataEnvrn->LiquidPrecipitation = today.LiquidPrecip / 1000.0; // convert from mm to m if ((state.dataEnvrn->RunPeriodEnvironment) && (!state.dataGlobal->WarmupFlag)) { int month = state.dataEnvrn->Month; state.dataWaterData->RainFall.MonthlyTotalPrecInWeather.at(month - 1) += state.dataEnvrn->LiquidPrecipitation * 1000.0; @@ -2276,34 +2115,34 @@ namespace WeatherManager { WaterManager::UpdatePrecipitation(state); - state.dataEnvrn->TotalCloudCover = state.dataWeatherManager->TodayTotalSkyCover(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); - state.dataEnvrn->OpaqueCloudCover = state.dataWeatherManager->TodayOpaqueSkyCover(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + state.dataEnvrn->TotalCloudCover = today.TotalSkyCover; + state.dataEnvrn->OpaqueCloudCover = today.OpaqueSkyCover; - if (state.dataWeatherManager->UseRainValues) { - // It is set as LiquidPrecipitation >= .8 mm here: state.dataWeatherManager->TomorrowLiquidPrecip(ts, hour) >= - // state.dataWeatherManager->IsRainThreshold; - state.dataEnvrn->IsRain = state.dataWeatherManager->TodayIsRain(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + if (state.dataWeather->UseRainValues) { + // It is set as LiquidPrecipitation >= .8 mm here: state.dataWeather->TomorrowLiquidPrecip(ts, hour) >= + // state.dataWeather->IsRainThreshold; + state.dataEnvrn->IsRain = today.IsRain; if (state.dataWaterData->RainFall.ModeID == DataWater::RainfallMode::RainSchedDesign && state.dataEnvrn->RunPeriodEnvironment) { // CurrentAmount unit: m - state.dataEnvrn->IsRain = state.dataWaterData->RainFall.CurrentAmount >= (state.dataWeatherManager->IsRainThreshold / 1000.0); + state.dataEnvrn->IsRain = state.dataWaterData->RainFall.CurrentAmount >= (state.dataWeather->IsRainThreshold / 1000.0); } } else { state.dataEnvrn->IsRain = false; } - if (state.dataWeatherManager->UseSnowValues) { - state.dataEnvrn->IsSnow = state.dataWeatherManager->TodayIsSnow(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); + if (state.dataWeather->UseSnowValues) { + state.dataEnvrn->IsSnow = today.IsSnow; } else { state.dataEnvrn->IsSnow = false; } if (state.dataEnvrn->IsSnow) { - state.dataEnvrn->GndReflectance = max(min(state.dataEnvrn->GndReflectance * state.dataWeatherManager->SnowGndRefModifier, 1.0), 0.0); + state.dataEnvrn->GndReflectance = max(min(state.dataEnvrn->GndReflectance * state.dataWeather->SnowGndRefModifier, 1.0), 0.0); state.dataEnvrn->GndReflectanceForDayltg = - max(min(state.dataEnvrn->GndReflectanceForDayltg * state.dataWeatherManager->SnowGndRefModifierForDayltg, 1.0), 0.0); + max(min(state.dataEnvrn->GndReflectanceForDayltg * state.dataWeather->SnowGndRefModifierForDayltg, 1.0), 0.0); } state.dataEnvrn->GndSolarRad = - max((state.dataEnvrn->BeamSolarRad * state.dataEnvrn->SOLCOS(3) + state.dataEnvrn->DifSolarRad) * state.dataEnvrn->GndReflectance, 0.0); + max((state.dataEnvrn->BeamSolarRad * state.dataEnvrn->SOLCOS.z + state.dataEnvrn->DifSolarRad) * state.dataEnvrn->GndReflectance, 0.0); if (!state.dataEnvrn->SunIsUp) { state.dataEnvrn->DifSolarRad = 0.0; @@ -2321,15 +2160,15 @@ namespace WeatherManager { DayltgCurrentExtHorizIllum(state); if (!state.dataEnvrn->IsRain) { - state.dataWeatherManager->RptIsRain = 0; + state.dataWeather->RptIsRain = 0; } else { - state.dataWeatherManager->RptIsRain = 1; + state.dataWeather->RptIsRain = 1; } if (!state.dataEnvrn->IsSnow) { - state.dataWeatherManager->RptIsSnow = 0; + state.dataWeather->RptIsSnow = 0; } else { - state.dataWeatherManager->RptIsSnow = 1; + state.dataWeather->RptIsSnow = 1; } } @@ -2343,8 +2182,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda K. Lawrie // DATE WRITTEN April 1999 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is the driving routine behind reading the weather data. @@ -2365,7 +2202,6 @@ namespace WeatherManager { // AUTHOR Linda K. Lawrie // DATE WRITTEN April 1999 // MODIFIED March 2012; add actual weather read. - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine reads the appropriate day of EPW weather data. @@ -2404,36 +2240,11 @@ namespace WeatherManager { int PresWeathObs; Array1D_int PresWeathConds(9); - struct HourlyWeatherData - { - // Members - Array1D_bool IsRain; // Rain indicator, true=rain - Array1D_bool IsSnow; // Snow indicator, true=snow - Array1D OutDryBulbTemp; // Hourly dry bulb temperature of outside air - Array1D OutDewPointTemp; // Hourly Dew Point Temperature of outside air - Array1D OutBaroPress; // Hourly barometric pressure of outside air - Array1D OutRelHum; // Hourly relative humidity - Array1D WindSpeed; // Hourly wind speed of outside air - Array1D WindDir; // Hourly wind direction of outside air - Array1D SkyTemp; // Hourly sky temperature - Array1D HorizIRSky; // Hourly Horizontal Infrared Radiation Intensity - Array1D BeamSolarRad; // Hourly direct normal solar irradiance - Array1D DifSolarRad; // Hourly sky diffuse horizontal solar irradiance - Array1D Albedo; // Albedo - Array1D LiquidPrecip; // Liquid Precipitation - Array1D TotalSkyCover; // Total Sky Cover - Array1D OpaqueSkyCover; // Opaque Sky Cover - - // Default Constructor - HourlyWeatherData() - : IsRain(24, false), IsSnow(24, false), OutDryBulbTemp(24, 0.0), OutDewPointTemp(24, 0.0), OutBaroPress(24, 0.0), OutRelHum(24, 0.0), - WindSpeed(24, 0.0), WindDir(24, 0.0), SkyTemp(24, 0.0), HorizIRSky(24, 0.0), BeamSolarRad(24, 0.0), DifSolarRad(24, 0.0), - Albedo(24, 0.0), LiquidPrecip(24, 0.0), TotalSkyCover(24, 0.0), OpaqueSkyCover(24, 0.0) - { - } - }; + constexpr std::string_view routineName = "ReadEPlusWeatherForDay"; - HourlyWeatherData Wthr; + Array1D wvarsHr = Array1D(Constant::HoursInDay); + + auto &thisEnviron = state.dataWeather->Environment(Environ); if (DayToRead == 1) { @@ -2445,14 +2256,14 @@ namespace WeatherManager { // Must position file to proper day // File already position to first data record // Set Current Day of Week to "start of Data Period" - state.dataWeatherManager->ReadEPlusWeatherCurTime = 1.0 / double(state.dataWeatherManager->NumIntervalsPerHour); - state.dataWeatherManager->CurDayOfWeek = state.dataWeatherManager->DataPeriods(1).WeekDay - 1; + state.dataWeather->ReadEPlusWeatherCurTime = 1.0 / double(state.dataWeather->NumIntervalsPerHour); + state.dataWeather->CurDayOfWeek = state.dataWeather->DataPeriods(1).WeekDay - 1; WYear = 0; WMonth = 0; WDay = 0; WHour = 0; WMinute = 0; - state.dataWeatherManager->LastHourSet = false; + state.dataWeather->LastHourSet = false; InputFile::ReadResult WeatherDataLine{"", true, false}; while (!Ready) { WeatherDataLine.update(state.files.inputWeatherFile.readLine()); @@ -2496,10 +2307,9 @@ namespace WeatherManager { LiquidPrecip); } else if (WeatherDataLine.eof) { if (NumRewinds > 0) { - std::string date = fmt::to_string(state.dataWeatherManager->Environment(Environ).StartMonth) + '/' + - fmt::to_string(state.dataWeatherManager->Environment(Environ).StartDay); - if (state.dataWeatherManager->Environment(Environ).MatchYear) { - date += '/' + fmt::to_string(state.dataWeatherManager->Environment(Environ).StartYear); + std::string date = fmt::to_string(thisEnviron.StartMonth) + '/' + fmt::to_string(thisEnviron.StartDay); + if (thisEnviron.MatchYear) { + date += '/' + fmt::to_string(thisEnviron.StartYear); } ShowSevereError(state, format("Multiple rewinds on EPW while searching for first day {}", date)); } else { @@ -2557,121 +2367,74 @@ namespace WeatherManager { state.files.inputWeatherFile.error_state_to_string()), OptionalOutputFileRef{state.files.eso}); } - if (state.dataWeatherManager->CurDayOfWeek <= 7) { - state.dataWeatherManager->CurDayOfWeek = mod(state.dataWeatherManager->CurDayOfWeek, 7) + 1; + if (state.dataWeather->CurDayOfWeek <= 7) { + state.dataWeather->CurDayOfWeek = mod(state.dataWeather->CurDayOfWeek, 7) + 1; } bool RecordDateMatch = - (WMonth == state.dataWeatherManager->Environment(Environ).StartMonth && - WDay == state.dataWeatherManager->Environment(Environ).StartDay && !state.dataWeatherManager->Environment(Environ).MatchYear) || - (WMonth == state.dataWeatherManager->Environment(Environ).StartMonth && - WDay == state.dataWeatherManager->Environment(Environ).StartDay && state.dataWeatherManager->Environment(Environ).MatchYear && - WYear == state.dataWeatherManager->Environment(Environ).StartYear); + (WMonth == thisEnviron.StartMonth && WDay == thisEnviron.StartDay && !thisEnviron.MatchYear) || + (WMonth == thisEnviron.StartMonth && WDay == thisEnviron.StartDay && thisEnviron.MatchYear && WYear == thisEnviron.StartYear); if (RecordDateMatch) { state.files.inputWeatherFile.backspace(); Ready = true; - if (state.dataWeatherManager->CurDayOfWeek <= 7) { - --state.dataWeatherManager->CurDayOfWeek; + if (state.dataWeather->CurDayOfWeek <= 7) { + --state.dataWeather->CurDayOfWeek; } // Do the range checks on the first set of fields -- no others. bool ErrorsFound = false; - if (DryBulb >= 99.9) - state.dataInputProcessing->inputProcessor->rangeCheck(state, - ErrorsFound, - "DryBulb Temperature", - "WeatherFile", - "Severe", - ">= -90", - (DryBulb >= -90.0), - "<= 70", - (DryBulb <= 70.0), - format("{:.2R}", DryBulb), - state.dataEnvrn->WeatherFileLocationTitle); - if (DewPoint < 99.9) - state.dataInputProcessing->inputProcessor->rangeCheck(state, - ErrorsFound, - "DewPoint Temperature", - "WeatherFile", - "Severe", - ">= -90", - (DewPoint >= -90.0), - "<= 70", - (DewPoint <= 70.0), - format("{:.2R}", DewPoint), - state.dataEnvrn->WeatherFileLocationTitle); - if (RelHum < 999.0) - state.dataInputProcessing->inputProcessor->rangeCheck(state, - ErrorsFound, - "Relative Humidity", - "WeatherFile", - "Severe", - "> 0", - (RelHum >= 0.0), - "<= 110", - (RelHum <= 110.0), - format("{:.0R}", RelHum), - state.dataEnvrn->WeatherFileLocationTitle); - if (AtmPress < 999999.0) - state.dataInputProcessing->inputProcessor->rangeCheck(state, - ErrorsFound, - "Atmospheric Pressure", - "WeatherFile", - "Severe", - "> 31000", - (AtmPress > 31000.0), - "<=120000", - (AtmPress <= 120000.0), - format("{:.0R}", AtmPress), - state.dataEnvrn->WeatherFileLocationTitle); - if (DirectRad < 9999.0) - state.dataInputProcessing->inputProcessor->lowerRangeCheck(state, - ErrorsFound, - "Direct Radiation", - "WeatherFile", - "Severe", - ">= 0", - (DirectRad >= 0.0), - {}, - state.dataEnvrn->WeatherFileLocationTitle); - if (DiffuseRad < 9999.0) - state.dataInputProcessing->inputProcessor->lowerRangeCheck(state, - ErrorsFound, - "Diffuse Radiation", - "WeatherFile", - "Severe", - ">= 0", - (DiffuseRad >= 0.0), - {}, - state.dataEnvrn->WeatherFileLocationTitle); - if (WindDir < 999.0) - state.dataInputProcessing->inputProcessor->rangeCheck(state, - ErrorsFound, - "Wind Direction", - "WeatherFile", - "Severe", - ">=0", - (WindDir >= 0.0), - "<=360", - (WindDir <= 360.0), - format("{:.0R}", WindDir), - state.dataEnvrn->WeatherFileLocationTitle); - if (WindSpeed < 999.0) - state.dataInputProcessing->inputProcessor->rangeCheck(state, - ErrorsFound, - "Wind Speed", - "WeatherFile", - "Severe", - ">=0", - (WindSpeed >= 0.0), - "<=40", - (WindSpeed <= 40.0), - format("{:.2R}", WindSpeed), - state.dataEnvrn->WeatherFileLocationTitle); + if (DryBulb < 99.9 && (DryBulb < -90.0 || DryBulb > 70.0)) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("DryBulb Temperature ({:.2R}) is out of range [-90.0, 70.0]", DryBulb)); + ErrorsFound = true; + } + + if (DewPoint < 99.9 && (DewPoint < -90.0 || DewPoint > 70.0)) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("DewPoint Temperature ({:.2R}) is out of range [-90.0, 70.0]", DewPoint)); + ErrorsFound = true; + } + + if (RelHum < 999.0 && (RelHum < 0.0 || RelHum > 110.0)) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("Relative Humidity ({:.2R}) is out of range [0.0, 100.0]", RelHum)); + ErrorsFound = true; + } + + if (AtmPress < 999999.0 && (AtmPress <= 31000.0 || AtmPress > 120000.0)) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("Atmospheric Pressure ({:.0R}) is out of range [31000, 120000]", AtmPress)); + ErrorsFound = true; + } + + if (DirectRad < 9999.0 && DirectRad < 0.0) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("Direct Radiation ({:.2R}) is out of range [0.0, -]", DirectRad)); + ErrorsFound = true; + } + + if (DiffuseRad < 9999.0 && DiffuseRad < 0.0) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("Diffuse Radiation ({:.2R}) is out of range [0.0, -]", DiffuseRad)); + ErrorsFound = true; + } + + if (WindDir < 999.0 && (WindDir < 0.0 || WindDir > 360.0)) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("Wind Direction ({:.2R}) is out of range [0.0, 360.0]", WindDir)); + ErrorsFound = true; + } + + if (WindSpeed < 999.0 && (WindSpeed < 0.0 || WindSpeed > 40.0)) { + ShowSevereError(state, format("{}: {}", routineName, state.dataEnvrn->WeatherFileLocationTitle)); + ShowContinueError(state, format("Wind Speed ({:.2R}) is out of range [0.0, 40.0]", WindSpeed)); + ErrorsFound = true; + } + if (ErrorsFound) { ShowSevereError(state, "Out of Range errors found with initial day of WeatherFile"); } } else { // Must skip this day - for (int i = 2; i <= state.dataWeatherManager->NumIntervalsPerHour; ++i) { + for (int i = 2; i <= state.dataWeather->NumIntervalsPerHour; ++i) { WeatherDataLine.update(state.files.inputWeatherFile.readLine()); if (!WeatherDataLine.good) { readList(WeatherDataLine.data, WYear, WMonth, WDay, WHour, WMinute); @@ -2686,7 +2449,7 @@ namespace WeatherManager { OptionalOutputFileRef{state.files.eso}); } } - for (int i = 1; i <= 23 * state.dataWeatherManager->NumIntervalsPerHour; ++i) { + for (int i = 1; i <= 23 * state.dataWeather->NumIntervalsPerHour; ++i) { WeatherDataLine.update(state.files.inputWeatherFile.readLine()); if (!WeatherDataLine.good) { readList(WeatherDataLine.data, WYear, WMonth, WDay, WHour, WMinute); @@ -2704,32 +2467,31 @@ namespace WeatherManager { } } + auto const &envCurr = state.dataWeather->Environment(state.dataWeather->Envrn); + // Why do some things here use state.dataWeather->Envrn and some the parameter Environ? + // Positioned to proper day if (!state.dataGlobal->KickOffSimulation && !state.dataGlobal->DoingSizing && - state.dataWeatherManager->Environment(Environ).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { - ++state.dataWeatherManager->Environment(Environ).CurrentCycle; - if (!state.dataWeatherManager->Environment(Environ).RollDayTypeOnRepeat) { - SetDayOfWeekInitialValues(state.dataWeatherManager->Environment(Environ).DayOfWeek, state.dataWeatherManager->CurDayOfWeek); - if (state.dataWeatherManager->DaylightSavingIsActive) { - SetDSTDateRanges(state, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).MonWeekDay, - state.dataWeatherManager->DSTIndex); + thisEnviron.KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather) { + ++thisEnviron.CurrentCycle; + if (!thisEnviron.RollDayTypeOnRepeat) { + SetDayOfWeekInitialValues(thisEnviron.DayOfWeek, state.dataWeather->CurDayOfWeek); + if (state.dataWeather->DaylightSavingIsActive) { + SetDSTDateRanges(state, envCurr.MonWeekDay, state.dataWeather->DSTIndex); } - SetSpecialDayDates(state, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).MonWeekDay); - } else if (state.dataWeatherManager->Environment(Environ).CurrentCycle == 1) { - SetDayOfWeekInitialValues(state.dataWeatherManager->Environment(Environ).DayOfWeek, state.dataWeatherManager->CurDayOfWeek); - state.dataWeatherManager->Environment(Environ).SetWeekDays = true; - if (state.dataWeatherManager->DaylightSavingIsActive) { - SetDSTDateRanges(state, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).MonWeekDay, - state.dataWeatherManager->DSTIndex); + SetSpecialDayDates(state, envCurr.MonWeekDay); + } else if (thisEnviron.CurrentCycle == 1) { + SetDayOfWeekInitialValues(thisEnviron.DayOfWeek, state.dataWeather->CurDayOfWeek); + thisEnviron.SetWeekDays = true; + if (state.dataWeather->DaylightSavingIsActive) { + SetDSTDateRanges(state, envCurr.MonWeekDay, state.dataWeather->DSTIndex); } - SetSpecialDayDates(state, state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).MonWeekDay); + SetSpecialDayDates(state, envCurr.MonWeekDay); } else { - state.dataWeatherManager->CurDayOfWeek = state.dataEnvrn->DayOfWeekTomorrow; + state.dataWeather->CurDayOfWeek = state.dataEnvrn->DayOfWeekTomorrow; } } else { - SetDayOfWeekInitialValues(state.dataWeatherManager->Environment(Environ).DayOfWeek, state.dataWeatherManager->CurDayOfWeek); + SetDayOfWeekInitialValues(thisEnviron.DayOfWeek, state.dataWeather->CurDayOfWeek); } } @@ -2740,23 +2502,9 @@ namespace WeatherManager { TryAgain = false; - state.dataWeatherManager->TomorrowOutDryBulbTemp = 0.0; - state.dataWeatherManager->TomorrowOutDewPointTemp = 0.0; - state.dataWeatherManager->TomorrowOutBaroPress = 0.0; - state.dataWeatherManager->TomorrowOutRelHum = 0.0; - state.dataWeatherManager->TomorrowWindSpeed = 0.0; - state.dataWeatherManager->TomorrowWindDir = 0.0; - state.dataWeatherManager->TomorrowSkyTemp = 0.0; - state.dataWeatherManager->TomorrowHorizIRSky = 0.0; - state.dataWeatherManager->TomorrowBeamSolarRad = 0.0; - state.dataWeatherManager->TomorrowDifSolarRad = 0.0; - state.dataWeatherManager->TomorrowAlbedo = 0.0; - state.dataWeatherManager->TomorrowLiquidPrecip = 0.0; - state.dataWeatherManager->TomorrowIsRain = false; - state.dataWeatherManager->TomorrowIsSnow = false; - for (int hour = 1; hour <= 24; ++hour) { - for (int CurTimeStep = 1; CurTimeStep <= state.dataWeatherManager->NumIntervalsPerHour; ++CurTimeStep) { + for (int CurTimeStep = 1; CurTimeStep <= state.dataWeather->NumIntervalsPerHour; ++CurTimeStep) { + state.dataWeather->wvarsHrTsTomorrow(CurTimeStep, hour) = WeatherVars(); auto WeatherDataLine = state.files.inputWeatherFile.readLine(); if (!WeatherDataLine.good) { WeatherDataLine.data.clear(); @@ -2809,8 +2557,8 @@ namespace WeatherManager { LiquidPrecip); } else { // ReadStatus /=0 if (WeatherDataLine.eof && - state.dataWeatherManager->NumDataPeriods == 1) { // Standard End-of-file, rewind and position to first day... - if (state.dataWeatherManager->DataPeriods(1).NumDays >= state.dataWeatherManager->NumDaysInYear) { + state.dataWeather->NumDataPeriods == 1) { // Standard End-of-file, rewind and position to first day... + if (state.dataWeather->DataPeriods(1).NumDays >= state.dataWeather->NumDaysInYear) { state.files.inputWeatherFile.rewind(); SkipEPlusWFHeader(state); WeatherDataLine.update(state.files.inputWeatherFile.readLine()); @@ -2891,18 +2639,18 @@ namespace WeatherManager { if (GLBHoriz < 0.0) GLBHoriz = 9999.0; if (state.dataEnvrn->DisplayWeatherMissingDataWarnings) { if (DirectRad >= 9999.0) { - ++state.dataWeatherManager->Missed.DirectRad; + ++state.dataWeather->wvarsMissedCounts.BeamSolarRad; } if (DiffuseRad >= 9999.0) { - state.dataWeatherManager->Missed.DiffuseRad = state.dataWeatherManager->Missed.DirectRad + 1; + state.dataWeather->wvarsMissedCounts.DifSolarRad = state.dataWeather->wvarsMissedCounts.BeamSolarRad + 1; } if (DirectRad < 0.0) { DirectRad = 9999.0; - ++state.dataWeatherManager->OutOfRange.DirectRad; + ++state.dataWeather->wvarsOutOfRangeCounts.BeamSolarRad; } if (DiffuseRad < 0.0) { DiffuseRad = 9999.0; - ++state.dataWeatherManager->OutOfRange.DiffuseRad; + ++state.dataWeather->wvarsOutOfRangeCounts.DifSolarRad; } } if (GLBHorizIllum < 0.0) GLBHorizIllum = 999999.0; @@ -2926,13 +2674,13 @@ namespace WeatherManager { if (LiquidPrecip < 0.0) LiquidPrecip = 999.0; if (hour == 1 && CurTimeStep == 1) { - if (WMonth == 2 && WDay == 29 && (!state.dataEnvrn->CurrentYearIsLeapYear || !state.dataWeatherManager->WFAllowsLeapYears)) { - state.dataWeatherManager->EndDayOfMonth(2) = 28; - state.dataWeatherManager->EndDayOfMonthWithLeapDay(2) = 28; + if (WMonth == 2 && WDay == 29 && (!state.dataEnvrn->CurrentYearIsLeapYear || !state.dataWeather->WFAllowsLeapYears)) { + state.dataWeather->EndDayOfMonth(2) = 28; + state.dataWeather->EndDayOfMonthWithLeapDay(2) = 28; SkipThisDay = true; TryAgain = true; ShowWarningError(state, "ReadEPlusWeatherForDay: Feb29 data encountered but will not be processed."); - if (!state.dataWeatherManager->WFAllowsLeapYears) { + if (!state.dataWeather->WFAllowsLeapYears) { ShowContinueError( state, "...WeatherFile does not allow Leap Years. HOLIDAYS/DAYLIGHT SAVINGS header must indicate \"Yes\"."); } @@ -2942,39 +2690,38 @@ namespace WeatherManager { SkipThisDay = false; } - if (state.dataWeatherManager->Environment(Environ).ActualWeather && state.dataEnvrn->CurrentYearIsLeapYear) { + if (thisEnviron.ActualWeather && state.dataEnvrn->CurrentYearIsLeapYear) { if (WMonth == 3 && WDay == 1 && state.dataEnvrn->Month == 2 && state.dataEnvrn->DayOfMonth == 28) { ShowFatalError(state, "ReadEPlusWeatherForDay: Current year is a leap year, but Feb29 data is missing."); } } - state.dataWeatherManager->TomorrowVariables.Year = WYear; - state.dataWeatherManager->TomorrowVariables.Month = WMonth; - state.dataWeatherManager->TomorrowVariables.DayOfMonth = WDay; - state.dataWeatherManager->TomorrowVariables.DayOfYear = - General::OrdinalDay(WMonth, WDay, state.dataWeatherManager->LeapYearAdd); - state.dataWeatherManager->TomorrowVariables.DayOfYear_Schedule = General::OrdinalDay(WMonth, WDay, 1); + state.dataWeather->TomorrowVariables.Year = WYear; + state.dataWeather->TomorrowVariables.Month = WMonth; + state.dataWeather->TomorrowVariables.DayOfMonth = WDay; + state.dataWeather->TomorrowVariables.DayOfYear = General::OrdinalDay(WMonth, WDay, state.dataWeather->LeapYearAdd); + state.dataWeather->TomorrowVariables.DayOfYear_Schedule = General::OrdinalDay(WMonth, WDay, 1); Real64 A; Real64 B; Real64 C; Real64 AVSC; CalculateDailySolarCoeffs(state, - state.dataWeatherManager->TomorrowVariables.DayOfYear, + state.dataWeather->TomorrowVariables.DayOfYear, A, B, C, AVSC, - state.dataWeatherManager->TomorrowVariables.EquationOfTime, - state.dataWeatherManager->TomorrowVariables.SinSolarDeclinAngle, - state.dataWeatherManager->TomorrowVariables.CosSolarDeclinAngle); - if (state.dataWeatherManager->CurDayOfWeek <= 7) { - state.dataWeatherManager->CurDayOfWeek = mod(state.dataWeatherManager->CurDayOfWeek, 7) + 1; + state.dataWeather->TomorrowVariables.EquationOfTime, + state.dataWeather->TomorrowVariables.SinSolarDeclinAngle, + state.dataWeather->TomorrowVariables.CosSolarDeclinAngle); + if (state.dataWeather->CurDayOfWeek <= 7) { + state.dataWeather->CurDayOfWeek = mod(state.dataWeather->CurDayOfWeek, 7) + 1; } - state.dataWeatherManager->TomorrowVariables.DayOfWeek = state.dataWeatherManager->CurDayOfWeek; - state.dataWeatherManager->TomorrowVariables.DaylightSavingIndex = - state.dataWeatherManager->DSTIndex(state.dataWeatherManager->TomorrowVariables.DayOfYear); - state.dataWeatherManager->TomorrowVariables.HolidayIndex = - state.dataWeatherManager->SpecialDayTypes(state.dataWeatherManager->TomorrowVariables.DayOfYear); + state.dataWeather->TomorrowVariables.DayOfWeek = state.dataWeather->CurDayOfWeek; + state.dataWeather->TomorrowVariables.DaylightSavingIndex = + state.dataWeather->DSTIndex(state.dataWeather->TomorrowVariables.DayOfYear); + state.dataWeather->TomorrowVariables.HolidayIndex = + state.dataWeather->SpecialDayTypes(state.dataWeather->TomorrowVariables.DayOfYear); } if (SkipThisDay) continue; @@ -2982,98 +2729,92 @@ namespace WeatherManager { // Check out missing values if (DryBulb >= 99.9) { - DryBulb = state.dataWeatherManager->Missing.DryBulb; - ++state.dataWeatherManager->Missed.DryBulb; + DryBulb = state.dataWeather->wvarsMissing.OutDryBulbTemp; + ++state.dataWeather->wvarsMissedCounts.OutDryBulbTemp; } if (DryBulb < -90.0 || DryBulb > 70.0) { - ++state.dataWeatherManager->OutOfRange.DryBulb; + ++state.dataWeather->wvarsOutOfRangeCounts.OutDryBulbTemp; } if (DewPoint >= 99.9) { - DewPoint = state.dataWeatherManager->Missing.DewPoint; - ++state.dataWeatherManager->Missed.DewPoint; + DewPoint = state.dataWeather->wvarsMissing.OutDewPointTemp; + ++state.dataWeather->wvarsMissedCounts.OutDewPointTemp; } if (DewPoint < -90.0 || DewPoint > 70.0) { - ++state.dataWeatherManager->OutOfRange.DewPoint; + ++state.dataWeather->wvarsOutOfRangeCounts.OutDewPointTemp; } if (RelHum >= 999.0) { - RelHum = state.dataWeatherManager->Missing.RelHumid; - ++state.dataWeatherManager->Missed.RelHumid; + RelHum = state.dataWeather->wvarsMissing.OutRelHum; + ++state.dataWeather->wvarsMissedCounts.OutRelHum; } if (RelHum < 0.0 || RelHum > 110.0) { - ++state.dataWeatherManager->OutOfRange.RelHumid; + ++state.dataWeather->wvarsOutOfRangeCounts.OutRelHum; } if (AtmPress >= 999999.0) { - AtmPress = state.dataWeatherManager->Missing.StnPres; - ++state.dataWeatherManager->Missed.StnPres; + AtmPress = state.dataWeather->wvarsMissing.OutBaroPress; + ++state.dataWeather->wvarsMissedCounts.OutBaroPress; } if (AtmPress <= 31000.0 || AtmPress > 120000.0) { - ++state.dataWeatherManager->OutOfRange.StnPres; - AtmPress = state.dataWeatherManager->Missing.StnPres; + ++state.dataWeather->wvarsOutOfRangeCounts.OutBaroPress; + AtmPress = state.dataWeather->wvarsMissing.OutBaroPress; } if (WindDir >= 999.0) { - WindDir = state.dataWeatherManager->Missing.WindDir; - ++state.dataWeatherManager->Missed.WindDir; + WindDir = state.dataWeather->wvarsMissing.WindDir; + ++state.dataWeather->wvarsMissedCounts.WindDir; } if (WindDir < 0.0 || WindDir > 360.0) { - ++state.dataWeatherManager->OutOfRange.WindDir; + ++state.dataWeather->wvarsOutOfRangeCounts.WindDir; } if (WindSpeed >= 999.0) { - WindSpeed = state.dataWeatherManager->Missing.WindSpd; - ++state.dataWeatherManager->Missed.WindSpd; + WindSpeed = state.dataWeather->wvarsMissing.WindSpeed; + ++state.dataWeather->wvarsMissedCounts.WindSpeed; } if (WindSpeed < 0.0 || WindSpeed > 40.0) { - ++state.dataWeatherManager->OutOfRange.WindSpd; + ++state.dataWeather->wvarsOutOfRangeCounts.WindSpeed; } if (TotalSkyCover >= 99.0) { - TotalSkyCover = state.dataWeatherManager->Missing.TotSkyCvr; - ++state.dataWeatherManager->Missed.TotSkyCvr; + TotalSkyCover = state.dataWeather->wvarsMissing.TotalSkyCover; + ++state.dataWeather->wvarsMissedCounts.TotalSkyCover; } if (OpaqueSkyCover >= 99.0) { - OpaqueSkyCover = state.dataWeatherManager->Missing.OpaqSkyCvr; - ++state.dataWeatherManager->Missed.OpaqSkyCvr; + OpaqueSkyCover = state.dataWeather->wvarsMissing.OpaqueSkyCover; + ++state.dataWeather->wvarsMissedCounts.OpaqueSkyCover; } if (SnowDepth >= 999.0) { - SnowDepth = state.dataWeatherManager->Missing.SnowDepth; - ++state.dataWeatherManager->Missed.SnowDepth; + SnowDepth = state.dataWeather->wvarsMissing.SnowDepth; + ++state.dataWeather->wvarsMissedCounts.SnowDepth; } if (Albedo >= 999.0) { - Albedo = state.dataWeatherManager->Missing.Albedo; - ++state.dataWeatherManager->Missed.Albedo; + Albedo = state.dataWeather->wvarsMissing.Albedo; + ++state.dataWeather->wvarsMissedCounts.Albedo; } if (LiquidPrecip >= 999.0) { - LiquidPrecip = state.dataWeatherManager->Missing.LiquidPrecip; - ++state.dataWeatherManager->Missed.LiquidPrecip; + LiquidPrecip = state.dataWeather->wvarsMissing.LiquidPrecip; + ++state.dataWeather->wvarsMissedCounts.LiquidPrecip; } - state.dataWeatherManager->TomorrowOutDryBulbTemp(CurTimeStep, hour) = DryBulb; - state.dataWeatherManager->TomorrowOutDewPointTemp(CurTimeStep, hour) = DewPoint; - state.dataWeatherManager->TomorrowOutBaroPress(CurTimeStep, hour) = AtmPress; - state.dataWeatherManager->TomorrowOutRelHum(CurTimeStep, hour) = RelHum; + auto &tomorrow = state.dataWeather->wvarsHrTsTomorrow(CurTimeStep, hour); + tomorrow.OutDryBulbTemp = DryBulb; + tomorrow.OutDewPointTemp = DewPoint; + tomorrow.OutBaroPress = AtmPress; + tomorrow.OutRelHum = RelHum; RelHum *= 0.01; - state.dataWeatherManager->TomorrowWindSpeed(CurTimeStep, hour) = WindSpeed; - state.dataWeatherManager->TomorrowWindDir(CurTimeStep, hour) = WindDir; - state.dataWeatherManager->TomorrowLiquidPrecip(CurTimeStep, hour) = LiquidPrecip; - state.dataWeatherManager->TomorrowTotalSkyCover(CurTimeStep, hour) = TotalSkyCover; - state.dataWeatherManager->TomorrowOpaqueSkyCover(CurTimeStep, hour) = OpaqueSkyCover; + tomorrow.WindSpeed = WindSpeed; + tomorrow.WindDir = WindDir; + tomorrow.LiquidPrecip = LiquidPrecip; + tomorrow.TotalSkyCover = TotalSkyCover; + tomorrow.OpaqueSkyCover = OpaqueSkyCover; - calcSky(state, - state.dataWeatherManager->TomorrowHorizIRSky(CurTimeStep, hour), - state.dataWeatherManager->TomorrowSkyTemp(CurTimeStep, hour), - OpaqueSkyCover, - DryBulb, - DewPoint, - RelHum, - IRHoriz); + calcSky(state, tomorrow.HorizIRSky, tomorrow.SkyTemp, OpaqueSkyCover, DryBulb, DewPoint, RelHum, IRHoriz); if (ETHoriz >= 9999.0) ETHoriz = 0.0; if (ETDirect >= 9999.0) ETDirect = 0.0; @@ -3096,42 +2837,39 @@ namespace WeatherManager { DiffuseRad = 0.0; } - state.dataWeatherManager->TomorrowBeamSolarRad(CurTimeStep, hour) = DirectRad; - state.dataWeatherManager->TomorrowDifSolarRad(CurTimeStep, hour) = DiffuseRad; + tomorrow.BeamSolarRad = DirectRad; + tomorrow.DifSolarRad = DiffuseRad; - state.dataWeatherManager->TomorrowIsRain(CurTimeStep, hour) = false; + tomorrow.IsRain = false; if (PresWeathObs == 0) { - if (PresWeathConds(1) < 9 || PresWeathConds(2) < 9 || PresWeathConds(3) < 9) - state.dataWeatherManager->TomorrowIsRain(CurTimeStep, hour) = true; + if (PresWeathConds(1) < 9 || PresWeathConds(2) < 9 || PresWeathConds(3) < 9) tomorrow.IsRain = true; } else { - state.dataWeatherManager->TomorrowIsRain(CurTimeStep, hour) = false; + tomorrow.IsRain = false; } - state.dataWeatherManager->TomorrowIsSnow(CurTimeStep, hour) = (SnowDepth > 0.0); + tomorrow.IsSnow = (SnowDepth > 0.0); // default if rain but none on weather file - if (state.dataWeatherManager->TomorrowIsRain(CurTimeStep, hour) && - state.dataWeatherManager->TomorrowLiquidPrecip(CurTimeStep, hour) == 0.0) - state.dataWeatherManager->TomorrowLiquidPrecip(CurTimeStep, hour) = 2.0; // 2mm in an hour ~ .08 inch - - state.dataWeatherManager->Missing.DryBulb = DryBulb; - state.dataWeatherManager->Missing.DewPoint = DewPoint; - state.dataWeatherManager->Missing.RelHumid = static_cast(std::round(RelHum * 100.0)); - state.dataWeatherManager->Missing.StnPres = AtmPress; - state.dataWeatherManager->Missing.WindDir = WindDir; - state.dataWeatherManager->Missing.WindSpd = WindSpeed; - state.dataWeatherManager->Missing.TotSkyCvr = TotalSkyCover; - state.dataWeatherManager->Missing.OpaqSkyCvr = OpaqueSkyCover; - state.dataWeatherManager->Missing.Visibility = Visibility; - state.dataWeatherManager->Missing.Ceiling = CeilHeight; - state.dataWeatherManager->Missing.PrecipWater = PrecipWater; - state.dataWeatherManager->Missing.AerOptDepth = AerosolOptDepth; - state.dataWeatherManager->Missing.SnowDepth = SnowDepth; - state.dataWeatherManager->Missing.DaysLastSnow = DaysSinceLastSnow; - state.dataWeatherManager->Missing.Albedo = Albedo; - - } // CurTimeStep Loop - - } // Hour Loop + if (tomorrow.IsRain && tomorrow.LiquidPrecip == 0.0) tomorrow.LiquidPrecip = 2.0; // 2mm in an hour ~ .08 inch + + state.dataWeather->wvarsMissing.OutDryBulbTemp = DryBulb; + state.dataWeather->wvarsMissing.OutDewPointTemp = DewPoint; + state.dataWeather->wvarsMissing.OutRelHum = static_cast(std::round(RelHum * 100.0)); + state.dataWeather->wvarsMissing.OutBaroPress = AtmPress; + state.dataWeather->wvarsMissing.WindDir = WindDir; + state.dataWeather->wvarsMissing.WindSpeed = WindSpeed; + state.dataWeather->wvarsMissing.TotalSkyCover = TotalSkyCover; + state.dataWeather->wvarsMissing.OpaqueSkyCover = OpaqueSkyCover; + state.dataWeather->wvarsMissing.Visibility = Visibility; + state.dataWeather->wvarsMissing.Ceiling = CeilHeight; + state.dataWeather->wvarsMissing.WaterPrecip = PrecipWater; + state.dataWeather->wvarsMissing.AerOptDepth = AerosolOptDepth; + state.dataWeather->wvarsMissing.SnowDepth = SnowDepth; + state.dataWeather->wvarsMissing.DaysLastSnow = DaysSinceLastSnow; + state.dataWeather->wvarsMissing.Albedo = Albedo; + + } // for (CurTimeStep) + + } // for (Hour) } // Try Again While Loop @@ -3139,186 +2877,135 @@ namespace WeatherManager { state.files.inputWeatherFile.backspace(); } - if (state.dataWeatherManager->NumIntervalsPerHour == 1 && state.dataGlobal->NumOfTimeStepInHour > 1) { + if (state.dataWeather->NumIntervalsPerHour == 1 && state.dataGlobal->NumOfTimeStepInHour > 1) { // Create interpolated weather for timestep orientation // First copy ts=1 (hourly) from data arrays to Wthr structure - for (int hour = 1; hour <= 24; ++hour) { - Wthr.OutDryBulbTemp(hour) = state.dataWeatherManager->TomorrowOutDryBulbTemp(1, hour); - Wthr.OutDewPointTemp(hour) = state.dataWeatherManager->TomorrowOutDewPointTemp(1, hour); - Wthr.OutBaroPress(hour) = state.dataWeatherManager->TomorrowOutBaroPress(1, hour); - Wthr.OutRelHum(hour) = state.dataWeatherManager->TomorrowOutRelHum(1, hour); - Wthr.WindSpeed(hour) = state.dataWeatherManager->TomorrowWindSpeed(1, hour); - Wthr.WindDir(hour) = state.dataWeatherManager->TomorrowWindDir(1, hour); - Wthr.SkyTemp(hour) = state.dataWeatherManager->TomorrowSkyTemp(1, hour); - Wthr.HorizIRSky(hour) = state.dataWeatherManager->TomorrowHorizIRSky(1, hour); - Wthr.BeamSolarRad(hour) = state.dataWeatherManager->TomorrowBeamSolarRad(1, hour); - Wthr.DifSolarRad(hour) = state.dataWeatherManager->TomorrowDifSolarRad(1, hour); - Wthr.IsRain(hour) = state.dataWeatherManager->TomorrowIsRain(1, hour); - Wthr.IsSnow(hour) = state.dataWeatherManager->TomorrowIsSnow(1, hour); - Wthr.Albedo(hour) = state.dataWeatherManager->TomorrowAlbedo(1, hour); - Wthr.LiquidPrecip(hour) = state.dataWeatherManager->TomorrowLiquidPrecip(1, hour); - Wthr.TotalSkyCover(hour) = state.dataWeatherManager->TomorrowTotalSkyCover(1, hour); - Wthr.OpaqueSkyCover(hour) = state.dataWeatherManager->TomorrowOpaqueSkyCover(1, hour); - } - - if (!state.dataWeatherManager->LastHourSet) { + for (int hour = 1; hour <= Constant::HoursInDay; ++hour) { + wvarsHr(hour) = state.dataWeather->wvarsHrTsTomorrow(1, hour); + } + + if (!state.dataWeather->LastHourSet) { // For first day of weather, all time steps of the first hour will be // equal to the first hour's value. // 2021-06: An additional input is added to here to allow the user to have chosen which hour to use - int HrUsedtoInterp = state.dataWeatherManager->Environment(Environ).firstHrInterpUseHr1 ? 1 : 24; - - state.dataWeatherManager->LastHrOutDryBulbTemp = Wthr.OutDryBulbTemp(HrUsedtoInterp); - state.dataWeatherManager->LastHrOutDewPointTemp = Wthr.OutDewPointTemp(HrUsedtoInterp); - state.dataWeatherManager->LastHrOutBaroPress = Wthr.OutBaroPress(HrUsedtoInterp); - state.dataWeatherManager->LastHrOutRelHum = Wthr.OutRelHum(HrUsedtoInterp); - state.dataWeatherManager->LastHrWindSpeed = Wthr.WindSpeed(HrUsedtoInterp); - state.dataWeatherManager->LastHrWindDir = Wthr.WindDir(HrUsedtoInterp); - state.dataWeatherManager->LastHrSkyTemp = Wthr.SkyTemp(HrUsedtoInterp); - state.dataWeatherManager->LastHrHorizIRSky = Wthr.HorizIRSky(HrUsedtoInterp); - state.dataWeatherManager->LastHrBeamSolarRad = Wthr.BeamSolarRad(HrUsedtoInterp); - state.dataWeatherManager->LastHrDifSolarRad = Wthr.DifSolarRad(HrUsedtoInterp); - state.dataWeatherManager->LastHrAlbedo = Wthr.Albedo(HrUsedtoInterp); - state.dataWeatherManager->LastHrLiquidPrecip = Wthr.LiquidPrecip(HrUsedtoInterp); - state.dataWeatherManager->LastHrTotalSkyCover = Wthr.TotalSkyCover(HrUsedtoInterp); - state.dataWeatherManager->LastHrOpaqueSkyCover = Wthr.OpaqueSkyCover(HrUsedtoInterp); - - state.dataWeatherManager->LastHourSet = true; + int HrUsedtoInterp = thisEnviron.firstHrInterpUseHr1 ? 1 : 24; + state.dataWeather->wvarsLastHr = wvarsHr(HrUsedtoInterp); + state.dataWeather->LastHourSet = true; } - for (int hour = 1; hour <= 24; ++hour) { + for (int hour = 1; hour <= Constant::HoursInDay; ++hour) { - int NxtHour = hour + 1; - if (hour == 24) { - NxtHour = 1; - } - state.dataWeatherManager->NextHrBeamSolarRad = Wthr.BeamSolarRad(NxtHour); - state.dataWeatherManager->NextHrDifSolarRad = Wthr.DifSolarRad(NxtHour); - state.dataWeatherManager->NextHrLiquidPrecip = Wthr.LiquidPrecip(NxtHour); + int NextHr = (hour == Constant::HoursInDay) ? 1 : hour + 1; + + state.dataWeather->wvarsNextHr.BeamSolarRad = wvarsHr(NextHr).BeamSolarRad; + state.dataWeather->wvarsNextHr.DifSolarRad = wvarsHr(NextHr).DifSolarRad; + state.dataWeather->wvarsNextHr.LiquidPrecip = wvarsHr(NextHr).LiquidPrecip; for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - Real64 WtNow = state.dataWeatherManager->Interpolation(ts); - Real64 WtPrevHour = 1.0 - WtNow; + Real64 wgtCurrHr = state.dataWeather->Interpolation(ts); + Real64 wgtPrevHr = 1.0 - wgtCurrHr; // Do Solar "weighting" - Real64 WgtHourNow = state.dataWeatherManager->SolarInterpolation(ts); - Real64 WgtPrevHour; - Real64 WgtNextHour; + Real64 wgtCurrHrSolar = state.dataWeather->SolarInterpolation(ts); + Real64 wgtPrevHrSolar; + Real64 wgtNextHrSolar; if (state.dataGlobal->NumOfTimeStepInHour == 1) { - WgtNextHour = 1.0 - WgtHourNow; - WgtPrevHour = 0.0; - } else { - if (WgtHourNow == 1.0) { - // It's at the half hour - WgtNextHour = 0.0; - WgtPrevHour = 0.0; - } else if (ts * state.dataWeatherManager->TimeStepFraction < 0.5) { - WgtNextHour = 0.0; - WgtPrevHour = 1.0 - WgtHourNow; - } else { // After the half hour - WgtPrevHour = 0.0; - WgtNextHour = 1.0 - WgtHourNow; - } + wgtNextHrSolar = 1.0 - wgtCurrHr; + wgtPrevHrSolar = 0.0; + } else if (wgtCurrHrSolar == 1.0) { + // It's at the half hour + wgtPrevHrSolar = 0.0; + wgtNextHrSolar = 0.0; + } else if (ts * state.dataWeather->TimeStepFraction < 0.5) { + wgtPrevHrSolar = 1.0 - wgtCurrHrSolar; + wgtNextHrSolar = 0.0; + } else { // After the half hour + wgtPrevHrSolar = 0.0; + wgtNextHrSolar = 1.0 - wgtCurrHrSolar; } - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour) = - state.dataWeatherManager->LastHrOutDryBulbTemp * WtPrevHour + Wthr.OutDryBulbTemp(hour) * WtNow; - state.dataWeatherManager->TomorrowOutBaroPress(ts, hour) = - state.dataWeatherManager->LastHrOutBaroPress * WtPrevHour + Wthr.OutBaroPress(hour) * WtNow; - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour) = - state.dataWeatherManager->LastHrOutDewPointTemp * WtPrevHour + Wthr.OutDewPointTemp(hour) * WtNow; - state.dataWeatherManager->TomorrowOutRelHum(ts, hour) = - state.dataWeatherManager->LastHrOutRelHum * WtPrevHour + Wthr.OutRelHum(hour) * WtNow; - state.dataWeatherManager->TomorrowWindSpeed(ts, hour) = - state.dataWeatherManager->LastHrWindSpeed * WtPrevHour + Wthr.WindSpeed(hour) * WtNow; - state.dataWeatherManager->TomorrowWindDir(ts, hour) = - interpolateWindDirection(state.dataWeatherManager->LastHrWindDir, Wthr.WindDir(hour), WtNow); - state.dataWeatherManager->TomorrowTotalSkyCover(ts, hour) = - state.dataWeatherManager->LastHrTotalSkyCover * WtPrevHour + Wthr.TotalSkyCover(hour) * WtNow; - state.dataWeatherManager->TomorrowOpaqueSkyCover(ts, hour) = - state.dataWeatherManager->LastHrOpaqueSkyCover * WtPrevHour + Wthr.OpaqueSkyCover(hour) * WtNow; + auto &tomorrowTs = state.dataWeather->wvarsHrTsTomorrow(ts, hour); + auto const &wvarsH = wvarsHr(hour); + tomorrowTs.OutDryBulbTemp = state.dataWeather->wvarsLastHr.OutDryBulbTemp * wgtPrevHr + wvarsH.OutDryBulbTemp * wgtCurrHr; + tomorrowTs.OutBaroPress = state.dataWeather->wvarsLastHr.OutBaroPress * wgtPrevHr + wvarsH.OutBaroPress * wgtCurrHr; + tomorrowTs.OutDewPointTemp = state.dataWeather->wvarsLastHr.OutDewPointTemp * wgtPrevHr + wvarsH.OutDewPointTemp * wgtCurrHr; + tomorrowTs.OutRelHum = state.dataWeather->wvarsLastHr.OutRelHum * wgtPrevHr + wvarsH.OutRelHum * wgtCurrHr; + tomorrowTs.WindSpeed = state.dataWeather->wvarsLastHr.WindSpeed * wgtPrevHr + wvarsH.WindSpeed * wgtCurrHr; + tomorrowTs.WindDir = interpolateWindDirection(state.dataWeather->wvarsLastHr.WindDir, wvarsH.WindDir, wgtCurrHr); + tomorrowTs.TotalSkyCover = state.dataWeather->wvarsLastHr.TotalSkyCover * wgtPrevHr + wvarsH.TotalSkyCover * wgtCurrHr; + tomorrowTs.OpaqueSkyCover = state.dataWeather->wvarsLastHr.OpaqueSkyCover * wgtPrevHr + wvarsH.OpaqueSkyCover * wgtCurrHr; // Sky emissivity now takes interpolated timestep inputs rather than interpolated calculation esky results calcSky(state, - state.dataWeatherManager->TomorrowHorizIRSky(ts, hour), - state.dataWeatherManager->TomorrowSkyTemp(ts, hour), - state.dataWeatherManager->TomorrowOpaqueSkyCover(ts, hour), - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour), - state.dataWeatherManager->TomorrowOutRelHum(ts, hour) * 0.01, - state.dataWeatherManager->LastHrHorizIRSky * WtPrevHour + Wthr.HorizIRSky(hour) * WtNow); - - state.dataWeatherManager->TomorrowDifSolarRad(ts, hour) = state.dataWeatherManager->LastHrDifSolarRad * WgtPrevHour + - Wthr.DifSolarRad(hour) * WgtHourNow + - state.dataWeatherManager->NextHrDifSolarRad * WgtNextHour; - state.dataWeatherManager->TomorrowBeamSolarRad(ts, hour) = state.dataWeatherManager->LastHrBeamSolarRad * WgtPrevHour + - Wthr.BeamSolarRad(hour) * WgtHourNow + - state.dataWeatherManager->NextHrBeamSolarRad * WgtNextHour; - - state.dataWeatherManager->TomorrowLiquidPrecip(ts, hour) = - state.dataWeatherManager->LastHrLiquidPrecip * WtPrevHour + Wthr.LiquidPrecip(hour) * WtNow; - state.dataWeatherManager->TomorrowLiquidPrecip(ts, hour) /= double(state.dataGlobal->NumOfTimeStepInHour); - state.dataWeatherManager->TomorrowIsRain(ts, hour) = - state.dataWeatherManager->TomorrowLiquidPrecip(ts, hour) >= state.dataWeatherManager->IsRainThreshold; // Wthr%IsRain(Hour) - state.dataWeatherManager->TomorrowIsSnow(ts, hour) = Wthr.IsSnow(hour); + tomorrowTs.HorizIRSky, + tomorrowTs.SkyTemp, + tomorrowTs.OpaqueSkyCover, + tomorrowTs.OutDryBulbTemp, + tomorrowTs.OutDewPointTemp, + tomorrowTs.OutRelHum * 0.01, + state.dataWeather->wvarsLastHr.HorizIRSky * wgtPrevHr + wvarsH.HorizIRSky * wgtCurrHr); + + tomorrowTs.DifSolarRad = state.dataWeather->wvarsLastHr.DifSolarRad * wgtPrevHrSolar + wvarsH.DifSolarRad * wgtCurrHrSolar + + state.dataWeather->wvarsNextHr.DifSolarRad * wgtNextHrSolar; + tomorrowTs.BeamSolarRad = state.dataWeather->wvarsLastHr.BeamSolarRad * wgtPrevHrSolar + wvarsH.BeamSolarRad * wgtCurrHrSolar + + state.dataWeather->wvarsNextHr.BeamSolarRad * wgtNextHrSolar; + + tomorrowTs.LiquidPrecip = state.dataWeather->wvarsLastHr.LiquidPrecip * wgtPrevHr + wvarsH.LiquidPrecip * wgtCurrHr; + tomorrowTs.LiquidPrecip /= double(state.dataGlobal->NumOfTimeStepInHour); + tomorrowTs.IsRain = tomorrowTs.LiquidPrecip >= state.dataWeather->IsRainThreshold; // Wthr%IsRain + tomorrowTs.IsSnow = wvarsH.IsSnow; } // End of TS Loop - state.dataWeatherManager->LastHrOutDryBulbTemp = Wthr.OutDryBulbTemp(hour); - state.dataWeatherManager->LastHrOutDewPointTemp = Wthr.OutDewPointTemp(hour); - state.dataWeatherManager->LastHrOutBaroPress = Wthr.OutBaroPress(hour); - state.dataWeatherManager->LastHrOutRelHum = Wthr.OutRelHum(hour); - state.dataWeatherManager->LastHrWindSpeed = Wthr.WindSpeed(hour); - state.dataWeatherManager->LastHrWindDir = Wthr.WindDir(hour); - state.dataWeatherManager->LastHrHorizIRSky = Wthr.HorizIRSky(hour); - state.dataWeatherManager->LastHrSkyTemp = Wthr.SkyTemp(hour); - state.dataWeatherManager->LastHrBeamSolarRad = Wthr.BeamSolarRad(hour); - state.dataWeatherManager->LastHrDifSolarRad = Wthr.DifSolarRad(hour); - state.dataWeatherManager->LastHrAlbedo = Wthr.Albedo(hour); - state.dataWeatherManager->LastHrLiquidPrecip = Wthr.LiquidPrecip(hour); - state.dataWeatherManager->LastHrTotalSkyCover = Wthr.TotalSkyCover(hour); - state.dataWeatherManager->LastHrOpaqueSkyCover = Wthr.OpaqueSkyCover(hour); + state.dataWeather->wvarsLastHr = wvarsHr(hour); } // End of Hour Loop } - if (state.dataWeatherManager->Environment(Environ).WP_Type1 != 0) { - switch (state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(Environ).WP_Type1).CalculationType) { - case SkyTempCalcType::ScheduleValue: - ScheduleManager::GetScheduleValuesForDay( - state, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(Environ).WP_Type1).SchedulePtr, - state.dataWeatherManager->TomorrowSkyTemp, - state.dataWeatherManager->TomorrowVariables.DayOfYear_Schedule, - state.dataWeatherManager->CurDayOfWeek); - break; - case SkyTempCalcType::DryBulbDelta: - ScheduleManager::GetScheduleValuesForDay( - state, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(Environ).WP_Type1).SchedulePtr, - state.dataWeatherManager->TomorrowSkyTemp, - state.dataWeatherManager->TomorrowVariables.DayOfYear_Schedule, - state.dataWeatherManager->CurDayOfWeek); - for (int hour = 1; hour <= 24; ++hour) { - for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - state.dataWeatherManager->TomorrowSkyTemp(ts, hour) = - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour) - state.dataWeatherManager->TomorrowSkyTemp(ts, hour); + if (thisEnviron.WP_Type1 != 0) { + switch (state.dataWeather->WPSkyTemperature(thisEnviron.WP_Type1).skyTempModel) { + case SkyTempModel::ScheduleValue: { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + + ScheduleManager::GetScheduleValuesForDay(state, + state.dataWeather->WPSkyTemperature(thisEnviron.WP_Type1).SchedulePtr, + tmp, + state.dataWeather->TomorrowVariables.DayOfYear_Schedule, + state.dataWeather->CurDayOfWeek); + + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) { + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) { + state.dataWeather->wvarsHrTsTomorrow(iTS, iHr).SkyTemp = tmp(iTS, iHr); } } - break; - case SkyTempCalcType::DewPointDelta: - ScheduleManager::GetScheduleValuesForDay( - state, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(Environ).WP_Type1).SchedulePtr, - state.dataWeatherManager->TomorrowSkyTemp, - state.dataWeatherManager->TomorrowVariables.DayOfYear_Schedule, - state.dataWeatherManager->CurDayOfWeek); - for (int hour = 1; hour <= 24; ++hour) { + } break; + case SkyTempModel::DryBulbDelta: { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetScheduleValuesForDay(state, + state.dataWeather->WPSkyTemperature(thisEnviron.WP_Type1).SchedulePtr, + tmp, + state.dataWeather->TomorrowVariables.DayOfYear_Schedule, + state.dataWeather->CurDayOfWeek); + + for (int hour = 1; hour <= Constant::HoursInDay; ++hour) { for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - state.dataWeatherManager->TomorrowSkyTemp(ts, hour) = - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour) - state.dataWeatherManager->TomorrowSkyTemp(ts, hour); + auto &tomorrowTs = state.dataWeather->wvarsHrTsTomorrow(ts, hour); + tomorrowTs.SkyTemp = tomorrowTs.OutDryBulbTemp - tmp(ts, hour); } } - break; + } break; + case SkyTempModel::DewPointDelta: { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetScheduleValuesForDay(state, + state.dataWeather->WPSkyTemperature(thisEnviron.WP_Type1).SchedulePtr, + tmp, + state.dataWeather->TomorrowVariables.DayOfYear_Schedule, + state.dataWeather->CurDayOfWeek); + ForAllHrTs(state, [&state, &tmp](int iHr, int iTS) { + auto &tomorrowTs = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + tomorrowTs.SkyTemp = tomorrowTs.OutDewPointTemp - tmp(iTS, iHr); + }); + } break; default: break; } @@ -3342,12 +3029,8 @@ namespace WeatherManager { return (fmod(interpAng, 360.)); // fmod is float modulus function } - Real64 CalcSkyEmissivity(EnergyPlusData &state, - SkyTempCalcType const ESkyCalcType, - Real64 const OSky, - Real64 const DryBulb, - Real64 const DewPoint, - Real64 const RelHum) + Real64 CalcSkyEmissivity( + EnergyPlusData &state, SkyTempModel const ESkyCalcType, Real64 const OSky, Real64 const DryBulb, Real64 const DewPoint, Real64 const RelHum) { // Calculate Sky Emissivity // References: @@ -3359,20 +3042,19 @@ namespace WeatherManager { Real64 ESky; - if (ESkyCalcType == SkyTempCalcType::BruntModel) { + if (ESkyCalcType == SkyTempModel::Brunt) { double const PartialPress = RelHum * Psychrometrics::PsyPsatFnTemp(state, DryBulb) * 0.01; ESky = 0.618 + 0.056 * pow(PartialPress, 0.5); - } else if (ESkyCalcType == SkyTempCalcType::IdsoModel) { + } else if (ESkyCalcType == SkyTempModel::Idso) { double const PartialPress = RelHum * Psychrometrics::PsyPsatFnTemp(state, DryBulb) * 0.01; - ESky = 0.685 + 0.000032 * PartialPress * exp(1699 / (DryBulb + Constant::KelvinConv)); - } else if (ESkyCalcType == SkyTempCalcType::BerdahlMartinModel) { + ESky = 0.685 + 0.000032 * PartialPress * exp(1699 / (DryBulb + Constant::Kelvin)); + } else if (ESkyCalcType == SkyTempModel::BerdahlMartin) { double const TDewC = min(DryBulb, DewPoint); ESky = 0.758 + 0.521 * (TDewC / 100) + 0.625 * pow_2(TDewC / 100); } else { - ESky = 0.787 + 0.764 * std::log((min(DryBulb, DewPoint) + Constant::KelvinConv) / Constant::KelvinConv); + ESky = 0.787 + 0.764 * std::log((min(DryBulb, DewPoint) + Constant::Kelvin) / Constant::Kelvin); } - ESky = ESky * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky)); - return ESky; + return ESky * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky)); } void SetDayOfWeekInitialValues(int const EnvironDayOfWeek, // Starting Day of Week for the (Weather) RunPeriod (User Input) @@ -3383,8 +3065,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN March 2012 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Set of begin day of week for an environment. Similar sets but slightly different @@ -3456,8 +3136,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN April 2001 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine interprets the EPW weather data line because comma delimited fields @@ -3493,10 +3171,10 @@ namespace WeatherManager { if (WMonth >= 1 && WMonth <= 12) { // Month number is valid if (WMonth != 2) { - if (WDay > state.dataWeatherManager->EndDayOfMonth(WMonth)) { + if (WDay > state.dataWeather->EndDayOfMonth(WMonth)) { DateInError = true; } - } else if (WDay > state.dataWeatherManager->EndDayOfMonth(WMonth) + 1) { // Whether actually used is determined by calling routine. + } else if (WDay > state.dataWeather->EndDayOfMonth(WMonth) + 1) { // Whether actually used is determined by calling routine. DateInError = true; } } else { @@ -3570,7 +3248,7 @@ namespace WeatherManager { // Content is not empty if (pos != 0) { bool error = false; - target = UtilityRoutines::ProcessNumber(current_line.substr(0, pos), error); + target = Util::ProcessNumber(current_line.substr(0, pos), error); if (error) { ErrorInterpretWeatherDataLine(state, WYear, WMonth, WDay, WHour, WMinute, Line, current_line); } @@ -3585,7 +3263,7 @@ namespace WeatherManager { target = 999.0; } else { bool error = false; - target = UtilityRoutines::ProcessNumber(current_line, error); + target = Util::ProcessNumber(current_line, error); if (error) { ErrorInterpretWeatherDataLine(state, WYear, WMonth, WDay, WHour, WMinute, Line, current_line); } @@ -3632,7 +3310,7 @@ namespace WeatherManager { value = std::atoi(c); // convert this short string into the appropriate int to read } } else { - ++state.dataWeatherManager->Missed.WeathCodes; + ++state.dataWeather->wvarsMissedCounts.WeathCodes; WCodesArr = 9; } } else { @@ -3656,17 +3334,17 @@ namespace WeatherManager { // weather day record information in the local module level derived type // called DesignDay. - constexpr Real64 GlobalSolarConstant(1367.0); - constexpr Real64 ZHGlobalSolarConstant(1355.0); - - Real64 constexpr ZhangHuangModCoeff_C0(0.5598); // 37.6865d0 - Real64 constexpr ZhangHuangModCoeff_C1(0.4982); // 13.9263d0 - Real64 constexpr ZhangHuangModCoeff_C2(-0.6762); // -20.2354d0 - Real64 constexpr ZhangHuangModCoeff_C3(0.02842); // 0.9695d0 - Real64 constexpr ZhangHuangModCoeff_C4(-0.00317); // -0.2046d0 - Real64 constexpr ZhangHuangModCoeff_C5(0.014); // -0.0980d0 - Real64 constexpr ZhangHuangModCoeff_D(-17.853); // -10.8568d0 - Real64 constexpr ZhangHuangModCoeff_K(0.843); // 49.3112d0 + constexpr Real64 GlobalSolarConstant = 1367.0; + constexpr Real64 ZHGlobalSolarConstant = 1355.0; + + Real64 constexpr ZhangHuang_C0 = 0.5598; // 37.6865d0 + Real64 constexpr ZhangHuang_C1 = 0.4982; // 13.9263d0 + Real64 constexpr ZhangHuang_C2 = -0.6762; // -20.2354d0 + Real64 constexpr ZhangHuang_C3 = 0.02842; // 0.9695d0 + Real64 constexpr ZhangHuang_C4 = -0.00317; // -0.2046d0 + Real64 constexpr ZhangHuang_C5 = 0.014; // -0.0980d0 + Real64 constexpr ZhangHuang_D = -17.853; // -10.8568d0 + Real64 constexpr ZhangHuang_K = 0.843; // 49.3112d0 static constexpr std::string_view RoutineNamePsyWFnTdbTwbPb("SetUpDesignDay:PsyWFnTdbTwbPb"); static constexpr std::string_view RoutineNamePsyWFnTdpPb("SetUpDesignDay:PsyWFnTdpPb"); static constexpr std::string_view RoutineNamePsyWFnTdbH("SetUpDesignDay:PsyWFnTdbH"); @@ -3679,18 +3357,15 @@ namespace WeatherManager { struct HourlyWeatherData { // Members - Array1D BeamSolarRad; // Hourly direct normal solar irradiance - Array1D DifSolarRad; // Hourly sky diffuse horizontal solar irradiance - - // Default Constructor - HourlyWeatherData() : BeamSolarRad(24, 0.0), DifSolarRad(24, 0.0) - { - } + Array1D BeamSolarRad = Array1D(Constant::HoursInDay, 0.0); // Hourly direct normal solar irradiance + Array1D DifSolarRad = Array1D(Constant::HoursInDay, 0.0); // Hourly sky diffuse horizontal solar irradiance }; // Object Data HourlyWeatherData Wthr; + auto &envCurr = state.dataWeather->Environment(EnvrnNum); + bool SaveWarmupFlag = state.dataGlobal->WarmupFlag; state.dataGlobal->WarmupFlag = true; @@ -3699,78 +3374,65 @@ namespace WeatherManager { int CurrentYear = Date0(1); if (state.dataGlobal->BeginSimFlag) { - state.dataWeatherManager->PrintDDHeader = true; + state.dataWeather->PrintDDHeader = true; } - state.dataWeatherManager->DesignDay(EnvrnNum).Year = CurrentYear; // f90 date_and_time implemented. full 4 digit year !+ 1900 - state.dataWeatherManager->DesignDay(EnvrnNum).Month = state.dataWeatherManager->DesDayInput(EnvrnNum).Month; - state.dataWeatherManager->DesignDay(EnvrnNum).DayOfMonth = state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth; - state.dataWeatherManager->DesignDay(EnvrnNum).DayOfYear = - General::OrdinalDay(state.dataWeatherManager->DesignDay(EnvrnNum).Month, state.dataWeatherManager->DesignDay(EnvrnNum).DayOfMonth, 0); + auto &designDay = state.dataWeather->DesignDay(EnvrnNum); + auto &desDayInput = state.dataWeather->DesDayInput(EnvrnNum); + designDay.Year = CurrentYear; // f90 date_and_time implemented. full 4 digit year !+ 1900 + designDay.Month = desDayInput.Month; + designDay.DayOfMonth = desDayInput.DayOfMonth; + designDay.DayOfYear = General::OrdinalDay(designDay.Month, designDay.DayOfMonth, 0); static constexpr std::string_view MnDyFmt("{:02}/{:02}"); - state.dataEnvrn->CurMnDy = - format(MnDyFmt, state.dataWeatherManager->DesDayInput(EnvrnNum).Month, state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth); + state.dataEnvrn->CurMnDy = format(MnDyFmt, desDayInput.Month, desDayInput.DayOfMonth); // EnvironmentName = DesDayInput( EnvrnNum ).Title; state.dataEnvrn->RunPeriodEnvironment = false; // Following builds Environment start/end for ASHRAE 55 warnings state.dataEnvrn->EnvironmentStartEnd = state.dataEnvrn->CurMnDy + " - " + state.dataEnvrn->CurMnDy; // Check that barometric pressure is within range - if (state.dataWeatherManager->DesDayInput(EnvrnNum).PressureEntered) { - if (std::abs((state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom - state.dataEnvrn->StdBaroPress) / - state.dataEnvrn->StdBaroPress) > 0.1) { // 10% off + if (desDayInput.PressureEntered) { + if (std::abs((desDayInput.PressBarom - state.dataEnvrn->StdBaroPress) / state.dataEnvrn->StdBaroPress) > 0.1) { // 10% off ShowWarningError(state, format("SetUpDesignDay: Entered DesignDay Barometric Pressure={:.0R} differs by more than 10% from Standard " "Barometric Pressure={:.0R}.", - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, + desDayInput.PressBarom, state.dataEnvrn->StdBaroPress)); ShowContinueError( state, format("...occurs in DesignDay={}, Standard Pressure (based on elevation) will be used.", state.dataEnvrn->EnvironmentName)); - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom = state.dataEnvrn->StdBaroPress; + desDayInput.PressBarom = state.dataEnvrn->StdBaroPress; } } else { - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom = state.dataEnvrn->StdBaroPress; + desDayInput.PressBarom = state.dataEnvrn->StdBaroPress; } // verify that design WB or DP <= design DB - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::DewPoint && - state.dataWeatherManager->DesDayInput(EnvrnNum).DewPointNeedsSet) { + if (desDayInput.HumIndType == DesDayHumIndType::DewPoint && desDayInput.DewPointNeedsSet) { // dew-point - Real64 testval = Psychrometrics::PsyWFnTdbRhPb( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb, 1.0, state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - Psychrometrics::PsyTdpFnWPb(state, testval, state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); + Real64 testval = Psychrometrics::PsyWFnTdbRhPb(state, desDayInput.MaxDryBulb, 1.0, desDayInput.PressBarom); + desDayInput.HumIndValue = Psychrometrics::PsyTdpFnWPb(state, testval, desDayInput.PressBarom); } // Day of week defaults to Monday, if day type specified, then that is used. - state.dataWeatherManager->DesignDay(EnvrnNum).DayOfWeek = 2; - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayType <= 7) - state.dataWeatherManager->DesignDay(EnvrnNum).DayOfWeek = state.dataWeatherManager->DesDayInput(EnvrnNum).DayType; + designDay.DayOfWeek = 2; + if (desDayInput.DayType <= 7) designDay.DayOfWeek = desDayInput.DayType; // set Holiday as indicated by user input - state.dataWeatherManager->DesignDay(EnvrnNum).HolidayIndex = 0; - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayType > 7) - state.dataWeatherManager->DesignDay(EnvrnNum).HolidayIndex = state.dataWeatherManager->DesDayInput(EnvrnNum).DayType; + designDay.HolidayIndex = 0; + if (desDayInput.DayType > 7) designDay.HolidayIndex = desDayInput.DayType; - state.dataWeatherManager->DesignDay(EnvrnNum).DaylightSavingIndex = state.dataWeatherManager->DesDayInput(EnvrnNum).DSTIndicator; + designDay.DaylightSavingIndex = desDayInput.DSTIndicator; // Set up Solar parameters for day Real64 A; // Apparent solar irradiation at air mass = 0 Real64 B; // Atmospheric extinction coefficient Real64 C; // ASHRAE diffuse radiation factor Real64 AVSC; // Annual variation in the solar constant - CalculateDailySolarCoeffs(state, - state.dataWeatherManager->DesignDay(EnvrnNum).DayOfYear, - A, - B, - C, - AVSC, - state.dataWeatherManager->DesignDay(EnvrnNum).EquationOfTime, - state.dataWeatherManager->DesignDay(EnvrnNum).SinSolarDeclinAngle, - state.dataWeatherManager->DesignDay(EnvrnNum).CosSolarDeclinAngle); - - if (state.dataWeatherManager->PrintDDHeader && state.dataReportFlag->DoWeatherInitReporting) { + CalculateDailySolarCoeffs( + state, designDay.DayOfYear, A, B, C, AVSC, designDay.EquationOfTime, designDay.SinSolarDeclinAngle, designDay.CosSolarDeclinAngle); + + if (state.dataWeather->PrintDDHeader && state.dataReportFlag->DoWeatherInitReporting) { static constexpr std::string_view EnvDDHdFormat( "! , Max Dry-Bulb Temp {C}, Temp Range {dC}, Temp Range Ind Type, " "Hum Ind Type, Hum Ind Value at Max Temp, Hum Ind Units, Pressure {Pa}, Wind Direction {deg CW from N}, Wind " @@ -3780,77 +3442,62 @@ namespace WeatherManager { "! ,DayOfYear,ASHRAE A Coeff,ASHRAE B Coeff,ASHRAE C Coeff,Solar " "Constant-Annual Variation,Eq of Time {minutes}, Solar Declination Angle {deg}, Solar Model"); print(state.files.eio, "{}\n", DDayMiscHdFormat); - state.dataWeatherManager->PrintDDHeader = false; + state.dataWeather->PrintDDHeader = false; } if (state.dataReportFlag->DoWeatherInitReporting) { - std::string const AlpUseRain = (state.dataWeatherManager->DesDayInput(EnvrnNum).RainInd == 1) ? "Yes" : "No"; - std::string const AlpUseSnow = (state.dataWeatherManager->DesDayInput(EnvrnNum).SnowInd == 1) ? "Yes" : "No"; + std::string_view const AlpUseRain = (desDayInput.RainInd == 1) ? "Yes" : "No"; + std::string_view const AlpUseSnow = (desDayInput.SnowInd == 1) ? "Yes" : "No"; print(state.files.eio, "Environment:Design Day Data,"); - print(state.files.eio, "{:.2R},", state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb); - print(state.files.eio, "{:.2R},", state.dataWeatherManager->DesDayInput(EnvrnNum).DailyDBRange); + print(state.files.eio, "{:.2R},", desDayInput.MaxDryBulb); + print(state.files.eio, "{:.2R},", desDayInput.DailyDBRange); - StringOut = ","; - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType == DDDBRangeType::Default) { - StringOut = "DefaultMultipliers,"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType == DDDBRangeType::Multiplier) { - StringOut = "MultiplierSchedule,"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType == DDDBRangeType::Profile) { - StringOut = "TemperatureProfile,"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType == DDDBRangeType::Difference) { - StringOut = "DifferenceSchedule,"; - } - print(state.files.eio, "{}", StringOut); + static constexpr std::array DesDayDryBulbRangeTypeStrings = { + "DefaultMultipliers,", "MultiplierSchedule,", "DifferenceSchedule,", "TemperatureProfile,"}; + + print(state.files.eio, "{}", DesDayDryBulbRangeTypeStrings[(int)desDayInput.dryBulbRangeType]); + + static constexpr std::array DesDayHumIndTypeStrings = { + "Wetbulb,{:.2R},{{C}},", + "Dewpoint,{:.2R},{{C}},", + "Enthalpy,{:.2R},{{J/kgDryAir}},", + "HumidityRatio,{:.4R},{{kgWater/kgDryAir}},", + "Schedule,,{{percent}},", + "WetBulbProfileDefaultMultipliers,{:.2R},{{C}},", + "WetBulbProfileDifferenceSchedule,{:.2R},{{C}},", + "WetBulbProfileMultiplierSchedule,{:.2R},{{C}},"}; // Hum Ind Type, Hum Ind Value at Max Temp, Hum Ind Units - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WetBulb) { - StringOut = format("Wetbulb,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::DewPoint) { - StringOut = format("Dewpoint,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::Enthalpy) { - StringOut = format("Enthalpy,{:.2R},{{J/kgDryAir}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::HumRatio) { - StringOut = format("HumidityRatio,{:.4R},{{kgWater/kgDryAir}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::RelHumSch) { - StringOut = "Schedule,,{percent},"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDef) { - StringOut = format("WetBulbProfileDefaultMultipliers,{:.2R},{{C}},", - state.dataWeatherManager->DesDayInput(state.dataWeatherManager->Envrn).HumIndValue); - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDif) { - StringOut = format("WetBulbProfileDifferenceSchedule,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfMul) { - StringOut = format("WetBulbProfileMultiplierSchedule,{:.2R},{{C}},", state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); - } - print(state.files.eio, "{}", StringOut); - print(state.files.eio, "{:.0R},", state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); - print(state.files.eio, "{:.0R},", state.dataWeatherManager->DesDayInput(EnvrnNum).WindDir); - print(state.files.eio, "{:.1R},", state.dataWeatherManager->DesDayInput(EnvrnNum).WindSpeed); - print(state.files.eio, "{:.2R},", state.dataWeatherManager->DesDayInput(EnvrnNum).SkyClear); + if (desDayInput.HumIndType == DesDayHumIndType::RelHumSch) { + print(state.files.eio, DesDayHumIndTypeStrings[(int)desDayInput.HumIndType]); + } else if (desDayInput.HumIndType == DesDayHumIndType::WBProfDef) { + print(state.files.eio, + DesDayHumIndTypeStrings[(int)desDayInput.HumIndType], + state.dataWeather->DesDayInput(state.dataWeather->Envrn).HumIndValue); + } else { + print(state.files.eio, DesDayHumIndTypeStrings[(int)desDayInput.HumIndType], desDayInput.HumIndValue); + } + + print(state.files.eio, "{:.0R},", desDayInput.PressBarom); + print(state.files.eio, "{:.0R},", desDayInput.WindDir); + print(state.files.eio, "{:.1R},", desDayInput.WindSpeed); + print(state.files.eio, "{:.2R},", desDayInput.SkyClear); print(state.files.eio, "{},{}\n", AlpUseRain, AlpUseSnow); static constexpr std::string_view DDayMiscFormat("Environment:Design Day Misc,{:3},"); - print(state.files.eio, DDayMiscFormat, state.dataWeatherManager->DesignDay(EnvrnNum).DayOfYear); + print(state.files.eio, DDayMiscFormat, designDay.DayOfYear); print(state.files.eio, "{:.1R},", A); print(state.files.eio, "{:.4R},", B); print(state.files.eio, "{:.4R},", C); print(state.files.eio, "{:.1R},", AVSC); - print(state.files.eio, "{:.2R},", state.dataWeatherManager->DesignDay(EnvrnNum).EquationOfTime * 60.0); - print(state.files.eio, "{:.1R},", std::asin(state.dataWeatherManager->DesignDay(EnvrnNum).SinSolarDeclinAngle) / Constant::DegToRadians); - - if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::ASHRAE_ClearSky) { - StringOut = "ASHRAEClearSky"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::Zhang_Huang) { - StringOut = "ZhangHuang"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::SolarModel_Schedule) { - StringOut = "User supplied beam/diffuse from schedules"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::ASHRAE_Tau) { - StringOut = "ASHRAETau"; - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::ASHRAE_Tau2017) { - StringOut = "ASHRAETau2017"; - } else { - StringOut = "unknown"; - } - print(state.files.eio, "{}\n", StringOut); + print(state.files.eio, "{:.2R},", designDay.EquationOfTime * 60.0); + print(state.files.eio, "{:.1R},", std::asin(designDay.SinSolarDeclinAngle) / Constant::DegToRadians); + + // Why have a different string for "Schedule" here than the one used for input? Really, why? + static constexpr std::array DesDaySolarModelStrings = { + "ASHRAEClearSky", "ZhangHuang", "User supplied beam/diffuse from schedules", "ASHRAETau", "ASHRAETau2017"}; + + print(state.files.eio, "{}\n", DesDaySolarModelStrings[(int)desDayInput.solarModel]); } // Must set up weather values for Design Day. User can specify the "humidity indicator" as @@ -3862,268 +3509,224 @@ namespace WeatherManager { Real64 HumidityRatio; // Humidity Ratio -- when constant for day bool ConstantHumidityRatio; - switch (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType) { - case DDHumIndType::WetBulb: - HumidityRatio = Psychrometrics::PsyWFnTdbTwbPb(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb, - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, - RoutineNamePsyWFnTdbTwbPb); + switch (desDayInput.HumIndType) { + case DesDayHumIndType::WetBulb: { + HumidityRatio = Psychrometrics::PsyWFnTdbTwbPb( + state, desDayInput.MaxDryBulb, desDayInput.HumIndValue, desDayInput.PressBarom, RoutineNamePsyWFnTdbTwbPb); ConstantHumidityRatio = true; - break; - case DDHumIndType::DewPoint: - HumidityRatio = Psychrometrics::PsyWFnTdpPb(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, - RoutineNamePsyWFnTdpPb); + } break; + case DesDayHumIndType::DewPoint: { + HumidityRatio = Psychrometrics::PsyWFnTdpPb(state, desDayInput.HumIndValue, desDayInput.PressBarom, RoutineNamePsyWFnTdpPb); ConstantHumidityRatio = true; - break; - case DDHumIndType::HumRatio: - HumidityRatio = state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue; + } break; + case DesDayHumIndType::HumRatio: { + HumidityRatio = desDayInput.HumIndValue; ConstantHumidityRatio = true; - break; - case DDHumIndType::Enthalpy: + } break; + case DesDayHumIndType::Enthalpy: { // HumIndValue is already in J/kg, so no conversions needed - HumidityRatio = Psychrometrics::PsyWFnTdbH(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb, - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, - RoutineNamePsyWFnTdbH); + HumidityRatio = Psychrometrics::PsyWFnTdbH(state, desDayInput.MaxDryBulb, desDayInput.HumIndValue, RoutineNamePsyWFnTdbH); ConstantHumidityRatio = true; - break; - case DDHumIndType::RelHumSch: + } break; + case DesDayHumIndType::RelHumSch: { // nothing to do -- DDHumIndModifier already contains the scheduled Relative Humidity ConstantHumidityRatio = false; - state.dataWeatherManager->TomorrowOutRelHum = state.dataWeatherManager->DDHumIndModifier(_, _, EnvrnNum); - break; - case DDHumIndType::WBProfDef: - case DDHumIndType::WBProfDif: - case DDHumIndType::WBProfMul: + ForAllHrTs(state, [&state, EnvrnNum](int iHr, int iTS) { + state.dataWeather->wvarsHrTsTomorrow(iTS, iHr).OutRelHum = state.dataWeather->desDayMods(EnvrnNum)(iTS, iHr).OutRelHum; + }); + } break; + case DesDayHumIndType::WBProfDef: + case DesDayHumIndType::WBProfDif: + case DesDayHumIndType::WBProfMul: { ConstantHumidityRatio = false; - break; - default: + } break; + default: { ShowSevereError(state, "SetUpDesignDay: Invalid Humidity Indicator type"); - ShowContinueError(state, format("Occurred in Design Day={}", state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - break; - } + ShowContinueError(state, format("Occurred in Design Day={}", desDayInput.Title)); + } break; + } // switch int OSky; // Opaque Sky Cover (tenths) - if (state.dataWeatherManager->DesDayInput(EnvrnNum).RainInd != 0) { - state.dataWeatherManager->TomorrowIsRain(_, _) = true; + if (desDayInput.RainInd != 0) { OSky = 10; - state.dataWeatherManager->TomorrowLiquidPrecip = 3.0; + ForAllHrTs(state, [&state](int iHr, int iTS) { + auto &ts = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + ts.IsRain = true; + ts.LiquidPrecip = 3.0; + }); } else { - state.dataWeatherManager->TomorrowIsRain(_, _) = false; OSky = 0; - state.dataWeatherManager->TomorrowLiquidPrecip = 0.0; + ForAllHrTs(state, [&state](int iHr, int iTS) { + auto &ts = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + ts.IsRain = false; + ts.LiquidPrecip = 0.0; + }); } Real64 GndReflet; // Ground Reflectivity - if (state.dataWeatherManager->DesDayInput(EnvrnNum).SnowInd == 0) { - state.dataWeatherManager->TomorrowIsSnow(_, _) = false; + if (desDayInput.SnowInd == 0) { GndReflet = 0.2; + ForAllHrTs(state, [&state](int iHr, int iTS) { + auto &ts = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + ts.IsSnow = false; + }); } else { // Snow - state.dataWeatherManager->TomorrowIsSnow(_, _) = true; GndReflet = 0.7; + ForAllHrTs(state, [&state](int iHr, int iTS) { + auto &ts = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + ts.IsSnow = true; + }); } // Some values are constant - state.dataWeatherManager->TomorrowOutBaroPress(_, _) = state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom; - state.dataWeatherManager->TomorrowWindSpeed(_, _) = state.dataWeatherManager->DesDayInput(EnvrnNum).WindSpeed; - state.dataWeatherManager->TomorrowWindDir(_, _) = state.dataWeatherManager->DesDayInput(EnvrnNum).WindDir; - state.dataWeatherManager->TomorrowAlbedo = 0.0; + ForAllHrTs(state, [&state, &desDayInput](int iHr, int iTS) { + auto &ts = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + ts.OutBaroPress = desDayInput.PressBarom; + ts.WindSpeed = desDayInput.WindSpeed; + ts.WindDir = desDayInput.WindDir; + ts.Albedo = 0.0; + }); // resolve daily ranges Real64 DBRange; // working copy of dry-bulb daily range, C (or 1 if input is difference) - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType == DDDBRangeType::Difference) { + if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Difference) { DBRange = 1.0; // use unscaled multiplier values if difference - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType == DDDBRangeType::Profile) { + } else if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Profile) { DBRange = 0.0; } else { - DBRange = state.dataWeatherManager->DesDayInput(EnvrnNum).DailyDBRange; + DBRange = desDayInput.DailyDBRange; } Real64 WBRange; // working copy of wet-bulb daily range. C (or 1 if input is difference) - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDif) { + if (desDayInput.HumIndType == DesDayHumIndType::WBProfDif) { WBRange = 1.0; // use unscaled multiplier values if difference } else { - WBRange = state.dataWeatherManager->DesDayInput(EnvrnNum).DailyWBRange; + WBRange = desDayInput.DailyWBRange; } - for (int hour = 1; hour <= 24; ++hour) { + auto const &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + for (int hour = 1; hour <= Constant::HoursInDay; ++hour) { for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType != DDDBRangeType::Profile) { + auto const &desDayModsTS = desDayModsEnvrn(ts, hour); + auto &tomorrowTs = state.dataWeather->wvarsHrTsTomorrow(ts, hour); + if (desDayInput.dryBulbRangeType != DesDayDryBulbRangeType::Profile) { // dry-bulb profile - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour) = - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb - - state.dataWeatherManager->DDDBRngModifier(ts, hour, EnvrnNum) * DBRange; - } else { // DesDayInput(EnvrnNum)%DBTempRangeType == DDDBRangeType::Profile - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour) = state.dataWeatherManager->DDDBRngModifier(ts, hour, EnvrnNum); + tomorrowTs.OutDryBulbTemp = desDayInput.MaxDryBulb - desDayModsTS.OutDryBulbTemp * DBRange; + } else { // DesDayInput(EnvrnNum)%DBTempRangeType == DesDayDryBulbRangeType::Profile + tomorrowTs.OutDryBulbTemp = desDayModsTS.OutDryBulbTemp; } // wet-bulb - generate from profile, humidity ratio, or dew point - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDef || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDif || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfMul) { - Real64 WetBulb = state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue - - state.dataWeatherManager->DDHumIndModifier(ts, hour, EnvrnNum) * WBRange; - WetBulb = min(WetBulb, state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour)); // WB must be <= DB - Real64 OutHumRat = Psychrometrics::PsyWFnTdbTwbPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - WetBulb, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour) = - Psychrometrics::PsyTdpFnWPb(state, OutHumRat, state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); - state.dataWeatherManager->TomorrowOutRelHum(ts, hour) = - Psychrometrics::PsyRhFnTdbWPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - OutHumRat, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, - WeatherManager) * - 100.0; + if (desDayInput.HumIndType == DesDayHumIndType::WBProfDef || desDayInput.HumIndType == DesDayHumIndType::WBProfDif || + desDayInput.HumIndType == DesDayHumIndType::WBProfMul) { + Real64 WetBulb = desDayInput.HumIndValue - desDayModsTS.OutRelHum * WBRange; + WetBulb = min(WetBulb, tomorrowTs.OutDryBulbTemp); // WB must be <= DB + Real64 OutHumRat = Psychrometrics::PsyWFnTdbTwbPb(state, tomorrowTs.OutDryBulbTemp, WetBulb, desDayInput.PressBarom); + tomorrowTs.OutDewPointTemp = Psychrometrics::PsyTdpFnWPb(state, OutHumRat, desDayInput.PressBarom); + tomorrowTs.OutRelHum = + Psychrometrics::PsyRhFnTdbWPb(state, tomorrowTs.OutDryBulbTemp, OutHumRat, desDayInput.PressBarom, WeatherManager) * 100.0; } else if (ConstantHumidityRatio) { // Need Dew Point Temperature. Use Relative Humidity to get Humidity Ratio, unless Humidity Ratio is constant // BG 9-26-07 moved following inside this IF statment; when HumIndType is 'Schedule' HumidityRatio wasn't being initialized - Real64 WetBulb = Psychrometrics::PsyTwbFnTdbWPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - HumidityRatio, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, - RoutineNameLong); - - Real64 OutHumRat = Psychrometrics::PsyWFnTdpPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); + Real64 WetBulb = + Psychrometrics::PsyTwbFnTdbWPb(state, tomorrowTs.OutDryBulbTemp, HumidityRatio, desDayInput.PressBarom, RoutineNameLong); + + Real64 OutHumRat = Psychrometrics::PsyWFnTdpPb(state, tomorrowTs.OutDryBulbTemp, desDayInput.PressBarom); if (HumidityRatio > OutHumRat) { - WetBulb = state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour); + WetBulb = tomorrowTs.OutDryBulbTemp; } else { - OutHumRat = Psychrometrics::PsyWFnTdbTwbPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - WetBulb, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); + OutHumRat = Psychrometrics::PsyWFnTdbTwbPb(state, tomorrowTs.OutDryBulbTemp, WetBulb, desDayInput.PressBarom); } - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour) = - Psychrometrics::PsyTdpFnWPb(state, OutHumRat, state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); - state.dataWeatherManager->TomorrowOutRelHum(ts, hour) = - Psychrometrics::PsyRhFnTdbWPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - OutHumRat, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, - WeatherManager) * - 100.0; + tomorrowTs.OutDewPointTemp = Psychrometrics::PsyTdpFnWPb(state, OutHumRat, desDayInput.PressBarom); + tomorrowTs.OutRelHum = + Psychrometrics::PsyRhFnTdbWPb(state, tomorrowTs.OutDryBulbTemp, OutHumRat, desDayInput.PressBarom, WeatherManager) * 100.0; } else { - HumidityRatio = Psychrometrics::PsyWFnTdbRhPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - state.dataWeatherManager->DDHumIndModifier(ts, hour, EnvrnNum) / 100.0, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); - state.dataWeatherManager->TomorrowOutRelHum(ts, hour) = - Psychrometrics::PsyRhFnTdbWPb(state, - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour), - HumidityRatio, - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom, - WeatherManager) * + HumidityRatio = + Psychrometrics::PsyWFnTdbRhPb(state, tomorrowTs.OutDryBulbTemp, desDayModsTS.OutRelHum / 100.0, desDayInput.PressBarom); + tomorrowTs.OutRelHum = + Psychrometrics::PsyRhFnTdbWPb(state, tomorrowTs.OutDryBulbTemp, HumidityRatio, desDayInput.PressBarom, WeatherManager) * 100.0; // TomorrowOutRelHum values set earlier - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour) = - Psychrometrics::PsyTdpFnWPb(state, HumidityRatio, state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom); - } - - double DryBulb = state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour); - double RelHum = state.dataWeatherManager->TomorrowOutRelHum(ts, hour) * 0.01; - Real64 ESky = CalcSkyEmissivity(state, - state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel, - OSky, - DryBulb, - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour), - RelHum); // Emissivitity of Sky - state.dataWeatherManager->TomorrowHorizIRSky(ts, hour) = - ESky * state.dataWeatherManager->Sigma * pow_4(DryBulb + Constant::KelvinConv); - - if (state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == SkyTempCalcType::BruntModel || - state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == SkyTempCalcType::IdsoModel || - state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == SkyTempCalcType::BerdahlMartinModel || - state.dataWeatherManager->Environment(EnvrnNum).SkyTempModel == SkyTempCalcType::ClarkAllenModel) { + tomorrowTs.OutDewPointTemp = Psychrometrics::PsyTdpFnWPb(state, HumidityRatio, desDayInput.PressBarom); + } + + double DryBulb = tomorrowTs.OutDryBulbTemp; + double RelHum = tomorrowTs.OutRelHum * 0.01; + Real64 ESky = + CalcSkyEmissivity(state, envCurr.skyTempModel, OSky, DryBulb, tomorrowTs.OutDewPointTemp, RelHum); // Emissivitity of Sky + tomorrowTs.HorizIRSky = ESky * Constant::StefanBoltzmann * pow_4(DryBulb + Constant::Kelvin); + + if (envCurr.skyTempModel == SkyTempModel::Brunt || envCurr.skyTempModel == SkyTempModel::Idso || + envCurr.skyTempModel == SkyTempModel::BerdahlMartin || envCurr.skyTempModel == SkyTempModel::ClarkAllen) { // Design day not scheduled - state.dataWeatherManager->TomorrowSkyTemp(ts, hour) = (DryBulb + Constant::KelvinConv) * root_4(ESky) - Constant::KelvinConv; + tomorrowTs.SkyTemp = (DryBulb + Constant::Kelvin) * root_4(ESky) - Constant::Kelvin; } // Generate solar values for timestep // working results = BeamRad and DiffRad // stored to program globals at end of loop Real64 BeamRad; Real64 DiffRad; - if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::SolarModel_Schedule) { + if (desDayInput.solarModel == DesDaySolarModel::SolarModel_Schedule) { // scheduled: set value unconditionally (whether sun up or not) - BeamRad = state.dataWeatherManager->DDBeamSolarValues(ts, hour, EnvrnNum); - DiffRad = state.dataWeatherManager->DDDiffuseSolarValues(ts, hour, EnvrnNum); + BeamRad = desDayModsTS.BeamSolarRad; + DiffRad = desDayModsTS.DifSolarRad; } else { // calc time = fractional hour of day Real64 CurTime; if (state.dataGlobal->NumOfTimeStepInHour != 1) { - CurTime = double(hour - 1) + double(ts) * state.dataWeatherManager->TimeStepFraction; + CurTime = double(hour - 1) + double(ts) * state.dataWeather->TimeStepFraction; } else { CurTime = double(hour) + state.dataEnvrn->TS1TimeOffset; } - Array1D SUNCOS(3); // Sun direction cosines - CalculateSunDirectionCosines(state, - CurTime, - state.dataWeatherManager->DesignDay(EnvrnNum).EquationOfTime, - state.dataWeatherManager->DesignDay(EnvrnNum).SinSolarDeclinAngle, - state.dataWeatherManager->DesignDay(EnvrnNum).CosSolarDeclinAngle, - SUNCOS); - Real64 CosZenith = SUNCOS(3); // Cosine of Zenith Angle of Sun + Vector3 SUNCOS; // Sun direction cosines + CalculateSunDirectionCosines( + state, CurTime, designDay.EquationOfTime, designDay.SinSolarDeclinAngle, designDay.CosSolarDeclinAngle, SUNCOS); + Real64 CosZenith = SUNCOS.z; // Cosine of Zenith Angle of Sun if (CosZenith < DataEnvironment::SunIsUpValue) { BeamRad = 0.0; DiffRad = 0.0; } else { - Real64 SinSolarAltitude = SUNCOS(3); + Real64 SinSolarAltitude = SUNCOS.z; - switch (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel) { - case DesignDaySolarModel::ASHRAE_ClearSky: { + switch (desDayInput.solarModel) { + case DesDaySolarModel::ASHRAE_ClearSky: { Real64 Exponent = B / CosZenith; Real64 TotHoriz; // Total Radiation on Horizontal Surface if (Exponent > 700.0) { TotHoriz = 0.0; } else { - TotHoriz = state.dataWeatherManager->DesDayInput(EnvrnNum).SkyClear * A * (C + CosZenith) * std::exp(-B / CosZenith); + TotHoriz = desDayInput.SkyClear * A * (C + CosZenith) * std::exp(-B / CosZenith); } // Radiation on an extraterrestial horizontal surface Real64 HO = GlobalSolarConstant * AVSC * CosZenith; Real64 KT = TotHoriz / HO; // Radiation ratio KT = min(KT, 0.75); DiffRad = TotHoriz * (1.0045 + KT * (0.04349 + KT * (-3.5227 + 2.6313 * KT))); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).SkyClear > 0.70) DiffRad = TotHoriz * C / (C + CosZenith); + if (desDayInput.SkyClear > 0.70) DiffRad = TotHoriz * C / (C + CosZenith); BeamRad = (TotHoriz - DiffRad) / CosZenith; DiffRad = max(0.0, DiffRad); BeamRad = max(0.0, BeamRad); } break; - case DesignDaySolarModel::ASHRAE_Tau: - case DesignDaySolarModel::ASHRAE_Tau2017: { + case DesDaySolarModel::ASHRAE_Tau: + case DesDaySolarModel::ASHRAE_Tau2017: { Real64 ETR = GlobalSolarConstant * AVSC; // radiation of an extraterrestrial normal surface, W/m2 Real64 GloHorzRad; - ASHRAETauModel(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel, - ETR, - CosZenith, - state.dataWeatherManager->DesDayInput(EnvrnNum).TauB, - state.dataWeatherManager->DesDayInput(EnvrnNum).TauD, - BeamRad, - DiffRad, - GloHorzRad); + ASHRAETauModel( + state, desDayInput.solarModel, ETR, CosZenith, desDayInput.TauB, desDayInput.TauD, BeamRad, DiffRad, GloHorzRad); } break; - case DesignDaySolarModel::Zhang_Huang: { + case DesDaySolarModel::Zhang_Huang: { int Hour3Ago = mod(hour + 20, 24) + 1; // hour 3 hours before - Real64 const TotSkyCover = max(1.0 - state.dataWeatherManager->DesDayInput(EnvrnNum).SkyClear, 0.0); - Real64 GloHorzRad = - (ZHGlobalSolarConstant * SinSolarAltitude * - (ZhangHuangModCoeff_C0 + ZhangHuangModCoeff_C1 * TotSkyCover + ZhangHuangModCoeff_C2 * pow_2(TotSkyCover) + - ZhangHuangModCoeff_C3 * (state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour) - - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, Hour3Ago)) + - ZhangHuangModCoeff_C4 * state.dataWeatherManager->TomorrowOutRelHum(ts, hour) + - ZhangHuangModCoeff_C5 * state.dataWeatherManager->TomorrowWindSpeed(ts, hour)) + - ZhangHuangModCoeff_D) / - ZhangHuangModCoeff_K; + Real64 const TotSkyCover = max(1.0 - desDayInput.SkyClear, 0.0); + Real64 GloHorzRad = (ZHGlobalSolarConstant * SinSolarAltitude * + (ZhangHuang_C0 + ZhangHuang_C1 * TotSkyCover + ZhangHuang_C2 * pow_2(TotSkyCover) + + ZhangHuang_C3 * (tomorrowTs.OutDryBulbTemp - + state.dataWeather->wvarsHrTsTomorrow(ts, Hour3Ago).OutDryBulbTemp) + + ZhangHuang_C4 * tomorrowTs.OutRelHum + ZhangHuang_C5 * tomorrowTs.WindSpeed) + + ZhangHuang_D) / + ZhangHuang_K; GloHorzRad = max(GloHorzRad, 0.0); Real64 ClearnessIndex_kt = GloHorzRad / (GlobalSolarConstant * SinSolarAltitude); // ClearnessIndex_kt=DesDayInput(EnvrnNum)%SkyClear @@ -4153,8 +3756,8 @@ namespace WeatherManager { if (state.dataEnvrn->IgnoreSolarRadiation || state.dataEnvrn->IgnoreBeamRadiation) BeamRad = 0.0; if (state.dataEnvrn->IgnoreSolarRadiation || state.dataEnvrn->IgnoreDiffuseRadiation) DiffRad = 0.0; - state.dataWeatherManager->TomorrowBeamSolarRad(ts, hour) = BeamRad; - state.dataWeatherManager->TomorrowDifSolarRad(ts, hour) = DiffRad; + tomorrowTs.BeamSolarRad = BeamRad; + tomorrowTs.DifSolarRad = DiffRad; } // Timestep (TS) Loop } // Hour Loop @@ -4162,62 +3765,58 @@ namespace WeatherManager { // back-fill hour values from timesteps // hour values = integrated over hour ending at time of hour // insurance: hourly values not known to be needed - for (int hour = 1; hour <= 24; ++hour) { - int Hour1Ago = mod(hour + 22, 24) + 1; - Real64 BeamRad = (state.dataWeatherManager->TomorrowBeamSolarRad(state.dataGlobal->NumOfTimeStepInHour, Hour1Ago) + - state.dataWeatherManager->TomorrowBeamSolarRad(state.dataGlobal->NumOfTimeStepInHour, hour)) / - 2.0; - Real64 DiffRad = (state.dataWeatherManager->TomorrowDifSolarRad(state.dataGlobal->NumOfTimeStepInHour, Hour1Ago) + - state.dataWeatherManager->TomorrowDifSolarRad(state.dataGlobal->NumOfTimeStepInHour, hour)) / - 2.0; + for (int hour = 1; hour <= Constant::HoursInDay; ++hour) { + int Hour1Ago = mod(hour + 22, Constant::HoursInDay) + 1; + auto const &tomorrowHr = state.dataWeather->wvarsHrTsTomorrow(state.dataGlobal->NumOfTimeStepInHour, hour); + auto const &tomorrowHr1Ago = state.dataWeather->wvarsHrTsTomorrow(state.dataGlobal->NumOfTimeStepInHour, Hour1Ago); + + Real64 BeamRad = (tomorrowHr1Ago.BeamSolarRad + tomorrowHr.BeamSolarRad) / 2.0; + Real64 DiffRad = (tomorrowHr1Ago.DifSolarRad + tomorrowHr.DifSolarRad) / 2.0; if (state.dataGlobal->NumOfTimeStepInHour > 1) { - BeamRad += sum(state.dataWeatherManager->TomorrowBeamSolarRad({1, state.dataGlobal->NumOfTimeStepInHour - 1}, hour)); - DiffRad += sum(state.dataWeatherManager->TomorrowDifSolarRad({1, state.dataGlobal->NumOfTimeStepInHour - 1}, hour)); + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour - 1; ++iTS) { + BeamRad += state.dataWeather->wvarsHrTsTomorrow(iTS, hour).BeamSolarRad; + DiffRad += state.dataWeather->wvarsHrTsTomorrow(iTS, hour).DifSolarRad; + } } Wthr.BeamSolarRad(hour) = BeamRad / state.dataGlobal->NumOfTimeStepInHour; Wthr.DifSolarRad(hour) = DiffRad / state.dataGlobal->NumOfTimeStepInHour; } - if (state.dataWeatherManager->Environment(EnvrnNum).WP_Type1 != 0) { + if (envCurr.WP_Type1 != 0) { - switch (state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(EnvrnNum).WP_Type1).CalculationType) { - case SkyTempCalcType::ScheduleValue: - ScheduleManager::GetSingleDayScheduleValues( - state, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(EnvrnNum).WP_Type1).SchedulePtr, - state.dataWeatherManager->TomorrowSkyTemp); - state.dataWeatherManager->DDSkyTempScheduleValues(_, _, EnvrnNum) = state.dataWeatherManager->TomorrowSkyTemp; - break; - case SkyTempCalcType::DryBulbDelta: - ScheduleManager::GetSingleDayScheduleValues( - state, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(EnvrnNum).WP_Type1).SchedulePtr, - state.dataWeatherManager->TomorrowSkyTemp); - state.dataWeatherManager->DDSkyTempScheduleValues(_, _, EnvrnNum) = state.dataWeatherManager->TomorrowSkyTemp; - for (int hour = 1; hour <= 24; ++hour) { - for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - state.dataWeatherManager->TomorrowSkyTemp(ts, hour) = - state.dataWeatherManager->TomorrowOutDryBulbTemp(ts, hour) - state.dataWeatherManager->TomorrowSkyTemp(ts, hour); - } - } - break; - case SkyTempCalcType::DewPointDelta: - ScheduleManager::GetSingleDayScheduleValues( - state, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(EnvrnNum).WP_Type1).SchedulePtr, - state.dataWeatherManager->TomorrowSkyTemp); - state.dataWeatherManager->DDSkyTempScheduleValues(_, _, EnvrnNum) = state.dataWeatherManager->TomorrowSkyTemp; - for (int hour = 1; hour <= 24; ++hour) { - for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - state.dataWeatherManager->TomorrowSkyTemp(ts, hour) = - state.dataWeatherManager->TomorrowOutDewPointTemp(ts, hour) - state.dataWeatherManager->TomorrowSkyTemp(ts, hour); - } - } - break; - default: - break; - } - } + switch (state.dataWeather->WPSkyTemperature(envCurr.WP_Type1).skyTempModel) { + case SkyTempModel::ScheduleValue: { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetSingleDayScheduleValues(state, state.dataWeather->WPSkyTemperature(envCurr.WP_Type1).SchedulePtr, tmp); + auto &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + ForAllHrTs(state, [&state, &tmp, &desDayModsEnvrn](int iHr, int iTS) { + state.dataWeather->wvarsHrTsTomorrow(iTS, iHr).SkyTemp = desDayModsEnvrn(iTS, iHr).SkyTemp = tmp(iTS, iHr); + }); + } break; + case SkyTempModel::DryBulbDelta: { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetSingleDayScheduleValues(state, state.dataWeather->WPSkyTemperature(envCurr.WP_Type1).SchedulePtr, tmp); + auto &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + ForAllHrTs(state, [&state, &tmp, &desDayModsEnvrn](int iHr, int iTS) { + auto &tomorrowTS = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + desDayModsEnvrn(iTS, iHr).SkyTemp = tmp(iTS, iHr); + tomorrowTS.SkyTemp = tomorrowTS.OutDryBulbTemp - tmp(iTS, iHr); + }); + } break; + case SkyTempModel::DewPointDelta: { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetSingleDayScheduleValues(state, state.dataWeather->WPSkyTemperature(envCurr.WP_Type1).SchedulePtr, tmp); + auto &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + ForAllHrTs(state, [&state, &tmp, &desDayModsEnvrn](int iHr, int iTS) { + auto &tomorrowTS = state.dataWeather->wvarsHrTsTomorrow(iTS, iHr); + desDayModsEnvrn(iTS, iHr).SkyTemp = tmp(iTS, iHr); + tomorrowTS.SkyTemp = tomorrowTS.OutDewPointTemp - tmp(iTS, iHr); + }); + } break; + default: { + } break; + } // switch (skyTempModel) + } // if (envCurr.WP_Type1 != 0) state.dataGlobal->WarmupFlag = SaveWarmupFlag; } @@ -4228,8 +3827,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR C Barnaby // DATE WRITTEN Nov 2010 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculate relative air mass using Kasten and Young approximation @@ -4261,22 +3858,20 @@ namespace WeatherManager { //------------------------------------------------------------------------------ void ASHRAETauModel([[maybe_unused]] EnergyPlusData &state, - DesignDaySolarModel const TauModelType, // ASHRAETau solar model type ASHRAE_Tau or ASHRAE_Tau2017 - Real64 const ETR, // extraterrestrial normal irradiance, W/m2 - Real64 const CosZen, // COS( solar zenith angle), 0 - 1 - Real64 const TauB, // beam tau factor - Real64 const TauD, // dif tau factor - Real64 &IDirN, // returned: direct (beam) irradiance on normal surface, W/m2 - Real64 &IDifH, // returned: diffuse irradiance on horiz surface, W/m2 - Real64 &IGlbH // returned: global irradiance on horiz surface, W/m2 + DesDaySolarModel const TauModel, // ASHRAETau solar model type ASHRAE_Tau or ASHRAE_Tau2017 + Real64 const ETR, // extraterrestrial normal irradiance, W/m2 + Real64 const CosZen, // COS( solar zenith angle), 0 - 1 + Real64 const TauB, // beam tau factor + Real64 const TauD, // dif tau factor + Real64 &IDirN, // returned: direct (beam) irradiance on normal surface, W/m2 + Real64 &IDifH, // returned: diffuse irradiance on horiz surface, W/m2 + Real64 &IGlbH // returned: global irradiance on horiz surface, W/m2 ) { // SUBROUTINE INFORMATION: // AUTHOR C Barnaby // DATE WRITTEN Nov 2010 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculate clear-sky direct and diffuse irradiance using ASHRAE "tau" model @@ -4297,7 +3892,7 @@ namespace WeatherManager { IDifH = 0.0; IGlbH = 0.0; } else { - if (TauModelType == DesignDaySolarModel::ASHRAE_Tau) { + if (TauModel == DesDaySolarModel::ASHRAE_Tau) { AB = 1.219 - 0.043 * TauB - 0.151 * TauD - 0.204 * TauB * TauD; AD = 0.202 + 0.852 * TauB - 0.007 * TauD - 0.357 * TauB * TauD; } else { @@ -4318,8 +3913,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN December 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine allocates the weather data structures (Today, Tomorrow, @@ -4327,71 +3920,8 @@ namespace WeatherManager { // Interpolation of data is done later after either setting up the design day (hourly // data) or reading in hourly weather data. - state.dataWeatherManager->TodayIsRain.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayIsRain = false; - state.dataWeatherManager->TodayIsSnow.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayIsSnow = false; - state.dataWeatherManager->TodayOutDryBulbTemp.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayOutDryBulbTemp = 0.0; - state.dataWeatherManager->TodayOutDewPointTemp.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayOutDewPointTemp = 0.0; - state.dataWeatherManager->TodayOutBaroPress.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayOutBaroPress = 0.0; - state.dataWeatherManager->TodayOutRelHum.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayOutRelHum = 0.0; - state.dataWeatherManager->TodayWindSpeed.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayWindSpeed = 0.0; - state.dataWeatherManager->TodayWindDir.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayWindDir = 0.0; - state.dataWeatherManager->TodaySkyTemp.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodaySkyTemp = 0.0; - state.dataWeatherManager->TodayHorizIRSky.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayHorizIRSky = 0.0; - state.dataWeatherManager->TodayBeamSolarRad.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayBeamSolarRad = 0.0; - state.dataWeatherManager->TodayDifSolarRad.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayDifSolarRad = 0.0; - state.dataWeatherManager->TodayAlbedo.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayAlbedo = 0.0; - state.dataWeatherManager->TodayLiquidPrecip.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayLiquidPrecip = 0.0; - state.dataWeatherManager->TodayTotalSkyCover.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayTotalSkyCover = 0.0; - state.dataWeatherManager->TodayOpaqueSkyCover.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TodayOpaqueSkyCover = 0.0; - - state.dataWeatherManager->TomorrowIsRain.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowIsRain = false; - state.dataWeatherManager->TomorrowIsSnow.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowIsSnow = false; - state.dataWeatherManager->TomorrowOutDryBulbTemp.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowOutDryBulbTemp = 0.0; - state.dataWeatherManager->TomorrowOutDewPointTemp.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowOutDewPointTemp = 0.0; - state.dataWeatherManager->TomorrowOutBaroPress.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowOutBaroPress = 0.0; - state.dataWeatherManager->TomorrowOutRelHum.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowOutRelHum = 0.0; - state.dataWeatherManager->TomorrowWindSpeed.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowWindSpeed = 0.0; - state.dataWeatherManager->TomorrowWindDir.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowWindDir = 0.0; - state.dataWeatherManager->TomorrowSkyTemp.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowSkyTemp = 0.0; - state.dataWeatherManager->TomorrowHorizIRSky.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowHorizIRSky = 0.0; - state.dataWeatherManager->TomorrowBeamSolarRad.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowBeamSolarRad = 0.0; - state.dataWeatherManager->TomorrowDifSolarRad.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowDifSolarRad = 0.0; - state.dataWeatherManager->TomorrowAlbedo.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowAlbedo = 0.0; - state.dataWeatherManager->TomorrowLiquidPrecip.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowLiquidPrecip = 0.0; - state.dataWeatherManager->TomorrowTotalSkyCover.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowTotalSkyCover = 0.0; - state.dataWeatherManager->TomorrowOpaqueSkyCover.allocate(state.dataGlobal->NumOfTimeStepInHour, 24); - state.dataWeatherManager->TomorrowOpaqueSkyCover = 0.0; + state.dataWeather->wvarsHrTsToday.allocate(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + state.dataWeather->wvarsHrTsTomorrow.allocate(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); } void CalculateDailySolarCoeffs(EnergyPlusData &state, @@ -4507,14 +4037,13 @@ namespace WeatherManager { Real64 const EqOfTime, // Equation of Time Real64 const SinSolDeclin, // Sine of Solar Declination Real64 const CosSolDeclin, // Cosine of Solar Declination - Array1D &SUNCOS) + Vector3 &SUNCOS) { // SUBROUTINE INFORMATION: // AUTHOR George Walton // DATE WRITTEN May 1975 // MODIFIED 1999 for EnergyPlus - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This routine computes the solar direction cosines for hourly @@ -4532,25 +4061,23 @@ namespace WeatherManager { // COMPUTE THE COSINE OF THE SOLAR ZENITH ANGLE. // This is also the Sine of the Solar Altitude Angle - SUNCOS(3) = SinSolDeclin * state.dataEnvrn->SinLatitude + CosSolDeclin * state.dataEnvrn->CosLatitude * COSH; + SUNCOS.z = SinSolDeclin * state.dataEnvrn->SinLatitude + CosSolDeclin * state.dataEnvrn->CosLatitude * COSH; - if (SUNCOS(3) >= DataEnvironment::SunIsUpValue) { // If Sun above horizon, compute other direction cosines - SUNCOS(2) = SinSolDeclin * state.dataEnvrn->CosLatitude - CosSolDeclin * state.dataEnvrn->SinLatitude * COSH; - SUNCOS(1) = CosSolDeclin * std::sin(H); + if (SUNCOS.z >= DataEnvironment::SunIsUpValue) { // If Sun above horizon, compute other direction cosines + SUNCOS.y = SinSolDeclin * state.dataEnvrn->CosLatitude - CosSolDeclin * state.dataEnvrn->SinLatitude * COSH; + SUNCOS.x = CosSolDeclin * std::sin(H); } else { // Sun is down, set to 0.0 - SUNCOS(1) = 0.0; - SUNCOS(2) = 0.0; + SUNCOS.x = 0.0; + SUNCOS.y = 0.0; } } - void DetermineSunUpDown(EnergyPlusData &state, Vector3 &SunDirectionCosines) + void DetermineSunUpDown(EnergyPlusData &state, Vector3 &SunCOS) { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN 1999 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine determines if the sun is up or down for the current @@ -4561,48 +4088,48 @@ namespace WeatherManager { // COMPUTE THE HOUR ANGLE if (state.dataGlobal->NumOfTimeStepInHour != 1) { - state.dataWeatherManager->HrAngle = - (15.0 * (12.0 - (state.dataGlobal->CurrentTime + state.dataWeatherManager->TodayVariables.EquationOfTime)) + - (state.dataEnvrn->TimeZoneMeridian - state.dataEnvrn->Longitude)); + state.dataWeather->HrAngle = (15.0 * (12.0 - (state.dataGlobal->CurrentTime + state.dataWeather->TodayVariables.EquationOfTime)) + + (state.dataEnvrn->TimeZoneMeridian - state.dataEnvrn->Longitude)); } else { - state.dataWeatherManager->HrAngle = (15.0 * (12.0 - ((state.dataGlobal->CurrentTime + state.dataEnvrn->TS1TimeOffset) + - state.dataWeatherManager->TodayVariables.EquationOfTime)) + - (state.dataEnvrn->TimeZoneMeridian - state.dataEnvrn->Longitude)); + state.dataWeather->HrAngle = + (15.0 * + (12.0 - ((state.dataGlobal->CurrentTime + state.dataEnvrn->TS1TimeOffset) + state.dataWeather->TodayVariables.EquationOfTime)) + + (state.dataEnvrn->TimeZoneMeridian - state.dataEnvrn->Longitude)); } - Real64 H = state.dataWeatherManager->HrAngle * Constant::DegToRadians; + Real64 H = state.dataWeather->HrAngle * Constant::DegToRadians; // Compute the Cosine of the Solar Zenith (Altitude) Angle. - Real64 CosZenith = state.dataEnvrn->SinLatitude * state.dataWeatherManager->TodayVariables.SinSolarDeclinAngle + - state.dataEnvrn->CosLatitude * state.dataWeatherManager->TodayVariables.CosSolarDeclinAngle * std::cos(H); + Real64 CosZenith = state.dataEnvrn->SinLatitude * state.dataWeather->TodayVariables.SinSolarDeclinAngle + + state.dataEnvrn->CosLatitude * state.dataWeather->TodayVariables.CosSolarDeclinAngle * std::cos(H); Real64 SolarZenith = std::acos(CosZenith); - Real64 SinAltitude = state.dataEnvrn->CosLatitude * state.dataWeatherManager->TodayVariables.CosSolarDeclinAngle * std::cos(H) + - state.dataEnvrn->SinLatitude * state.dataWeatherManager->TodayVariables.SinSolarDeclinAngle; + Real64 SinAltitude = state.dataEnvrn->CosLatitude * state.dataWeather->TodayVariables.CosSolarDeclinAngle * std::cos(H) + + state.dataEnvrn->SinLatitude * state.dataWeather->TodayVariables.SinSolarDeclinAngle; Real64 SolarAltitude = std::asin(SinAltitude); - Real64 CosAzimuth = -(state.dataEnvrn->SinLatitude * CosZenith - state.dataWeatherManager->TodayVariables.SinSolarDeclinAngle) / + Real64 CosAzimuth = -(state.dataEnvrn->SinLatitude * CosZenith - state.dataWeather->TodayVariables.SinSolarDeclinAngle) / (state.dataEnvrn->CosLatitude * std::sin(SolarZenith)); // Following because above can yield invalid cos value. (e.g. at south pole) CosAzimuth = max(CosAzimuth, -1.0); CosAzimuth = min(1.0, CosAzimuth); Real64 SolarAzimuth = std::acos(CosAzimuth); - state.dataWeatherManager->SolarAltitudeAngle = SolarAltitude / Constant::DegToRadians; - state.dataWeatherManager->SolarAzimuthAngle = SolarAzimuth / Constant::DegToRadians; - if (state.dataWeatherManager->HrAngle < 0.0) { - state.dataWeatherManager->SolarAzimuthAngle = 360.0 - state.dataWeatherManager->SolarAzimuthAngle; + state.dataWeather->SolarAltitudeAngle = SolarAltitude / Constant::DegToRadians; + state.dataWeather->SolarAzimuthAngle = SolarAzimuth / Constant::DegToRadians; + if (state.dataWeather->HrAngle < 0.0) { + state.dataWeather->SolarAzimuthAngle = 360.0 - state.dataWeather->SolarAzimuthAngle; } - SunDirectionCosines.z = CosZenith; + SunCOS.z = CosZenith; state.dataEnvrn->SunIsUpPrevTS = state.dataEnvrn->SunIsUp; if (CosZenith < DataEnvironment::SunIsUpValue) { state.dataEnvrn->SunIsUp = false; - SunDirectionCosines.y = 0.0; - SunDirectionCosines.x = 0.0; + SunCOS.y = 0.0; + SunCOS.x = 0.0; } else { state.dataEnvrn->SunIsUp = true; - SunDirectionCosines.y = state.dataWeatherManager->TodayVariables.SinSolarDeclinAngle * state.dataEnvrn->CosLatitude - - state.dataWeatherManager->TodayVariables.CosSolarDeclinAngle * state.dataEnvrn->SinLatitude * std::cos(H); - SunDirectionCosines.x = state.dataWeatherManager->TodayVariables.CosSolarDeclinAngle * std::sin(H); + SunCOS.y = state.dataWeather->TodayVariables.SinSolarDeclinAngle * state.dataEnvrn->CosLatitude - + state.dataWeather->TodayVariables.CosSolarDeclinAngle * state.dataEnvrn->SinLatitude * std::cos(H); + SunCOS.x = state.dataWeather->TodayVariables.CosSolarDeclinAngle * std::sin(H); } } @@ -4612,15 +4139,14 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN June 1999 - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine checks to see if a weather file and what kind of weather file // exists in the working directory and calls appropriate routines to // open the files and set up for use. - state.dataWeatherManager->WeatherFileExists = FileSystem::fileExists(state.files.inputWeatherFilePath.filePath); - if (state.dataWeatherManager->WeatherFileExists) { + state.dataWeather->WeatherFileExists = FileSystem::fileExists(state.files.inputWeatherFilePath.filePath); + if (state.dataWeather->WeatherFileExists) { OpenEPlusWeatherFile(state, ErrorsFound, true); } } @@ -4694,8 +4220,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN June 1997 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is currently the main interface between the old data @@ -4703,39 +4227,38 @@ namespace WeatherManager { // in this module. At some point, this subroutine will be converted // to read information directly from the new input file. - if (state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather && - state.dataWeatherManager->WeatherFileExists) { - if (state.dataWeatherManager->LocationGathered) { + if (state.dataWeather->Environment(state.dataWeather->NumOfEnvrn).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather && + state.dataWeather->WeatherFileExists) { + if (state.dataWeather->LocationGathered) { // See if "matching" location - if (std::abs(state.dataEnvrn->Latitude - state.dataWeatherManager->WeatherFileLatitude) > 1.0 || - std::abs(state.dataEnvrn->Longitude - state.dataWeatherManager->WeatherFileLongitude) > 1.0 || - std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeatherManager->WeatherFileTimeZone) > 0.0 || - std::abs(state.dataEnvrn->Elevation - state.dataWeatherManager->WeatherFileElevation) / max(state.dataEnvrn->Elevation, 1.0) > - 0.10) { + if (std::abs(state.dataEnvrn->Latitude - state.dataWeather->WeatherFileLatitude) > 1.0 || + std::abs(state.dataEnvrn->Longitude - state.dataWeather->WeatherFileLongitude) > 1.0 || + std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeather->WeatherFileTimeZone) > 0.0 || + std::abs(state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation) / max(state.dataEnvrn->Elevation, 1.0) > 0.10) { ShowWarningError(state, "Weather file location will be used rather than entered (IDF) Location object."); - ShowContinueError(state, format("..Location object={}", state.dataWeatherManager->LocationTitle)); + ShowContinueError(state, format("..Location object={}", state.dataWeather->LocationTitle)); ShowContinueError(state, format("..Weather File Location={}", state.dataEnvrn->WeatherFileLocationTitle)); ShowContinueError( state, format("..due to location differences, Latitude difference=[{:.2R}] degrees, Longitude difference=[{:.2R}] degrees.", - std::abs(state.dataEnvrn->Latitude - state.dataWeatherManager->WeatherFileLatitude), - std::abs(state.dataEnvrn->Longitude - state.dataWeatherManager->WeatherFileLongitude))); + std::abs(state.dataEnvrn->Latitude - state.dataWeather->WeatherFileLatitude), + std::abs(state.dataEnvrn->Longitude - state.dataWeather->WeatherFileLongitude))); ShowContinueError(state, format("..Time Zone difference=[{:.1R}] hour(s), Elevation difference=[{:.2R}] percent, [{:.2R}] meters.", - std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeatherManager->WeatherFileTimeZone), - std::abs((state.dataEnvrn->Elevation - state.dataWeatherManager->WeatherFileElevation) / + std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeather->WeatherFileTimeZone), + std::abs((state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation) / max(state.dataEnvrn->Elevation, 1.0) * 100.0), - std::abs(state.dataEnvrn->Elevation - state.dataWeatherManager->WeatherFileElevation))); + std::abs(state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation))); } } - state.dataWeatherManager->LocationTitle = state.dataEnvrn->WeatherFileLocationTitle; - state.dataEnvrn->Latitude = state.dataWeatherManager->WeatherFileLatitude; - state.dataEnvrn->Longitude = state.dataWeatherManager->WeatherFileLongitude; - state.dataEnvrn->TimeZoneNumber = state.dataWeatherManager->WeatherFileTimeZone; - state.dataEnvrn->Elevation = state.dataWeatherManager->WeatherFileElevation; - } else if (!state.dataWeatherManager->LocationGathered) { - state.dataWeatherManager->LocationTitle = "Not Entered"; + state.dataWeather->LocationTitle = state.dataEnvrn->WeatherFileLocationTitle; + state.dataEnvrn->Latitude = state.dataWeather->WeatherFileLatitude; + state.dataEnvrn->Longitude = state.dataWeather->WeatherFileLongitude; + state.dataEnvrn->TimeZoneNumber = state.dataWeather->WeatherFileTimeZone; + state.dataEnvrn->Elevation = state.dataWeather->WeatherFileElevation; + } else if (!state.dataWeather->LocationGathered) { + state.dataWeather->LocationTitle = "Not Entered"; ShowSevereError(state, "No Location given. Must have location information for simulation."); ErrorsFound = true; } @@ -4753,7 +4276,7 @@ namespace WeatherManager { static constexpr std::string_view LocFormat("Site:Location,{},{:.2R},{:.2R},{:.2R},{:.2R},{:.0R},{:.4R}\n"); print(state.files.eio, LocFormat, - state.dataWeatherManager->LocationTitle, + state.dataWeather->LocationTitle, state.dataEnvrn->Latitude, state.dataEnvrn->Longitude, state.dataEnvrn->TimeZoneNumber, @@ -4769,8 +4292,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN June 1997 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is checks to see whether the user specified location @@ -4858,7 +4379,6 @@ namespace WeatherManager { // AUTHOR Linda Lawrie // DATE WRITTEN February 1977 // MODIFIED June 1997 (RKS) - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine contains a portion of the legacy subroutine CKBLDE. @@ -4868,7 +4388,7 @@ namespace WeatherManager { // routine also sends the weather file header information at the // Environment derived type. - if (!state.dataWeatherManager->WeatherFileExists) { // No weather file exists but the user requested one--print error message + if (!state.dataWeather->WeatherFileExists) { // No weather file exists but the user requested one--print error message if (state.dataGlobal->DoWeathSim) { ShowSevereError(state, "GetNextEnvironment: Weather Environment(s) requested, but no weather file found"); @@ -4885,7 +4405,6 @@ namespace WeatherManager { // AUTHOR Rick Strand // DATE WRITTEN June 1997 // MODIFIED December 2017; Jason DeGraw - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine prints out the necessary header information required @@ -4908,14 +4427,14 @@ namespace WeatherManager { static constexpr std::string_view RunPeriodString(",1,Cumulative Days of Simulation[] ! When Run Period "); static constexpr std::string_view YearlyString(",1,Calendar Year of Simulation[] ! When Annual "); - AssignReportNumber(state, state.dataWeatherManager->EnvironmentReportNbr); - if (state.dataWeatherManager->EnvironmentReportNbr != 1) { // problem + AssignReportNumber(state, state.dataWeather->EnvironmentReportNbr); + if (state.dataWeather->EnvironmentReportNbr != 1) { // problem ShowFatalError(state, "ReportOutputFileHeaders: Assigned report number for Environment title is not 1. Contact Support."); } - state.dataWeatherManager->EnvironmentReportChr = fmt::to_string(state.dataWeatherManager->EnvironmentReportNbr); - strip(state.dataWeatherManager->EnvironmentReportChr); - print(state.files.eso, "{}{}\n", state.dataWeatherManager->EnvironmentReportChr, EnvironmentString); - print(state.files.mtr, "{}{}\n", state.dataWeatherManager->EnvironmentReportChr, EnvironmentString); + state.dataWeather->EnvironmentReportChr = fmt::to_string(state.dataWeather->EnvironmentReportNbr); + strip(state.dataWeather->EnvironmentReportChr); + print(state.files.eso, "{}{}\n", state.dataWeather->EnvironmentReportChr, EnvironmentString); + print(state.files.mtr, "{}{}\n", state.dataWeather->EnvironmentReportChr, EnvironmentString); AssignReportNumber(state, state.dataOutputProcessor->TimeStepStampReportNbr); state.dataOutputProcessor->TimeStepStampReportChr = fmt::to_string(state.dataOutputProcessor->TimeStepStampReportNbr); @@ -4954,8 +4473,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN June 1997 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is the main driver of the weather reporting. This @@ -4971,7 +4488,7 @@ namespace WeatherManager { // Report the time stamp and the current weather to the output file - if (!state.dataGlobal->WarmupFlag && !state.dataWeatherManager->RPReadAllWeatherData) { // Write the required output information + if (!state.dataGlobal->WarmupFlag && !state.dataWeather->RPReadAllWeatherData) { // Write the required output information // The first time through in a non-warmup day, the environment header // must be printed. This must be done here and not in the generic @@ -4992,12 +4509,12 @@ namespace WeatherManager { state.dataReportFlag->PrintEndDataDictionary = false; } if (state.dataGlobal->DoOutputReporting) { - std::string const &Title(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).Title); + std::string const &Title = state.dataWeather->Environment(state.dataWeather->Envrn).Title; static constexpr std::string_view EnvironmentStampFormatStr( "{},{},{:7.2F},{:7.2F},{:7.2F},{:7.2F}\n"); // Format descriptor for environ stamp print(state.files.eso, EnvironmentStampFormatStr, - state.dataWeatherManager->EnvironmentReportChr, + state.dataWeather->EnvironmentReportChr, Title, state.dataEnvrn->Latitude, state.dataEnvrn->Longitude, @@ -5005,7 +4522,7 @@ namespace WeatherManager { state.dataEnvrn->Elevation); print(state.files.mtr, EnvironmentStampFormatStr, - state.dataWeatherManager->EnvironmentReportChr, + state.dataWeather->EnvironmentReportChr, Title, state.dataEnvrn->Latitude, state.dataEnvrn->Longitude, @@ -5023,8 +4540,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Richard Liesen // DATE WRITTEN September 1997 - // MODIFIED - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is the main driver of the weather manager module. @@ -5038,37 +4553,36 @@ namespace WeatherManager { state.dataEnvrn->TotDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay"); int RPD1 = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays"); int RPD2 = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType"); - state.dataWeatherManager->TotRunPers = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "RunPeriod"); - state.dataWeatherManager->NumOfEnvrn = state.dataEnvrn->TotDesDays + state.dataWeatherManager->TotRunPers + RPD1 + RPD2; - state.dataGlobal->WeathSimReq = state.dataWeatherManager->TotRunPers > 0; - state.dataWeatherManager->TotReportPers = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "Output:Table:ReportPeriod"); - - state.dataWeatherManager->SPSiteScheduleNamePtr.allocate(state.dataEnvrn->TotDesDays * 5); - state.dataWeatherManager->SPSiteScheduleUnits.allocate(state.dataEnvrn->TotDesDays * 5); - - state.dataWeatherManager->SPSiteScheduleNamePtr = 0; - state.dataWeatherManager->SPSiteScheduleUnits = ""; - - // Allocate the Design Day and Environment array to the # of DD's or/and - // Annual runs on input file - state.dataWeatherManager->DesignDay.allocate(state.dataEnvrn->TotDesDays); - state.dataWeatherManager->Environment.allocate(state.dataWeatherManager->NumOfEnvrn); + state.dataWeather->TotRunPers = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "RunPeriod"); + state.dataWeather->NumOfEnvrn = state.dataEnvrn->TotDesDays + state.dataWeather->TotRunPers + RPD1 + RPD2; + state.dataGlobal->WeathSimReq = state.dataWeather->TotRunPers > 0; + state.dataWeather->TotReportPers = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "Output:Table:ReportPeriod"); +#ifdef GET_OUT + state.dataWeather->SPSiteScheduleNamePtr.allocate(state.dataEnvrn->TotDesDays * 5); + state.dataWeather->SPSiteScheduleUnits.allocate(state.dataEnvrn->TotDesDays * 5); + + state.dataWeather->SPSiteScheduleNamePtr = 0; + state.dataWeather->SPSiteScheduleUnits = ""; +#endif // + // Allocate the Design Day and Environment array to the # of DD's or/and + // Annual runs on input file + state.dataWeather->DesignDay.allocate(state.dataEnvrn->TotDesDays); + state.dataWeather->Environment.allocate(state.dataWeather->NumOfEnvrn); // Set all Environments to DesignDay and then the weather environment will be set // in the get annual run data subroutine for (int Env = 1; Env <= state.dataEnvrn->TotDesDays; ++Env) { - state.dataWeatherManager->Environment(Env).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state.dataWeather->Environment(Env).KindOfEnvrn = Constant::KindOfSim::DesignDay; } for (int Env = 1; Env <= RPD1 + RPD2; ++Env) { if (!state.dataSysVars->DDOnly) { - state.dataWeatherManager->Environment(state.dataEnvrn->TotDesDays + Env).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; + state.dataWeather->Environment(state.dataEnvrn->TotDesDays + Env).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; } else { - state.dataWeatherManager->Environment(state.dataEnvrn->TotDesDays + Env).KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; + state.dataWeather->Environment(state.dataEnvrn->TotDesDays + Env).KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; } } - for (int Env = 1; Env <= state.dataWeatherManager->TotRunPers; ++Env) { - state.dataWeatherManager->Environment(state.dataEnvrn->TotDesDays + RPD1 + RPD2 + Env).KindOfEnvrn = - Constant::KindOfSim::RunPeriodWeather; + for (int Env = 1; Env <= state.dataWeather->TotRunPers; ++Env) { + state.dataWeather->Environment(state.dataEnvrn->TotDesDays + RPD1 + RPD2 + Env).KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; } if (state.dataEnvrn->TotDesDays >= 1) { @@ -5082,25 +4596,25 @@ namespace WeatherManager { // the last environment(s) is designated the weather environment if an annual run // is selected. All of the design systems is done from the design day info // which will have to be completed to run the annual run. - if (state.dataWeatherManager->TotRunPers >= 1 || state.dataSysVars->FullAnnualRun) { - GetRunPeriodData(state, state.dataWeatherManager->TotRunPers, ErrorsFound); + if (state.dataWeather->TotRunPers >= 1 || state.dataSysVars->FullAnnualRun) { + GetRunPeriodData(state, state.dataWeather->TotRunPers, ErrorsFound); } - if (state.dataWeatherManager->TotReportPers > 0) { - GetReportPeriodData(state, state.dataWeatherManager->TotReportPers, ErrorsFound); - GroupReportPeriodByType(state, state.dataWeatherManager->TotReportPers); + if (state.dataWeather->TotReportPers > 0) { + GetReportPeriodData(state, state.dataWeather->TotReportPers, ErrorsFound); + GroupReportPeriodByType(state, state.dataWeather->TotReportPers); } if (state.dataSysVars->FullAnnualRun) { // GetRunPeriodData may have reset the value of TotRunPers - state.dataWeatherManager->NumOfEnvrn = state.dataEnvrn->TotDesDays + state.dataWeatherManager->TotRunPers + RPD1 + RPD2; + state.dataWeather->NumOfEnvrn = state.dataEnvrn->TotDesDays + state.dataWeather->TotRunPers + RPD1 + RPD2; } - if (RPD1 >= 1 || RPD2 >= 1 || state.dataWeatherManager->TotRunPers >= 1 || state.dataSysVars->FullAnnualRun) { + if (RPD1 >= 1 || RPD2 >= 1 || state.dataWeather->TotRunPers >= 1 || state.dataSysVars->FullAnnualRun) { GetSpecialDayPeriodData(state, ErrorsFound); GetDSTData(state, ErrorsFound); - if (state.dataWeatherManager->IDFDaylightSaving) { - state.dataWeatherManager->DST = state.dataWeatherManager->IDFDST; + if (state.dataWeather->IDFDaylightSaving) { + state.dataWeather->DST = state.dataWeather->IDFDST; } } @@ -5119,11 +4633,11 @@ namespace WeatherManager { SetupEnvironmentTypes(state); GetWeatherProperties(state, ErrorsFound); - +#ifdef GET_OUT // Deallocate ones used for schedule pointers - state.dataWeatherManager->SPSiteScheduleNamePtr.deallocate(); - state.dataWeatherManager->SPSiteScheduleUnits.deallocate(); - + state.dataWeather->SPSiteScheduleNamePtr.deallocate(); + state.dataWeather->SPSiteScheduleUnits.deallocate(); +#endif // if (ErrorsFound) { ShowFatalError(state, "GetWeatherInput: Above errors cause termination"); } @@ -5154,48 +4668,52 @@ namespace WeatherManager { } void GetReportPeriodData(EnergyPlusData &state, - int &nReportPeriods, // Total number of Report Periods requested + int nReportPeriods, // Total number of Report Periods requested bool &ErrorsFound) { - state.dataWeatherManager->ReportPeriodInput.allocate(nReportPeriods); - state.dataWeatherManager->ReportPeriodInputUniqueNames.reserve(static_cast(nReportPeriods)); + constexpr std::string_view routineName = "GetReportPeriodData"; + state.dataWeather->ReportPeriodInput.allocate(nReportPeriods); - state.dataIPShortCut->cCurrentModuleObject = "Output:Table:ReportPeriod"; + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "Output:Table:ReportPeriod"; int Count = 0; int NumAlpha; // Number of alphas being input int NumNumeric; // Number of numbers being input int IOStat; // IO Status when calling get input subroutine for (int i = 1; i <= nReportPeriods; ++i) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, i, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumeric, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + std::string newName = Util::makeUPPER(ipsc->cAlphaArgs(1)); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, newName}; // A1, \field Name - if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) { - GlobalNames::VerifyUniqueInterObjectName(state, - state.dataWeatherManager->ReportPeriodInputUniqueNames, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(1), - ErrorsFound); + if (std::find_if(state.dataWeather->ReportPeriodInput.begin(), + state.dataWeather->ReportPeriodInput.end(), + [&newName](ReportPeriodData const &rpd) { return newName == rpd.title; }) != + state.dataWeather->ReportPeriodInput.end()) { + ShowSevereDuplicateName(state, eoh); + ErrorsFound = true; } ++Count; + + auto &reportPeriodInput = state.dataWeather->ReportPeriodInput(i); // Loop = RP + Ptr; // Note JM 2018-11-20: IDD allows blank name, but input processor will create a name such as "ReportPeriod 1" anyways // which is fine for our reporting below - state.dataWeatherManager->ReportPeriodInput(i).title = state.dataIPShortCut->cAlphaArgs(1); + reportPeriodInput.title = newName; // A2, \field Report Name - state.dataWeatherManager->ReportPeriodInput(i).reportName = state.dataIPShortCut->cAlphaArgs(2); + reportPeriodInput.reportName = ipsc->cAlphaArgs(2); // set the start and end day of month from user input // N1, \field Begin Year @@ -5206,130 +4724,96 @@ namespace WeatherManager { // N6, \field End Month // N7, \field End Day of Month // N8; \field End Hour of Day - state.dataWeatherManager->ReportPeriodInput(i).startYear = int(state.dataIPShortCut->rNumericArgs(1)); - state.dataWeatherManager->ReportPeriodInput(i).startMonth = int(state.dataIPShortCut->rNumericArgs(2)); - state.dataWeatherManager->ReportPeriodInput(i).startDay = int(state.dataIPShortCut->rNumericArgs(3)); - state.dataWeatherManager->ReportPeriodInput(i).startHour = int(state.dataIPShortCut->rNumericArgs(4)); - state.dataWeatherManager->ReportPeriodInput(i).endYear = int(state.dataIPShortCut->rNumericArgs(5)); - state.dataWeatherManager->ReportPeriodInput(i).endMonth = int(state.dataIPShortCut->rNumericArgs(6)); - state.dataWeatherManager->ReportPeriodInput(i).endDay = int(state.dataIPShortCut->rNumericArgs(7)); - state.dataWeatherManager->ReportPeriodInput(i).endHour = int(state.dataIPShortCut->rNumericArgs(8)); + reportPeriodInput.startYear = int(ipsc->rNumericArgs(1)); + reportPeriodInput.startMonth = int(ipsc->rNumericArgs(2)); + reportPeriodInput.startDay = int(ipsc->rNumericArgs(3)); + reportPeriodInput.startHour = int(ipsc->rNumericArgs(4)); + reportPeriodInput.endYear = int(ipsc->rNumericArgs(5)); + reportPeriodInput.endMonth = int(ipsc->rNumericArgs(6)); + reportPeriodInput.endDay = int(ipsc->rNumericArgs(7)); + reportPeriodInput.endHour = int(ipsc->rNumericArgs(8)); // Validate year inputs - if (state.dataWeatherManager->ReportPeriodInput(i).startYear == 0) { - if (state.dataWeatherManager->ReportPeriodInput(i).endYear != 0) { // Have to have an input start year to input an end year + if (reportPeriodInput.startYear == 0) { + if (reportPeriodInput.endYear != 0) { // Have to have an input start year to input an end year ShowSevereError(state, format("{}: object={}, end year cannot be specified if the start year is not.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->ReportPeriodInput(i).title)); + ipsc->cCurrentModuleObject, + reportPeriodInput.title)); ErrorsFound = true; } - } else if (state.dataWeatherManager->ReportPeriodInput(i).startYear < 1583) { // Bail on the proleptic Gregorian calendar + } else if (reportPeriodInput.startYear < 1583) { // Bail on the proleptic Gregorian calendar ShowSevereError(state, format("{}: object={}, start year ({}) is too early, please choose a date after 1582.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->ReportPeriodInput(i).title, - state.dataWeatherManager->ReportPeriodInput(i).startYear)); + ipsc->cCurrentModuleObject, + reportPeriodInput.title, + reportPeriodInput.startYear)); ErrorsFound = true; } - if (state.dataWeatherManager->ReportPeriodInput(i).endYear != 0 && - state.dataWeatherManager->ReportPeriodInput(i).startYear > state.dataWeatherManager->ReportPeriodInput(i).endYear) { + if (reportPeriodInput.endYear != 0 && reportPeriodInput.startYear > reportPeriodInput.endYear) { ShowSevereError(state, format("{}: object={}, start year ({}) is after the end year ({}).", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->ReportPeriodInput(i).title, - state.dataWeatherManager->ReportPeriodInput(i).startYear, - state.dataWeatherManager->ReportPeriodInput(i).endYear)); + ipsc->cCurrentModuleObject, + reportPeriodInput.title, + reportPeriodInput.startYear, + reportPeriodInput.endYear)); ErrorsFound = true; } - state.dataWeatherManager->ReportPeriodInput(i).startJulianDate = - computeJulianDate(state.dataWeatherManager->ReportPeriodInput(i).startYear, - state.dataWeatherManager->ReportPeriodInput(i).startMonth, - state.dataWeatherManager->ReportPeriodInput(i).startDay); - state.dataWeatherManager->ReportPeriodInput(i).endJulianDate = computeJulianDate(state.dataWeatherManager->ReportPeriodInput(i).endYear, - state.dataWeatherManager->ReportPeriodInput(i).endMonth, - state.dataWeatherManager->ReportPeriodInput(i).endDay); + reportPeriodInput.startJulianDate = + computeJulianDate(reportPeriodInput.startYear, reportPeriodInput.startMonth, reportPeriodInput.startDay); + reportPeriodInput.endJulianDate = computeJulianDate(reportPeriodInput.endYear, reportPeriodInput.endMonth, reportPeriodInput.endDay); } } - void CopyReportPeriodObject(const Array1D &source, - const int sourceIdx, - Array1D &target, - const int targetIdx) - // copy the content of one reporting period object to another. - // The aim is to transfer data of each reporting period object to its corresonding - // report time so the indexing works out - { - target(targetIdx).title = source(sourceIdx).title; - target(targetIdx).reportName = source(sourceIdx).reportName; - target(targetIdx).startYear = source(sourceIdx).startYear; - target(targetIdx).startMonth = source(sourceIdx).startMonth; - target(targetIdx).startDay = source(sourceIdx).startDay; - target(targetIdx).startHour = source(sourceIdx).startHour; - target(targetIdx).startJulianDate = source(sourceIdx).startJulianDate; - target(targetIdx).endYear = source(sourceIdx).endYear; - target(targetIdx).endMonth = source(sourceIdx).endMonth; - target(targetIdx).endDay = source(sourceIdx).endDay; - target(targetIdx).endHour = source(sourceIdx).endHour; - target(targetIdx).endJulianDate = source(sourceIdx).endJulianDate; - } - void GroupReportPeriodByType(EnergyPlusData &state, const int nReportPeriods) { // transfer data from the reporting period object to the corresponding report period type arrays // ThermalResilienceSummary, CO2ResilienceSummary, VisualResilienceSummary, and AllResilienceSummaries - for (int i = 1; i <= nReportPeriods; ++i) { - if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "THERMALRESILIENCESUMMARY") { - state.dataWeatherManager->TotThermalReportPers += 1; - } else if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "CO2RESILIENCESUMMARY") { - state.dataWeatherManager->TotCO2ReportPers += 1; - } else if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "VISUALRESILIENCESUMMARY") { - state.dataWeatherManager->TotVisualReportPers += 1; - } else if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "ALLRESILIENCESUMMARIES") { - state.dataWeatherManager->TotThermalReportPers += 1; - state.dataWeatherManager->TotCO2ReportPers += 1; - state.dataWeatherManager->TotVisualReportPers += 1; - } - } - - state.dataWeatherManager->ThermalReportPeriodInput.allocate(state.dataWeatherManager->TotThermalReportPers); - state.dataWeatherManager->CO2ReportPeriodInput.allocate(state.dataWeatherManager->TotCO2ReportPers); - state.dataWeatherManager->VisualReportPeriodInput.allocate(state.dataWeatherManager->TotVisualReportPers); - - int ThermalReportPeriodsIdx = 1; - int CO2ReportPeriodsIdx = 1; - int VisualReportPeriodsIdx = 1; - for (int i = 1; i <= nReportPeriods; ++i) { - if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "THERMALRESILIENCESUMMARY") { - CopyReportPeriodObject( - state.dataWeatherManager->ReportPeriodInput, i, state.dataWeatherManager->ThermalReportPeriodInput, ThermalReportPeriodsIdx); - ThermalReportPeriodsIdx += 1; - } else if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "CO2RESILIENCESUMMARY") { - CopyReportPeriodObject( - state.dataWeatherManager->ReportPeriodInput, i, state.dataWeatherManager->CO2ReportPeriodInput, CO2ReportPeriodsIdx); - CO2ReportPeriodsIdx += 1; - } else if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "VISUALRESILIENCESUMMARY") { - CopyReportPeriodObject( - state.dataWeatherManager->ReportPeriodInput, i, state.dataWeatherManager->VisualReportPeriodInput, VisualReportPeriodsIdx); - VisualReportPeriodsIdx += 1; - } else if (state.dataWeatherManager->ReportPeriodInput(i).reportName == "ALLRESILIENCESUMMARIES") { - CopyReportPeriodObject( - state.dataWeatherManager->ReportPeriodInput, i, state.dataWeatherManager->ThermalReportPeriodInput, ThermalReportPeriodsIdx); - ThermalReportPeriodsIdx += 1; - CopyReportPeriodObject( - state.dataWeatherManager->ReportPeriodInput, i, state.dataWeatherManager->CO2ReportPeriodInput, CO2ReportPeriodsIdx); - CO2ReportPeriodsIdx += 1; - CopyReportPeriodObject( - state.dataWeatherManager->ReportPeriodInput, i, state.dataWeatherManager->VisualReportPeriodInput, VisualReportPeriodsIdx); - VisualReportPeriodsIdx += 1; + for (auto const &reportPeriodInput : state.dataWeather->ReportPeriodInput) { + + if (reportPeriodInput.reportName == "THERMALRESILIENCESUMMARY") { + ++state.dataWeather->TotThermalReportPers; + } else if (reportPeriodInput.reportName == "CO2RESILIENCESUMMARY") { + ++state.dataWeather->TotCO2ReportPers; + } else if (reportPeriodInput.reportName == "VISUALRESILIENCESUMMARY") { + ++state.dataWeather->TotVisualReportPers; + } else if (reportPeriodInput.reportName == "ALLRESILIENCESUMMARIES") { + ++state.dataWeather->TotThermalReportPers; + ++state.dataWeather->TotCO2ReportPers; + ++state.dataWeather->TotVisualReportPers; + } + } + + state.dataWeather->ThermalReportPeriodInput.allocate(state.dataWeather->TotThermalReportPers); + state.dataWeather->CO2ReportPeriodInput.allocate(state.dataWeather->TotCO2ReportPers); + state.dataWeather->VisualReportPeriodInput.allocate(state.dataWeather->TotVisualReportPers); + + for (int i = 1, iThermal = 1, iVisual = 1, iCO2 = 1; i <= nReportPeriods; ++i) { + auto const &reportPeriodInput = state.dataWeather->ReportPeriodInput(i); + if (reportPeriodInput.reportName == "THERMALRESILIENCESUMMARY") { + state.dataWeather->ThermalReportPeriodInput(iThermal) = reportPeriodInput; + ++iThermal; + } else if (reportPeriodInput.reportName == "CO2RESILIENCESUMMARY") { + state.dataWeather->CO2ReportPeriodInput(iCO2) = reportPeriodInput; + ++iCO2; + } else if (reportPeriodInput.reportName == "VISUALRESILIENCESUMMARY") { + state.dataWeather->VisualReportPeriodInput(iVisual) = reportPeriodInput; + ++iVisual; + } else if (reportPeriodInput.reportName == "ALLRESILIENCESUMMARIES") { + state.dataWeather->ThermalReportPeriodInput(iThermal) = reportPeriodInput; + ++iThermal; + state.dataWeather->CO2ReportPeriodInput(iCO2) = reportPeriodInput; + ++iCO2; + state.dataWeather->VisualReportPeriodInput(iVisual) = reportPeriodInput; + ++iVisual; } } } void GetRunPeriodData(EnergyPlusData &state, - int &nRunPeriods, // Total number of Run Periods requested + int nRunPeriods, // Total number of Run Periods requested bool &ErrorsFound) { @@ -5338,50 +4822,52 @@ namespace WeatherManager { // DATE WRITTEN October 1997 // MODIFIED February 1999, Add multiple run periods, Change name. // March 2012, LKL, Add features to object; New "actual weather" object; - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine gets the run period info from User input and the // simulation dates + constexpr std::string_view routineName = "GetRunPeriodData"; // Call Input Get routine to retrieve annual run data - state.dataWeatherManager->RunPeriodInput.allocate(nRunPeriods); - state.dataWeatherManager->RunPeriodInputUniqueNames.reserve(static_cast(nRunPeriods)); + state.dataWeather->RunPeriodInput.allocate(nRunPeriods); - state.dataIPShortCut->cCurrentModuleObject = "RunPeriod"; + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "RunPeriod"; int Count = 0; int NumAlpha; // Number of alphas being input int NumNumeric; // Number of numbers being input int IOStat; // IO Status when calling get input subroutine for (int i = 1; i <= nRunPeriods; ++i) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, i, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumeric, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); // A1, \field Name - if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) { - GlobalNames::VerifyUniqueInterObjectName(state, - state.dataWeatherManager->RunPeriodInputUniqueNames, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(1), - ErrorsFound); + std::string newName = Util::makeUPPER(ipsc->cAlphaArgs(1)); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, newName}; + + if (std::find_if(state.dataWeather->RunPeriodInput.begin(), + state.dataWeather->RunPeriodInput.end(), + [&newName](RunPeriodData const &rpd) { return rpd.title == newName; }) != state.dataWeather->RunPeriodInput.end()) { + ShowSevereDuplicateName(state, eoh); + ErrorsFound = true; } ++Count; // Loop = RP + Ptr; // Note JM 2018-11-20: IDD allows blank name, but input processor will create a name such as "RUNPERIOD 1" anyways // which is fine for our reporting below - state.dataWeatherManager->RunPeriodInput(i).title = state.dataIPShortCut->cAlphaArgs(1); + auto &runPeriodInput = state.dataWeather->RunPeriodInput(i); + runPeriodInput.title = ipsc->cAlphaArgs(1); // set the start and end day of month from user input // N1 , \field Begin Month @@ -5390,47 +4876,46 @@ namespace WeatherManager { // N4 , \field End Month // N5 , \field End Day of Month // N6, \field End Year - state.dataWeatherManager->RunPeriodInput(i).startMonth = int(state.dataIPShortCut->rNumericArgs(1)); - state.dataWeatherManager->RunPeriodInput(i).startDay = int(state.dataIPShortCut->rNumericArgs(2)); - state.dataWeatherManager->RunPeriodInput(i).startYear = int(state.dataIPShortCut->rNumericArgs(3)); - state.dataWeatherManager->RunPeriodInput(i).endMonth = int(state.dataIPShortCut->rNumericArgs(4)); - state.dataWeatherManager->RunPeriodInput(i).endDay = int(state.dataIPShortCut->rNumericArgs(5)); - state.dataWeatherManager->RunPeriodInput(i).endYear = int(state.dataIPShortCut->rNumericArgs(6)); - state.dataWeatherManager->RunPeriodInput(i).TreatYearsAsConsecutive = true; + runPeriodInput.startMonth = int(ipsc->rNumericArgs(1)); + runPeriodInput.startDay = int(ipsc->rNumericArgs(2)); + runPeriodInput.startYear = int(ipsc->rNumericArgs(3)); + runPeriodInput.endMonth = int(ipsc->rNumericArgs(4)); + runPeriodInput.endDay = int(ipsc->rNumericArgs(5)); + runPeriodInput.endYear = int(ipsc->rNumericArgs(6)); + runPeriodInput.TreatYearsAsConsecutive = true; if (state.dataSysVars->FullAnnualRun && i == 1) { - state.dataWeatherManager->RunPeriodInput(i).startMonth = 1; - state.dataWeatherManager->RunPeriodInput(i).startDay = 1; - state.dataWeatherManager->RunPeriodInput(i).endMonth = 12; - state.dataWeatherManager->RunPeriodInput(i).endDay = 31; + runPeriodInput.startMonth = 1; + runPeriodInput.startDay = 1; + runPeriodInput.endMonth = 12; + runPeriodInput.endDay = 31; } // Validate year inputs - if (state.dataWeatherManager->RunPeriodInput(i).startYear == 0) { - if (state.dataWeatherManager->RunPeriodInput(i).endYear != 0) { // Have to have an input start year to input an end year + if (runPeriodInput.startYear == 0) { + if (runPeriodInput.endYear != 0) { // Have to have an input start year to input an end year ShowSevereError(state, format("{}: object={}, end year cannot be specified if the start year is not.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title)); + ipsc->cCurrentModuleObject, + runPeriodInput.title)); ErrorsFound = true; } - } else if (state.dataWeatherManager->RunPeriodInput(i).startYear < 1583) { // Bail on the proleptic Gregorian calendar + } else if (runPeriodInput.startYear < 1583) { // Bail on the proleptic Gregorian calendar ShowSevereError(state, format("{}: object={}, start year ({}) is too early, please choose a date after 1582.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startYear)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startYear)); ErrorsFound = true; } - if (state.dataWeatherManager->RunPeriodInput(i).endYear != 0 && - state.dataWeatherManager->RunPeriodInput(i).startYear > state.dataWeatherManager->RunPeriodInput(i).endYear) { + if (runPeriodInput.endYear != 0 && runPeriodInput.startYear > runPeriodInput.endYear) { ShowSevereError(state, format("{}: object={}, start year ({}) is after the end year ({}).", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startYear, - state.dataWeatherManager->RunPeriodInput(i).endYear)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startYear, + runPeriodInput.endYear)); ErrorsFound = true; } @@ -5442,345 +4927,274 @@ namespace WeatherManager { ShowWarningError(state, format("{}: object={}{} invalid (Day of Week) [{}] for Start is not valid, Sunday will be used.", state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, + state.dataWeather->RunPeriodInput(i).title, state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = ScheduleManager::DayType::Sunday; + runPeriodInput.startWeekDay = ScheduleManager::DayType::Sunday; } else { - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = static_cast(dayType); + runPeriodInput.startWeekDay = static_cast(dayType); inputWeekday = true; } } else { // No input, set the default as Sunday. This may get overriden below - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = ScheduleManager::DayType::Sunday; + runPeriodInput.startWeekDay = ScheduleManager::DayType::Sunday; } // Validate the dates now that the weekday field has been looked at - if (state.dataWeatherManager->RunPeriodInput(i).startMonth == 2 && state.dataWeatherManager->RunPeriodInput(i).startDay == 29) { + if (runPeriodInput.startMonth == 2 && runPeriodInput.startDay == 29) { // Requested start date is a leap year - if (state.dataWeatherManager->RunPeriodInput(i).startYear == 0) { // No input starting year + if (runPeriodInput.startYear == 0) { // No input starting year if (inputWeekday) { - state.dataWeatherManager->RunPeriodInput(i).startYear = - findLeapYearForWeekday(state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay, - state.dataWeatherManager->RunPeriodInput(i).startWeekDay); + runPeriodInput.startYear = + findLeapYearForWeekday(runPeriodInput.startMonth, runPeriodInput.startDay, runPeriodInput.startWeekDay); } else { // 2012 is the default year, 1/1 is a Sunday - state.dataWeatherManager->RunPeriodInput(i).startYear = 2012; - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = - calculateDayOfWeek(state, - state.dataWeatherManager->RunPeriodInput(i).startYear, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay); + runPeriodInput.startYear = 2012; + runPeriodInput.startWeekDay = + calculateDayOfWeek(state, runPeriodInput.startYear, runPeriodInput.startMonth, runPeriodInput.startDay); } - } else { // Have an input start year - if (!isLeapYear(state.dataWeatherManager->RunPeriodInput(i).startYear)) { // Start year is not a leap year + } else { // Have an input start year + if (!isLeapYear(runPeriodInput.startYear)) { // Start year is not a leap year ShowSevereError(state, format("{}: object={}, start year ({}) is not a leap year but the requested start date is 2/29.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startYear)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startYear)); ErrorsFound = true; } else { // Start year is a leap year - ScheduleManager::DayType weekday = calculateDayOfWeek(state, - state.dataWeatherManager->RunPeriodInput(i).startYear, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay); + ScheduleManager::DayType weekday = + calculateDayOfWeek(state, runPeriodInput.startYear, runPeriodInput.startMonth, runPeriodInput.startDay); if (inputWeekday) { // Check for correctness of input - if (weekday != state.dataWeatherManager->RunPeriodInput(i).startWeekDay) { + if (weekday != runPeriodInput.startWeekDay) { ShowWarningError(state, format("{}: object={}, start weekday ({}) does not match the start year ({}), corrected to {}.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaArgs(2), - state.dataWeatherManager->RunPeriodInput(i).startYear, + ipsc->cCurrentModuleObject, + runPeriodInput.title, + ipsc->cAlphaArgs(2), + runPeriodInput.startYear, ScheduleManager::dayTypeNamesUC[static_cast(weekday)])); - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = weekday; + runPeriodInput.startWeekDay = weekday; } } else { // Set the weekday if it was not input - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = weekday; + runPeriodInput.startWeekDay = weekday; } } } } else { // Non leap-day start date - if (!validMonthDay(state.dataWeatherManager->RunPeriodInput(i).startMonth, state.dataWeatherManager->RunPeriodInput(i).startDay)) { + if (!validMonthDay(runPeriodInput.startMonth, runPeriodInput.startDay)) { ShowSevereError(state, format("{}: object={}, Invalid input start month/day ({}/{})", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startMonth, + runPeriodInput.startDay)); ErrorsFound = true; - } else { // Month/day is valid - if (state.dataWeatherManager->RunPeriodInput(i).startYear == 0) { // No input starting year + } else { // Month/day is valid + if (runPeriodInput.startYear == 0) { // No input starting year if (inputWeekday) { - state.dataWeatherManager->RunPeriodInput(i).startYear = - findYearForWeekday(state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay, - state.dataWeatherManager->RunPeriodInput(i).startWeekDay); + runPeriodInput.startYear = + findYearForWeekday(runPeriodInput.startMonth, runPeriodInput.startDay, runPeriodInput.startWeekDay); } else { // 2017 is the default year, 1/1 is a Sunday - state.dataWeatherManager->RunPeriodInput(i).startYear = 2017; - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = - calculateDayOfWeek(state, - state.dataWeatherManager->RunPeriodInput(i).startYear, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay); + runPeriodInput.startYear = 2017; + runPeriodInput.startWeekDay = + calculateDayOfWeek(state, runPeriodInput.startYear, runPeriodInput.startMonth, runPeriodInput.startDay); } } else { // Have an input starting year - ScheduleManager::DayType weekday = calculateDayOfWeek(state, - state.dataWeatherManager->RunPeriodInput(i).startYear, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay); + ScheduleManager::DayType weekday = + calculateDayOfWeek(state, runPeriodInput.startYear, runPeriodInput.startMonth, runPeriodInput.startDay); if (inputWeekday) { // Check for correctness of input - if (weekday != state.dataWeatherManager->RunPeriodInput(i).startWeekDay) { + if (weekday != runPeriodInput.startWeekDay) { ShowWarningError(state, format("{}: object={}, start weekday ({}) does not match the start year ({}), corrected to {}.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaArgs(2), - state.dataWeatherManager->RunPeriodInput(i).startYear, + ipsc->cCurrentModuleObject, + runPeriodInput.title, + ipsc->cAlphaArgs(2), + runPeriodInput.startYear, ScheduleManager::dayTypeNamesUC[static_cast(weekday)])); - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = weekday; + runPeriodInput.startWeekDay = weekday; } } else { // Set the weekday if it was not input - state.dataWeatherManager->RunPeriodInput(i).startWeekDay = weekday; + runPeriodInput.startWeekDay = weekday; } } } } // Compute the Julian date of the start date - state.dataWeatherManager->RunPeriodInput(i).startJulianDate = computeJulianDate(state.dataWeatherManager->RunPeriodInput(i).startYear, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay); + runPeriodInput.startJulianDate = computeJulianDate(runPeriodInput.startYear, runPeriodInput.startMonth, runPeriodInput.startDay); // Validate the end date - if (state.dataWeatherManager->RunPeriodInput(i).endMonth == 2 && state.dataWeatherManager->RunPeriodInput(i).endDay == 29) { + if (runPeriodInput.endMonth == 2 && runPeriodInput.endDay == 29) { // Requested end date is a leap year - if (state.dataWeatherManager->RunPeriodInput(i).endYear == 0) { // No input end year - if (isLeapYear(state.dataWeatherManager->RunPeriodInput(i).startYear) && - state.dataWeatherManager->RunPeriodInput(i).startMonth < 3) { + if (runPeriodInput.endYear == 0) { // No input end year + if (isLeapYear(runPeriodInput.startYear) && runPeriodInput.startMonth < 3) { // The run period is from some date on or before 2/29 through 2/29 - state.dataWeatherManager->RunPeriodInput(i).endYear = state.dataWeatherManager->RunPeriodInput(i).startYear; + runPeriodInput.endYear = runPeriodInput.startYear; } else { // There might be a better approach here, but for now just loop forward for the next leap year - for (int yr = state.dataWeatherManager->RunPeriodInput(i).startYear + 1; - yr < state.dataWeatherManager->RunPeriodInput(i).startYear + 10; - yr++) { + for (int yr = runPeriodInput.startYear + 1; yr < runPeriodInput.startYear + 10; yr++) { if (isLeapYear(yr)) { - state.dataWeatherManager->RunPeriodInput(i).endYear = yr; + runPeriodInput.endYear = yr; break; } } } - } else { // Have an input end year - if (!isLeapYear(state.dataWeatherManager->RunPeriodInput(i).endYear)) { // End year is not a leap year + } else { // Have an input end year + if (!isLeapYear(runPeriodInput.endYear)) { // End year is not a leap year ShowSevereError(state, format("{}: object={}, end year ({}) is not a leap year but the requested end date is 2/29.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startYear)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startYear)); ErrorsFound = true; } else { - state.dataWeatherManager->RunPeriodInput(i).endJulianDate = - computeJulianDate(state.dataWeatherManager->RunPeriodInput(i).endYear, - state.dataWeatherManager->RunPeriodInput(i).endMonth, - state.dataWeatherManager->RunPeriodInput(i).endDay); - if (state.dataWeatherManager->RunPeriodInput(i).startJulianDate > state.dataWeatherManager->RunPeriodInput(i).endJulianDate) { + runPeriodInput.endJulianDate = computeJulianDate(runPeriodInput.endYear, runPeriodInput.endMonth, runPeriodInput.endDay); + if (runPeriodInput.startJulianDate > runPeriodInput.endJulianDate) { ShowSevereError(state, format("{}: object={}, start Julian date ({}) is after the end Julian date ({}).", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startJulianDate, - state.dataWeatherManager->RunPeriodInput(i).endJulianDate)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startJulianDate, + runPeriodInput.endJulianDate)); ErrorsFound = true; } } } } else { // Non leap-day end date - if (!validMonthDay(state.dataWeatherManager->RunPeriodInput(i).endMonth, state.dataWeatherManager->RunPeriodInput(i).endDay)) { + if (!validMonthDay(runPeriodInput.endMonth, runPeriodInput.endDay)) { ShowSevereError(state, format("{}: object={}, Invalid input end month/day ({}/{})", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startMonth, + runPeriodInput.startDay)); ErrorsFound = true; - } else { // Month/day is valid - if (state.dataWeatherManager->RunPeriodInput(i).endYear == 0) { // No input end year + } else { // Month/day is valid + if (runPeriodInput.endYear == 0) { // No input end year // Assume same year as start year - state.dataWeatherManager->RunPeriodInput(i).endYear = state.dataWeatherManager->RunPeriodInput(i).startYear; - state.dataWeatherManager->RunPeriodInput(i).endJulianDate = - computeJulianDate(state.dataWeatherManager->RunPeriodInput(i).endYear, - state.dataWeatherManager->RunPeriodInput(i).endMonth, - state.dataWeatherManager->RunPeriodInput(i).endDay); - if (state.dataWeatherManager->RunPeriodInput(i).startJulianDate > state.dataWeatherManager->RunPeriodInput(i).endJulianDate) { - state.dataWeatherManager->RunPeriodInput(i).endJulianDate = 0; // Force recalculation later - state.dataWeatherManager->RunPeriodInput(i).endYear += 1; + runPeriodInput.endYear = runPeriodInput.startYear; + runPeriodInput.endJulianDate = computeJulianDate(runPeriodInput.endYear, runPeriodInput.endMonth, runPeriodInput.endDay); + if (runPeriodInput.startJulianDate > runPeriodInput.endJulianDate) { + runPeriodInput.endJulianDate = 0; // Force recalculation later + runPeriodInput.endYear += 1; } } else { // Have an input end year - state.dataWeatherManager->RunPeriodInput(i).endJulianDate = - computeJulianDate(state.dataWeatherManager->RunPeriodInput(i).endYear, - state.dataWeatherManager->RunPeriodInput(i).endMonth, - state.dataWeatherManager->RunPeriodInput(i).endDay); - if (state.dataWeatherManager->RunPeriodInput(i).startJulianDate > state.dataWeatherManager->RunPeriodInput(i).endJulianDate) { + runPeriodInput.endJulianDate = computeJulianDate(runPeriodInput.endYear, runPeriodInput.endMonth, runPeriodInput.endDay); + if (runPeriodInput.startJulianDate > runPeriodInput.endJulianDate) { ShowSevereError(state, format("{}: object={}, start Julian date ({}) is after the end Julian date ({}).", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataWeatherManager->RunPeriodInput(i).startJulianDate, - state.dataWeatherManager->RunPeriodInput(i).endJulianDate)); + ipsc->cCurrentModuleObject, + runPeriodInput.title, + runPeriodInput.startJulianDate, + runPeriodInput.endJulianDate)); ErrorsFound = true; } } } } - if (state.dataWeatherManager->RunPeriodInput(i).endJulianDate == 0) { - state.dataWeatherManager->RunPeriodInput(i).endJulianDate = computeJulianDate(state.dataWeatherManager->RunPeriodInput(i).endYear, - state.dataWeatherManager->RunPeriodInput(i).endMonth, - state.dataWeatherManager->RunPeriodInput(i).endDay); + if (runPeriodInput.endJulianDate == 0) { + runPeriodInput.endJulianDate = computeJulianDate(runPeriodInput.endYear, runPeriodInput.endMonth, runPeriodInput.endDay); } - state.dataWeatherManager->RunPeriodInput(i).numSimYears = - state.dataWeatherManager->RunPeriodInput(i).endYear - state.dataWeatherManager->RunPeriodInput(i).startYear + 1; + runPeriodInput.numSimYears = runPeriodInput.endYear - runPeriodInput.startYear + 1; // A3, \field Use Weather File Holidays and Special Days - if (state.dataIPShortCut->lAlphaFieldBlanks(3) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "YES")) { - state.dataWeatherManager->RunPeriodInput(i).useHolidays = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "NO")) { - state.dataWeatherManager->RunPeriodInput(i).useHolidays = false; + BooleanSwitch b; + if (ipsc->lAlphaFieldBlanks(3)) { + runPeriodInput.useHolidays = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(3)))) != BooleanSwitch::Invalid) { + runPeriodInput.useHolidays = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={}{} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } // A4, \field Use Weather File Daylight Saving Period - if (state.dataIPShortCut->lAlphaFieldBlanks(4) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "YES")) { - state.dataWeatherManager->RunPeriodInput(i).useDST = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "NO")) { - state.dataWeatherManager->RunPeriodInput(i).useDST = false; + if (ipsc->lAlphaFieldBlanks(4)) { + runPeriodInput.useDST = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(4)))) != BooleanSwitch::Invalid) { + runPeriodInput.useDST = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={}{} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4)); ErrorsFound = true; } // A5, \field Apply Weekend Holiday Rule - if (state.dataIPShortCut->lAlphaFieldBlanks(5) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "YES")) { - state.dataWeatherManager->RunPeriodInput(i).applyWeekendRule = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "NO")) { - state.dataWeatherManager->RunPeriodInput(i).applyWeekendRule = false; + if (ipsc->lAlphaFieldBlanks(5)) { + runPeriodInput.applyWeekendRule = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(5)))) != BooleanSwitch::Invalid) { + runPeriodInput.applyWeekendRule = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={}{} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; } // A6, \field Use Weather File Rain Indicators - if (state.dataIPShortCut->lAlphaFieldBlanks(6) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "YES")) { - state.dataWeatherManager->RunPeriodInput(i).useRain = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "NO")) { - state.dataWeatherManager->RunPeriodInput(i).useRain = false; + if (ipsc->lAlphaFieldBlanks(6)) { + runPeriodInput.useRain = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(6)))) != BooleanSwitch::Invalid) { + runPeriodInput.useRain = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={}{} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(6), ipsc->cAlphaArgs(6)); ErrorsFound = true; } // A7, \field Use Weather File Snow Indicators - if (state.dataIPShortCut->lAlphaFieldBlanks(7) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "YES")) { - state.dataWeatherManager->RunPeriodInput(i).useSnow = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "NO")) { - state.dataWeatherManager->RunPeriodInput(i).useSnow = false; + if (ipsc->lAlphaFieldBlanks(7)) { + runPeriodInput.useSnow = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(7)))) != BooleanSwitch::Invalid) { + runPeriodInput.useSnow = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={}{} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(7), ipsc->cAlphaArgs(7)); ErrorsFound = true; } // A8, \field Treat Weather as Actual - if (state.dataIPShortCut->lAlphaFieldBlanks(8) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "NO")) { - state.dataWeatherManager->RunPeriodInput(i).actualWeather = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "YES")) { - state.dataWeatherManager->RunPeriodInput(i).actualWeather = true; + if (ipsc->lAlphaFieldBlanks(8)) { + runPeriodInput.actualWeather = false; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(8)))) != BooleanSwitch::Invalid) { + runPeriodInput.actualWeather = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={}{} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodInput(i).title, - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(8), ipsc->cAlphaArgs(8)); ErrorsFound = true; } // A9, \field First Hour Interpolation Starting Values - if (state.dataIPShortCut->lAlphaFieldBlanks(9) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "Hour24")) { - state.dataWeatherManager->RunPeriodInput(i).firstHrInterpUsingHr1 = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "Hour1")) { - state.dataWeatherManager->RunPeriodInput(i).firstHrInterpUsingHr1 = true; + if (ipsc->lAlphaFieldBlanks(9) || Util::SameString(ipsc->cAlphaArgs(8), "Hour24")) { + runPeriodInput.firstHrInterpUsingHr1 = false; + } else if (Util::SameString(ipsc->cAlphaArgs(9), "Hour1")) { + runPeriodInput.firstHrInterpUsingHr1 = true; } else { // fail-safe default - state.dataWeatherManager->RunPeriodInput(i).firstHrInterpUsingHr1 = false; + runPeriodInput.firstHrInterpUsingHr1 = false; } - state.dataWeatherManager->RunPeriodInput(i).dayOfWeek = static_cast(state.dataWeatherManager->RunPeriodInput(i).startWeekDay); - state.dataWeatherManager->RunPeriodInput(i).isLeapYear = isLeapYear(state.dataWeatherManager->RunPeriodInput(i).startYear); + runPeriodInput.dayOfWeek = static_cast(runPeriodInput.startWeekDay); + runPeriodInput.isLeapYear = isLeapYear(runPeriodInput.startYear); // calculate the annual start and end days from the user inputted month and day - state.dataWeatherManager->RunPeriodInput(i).monWeekDay = 0; - if (state.dataWeatherManager->RunPeriodInput(i).dayOfWeek != 0 && !ErrorsFound) { - SetupWeekDaysByMonth(state, - state.dataWeatherManager->RunPeriodInput(i).startMonth, - state.dataWeatherManager->RunPeriodInput(i).startDay, - state.dataWeatherManager->RunPeriodInput(i).dayOfWeek, - state.dataWeatherManager->RunPeriodInput(i).monWeekDay); + runPeriodInput.monWeekDay = 0; + if (runPeriodInput.dayOfWeek != 0 && !ErrorsFound) { + SetupWeekDaysByMonth(state, runPeriodInput.startMonth, runPeriodInput.startDay, runPeriodInput.dayOfWeek, runPeriodInput.monWeekDay); } } if (nRunPeriods == 0 && state.dataSysVars->FullAnnualRun) { ShowWarningError(state, "No Run Periods input but Full Annual Simulation selected. Adding Run Period to 1/1 through 12/31."); - state.dataWeatherManager->Environment.redimension(++state.dataWeatherManager->NumOfEnvrn); - state.dataWeatherManager->Environment(state.dataWeatherManager->NumOfEnvrn).KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; + state.dataWeather->Environment.redimension(++state.dataWeather->NumOfEnvrn); + state.dataWeather->Environment(state.dataWeather->NumOfEnvrn).KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; nRunPeriods = 1; state.dataGlobal->WeathSimReq = true; - state.dataWeatherManager->RunPeriodInput.allocate(nRunPeriods); - state.dataWeatherManager->RunPeriodInput(1).startJulianDate = General::OrdinalDay(state.dataWeatherManager->RunPeriodInput(1).startMonth, - state.dataWeatherManager->RunPeriodInput(1).startDay, - state.dataWeatherManager->LeapYearAdd); - state.dataWeatherManager->RunPeriodInput(1).endJulianDate = General::OrdinalDay(state.dataWeatherManager->RunPeriodInput(1).endMonth, - state.dataWeatherManager->RunPeriodInput(1).endDay, - state.dataWeatherManager->LeapYearAdd); - state.dataWeatherManager->RunPeriodInput(1).monWeekDay = 0; - if (state.dataWeatherManager->RunPeriodInput(1).dayOfWeek != 0 && !ErrorsFound) { - SetupWeekDaysByMonth(state, - state.dataWeatherManager->RunPeriodInput(1).startMonth, - state.dataWeatherManager->RunPeriodInput(1).startDay, - state.dataWeatherManager->RunPeriodInput(1).dayOfWeek, - state.dataWeatherManager->RunPeriodInput(1).monWeekDay); + state.dataWeather->RunPeriodInput.allocate(nRunPeriods); + auto &runPerInput1 = state.dataWeather->RunPeriodInput(1); + runPerInput1.startJulianDate = General::OrdinalDay(runPerInput1.startMonth, runPerInput1.startDay, state.dataWeather->LeapYearAdd); + runPerInput1.endJulianDate = General::OrdinalDay(runPerInput1.endMonth, runPerInput1.endDay, state.dataWeather->LeapYearAdd); + runPerInput1.monWeekDay = 0; + if (runPerInput1.dayOfWeek != 0 && !ErrorsFound) { + SetupWeekDaysByMonth(state, runPerInput1.startMonth, runPerInput1.startDay, runPerInput1.dayOfWeek, runPerInput1.monWeekDay); } } else if (nRunPeriods > 1 && state.dataSysVars->FullAnnualRun) { nRunPeriods = 1; @@ -5798,356 +5212,279 @@ namespace WeatherManager { // This subroutine gets the run period design info from User input and the // simulation dates + constexpr std::string_view routineName = "GetRunPeriodDesignData"; // Call Input Get routine to retrieve annual run data int RPD1 = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays"); int RPD2 = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType"); - state.dataWeatherManager->TotRunDesPers = RPD1 + RPD2; + state.dataWeather->TotRunDesPers = RPD1 + RPD2; - state.dataWeatherManager->RunPeriodDesignInput.allocate(RPD1 + RPD2); - state.dataWeatherManager->RunPeriodDesignInputUniqueNames.reserve(static_cast(RPD1 + RPD2)); + state.dataWeather->RunPeriodDesignInput.allocate(RPD1 + RPD2); int Count = 0; - state.dataIPShortCut->cCurrentModuleObject = "SizingPeriod:WeatherFileDays"; + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "SizingPeriod:WeatherFileDays"; for (int i = 1; i <= RPD1; ++i) { int NumAlphas; // Number of alphas being input int NumNumerics; // Number of Numerics being input int IOStat; // IO Status when calling get input subroutine state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, i, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumerics, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - GlobalNames::VerifyUniqueInterObjectName(state, - state.dataWeatherManager->RunPeriodDesignInputUniqueNames, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(1), - ErrorsFound); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + std::string newName = Util::makeUPPER(ipsc->cAlphaArgs(1)); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, newName}; + if (std::find_if(state.dataWeather->RunPeriodDesignInput.begin(), + state.dataWeather->RunPeriodDesignInput.end(), + [&newName](RunPeriodData const &rpd) { return newName == rpd.title; }) != + state.dataWeather->RunPeriodDesignInput.end()) { + ShowSevereDuplicateName(state, eoh); + ErrorsFound = true; + } ++Count; - state.dataWeatherManager->RunPeriodDesignInput(Count).title = state.dataIPShortCut->cAlphaArgs(1); - state.dataWeatherManager->RunPeriodDesignInput(Count).periodType = "User Selected WeatherFile RunPeriod (Design)"; + + auto &runPerDesInput = state.dataWeather->RunPeriodDesignInput(Count); + runPerDesInput.title = newName; + runPerDesInput.periodType = "User Selected WeatherFile RunPeriod (Design)"; // set the start and end day of month from user input - state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth = int(state.dataIPShortCut->rNumericArgs(1)); - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay = int(state.dataIPShortCut->rNumericArgs(2)); - state.dataWeatherManager->RunPeriodDesignInput(Count).endMonth = int(state.dataIPShortCut->rNumericArgs(3)); - state.dataWeatherManager->RunPeriodDesignInput(Count).endDay = int(state.dataIPShortCut->rNumericArgs(4)); + runPerDesInput.startMonth = int(ipsc->rNumericArgs(1)); + runPerDesInput.startDay = int(ipsc->rNumericArgs(2)); + runPerDesInput.endMonth = int(ipsc->rNumericArgs(3)); + runPerDesInput.endDay = int(ipsc->rNumericArgs(4)); - switch (state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth) { + switch (runPerDesInput.startMonth) { case 1: case 3: case 5: case 7: case 8: case 10: - case 12: - if (state.dataWeatherManager->RunPeriodDesignInput(Count).startDay > 31) { + case 12: { + if (runPerDesInput.startDay > 31) { ShowSevereError(state, - format("{}: object={} {}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - format("{} invalid (Day of Month) [{}]", - state.dataIPShortCut->cNumericFieldNames(2), - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay))); + format("{}: object={} {} invalid (Day of Month) [{}]", + ipsc->cCurrentModuleObject, + runPerDesInput.title, + ipsc->cNumericFieldNames(2), + runPerDesInput.startDay)); ErrorsFound = true; } - break; + } break; case 4: case 6: case 9: - case 11: - if (state.dataWeatherManager->RunPeriodDesignInput(Count).startDay > 30) { + case 11: { + if (runPerDesInput.startDay > 30) { ShowSevereError(state, - format("{}: object={} {}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - format("{} invalid (Day of Month) [{}]", - state.dataIPShortCut->cNumericFieldNames(2), - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay))); + format("{}: object={} {} invalid (Day of Month) [{}]", + ipsc->cCurrentModuleObject, + runPerDesInput.title, + ipsc->cNumericFieldNames(2), + runPerDesInput.startDay)); ErrorsFound = true; } - break; - case 2: - if (state.dataWeatherManager->RunPeriodDesignInput(Count).startDay > 28 + state.dataWeatherManager->LeapYearAdd) { + } break; + case 2: { + if (runPerDesInput.startDay > 28 + state.dataWeather->LeapYearAdd) { ShowSevereError(state, - format("{}: object={} {}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - format("{} invalid (Day of Month) [{}]", - state.dataIPShortCut->cNumericFieldNames(2), - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay))); + format("{}: object={} {} invalid (Day of Month) [{}]", + ipsc->cCurrentModuleObject, + runPerDesInput.title, + ipsc->cNumericFieldNames(2), + runPerDesInput.startDay)); ErrorsFound = true; } - break; - default: + } break; + default: { ShowSevereError(state, - format("{}: object={} {}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - format("{} invalid (Month) [{}]", - state.dataIPShortCut->cNumericFieldNames(1), - state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth))); + format("{}: object={} {} invalid (Month) [{}]", + ipsc->cCurrentModuleObject, + runPerDesInput.title, + ipsc->cNumericFieldNames(1), + runPerDesInput.startMonth)); ErrorsFound = true; - break; - } + } break; + } // switch - if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { - state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek = - static_cast(ScheduleManager::DayType::Monday); // Defaults to Monday + if (ipsc->lAlphaFieldBlanks(2)) { + runPerDesInput.dayOfWeek = (int)ScheduleManager::DayType::Monday; // Defaults to Monday } else { - state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek = - getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); - if (state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek < 1 || - state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek == 8) { + runPerDesInput.dayOfWeek = getEnumValue(ScheduleManager::dayTypeNamesUC, ipsc->cAlphaArgs(2)); + if (runPerDesInput.dayOfWeek < 1 || runPerDesInput.dayOfWeek == 8) { ShowWarningError(state, format("{}: object={} {} invalid (Day of Week) [{} for Start is not Valid, Monday will be Used.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(1), - state.dataIPShortCut->cAlphaArgs(1))); - state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek = - static_cast(ScheduleManager::DayType::Monday); // Defaults to Monday + ipsc->cCurrentModuleObject, + runPerDesInput.title, + ipsc->cAlphaFieldNames(1), + ipsc->cAlphaArgs(1))); + runPerDesInput.dayOfWeek = (int)ScheduleManager::DayType::Monday; // Defaults to Monday } } - if (state.dataIPShortCut->lAlphaFieldBlanks(3) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "YES")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useDST = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "NO")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useDST = false; + BooleanSwitch b; + if (ipsc->lAlphaFieldBlanks(3)) { + runPerDesInput.useDST = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(3)))) != BooleanSwitch::Invalid) { + runPerDesInput.useDST = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={} {} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } - if (state.dataIPShortCut->lAlphaFieldBlanks(4) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "YES")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useRain = true; - state.dataWeatherManager->RunPeriodDesignInput(Count).useSnow = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "NO")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useRain = false; - state.dataWeatherManager->RunPeriodDesignInput(Count).useSnow = false; + if (ipsc->lAlphaFieldBlanks(4)) { + runPerDesInput.useRain = runPerDesInput.useSnow = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(4)))) != BooleanSwitch::Invalid) { + runPerDesInput.useRain = runPerDesInput.useSnow = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={} {} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4)); ErrorsFound = true; } // calculate the annual start and end days from the user inputted month and day - state.dataWeatherManager->RunPeriodDesignInput(Count).startJulianDate = - General::OrdinalDay(state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth, - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay, - state.dataWeatherManager->LeapYearAdd); - state.dataWeatherManager->RunPeriodDesignInput(Count).endJulianDate = - General::OrdinalDay(state.dataWeatherManager->RunPeriodDesignInput(Count).endMonth, - state.dataWeatherManager->RunPeriodDesignInput(Count).endDay, - state.dataWeatherManager->LeapYearAdd); - if (state.dataWeatherManager->RunPeriodDesignInput(Count).startJulianDate <= - state.dataWeatherManager->RunPeriodDesignInput(Count).endJulianDate) { - state.dataWeatherManager->RunPeriodDesignInput(Count).totalDays = - (state.dataWeatherManager->RunPeriodDesignInput(Count).endJulianDate - - state.dataWeatherManager->RunPeriodDesignInput(Count).startJulianDate + 1) * - state.dataWeatherManager->RunPeriodDesignInput(Count).numSimYears; + runPerDesInput.startJulianDate = General::OrdinalDay(runPerDesInput.startMonth, runPerDesInput.startDay, state.dataWeather->LeapYearAdd); + runPerDesInput.endJulianDate = General::OrdinalDay(runPerDesInput.endMonth, runPerDesInput.endDay, state.dataWeather->LeapYearAdd); + if (runPerDesInput.startJulianDate <= runPerDesInput.endJulianDate) { + runPerDesInput.totalDays = (runPerDesInput.endJulianDate - runPerDesInput.startJulianDate + 1) * runPerDesInput.numSimYears; } else { - state.dataWeatherManager->RunPeriodDesignInput(Count).totalDays = - (General::OrdinalDay(12, 31, state.dataWeatherManager->LeapYearAdd) - - state.dataWeatherManager->RunPeriodDesignInput(Count).startJulianDate + 1 + - state.dataWeatherManager->RunPeriodDesignInput(Count).endJulianDate) * - state.dataWeatherManager->RunPeriodDesignInput(Count).numSimYears; - } - state.dataWeatherManager->RunPeriodDesignInput(Count).monWeekDay = 0; - if (state.dataWeatherManager->RunPeriodDesignInput(1).dayOfWeek != 0 && !ErrorsFound) { + runPerDesInput.totalDays = (General::OrdinalDay(12, 31, state.dataWeather->LeapYearAdd) - runPerDesInput.startJulianDate + 1 + + runPerDesInput.endJulianDate) * + runPerDesInput.numSimYears; + } + runPerDesInput.monWeekDay = 0; + auto &runPeriodDesignInput1 = state.dataWeather->RunPeriodDesignInput(1); + if (runPeriodDesignInput1.dayOfWeek != 0 && !ErrorsFound) { SetupWeekDaysByMonth(state, - state.dataWeatherManager->RunPeriodDesignInput(1).startMonth, - state.dataWeatherManager->RunPeriodDesignInput(1).startDay, - state.dataWeatherManager->RunPeriodDesignInput(1).dayOfWeek, - state.dataWeatherManager->RunPeriodDesignInput(1).monWeekDay); + runPeriodDesignInput1.startMonth, + runPeriodDesignInput1.startDay, + runPeriodDesignInput1.dayOfWeek, + runPeriodDesignInput1.monWeekDay); } } - state.dataIPShortCut->cCurrentModuleObject = "SizingPeriod:WeatherFileConditionType"; + ipsc->cCurrentModuleObject = "SizingPeriod:WeatherFileConditionType"; for (int i = 1; i <= RPD2; ++i) { int NumAlphas; // Number of alphas being input int NumNumerics; // Number of Numerics being input int IOStat; // IO Status when calling get input subroutine state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, i, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumerics, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - GlobalNames::VerifyUniqueInterObjectName(state, - state.dataWeatherManager->RunPeriodDesignInputUniqueNames, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(1), - ErrorsFound); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + std::string newName = Util::makeUPPER(ipsc->cAlphaArgs(1)); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, newName}; + if (std::find_if(state.dataWeather->RunPeriodDesignInput.begin(), + state.dataWeather->RunPeriodDesignInput.end(), + [&newName](RunPeriodData const &rpd) { return newName == rpd.title; }) != + state.dataWeather->RunPeriodDesignInput.end()) { + ShowSevereDuplicateName(state, eoh); + ErrorsFound = true; + } ++Count; - state.dataWeatherManager->RunPeriodDesignInput(Count).title = state.dataIPShortCut->cAlphaArgs(1); - state.dataWeatherManager->RunPeriodDesignInput(Count).periodType = - "User Selected WeatherFile Typical/Extreme Period (Design)=" + state.dataIPShortCut->cAlphaArgs(2); + auto &runPerDesInput = state.dataWeather->RunPeriodDesignInput(Count); + runPerDesInput.title = ipsc->cAlphaArgs(1); + runPerDesInput.periodType = "User Selected WeatherFile Typical/Extreme Period (Design)=" + ipsc->cAlphaArgs(2); // Period Selection - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { - int WhichPeriod = UtilityRoutines::FindItem( - state.dataIPShortCut->cAlphaArgs(2), state.dataWeatherManager->TypicalExtremePeriods, &TypicalExtremeData::MatchValue); - if (WhichPeriod != 0) { - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartMonth; - state.dataWeatherManager->RunPeriodDesignInput(Count).startJulianDate = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartJDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).endDay = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).endMonth = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndMonth; - state.dataWeatherManager->RunPeriodDesignInput(Count).endJulianDate = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndJDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).totalDays = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).TotalDays; - } else { - WhichPeriod = UtilityRoutines::FindItem( - state.dataIPShortCut->cAlphaArgs(2), state.dataWeatherManager->TypicalExtremePeriods, &TypicalExtremeData::MatchValue1); + if (ipsc->lAlphaFieldBlanks(2)) { + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(2)); + ErrorsFound = true; + } else { + int WhichPeriod = Util::FindItem(ipsc->cAlphaArgs(2), state.dataWeather->TypicalExtremePeriods, &TypicalExtremeData::MatchValue); + if (WhichPeriod == 0) { + WhichPeriod = Util::FindItem(ipsc->cAlphaArgs(2), state.dataWeather->TypicalExtremePeriods, &TypicalExtremeData::MatchValue1); + if (WhichPeriod != 0) { + } + } + if (WhichPeriod == 0) { + WhichPeriod = Util::FindItem(ipsc->cAlphaArgs(2), state.dataWeather->TypicalExtremePeriods, &TypicalExtremeData::MatchValue2); if (WhichPeriod != 0) { - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartMonth; - state.dataWeatherManager->RunPeriodDesignInput(Count).startJulianDate = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartJDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).endDay = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).endMonth = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndMonth; - state.dataWeatherManager->RunPeriodDesignInput(Count).endJulianDate = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndJDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).totalDays = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).TotalDays; ShowWarningError(state, format("{}: object={} {}={} matched to {}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).MatchValue)); - } else { - WhichPeriod = UtilityRoutines::FindItem( - state.dataIPShortCut->cAlphaArgs(2), state.dataWeatherManager->TypicalExtremePeriods, &TypicalExtremeData::MatchValue2); - if (WhichPeriod != 0) { - state.dataWeatherManager->RunPeriodDesignInput(Count).startDay = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).startMonth = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartMonth; - state.dataWeatherManager->RunPeriodDesignInput(Count).startJulianDate = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).StartJDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).endDay = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).endMonth = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndMonth; - state.dataWeatherManager->RunPeriodDesignInput(Count).endJulianDate = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).EndJDay; - state.dataWeatherManager->RunPeriodDesignInput(Count).totalDays = - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).TotalDays; - ShowWarningError(state, - format("{}: object={} {}={} matched to {}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2), - state.dataWeatherManager->TypicalExtremePeriods(WhichPeriod).MatchValue)); - } else { - ShowSevereError(state, - format("{}: object={} {} invalid (not on Weather File)={}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2))); - ErrorsFound = true; - } + ipsc->cCurrentModuleObject, + runPerDesInput.title, + ipsc->cAlphaFieldNames(2), + ipsc->cAlphaArgs(2), + state.dataWeather->TypicalExtremePeriods(WhichPeriod).MatchValue2)); } } + if (WhichPeriod == 0) { + ShowSevereError(state, + format("{}: object={} {} invalid (not on Weather File)={}", + ipsc->cCurrentModuleObject, + runPerDesInput.title, + ipsc->cAlphaFieldNames(2), + ipsc->cAlphaArgs(2))); + ErrorsFound = true; + } else { + auto const &typicalExtPer = state.dataWeather->TypicalExtremePeriods(WhichPeriod); + runPerDesInput.startDay = typicalExtPer.StartDay; + runPerDesInput.startMonth = typicalExtPer.StartMonth; + runPerDesInput.startJulianDate = typicalExtPer.StartJDay; + runPerDesInput.endDay = typicalExtPer.EndDay; + runPerDesInput.endMonth = typicalExtPer.EndMonth; + runPerDesInput.endJulianDate = typicalExtPer.EndJDay; + runPerDesInput.totalDays = typicalExtPer.TotalDays; + } + } + + if (ipsc->lAlphaFieldBlanks(3)) { + runPerDesInput.dayOfWeek = (int)ScheduleManager::DayType::Monday; // Defaults to Monday } else { - ShowSevereError(state, - format("{}: object={} {} invalid (blank).", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(2))); - ErrorsFound = true; - } - - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek = - static_cast(ScheduleManager::DayType::Monday); // Defaults to Monday - } else { - state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek = - getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(3)); - if (state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek < static_cast(ScheduleManager::DayType::Sunday) || - state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek == static_cast(ScheduleManager::DayType::Holiday)) { + runPerDesInput.dayOfWeek = getEnumValue(ScheduleManager::dayTypeNamesUC, ipsc->cAlphaArgs(3)); + if (runPerDesInput.dayOfWeek < (int)ScheduleManager::DayType::Sunday || + runPerDesInput.dayOfWeek == (int)ScheduleManager::DayType::Holiday) { // Sunday-Saturday, SummerDesignDay, WinterDesignDay, CustomDay1, and CustomDay2 are all valid. Holiday is not valid. // The input processor should trap invalid key choices, so this should never trip. assert(false); } } - if (state.dataIPShortCut->lAlphaFieldBlanks(4) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "YES")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useDST = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "NO")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useDST = false; + BooleanSwitch b; + if (ipsc->lAlphaFieldBlanks(4)) { + runPerDesInput.useDST = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(4)))) != BooleanSwitch::Invalid) { + runPerDesInput.useDST = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={} {} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4)); ErrorsFound = true; } - if (state.dataIPShortCut->lAlphaFieldBlanks(5) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "YES")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useRain = true; - state.dataWeatherManager->RunPeriodDesignInput(Count).useSnow = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "NO")) { - state.dataWeatherManager->RunPeriodDesignInput(Count).useRain = false; - state.dataWeatherManager->RunPeriodDesignInput(Count).useSnow = false; + if (ipsc->lAlphaFieldBlanks(5)) { + runPerDesInput.useRain = runPerDesInput.useSnow = true; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(5)))) != BooleanSwitch::Invalid) { + runPerDesInput.useRain = runPerDesInput.useSnow = static_cast(b); } else { - ShowSevereError(state, - format("{}: object={} {} invalid [{}]", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->RunPeriodDesignInput(Count).title, - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; } - state.dataWeatherManager->RunPeriodDesignInput(1).monWeekDay = 0; - if (state.dataWeatherManager->RunPeriodDesignInput(1).dayOfWeek != 0 && !ErrorsFound) { + auto &runPeriodDesignInput1 = state.dataWeather->RunPeriodDesignInput(1); + runPeriodDesignInput1.monWeekDay = 0; + if (runPeriodDesignInput1.dayOfWeek != 0 && !ErrorsFound) { SetupWeekDaysByMonth(state, - state.dataWeatherManager->RunPeriodDesignInput(1).startMonth, - state.dataWeatherManager->RunPeriodDesignInput(1).startDay, - state.dataWeatherManager->RunPeriodDesignInput(1).dayOfWeek, - state.dataWeatherManager->RunPeriodDesignInput(1).monWeekDay); + runPeriodDesignInput1.startMonth, + runPeriodDesignInput1.startDay, + runPeriodDesignInput1.dayOfWeek, + runPeriodDesignInput1.monWeekDay); } } } @@ -6158,8 +5495,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN June 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine reads any special day period data from the IDF and @@ -6194,28 +5529,35 @@ namespace WeatherManager { // \key CustomDay1 // \key CustomDay2 - state.dataIPShortCut->cCurrentModuleObject = "RunPeriodControl:SpecialDays"; - int NumSpecDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + constexpr std::string_view routineName = "GetSpecialDayPeriodData"; + + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "RunPeriodControl:SpecialDays"; + int NumSpecDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); int Count; - if (allocated(state.dataWeatherManager->SpecialDays)) { // EPW already allocated the array - Count = state.dataWeatherManager->NumSpecialDays - NumSpecDays + 1; + if (allocated(state.dataWeather->SpecialDays)) { // EPW already allocated the array + Count = state.dataWeather->NumSpecialDays - NumSpecDays + 1; } else { - state.dataWeatherManager->SpecialDays.allocate(NumSpecDays); - state.dataWeatherManager->NumSpecialDays = NumSpecDays; + state.dataWeather->SpecialDays.allocate(NumSpecDays); + state.dataWeather->NumSpecialDays = NumSpecDays; Count = 1; } - for (int i = 1; i <= NumSpecDays; ++i) { + Array1D_string AlphArray(3); + int NumAlphas; + Array1D Duration(1); + int NumNumbers; + int IOStat; + + for (int i = 1; i <= NumSpecDays; ++i, ++Count) { - Array1D_string AlphArray(3); - int NumAlphas; - Array1D Duration(1); - int NumNumbers; - int IOStat; state.dataInputProcessing->inputProcessor->getObjectItem( - state, state.dataIPShortCut->cCurrentModuleObject, i, AlphArray, NumAlphas, Duration, NumNumbers, IOStat); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); - state.dataWeatherManager->SpecialDays(Count).Name = AlphArray(1); + state, ipsc->cCurrentModuleObject, i, AlphArray, NumAlphas, Duration, NumNumbers, IOStat); + + auto &specialDay = state.dataWeather->SpecialDays(Count); + + specialDay.Name = AlphArray(1); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, specialDay.Name}; int PMonth; int PDay; @@ -6223,54 +5565,39 @@ namespace WeatherManager { DateType dateType; General::ProcessDateString(state, AlphArray(2), PMonth, PDay, PWeekDay, dateType, ErrorsFound); if (dateType == DateType::MonthDay) { - state.dataWeatherManager->SpecialDays(Count).DateType = dateType; - state.dataWeatherManager->SpecialDays(Count).Month = PMonth; - state.dataWeatherManager->SpecialDays(Count).Day = PDay; - state.dataWeatherManager->SpecialDays(Count).WeekDay = 0; - state.dataWeatherManager->SpecialDays(Count).CompDate = PMonth * 32 + PDay; - state.dataWeatherManager->SpecialDays(Count).WthrFile = false; + specialDay.dateType = dateType; + specialDay.Month = PMonth; + specialDay.Day = PDay; + specialDay.WeekDay = 0; + specialDay.CompDate = PMonth * 32 + PDay; + specialDay.WthrFile = false; } else if (dateType != DateType::Invalid) { - state.dataWeatherManager->SpecialDays(Count).DateType = dateType; - state.dataWeatherManager->SpecialDays(Count).Month = PMonth; - state.dataWeatherManager->SpecialDays(Count).Day = PDay; - state.dataWeatherManager->SpecialDays(Count).WeekDay = PWeekDay; - state.dataWeatherManager->SpecialDays(Count).CompDate = 0; - state.dataWeatherManager->SpecialDays(Count).WthrFile = false; + specialDay.dateType = dateType; + specialDay.Month = PMonth; + specialDay.Day = PDay; + specialDay.WeekDay = PWeekDay; + specialDay.CompDate = 0; + specialDay.WthrFile = false; } else if (dateType == DateType::Invalid) { - ShowSevereError(state, - format("{}: {} Invalid {}={}", - state.dataIPShortCut->cCurrentModuleObject, - AlphArray(1), - state.dataIPShortCut->cAlphaFieldNames(2), - AlphArray(2))); + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), AlphArray(2)); ErrorsFound = true; } if (Duration(1) > 0) { - state.dataWeatherManager->SpecialDays(Count).Duration = int(Duration(1)); + specialDay.Duration = int(Duration(1)); } else { - ShowSevereError(state, - format("{}: {} Invalid {}={:.0T}", - state.dataIPShortCut->cCurrentModuleObject, - AlphArray(1), - state.dataIPShortCut->cNumericFieldNames(1), - Duration(1))); + ShowSevereError( + state, format("{}: {} Invalid {}={:.0T}", ipsc->cCurrentModuleObject, AlphArray(1), ipsc->cNumericFieldNames(1), Duration(1))); ErrorsFound = true; } int DayType = getEnumValue(ScheduleManager::dayTypeNamesUC, AlphArray(3)); if (DayType == 0) { - ShowSevereError(state, - format("{}: {} Invalid {}={}", - state.dataIPShortCut->cCurrentModuleObject, - AlphArray(1), - state.dataIPShortCut->cAlphaFieldNames(3), - AlphArray(3))); + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(3), AlphArray(3)); ErrorsFound = true; } else { - state.dataWeatherManager->SpecialDays(Count).DayType = DayType; + specialDay.DayType = DayType; } - ++Count; } } @@ -6280,8 +5607,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN June 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine creates the array of Special Day types used during @@ -6290,33 +5615,26 @@ namespace WeatherManager { // METHODOLOGY EMPLOYED: // Sets up the SpecialDayTypes array that then is used during simulation. - state.dataWeatherManager->SpecialDayTypes = 0; // Initialize/Reset Special Day Types array + state.dataWeather->SpecialDayTypes = 0; // Initialize/Reset Special Day Types array - for (int i = 1; i <= state.dataWeatherManager->NumSpecialDays; ++i) { - - if (state.dataWeatherManager->SpecialDays(i).WthrFile) continue; + for (int i = 1; i <= state.dataWeather->NumSpecialDays; ++i) { + auto const &specialDay = state.dataWeather->SpecialDays(i); + if (specialDay.WthrFile) continue; int Warn = 0; - int JDay = General::OrdinalDay(state.dataWeatherManager->SpecialDays(i).Month, - state.dataWeatherManager->SpecialDays(i).Day, - state.dataWeatherManager->LeapYearAdd) - - 1; + int JDay = General::OrdinalDay(specialDay.Month, specialDay.Day, state.dataWeather->LeapYearAdd) - 1; - for (int j = 1; j <= state.dataWeatherManager->SpecialDays(i).Duration; ++j) { + for (int j = 1; j <= specialDay.Duration; ++j) { ++JDay; if (JDay > 366) { - ShowWarningError(state, - format("SpecialDay={} causes index of more than 366, ignoring those beyond 366", - state.dataWeatherManager->SpecialDays(i).Name)); + ShowWarningError(state, format("SpecialDay={} causes index of more than 366, ignoring those beyond 366", specialDay.Name)); } else { - if (state.dataWeatherManager->SpecialDayTypes(JDay) != 0 && Warn == 0) { - ShowWarningError( - state, - format("SpecialDay={} attempted overwrite of previous set special day", state.dataWeatherManager->SpecialDays(i).Name)); + if (state.dataWeather->SpecialDayTypes(JDay) != 0 && Warn == 0) { + ShowWarningError(state, format("SpecialDay={} attempted overwrite of previous set special day", specialDay.Name)); Warn = 1; - } else if (state.dataWeatherManager->SpecialDayTypes(JDay) == 0) { - state.dataWeatherManager->SpecialDayTypes(JDay) = state.dataWeatherManager->SpecialDays(i).DayType; + } else if (state.dataWeather->SpecialDayTypes(JDay) == 0) { + state.dataWeather->SpecialDayTypes(JDay) = specialDay.DayType; } } } @@ -6329,8 +5647,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN August 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine gets a possible "Daylight Saving Period" from the IDF. Using this @@ -6356,77 +5672,73 @@ namespace WeatherManager { // \memo can be Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday // \memo can be 1 or 1st, 2 or 2nd, etc. up to 5(?) - state.dataIPShortCut->cCurrentModuleObject = "RunPeriodControl:DaylightSavingTime"; - int NumFound = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + constexpr std::string_view routineName = "GetDSTData"; + + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "RunPeriodControl:DaylightSavingTime"; + int NumFound = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (NumFound == 1) { int NumAlphas; int IOStat; int NumNumbers; state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, 1, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + if (NumAlphas != 2) { - ShowSevereError(state, format("{}: Insufficient fields, must have Start AND End Dates", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Insufficient fields, must have Start AND End Dates", ipsc->cCurrentModuleObject)); ErrorsFound = true; } else { // Correct number of arguments General::ProcessDateString(state, - state.dataIPShortCut->cAlphaArgs(1), - state.dataWeatherManager->IDFDST.StMon, - state.dataWeatherManager->IDFDST.StDay, - state.dataWeatherManager->IDFDST.StWeekDay, - state.dataWeatherManager->IDFDST.StDateType, + ipsc->cAlphaArgs(1), + state.dataWeather->IDFDST.StMon, + state.dataWeather->IDFDST.StDay, + state.dataWeather->IDFDST.StWeekDay, + state.dataWeather->IDFDST.StDateType, ErrorsFound); - if (state.dataWeatherManager->IDFDST.StDateType == DateType::Invalid) { - ShowSevereError(state, - format("{}: Invalid {}={}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(1), - state.dataIPShortCut->cAlphaArgs(1))); + if (state.dataWeather->IDFDST.StDateType == DateType::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } General::ProcessDateString(state, - state.dataIPShortCut->cAlphaArgs(2), - state.dataWeatherManager->IDFDST.EnMon, - state.dataWeatherManager->IDFDST.EnDay, - state.dataWeatherManager->IDFDST.EnWeekDay, - state.dataWeatherManager->IDFDST.EnDateType, + ipsc->cAlphaArgs(2), + state.dataWeather->IDFDST.EnMon, + state.dataWeather->IDFDST.EnDay, + state.dataWeather->IDFDST.EnWeekDay, + state.dataWeather->IDFDST.EnDateType, ErrorsFound); - if (state.dataWeatherManager->IDFDST.EnDateType == DateType::Invalid) { - ShowSevereError(state, - format("{}: Invalid {}={}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2))); + if (state.dataWeather->IDFDST.EnDateType == DateType::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } - state.dataWeatherManager->IDFDaylightSaving = true; + state.dataWeather->IDFDaylightSaving = true; } } else if (NumFound > 1) { - ShowSevereError(state, format("{}: Too many objects in Input File, only one allowed.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Too many objects in Input File, only one allowed.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } } void GetDesignDayData(EnergyPlusData &state, - int &TotDesDays, // Total number of Design days to Setup + int TotDesDays, // Total number of Design days to Setup bool &ErrorsFound) { // SUBROUTINE INFORMATION: // AUTHOR Richard Liesen // DATE WRITTEN September 1997 - // MODIFIED - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine retrieves the design day info from user input file @@ -6461,7 +5773,7 @@ namespace WeatherManager { // N13, \field ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) // N14; \field Sky Clearness - static constexpr std::array(DDHumIndType::Num)> DDHumIndTypeStringRep = { + static constexpr std::array(DesDayHumIndType::Num)> DesDayHumIndTypeStringRep = { "Wetbulb [C]", "Dewpoint [C]", "Enthalpy [J/kg]", @@ -6475,46 +5787,36 @@ namespace WeatherManager { static constexpr std::array DefaultTempRangeMult = {0.88, 0.92, 0.95, 0.98, 1.0, 0.98, 0.91, 0.74, 0.55, 0.38, 0.23, 0.13, 0.05, 0.00, 0.00, 0.06, 0.14, 0.24, 0.39, 0.50, 0.59, 0.68, 0.75, 0.82}; + static constexpr std::string_view routineName = "GetDesignDayData"; + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: std::string units; OutputProcessor::Unit unitType; - state.dataWeatherManager->DesDayInput.allocate(TotDesDays); // Allocate the array to the # of DD's - state.dataWeatherManager->DDDBRngModifier.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, TotDesDays); - state.dataWeatherManager->DDDBRngModifier = 0.0; - state.dataWeatherManager->DDHumIndModifier.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, TotDesDays); - state.dataWeatherManager->DDHumIndModifier = 0.0; - state.dataWeatherManager->DDBeamSolarValues.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, TotDesDays); - state.dataWeatherManager->DDBeamSolarValues = 0.0; - state.dataWeatherManager->DDDiffuseSolarValues.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, TotDesDays); - state.dataWeatherManager->DDDiffuseSolarValues = 0.0; - state.dataWeatherManager->DDSkyTempScheduleValues.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, TotDesDays); - state.dataWeatherManager->DDSkyTempScheduleValues = 0.0; - - state.dataWeatherManager->SPSiteDryBulbRangeModScheduleValue.dimension(TotDesDays, 0.0); - state.dataWeatherManager->SPSiteHumidityConditionScheduleValue.dimension(TotDesDays, 0.0); - state.dataWeatherManager->SPSiteBeamSolarScheduleValue.dimension(TotDesDays, 0.0); - state.dataWeatherManager->SPSiteDiffuseSolarScheduleValue.dimension(TotDesDays, 0.0); - state.dataWeatherManager->SPSiteSkyTemperatureScheduleValue.dimension(TotDesDays, 0.0); + state.dataWeather->DesDayInput.allocate(TotDesDays); // Allocate the array to the # of DD's + state.dataWeather->desDayMods.allocate(TotDesDays); + for (int iDD = 1; iDD <= TotDesDays; ++iDD) + state.dataWeather->desDayMods(iDD).allocate(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + + state.dataWeather->spSiteSchedules.dimension(TotDesDays, Weather::SPSiteSchedules()); if (state.dataSysVars->ReverseDD && TotDesDays <= 1) { ShowSevereError(state, "GetDesignDayData: Reverse Design Day requested but # Design Days <=1"); } - state.dataIPShortCut->cCurrentModuleObject = "SizingPeriod:DesignDay"; - for (int i = 1; i <= TotDesDays; ++i) { + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "SizingPeriod:DesignDay"; + for (int iDesDay = 1; iDesDay <= TotDesDays; ++iDesDay) { int EnvrnNum; - if (state.dataSysVars->ReverseDD) { - if (i == 1 && TotDesDays > 1) { - EnvrnNum = 2; - } else if (i == 2) { - EnvrnNum = 1; - } else { - EnvrnNum = i; - } + if (!state.dataSysVars->ReverseDD) { + EnvrnNum = iDesDay; + } else if (iDesDay == 1 && TotDesDays > 1) { + EnvrnNum = 2; + } else if (iDesDay == 2) { + EnvrnNum = 1; } else { - EnvrnNum = i; + EnvrnNum = iDesDay; } // Call Input Get routine to retrieve design day data @@ -6524,946 +5826,627 @@ namespace WeatherManager { int NumNumerics; // Number of material properties being passed int IOStat; // IO Status when calling get input subroutine state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, - i, - state.dataIPShortCut->cAlphaArgs, + ipsc->cCurrentModuleObject, + iDesDay, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumerics, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); - state.dataWeatherManager->DesDayInput(EnvrnNum).Title = state.dataIPShortCut->cAlphaArgs(1); // Environment name - state.dataWeatherManager->Environment(EnvrnNum).Title = state.dataWeatherManager->DesDayInput(EnvrnNum).Title; + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + auto &envCurr = state.dataWeather->Environment(EnvrnNum); + auto &desDayInput = state.dataWeather->DesDayInput(EnvrnNum); + desDayInput.Title = ipsc->cAlphaArgs(1); // Environment name + envCurr.Title = desDayInput.Title; + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, desDayInput.Title}; // N3, \field Maximum Dry-Bulb Temperature // N4, \field Daily Dry-Bulb Temperature Range // N9, \field Barometric Pressure // N10, \field Wind Speed // N11, \field Wind Direction - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb = state.dataIPShortCut->rNumericArgs(3); // Maximum Dry-Bulb Temperature (C) - if (!state.dataIPShortCut->lNumericFieldBlanks(3)) MaxDryBulbEntered = true; - state.dataWeatherManager->DesDayInput(EnvrnNum).DailyDBRange = - state.dataIPShortCut->rNumericArgs(4); // Daily dry-bulb temperature range (deltaC) - state.dataWeatherManager->DesDayInput(EnvrnNum).PressBarom = - state.dataIPShortCut->rNumericArgs(9); // Atmospheric/Barometric Pressure (Pascals) - if (!state.dataIPShortCut->lNumericFieldBlanks(9)) PressureEntered = true; - state.dataWeatherManager->DesDayInput(EnvrnNum).PressureEntered = PressureEntered; - state.dataWeatherManager->DesDayInput(EnvrnNum).WindSpeed = state.dataIPShortCut->rNumericArgs(10); // Wind Speed (m/s) - state.dataWeatherManager->DesDayInput(EnvrnNum).WindDir = mod(state.dataIPShortCut->rNumericArgs(11), 360.0); // Wind Direction + desDayInput.MaxDryBulb = ipsc->rNumericArgs(3); // Maximum Dry-Bulb Temperature (C) + MaxDryBulbEntered = !ipsc->lNumericFieldBlanks(3); + desDayInput.DailyDBRange = ipsc->rNumericArgs(4); // Daily dry-bulb temperature range (deltaC) + desDayInput.PressBarom = ipsc->rNumericArgs(9); // Atmospheric/Barometric Pressure (Pascals) + PressureEntered = !ipsc->lNumericFieldBlanks(9); + desDayInput.PressureEntered = PressureEntered; + desDayInput.WindSpeed = ipsc->rNumericArgs(10); // Wind Speed (m/s) + desDayInput.WindDir = mod(ipsc->rNumericArgs(11), 360.0); // Wind Direction // (degrees clockwise from North, N=0, E=90, S=180, W=270) // N1, \field Month // N2, \field Day of Month // N12, \field ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) // N13, \field ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) // N8, \field Daily Wet-Bulb Temperature Range - state.dataWeatherManager->DesDayInput(EnvrnNum).Month = int(state.dataIPShortCut->rNumericArgs(1)); // Month of Year ( 1 - 12 ) - state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth = int(state.dataIPShortCut->rNumericArgs(2)); // Day of Month ( 1 - 31 ) - state.dataWeatherManager->DesDayInput(EnvrnNum).TauB = state.dataIPShortCut->rNumericArgs(12); // beam tau >= 0 - state.dataWeatherManager->DesDayInput(EnvrnNum).TauD = state.dataIPShortCut->rNumericArgs(13); // diffuse tau >= 0 - state.dataWeatherManager->DesDayInput(EnvrnNum).DailyWBRange = - state.dataIPShortCut->rNumericArgs(8); // Daily wet-bulb temperature range (deltaC) + desDayInput.Month = int(ipsc->rNumericArgs(1)); // Month of Year ( 1 - 12 ) + desDayInput.DayOfMonth = int(ipsc->rNumericArgs(2)); // Day of Month ( 1 - 31 ) + desDayInput.TauB = ipsc->rNumericArgs(12); // beam tau >= 0 + desDayInput.TauD = ipsc->rNumericArgs(13); // diffuse tau >= 0 + desDayInput.DailyWBRange = ipsc->rNumericArgs(8); // Daily wet-bulb temperature range (deltaC) // N14; \field Sky Clearness - state.dataWeatherManager->DesDayInput(EnvrnNum).SkyClear = state.dataIPShortCut->rNumericArgs(14); // Sky Clearness (0 to 1) + desDayInput.SkyClear = ipsc->rNumericArgs(14); // Sky Clearness (0 to 1) // N15, \field Maximum Warmup Days Between Sizing Periods - if (state.dataIPShortCut->lNumericFieldBlanks(15)) { + if (ipsc->lNumericFieldBlanks(15)) { // Default to -1 if not input - state.dataWeatherManager->DesDayInput(EnvrnNum).maxWarmupDays = -1; + desDayInput.maxWarmupDays = -1; } else { - state.dataWeatherManager->DesDayInput(EnvrnNum).maxWarmupDays = int(state.dataIPShortCut->rNumericArgs(15)); + desDayInput.maxWarmupDays = int(ipsc->rNumericArgs(15)); } // A13, \field Begin Environment Reset Mode - if (state.dataIPShortCut->lAlphaFieldBlanks(13)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).suppressBegEnvReset = false; + if (ipsc->lAlphaFieldBlanks(13)) { + desDayInput.suppressBegEnvReset = false; } else { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(13), "FullResetAtBeginEnvironment")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).suppressBegEnvReset = false; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(13), "SuppressThermalResetAtBeginEnvironment")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).suppressBegEnvReset = true; + if (Util::SameString(ipsc->cAlphaArgs(13), "FullResetAtBeginEnvironment")) { + desDayInput.suppressBegEnvReset = false; + } else if (Util::SameString(ipsc->cAlphaArgs(13), "SuppressThermalResetAtBeginEnvironment")) { + desDayInput.suppressBegEnvReset = true; } } // for PerformancePrecisionTradeoffs if (state.dataEnvrn->forceBeginEnvResetSuppress) { - state.dataWeatherManager->DesDayInput(EnvrnNum).suppressBegEnvReset = true; + desDayInput.suppressBegEnvReset = true; } // A7, \field Rain Indicator - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "Yes")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).RainInd = 1; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(7), "No") || state.dataIPShortCut->lAlphaFieldBlanks(7)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).RainInd = 0; + BooleanSwitch b; + + if (ipsc->lAlphaFieldBlanks(7)) { + desDayInput.RainInd = 0; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(7)))) != BooleanSwitch::Invalid) { + desDayInput.RainInd = (int)b; } else { - ShowWarningError(state, - format("{}=\"{}\", invalid field: {}=\"{}\".", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title, - state.dataIPShortCut->cAlphaFieldNames(7), - state.dataIPShortCut->cAlphaArgs(7))); - ShowContinueError(state, "\"No\" will be used."); - state.dataWeatherManager->DesDayInput(EnvrnNum).RainInd = 0; + ShowWarningInvalidBool(state, eoh, ipsc->cAlphaFieldNames(7), ipsc->cAlphaArgs(7), "No"); + desDayInput.RainInd = 0; } // A8, \field Snow Indicator - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "Yes")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).SnowInd = 1; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), "No") || state.dataIPShortCut->lAlphaFieldBlanks(8)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).SnowInd = 0; + if (ipsc->lAlphaFieldBlanks(8)) { + desDayInput.SnowInd = 0; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(8)))) != BooleanSwitch::Invalid) { + desDayInput.SnowInd = (int)b; } else { - ShowWarningError(state, - format("{}=\"{}\", invalid field: {}=\"{}\".", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title, - state.dataIPShortCut->cAlphaFieldNames(8), - state.dataIPShortCut->cAlphaArgs(8))); - ShowContinueError(state, "\"No\" will be used."); - state.dataWeatherManager->DesDayInput(EnvrnNum).SnowInd = 0; + ShowWarningInvalidBool(state, eoh, ipsc->cAlphaFieldNames(8), ipsc->cAlphaArgs(8), "No"); + desDayInput.SnowInd = 0; } // A3, \field Dry-Bulb Temperature Range Modifier Type // check DB profile input - if (state.dataIPShortCut->lAlphaFieldBlanks(3) || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "DefaultMultipliers")) { - state.dataIPShortCut->cAlphaArgs(3) = "DefaultMultipliers"; - state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType = DDDBRangeType::Default; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "Multiplier") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "MultiplierSchedule")) { - state.dataIPShortCut->cAlphaArgs(3) = "MultiplierSchedule"; - state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType = DDDBRangeType::Multiplier; + if (ipsc->lAlphaFieldBlanks(3)) { + desDayInput.dryBulbRangeType = DesDayDryBulbRangeType::Default; + } else if ((desDayInput.dryBulbRangeType = static_cast( + getEnumValue(DesDayDryBulbRangeTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(3))))) != DesDayDryBulbRangeType::Invalid) { + } else { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); + ErrorsFound = true; + desDayInput.dryBulbRangeType = DesDayDryBulbRangeType::Default; + } + + if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Multiplier) { units = "[]"; unitType = OutputProcessor::Unit::None; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "Difference") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "Delta") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "DifferenceSchedule") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "DeltaSchedule")) { - state.dataIPShortCut->cAlphaArgs(3) = "DifferenceSchedule"; - state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType = DDDBRangeType::Difference; + } else if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Difference) { units = "[deltaC]"; unitType = OutputProcessor::Unit::deltaC; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "TemperatureProfileSchedule")) { - state.dataIPShortCut->cAlphaArgs(3) = "TemperatureProfileSchedule"; - state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType = DDDBRangeType::Profile; + } else if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Profile) { units = "[C]"; unitType = OutputProcessor::Unit::C; - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); - ErrorsFound = true; - state.dataIPShortCut->cAlphaArgs(3) = "invalid field"; - state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType = DDDBRangeType::Default; } - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType != DDDBRangeType::Profile && !MaxDryBulbEntered && - state.dataIPShortCut->cAlphaArgs(3) != "invalid field") { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid blank field: {}", state.dataIPShortCut->cNumericFieldNames(3))); - ShowContinueError(state, - format("..this field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3))); + if (desDayInput.dryBulbRangeType != DesDayDryBulbRangeType::Profile && !MaxDryBulbEntered && ipsc->cAlphaArgs(3) != "invalid field") { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(3), ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } // Assume either "multiplier" option will make full use of range... - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType != DDDBRangeType::Difference && - state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType != DDDBRangeType::Profile) { - Real64 testval = - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb - state.dataWeatherManager->DesDayInput(EnvrnNum).DailyDBRange; - bool errFlag = false; - state.dataInputProcessing->inputProcessor->rangeCheck(state, - errFlag, - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cCurrentModuleObject, - "Severe", - ">= -90", - (testval >= -90.0), - "<= 70", - (testval <= 70.0), - {}, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title); - if (errFlag) { + if (desDayInput.dryBulbRangeType != DesDayDryBulbRangeType::Difference && + desDayInput.dryBulbRangeType != DesDayDryBulbRangeType::Profile) { + Real64 testval = desDayInput.MaxDryBulb - desDayInput.DailyDBRange; + if (testval < -90.0 || testval > 70.0) { + ShowSevereError(state, format("{}: {} = {}", routineName, ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("{} ({.2R}) is out of range [-90.0, 70.0]", ipsc->cAlphaFieldNames(3), testval)); ErrorsFound = true; } } // A4, \field Dry-Bulb Temperature Range Modifier Day Schedule Name - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DBTempRangeType != DDDBRangeType::Default) { - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).TempRangeSchPtr = - ScheduleManager::GetDayScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).TempRangeSchPtr == 0) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, - format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4))); - ErrorsFound = true; - } else { - ScheduleManager::GetSingleDayScheduleValues(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).TempRangeSchPtr, - state.dataWeatherManager->DDDBRngModifier(_, _, EnvrnNum)); - int schPtr = General::FindNumberInList(state.dataWeatherManager->DesDayInput(EnvrnNum).TempRangeSchPtr, - state.dataWeatherManager->SPSiteScheduleNamePtr, - state.dataWeatherManager->NumSPSiteScheduleNamePtrs); - if ((schPtr == 0) || (state.dataWeatherManager->SPSiteScheduleUnits(schPtr) != units)) { - ++state.dataWeatherManager->NumSPSiteScheduleNamePtrs; - state.dataWeatherManager->SPSiteScheduleNamePtr(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = - state.dataWeatherManager->DesDayInput(EnvrnNum).TempRangeSchPtr; - state.dataWeatherManager->SPSiteScheduleUnits(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = units; - SetupOutputVariable(state, - "Sizing Period Site Drybulb Temperature Range Modifier Schedule Value", - unitType, - state.dataWeatherManager->SPSiteDryBulbRangeModScheduleValue(EnvrnNum), - OutputProcessor::SOVTimeStepType::Zone, - OutputProcessor::SOVStoreType::Average, - state.dataIPShortCut->cAlphaArgs(4)); - } - if (state.dataIPShortCut->cAlphaArgs(3) == "MultiplierSchedule") { - if (!ScheduleManager::CheckDayScheduleValueMinMax( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).TempRangeSchPtr, 0.0, false, 1.0, false)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4))); - ShowContinueError(state, "..Specified [Schedule] Dry-bulb Range Multiplier Values are not within [0.0, 1.0]"); - ErrorsFound = true; - } - } else if (state.dataIPShortCut->cAlphaArgs(3) == "DifferenceSchedule") { // delta, must be > 0.0 - if (!ScheduleManager::CheckDayScheduleValueMinMax( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).TempRangeSchPtr, 0.0, false)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4))); - ShowSevereError(state, "Some [Schedule] Dry-bulb Range Difference Values are < 0.0 [would make max larger]."); - ErrorsFound = true; - } - } - if (state.dataIPShortCut->cAlphaArgs(3) == "TemperatureProfileSchedule") { - Real64 testval = maxval(state.dataWeatherManager->DDDBRngModifier(_, _, EnvrnNum)); - if (MaxDryBulbEntered) { - ShowWarningError(state, - format("{}=\"{}\", data override.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..{}=[{:.2R}] will be overwritten.", - state.dataIPShortCut->cNumericFieldNames(3), - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb)); - ShowContinueError( - state, format("..{}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); - ShowContinueError(state, format("..with max value=[{:.2R}].", testval)); - } - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb = testval; - } - Real64 testval = maxval(state.dataWeatherManager->DDDBRngModifier(_, _, EnvrnNum)); - testval = state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb - testval; - bool errFlag = false; - state.dataInputProcessing->inputProcessor->rangeCheck(state, - errFlag, - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cCurrentModuleObject, - "Severe", - ">= -90", - (testval >= -90.0), - "<= 70", - (testval <= 70.0), - {}, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title); - if (errFlag) { - ErrorsFound = true; - } - } - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cAlphaFieldNames(4))); - ShowContinueError(state, format("..required when {} indicates \"SCHEDULE\".", state.dataIPShortCut->cAlphaFieldNames(3))); - ErrorsFound = true; - } - } else { + if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Default) { // Default dry-bulb temperature Range Real64 LastHrValue = DefaultTempRangeMult[23]; - for (int hour = 1; hour <= 24; ++hour) { + for (int hour = 1; hour <= Constant::HoursInDay; ++hour) { for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - Real64 WNow = state.dataWeatherManager->Interpolation(ts); + Real64 WNow = state.dataWeather->Interpolation(ts); Real64 WPrev = 1.0 - WNow; - state.dataWeatherManager->DDDBRngModifier(ts, hour, EnvrnNum) = LastHrValue * WPrev + DefaultTempRangeMult[hour - 1] * WNow; + state.dataWeather->desDayMods(EnvrnNum)(ts, hour).OutDryBulbTemp = + LastHrValue * WPrev + DefaultTempRangeMult[hour - 1] * WNow; } LastHrValue = DefaultTempRangeMult[hour - 1]; } + + } else if (ipsc->lAlphaFieldBlanks(4)) { + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaFieldNames(3), "SCHEDULE"); + ErrorsFound = true; + + } else if ((desDayInput.TempRangeSchPtr = ScheduleManager::GetDayScheduleIndex(state, ipsc->cAlphaArgs(4))) == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4)); + ErrorsFound = true; + + } else { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetSingleDayScheduleValues(state, desDayInput.TempRangeSchPtr, tmp); + auto &desDayModEnvrn = state.dataWeather->desDayMods(EnvrnNum); + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) { + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) { + desDayModEnvrn(iTS, iHr).OutDryBulbTemp = tmp(iTS, iHr); + } + } + + if (std::find(state.dataWeather->spSiteSchedNums.begin(), state.dataWeather->spSiteSchedNums.end(), desDayInput.TempRangeSchPtr) == + state.dataWeather->spSiteSchedNums.end()) { + state.dataWeather->spSiteSchedNums.emplace_back(desDayInput.TempRangeSchPtr); + SetupOutputVariable(state, + "Sizing Period Site Drybulb Temperature Range Modifier Schedule Value", + unitType, + state.dataWeather->spSiteSchedules(EnvrnNum).OutDryBulbTemp, + OutputProcessor::SOVTimeStepType::Zone, + OutputProcessor::SOVStoreType::Average, + ipsc->cAlphaArgs(4)); + } + + if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Multiplier) { + if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.TempRangeSchPtr, 0.0, false, 1.0, false)) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4))); + ShowContinueError(state, "..Specified [Schedule] Dry-bulb Range Multiplier Values are not within [0.0, 1.0]"); + ErrorsFound = true; + } + } else if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Difference) { // delta, must be > 0.0 + if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.TempRangeSchPtr, 0.0, false)) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4))); + ShowSevereError(state, "Some [Schedule] Dry-bulb Range Difference Values are < 0.0 [would make max larger]."); + ErrorsFound = true; + } + } + + auto const &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + Real64 testval = std::numeric_limits::min(); + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) { + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) { + if (desDayModsEnvrn(iTS, iHr).OutDryBulbTemp > testval) testval = desDayModsEnvrn(iTS, iHr).OutDryBulbTemp; + } + } + + if (desDayInput.dryBulbRangeType == DesDayDryBulbRangeType::Profile) { + if (MaxDryBulbEntered) { + ShowWarningError(state, format("{}=\"{}\", data override.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..{}=[{:.2R}] will be overwritten.", ipsc->cNumericFieldNames(3), desDayInput.MaxDryBulb)); + ShowContinueError(state, format("..{}=\"{}\".", ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3))); + ShowContinueError(state, format("..with max value=[{:.2R}].", testval)); + } + desDayInput.MaxDryBulb = testval; + } + + testval = desDayInput.MaxDryBulb - testval; + if (testval < -90.0 || testval > 70.0) { + ShowSevereError(state, format("{}: {} = {}", routineName, ipsc->cCurrentModuleObject, desDayInput.Title)); + // should this be cNumericFieldNames? + ShowContinueError(state, format("{} = ({.2R}) is out of range [-90.0, 70.0]", ipsc->cAlphaFieldNames(4), testval)); + ErrorsFound = true; + } } // A5, \field Humidity Condition Type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "WetBulb")) { - state.dataIPShortCut->cAlphaArgs(5) = "WetBulb"; + desDayInput.HumIndType = static_cast(getEnumValue(DesDayHumIndTypeNamesUC, Util::makeUPPER(ipsc->cAlphaArgs(5)))); + + switch (desDayInput.HumIndType) { + case DesDayHumIndType::WetBulb: { // N5, \field Wetbulb or DewPoint at Maximum Dry-Bulb - if (!state.dataIPShortCut->lNumericFieldBlanks(5)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - state.dataIPShortCut->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(5))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + if (ipsc->lNumericFieldBlanks(5)) { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(5), ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; + } else { + desDayInput.HumIndValue = ipsc->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb } - bool errFlag = false; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::WetBulb; - state.dataInputProcessing->inputProcessor->rangeCheck(state, - errFlag, - state.dataIPShortCut->cAlphaFieldNames(5) + " - Wet-Bulb", - state.dataIPShortCut->cCurrentModuleObject, - "Severe", - ">= -90", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue >= -90.0), - "<= 70", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue <= 70.0), - {}, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title); - if (errFlag) { - // CALL ShowContinueError(state, TRIM(state.dataIPShortCut->cCurrentModuleObject)//': Occured in - // '//TRIM(DesDayInput(EnvrnNum)%Title)) + + if (desDayInput.HumIndValue < -90.0 || desDayInput.HumIndValue > 70.0) { + ShowSevereError(state, format("{}: {} = {}", routineName, ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError( + state, format("{} = {.2R} is out of range [-90.0, 70.0]", ipsc->cAlphaFieldNames(5) + " - WetBulb", desDayInput.HumIndValue)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "DewPoint")) { - state.dataIPShortCut->cAlphaArgs(5) = "DewPoint"; - if (!state.dataIPShortCut->lNumericFieldBlanks(5)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - state.dataIPShortCut->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(5))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + } break; + + case DesDayHumIndType::DewPoint: { + if (ipsc->lNumericFieldBlanks(5)) { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(5), ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; + } else { + desDayInput.HumIndValue = ipsc->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb } - bool errFlag = false; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::DewPoint; - state.dataInputProcessing->inputProcessor->rangeCheck(state, - errFlag, - state.dataIPShortCut->cAlphaFieldNames(5) + " - Dew-Point", - state.dataIPShortCut->cCurrentModuleObject, - "Severe", - ">= -90", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue >= -90.0), - "<= 70", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue <= 70.0), - {}, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title); - if (errFlag) { + + if (desDayInput.HumIndValue < -90.0 || desDayInput.HumIndValue > 70.0) { + ShowSevereError(state, format("{}: {} = {}", routineName, ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError( + state, + format("{} = {.2R} is out of range [-90.0, 70.0]", ipsc->cAlphaFieldNames(5) + " - DewPoint", desDayInput.HumIndValue)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "HumidityRatio")) { - state.dataIPShortCut->cAlphaArgs(5) = "HumidityRatio"; + } break; + + case DesDayHumIndType::HumRatio: { // N6, \field Humidity Ratio at Maximum Dry-Bulb - if (!state.dataIPShortCut->lNumericFieldBlanks(6)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - state.dataIPShortCut->rNumericArgs(6); // Humidity Indicating Conditions at Max Dry-Bulb - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(6))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + if (ipsc->lNumericFieldBlanks(6)) { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(6), ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; + } else { + desDayInput.HumIndValue = ipsc->rNumericArgs(6); // Humidity Indicating Conditions at Max Dry-Bulb } - bool errFlag = false; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::HumRatio; - state.dataInputProcessing->inputProcessor->rangeCheck(state, - errFlag, - state.dataIPShortCut->cAlphaFieldNames(5) + " - Humidity-Ratio", - state.dataIPShortCut->cCurrentModuleObject, - "Severe", - ">= 0", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue >= 0.0), - "<= .03", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue <= 0.03), - {}, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title); - if (errFlag) { + + if (desDayInput.HumIndValue < 0.0 || desDayInput.HumIndValue > 0.03) { + ShowSevereError(state, format("{}: {} = {}", routineName, ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError( + state, + format("{} = {.2R} is out of range [0.0, 0.03]", ipsc->cAlphaFieldNames(5) + " - Humidity-Ratio", desDayInput.HumIndValue)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "Enthalpy")) { - state.dataIPShortCut->cAlphaArgs(5) = "Enthalpy"; + } break; + + case DesDayHumIndType::Enthalpy: { // N7, \field Enthalpy at Maximum Dry-Bulb {J/kg}. - if (!state.dataIPShortCut->lNumericFieldBlanks(7)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - state.dataIPShortCut->rNumericArgs(7); // Humidity Indicating Conditions at Max Dry-Bulb - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(7))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + if (ipsc->lNumericFieldBlanks(7)) { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(7), ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; + } else { + desDayInput.HumIndValue = ipsc->rNumericArgs(7); // Humidity Indicating Conditions at Max Dry-Bulb } - bool errFlag = false; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::Enthalpy; - state.dataInputProcessing->inputProcessor->rangeCheck(state, - errFlag, - state.dataIPShortCut->cAlphaFieldNames(5) + " - Enthalpy", - "SizingPeriod:DesignDay", - "Severe", - ">= 0.0", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue >= 0.0), - "<= 130000", - (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue <= 130000.0), - {}, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title); - if (errFlag) { + + desDayInput.HumIndType = DesDayHumIndType::Enthalpy; + if (desDayInput.HumIndValue < 0.0 || desDayInput.HumIndValue > 130000.0) { + ShowSevereError(state, format("{}: {} = {}", routineName, ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError( + state, + format("{} = {.0R} is out of range [0.0, 130000.0]", ipsc->cAlphaFieldNames(5) + " - Enthalpy", desDayInput.HumIndValue)); ErrorsFound = true; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "RelativeHumiditySchedule")) { - state.dataIPShortCut->cAlphaArgs(5) = "RelativeHumiditySchedule"; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::RelHumSch; + } break; + + case DesDayHumIndType::RelHumSch: { units = "[%]"; unitType = OutputProcessor::Unit::Perc; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "WetBulbProfileMultiplierSchedule")) { - state.dataIPShortCut->cAlphaArgs(5) = "WetBulbProfileMultiplierSchedule"; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::WBProfMul; + } break; + + case DesDayHumIndType::WBProfMul: { units = "[]"; unitType = OutputProcessor::Unit::None; - if (!state.dataIPShortCut->lNumericFieldBlanks(5)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - state.dataIPShortCut->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(5))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + if (ipsc->lNumericFieldBlanks(5)) { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(5), ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; + } else { + desDayInput.HumIndValue = ipsc->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "WetBulbProfileDifferenceSchedule")) { - state.dataIPShortCut->cAlphaArgs(5) = "WetBulbProfileDifferenceSchedule"; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::WBProfDif; + } break; + + case DesDayHumIndType::WBProfDif: { units = "[]"; unitType = OutputProcessor::Unit::None; - if (!state.dataIPShortCut->lNumericFieldBlanks(5)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - state.dataIPShortCut->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb - } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(5))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + if (ipsc->lNumericFieldBlanks(5)) { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(5), ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; - } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "WetBulbProfileDefaultMultipliers")) { - state.dataIPShortCut->cAlphaArgs(5) = "WetBulbProfileDefaultMultipliers"; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::WBProfDef; - if (!state.dataIPShortCut->lNumericFieldBlanks(5)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = - state.dataIPShortCut->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb } else { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(5))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(5), - state.dataIPShortCut->cAlphaArgs(5))); + desDayInput.HumIndValue = ipsc->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb + } + } break; + + case DesDayHumIndType::WBProfDef: { + if (ipsc->lNumericFieldBlanks(5)) { + ShowSevereEmptyField(state, eoh, ipsc->cNumericFieldNames(5), ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5)); ErrorsFound = true; + } else { + desDayInput.HumIndValue = ipsc->rNumericArgs(5); // Humidity Indicating Conditions at Max Dry-Bulb } - } else { - ShowWarningError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5))); + } break; + + default: { + ShowWarningError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5))); ShowContinueError(state, "WetBulb will be used. Maximum Dry Bulb will be used as WetBulb at Maximum Dry Bulb."); - state.dataIPShortCut->cAlphaArgs(5) = "WetBulb"; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType = DDHumIndType::WetBulb; - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = state.dataIPShortCut->rNumericArgs(3); - } + desDayInput.HumIndType = DesDayHumIndType::WetBulb; + desDayInput.HumIndValue = ipsc->rNumericArgs(3); + } break; + } // switch (desDayInput.HumIndType) // resolve humidity schedule if needed // A6, \field Humidity Condition Day Schedule Name - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::RelHumSch || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfMul || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDif) { - if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cAlphaFieldNames(6))); - ShowContinueError(state, - format("..field is required when {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3))); + if (desDayInput.HumIndType == DesDayHumIndType::RelHumSch || desDayInput.HumIndType == DesDayHumIndType::WBProfMul || + desDayInput.HumIndType == DesDayHumIndType::WBProfDif) { + if (ipsc->lAlphaFieldBlanks(6)) { + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(6), ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; + } else if ((desDayInput.HumIndSchPtr = ScheduleManager::GetDayScheduleIndex(state, ipsc->cAlphaArgs(6))) == 0) { + ShowWarningItemNotFound(state, + eoh, + ipsc->cAlphaFieldNames(6), + ipsc->cAlphaArgs(6), + "Default Humidity (constant for day using Humidity Indicator Temp)."); + // reset HumIndType ? } else { - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr = - ScheduleManager::GetDayScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(6)); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr == 0) { - ShowWarningError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, - format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(6), state.dataIPShortCut->cAlphaArgs(6))); - ShowContinueError(state, "Default Humidity will be used (constant for day using Humidity Indicator Temp)."); - // reset HumIndType ? - } else { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetSingleDayScheduleValues(state, desDayInput.HumIndSchPtr, tmp); + + auto &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) + desDayModsEnvrn(iTS, iHr).OutRelHum = tmp(iTS, iHr); + + if (std::find(state.dataWeather->spSiteSchedNums.begin(), state.dataWeather->spSiteSchedNums.end(), desDayInput.HumIndSchPtr) == + state.dataWeather->spSiteSchedNums.end()) { + state.dataWeather->spSiteSchedNums.emplace_back(desDayInput.HumIndSchPtr); + SetupOutputVariable(state, + "Sizing Period Site Humidity Condition Schedule Value", + unitType, + state.dataWeather->spSiteSchedules(EnvrnNum).OutRelHum, + OutputProcessor::SOVTimeStepType::Zone, + OutputProcessor::SOVStoreType::Average, + ipsc->cAlphaArgs(6)); + } - ScheduleManager::GetSingleDayScheduleValues(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr, - state.dataWeatherManager->DDHumIndModifier(_, _, EnvrnNum)); - - int schPtr = General::FindNumberInList(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr, - state.dataWeatherManager->SPSiteScheduleNamePtr, - state.dataWeatherManager->NumSPSiteScheduleNamePtrs); - if ((schPtr == 0) || (state.dataWeatherManager->SPSiteScheduleUnits(schPtr) != units)) { - ++state.dataWeatherManager->NumSPSiteScheduleNamePtrs; - state.dataWeatherManager->SPSiteScheduleNamePtr(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr; - state.dataWeatherManager->SPSiteScheduleUnits(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = units; - SetupOutputVariable(state, - "Sizing Period Site Humidity Condition Schedule Value", - unitType, - state.dataWeatherManager->SPSiteHumidityConditionScheduleValue(EnvrnNum), - OutputProcessor::SOVTimeStepType::Zone, - OutputProcessor::SOVStoreType::Average, - state.dataIPShortCut->cAlphaArgs(6)); + switch (desDayInput.HumIndType) { + case DesDayHumIndType::RelHumSch: { + if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.HumIndSchPtr, 0.0, false, 100.0, false)) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(6), ipsc->cAlphaArgs(6))); + ShowContinueError(state, "Specified [Scheduled] Relative Humidity Values are not within [0.0, 100.0]"); + ErrorsFound = true; } - - switch (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType) { - case DDHumIndType::RelHumSch: - if (!ScheduleManager::CheckDayScheduleValueMinMax( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr, 0.0, false, 100.0, false)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6))); - ShowContinueError(state, "Specified [Scheduled] Relative Humidity Values are not within [0.0, 100.0]"); - ErrorsFound = true; - } - break; - case DDHumIndType::WBProfMul: - // multiplier: use schedule value, check 0 <= v <= 1 - if (!ScheduleManager::CheckDayScheduleValueMinMax( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr, 0.0, false, 1.0, false)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6))); - ShowContinueError(state, "..Specified [Schedule] Wet-bulb Profile Range Multiplier Values are not within [0.0, 1.0]"); - ErrorsFound = true; - } - break; - case DDHumIndType::WBProfDif: - if (!ScheduleManager::CheckDayScheduleValueMinMax( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndSchPtr, 0.0, false)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(6), - state.dataIPShortCut->cAlphaArgs(6))); - ShowSevereError(state, "Some [Schedule] Wet-bulb Profile Difference Values are < 0.0 [would make max larger]."); - ErrorsFound = true; - } - default: - break; + } break; + case DesDayHumIndType::WBProfMul: { + // multiplier: use schedule value, check 0 <= v <= 1 + if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.HumIndSchPtr, 0.0, false, 1.0, false)) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(6), ipsc->cAlphaArgs(6))); + ShowContinueError(state, "..Specified [Schedule] Wet-bulb Profile Range Multiplier Values are not within [0.0, 1.0]"); + ErrorsFound = true; } - } - } + } break; + case DesDayHumIndType::WBProfDif: { + if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.HumIndSchPtr, 0.0, false)) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(6), ipsc->cAlphaArgs(6))); + ShowSevereError(state, "Some [Schedule] Wet-bulb Profile Difference Values are < 0.0 [would make max larger]."); + ErrorsFound = true; + } + } break; + default: { + } break; + } // switch (desDayInput.HumIndType) + } // if (desDayInput.HumIndSchPtr == 0) - } else if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDef) { + } else if (desDayInput.HumIndType == DesDayHumIndType::WBProfDef) { // re WetBulbProfileDefaultMultipliers Real64 LastHrValue = DefaultTempRangeMult[23]; - for (int hour = 1; hour <= 24; ++hour) { + for (int hour = 1; hour <= Constant::HoursInDay; ++hour) { for (int ts = 1; ts <= state.dataGlobal->NumOfTimeStepInHour; ++ts) { - Real64 WNow = state.dataWeatherManager->Interpolation(ts); + Real64 WNow = state.dataWeather->Interpolation(ts); Real64 WPrev = 1.0 - WNow; - state.dataWeatherManager->DDHumIndModifier(ts, hour, EnvrnNum) = LastHrValue * WPrev + DefaultTempRangeMult[hour - 1] * WNow; + state.dataWeather->desDayMods(EnvrnNum)(ts, hour).OutRelHum = LastHrValue * WPrev + DefaultTempRangeMult[hour - 1] * WNow; } LastHrValue = DefaultTempRangeMult[hour - 1]; } } // verify that design WB or DP <= design DB - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::DewPoint || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WetBulb || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfMul || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDef || - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::WBProfDif) { - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue > state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb) { - ShowWarningError(state, - format("{}=\"{}\", range check data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); + if (desDayInput.HumIndType == DesDayHumIndType::DewPoint || desDayInput.HumIndType == DesDayHumIndType::WetBulb || + desDayInput.HumIndType == DesDayHumIndType::WBProfMul || desDayInput.HumIndType == DesDayHumIndType::WBProfDef || + desDayInput.HumIndType == DesDayHumIndType::WBProfDif) { + if (desDayInput.HumIndValue > desDayInput.MaxDryBulb) { + ShowWarningError(state, format("{}=\"{}\", range check data.", ipsc->cCurrentModuleObject, desDayInput.Title)); ShowContinueError(state, format("..Humidity Indicator Temperature at Max Temperature={:.1R} > Max DryBulb={:.1R}", - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue, - state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb)); - ShowContinueError(state, format("..{}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5))); + desDayInput.HumIndValue, + desDayInput.MaxDryBulb)); + ShowContinueError(state, format("..{}=\"{}\".", ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5))); ShowContinueError(state, "..Conditions for day will be set to Relative Humidity = 100%"); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType == DDHumIndType::DewPoint) { - state.dataWeatherManager->DesDayInput(EnvrnNum).DewPointNeedsSet = true; + if (desDayInput.HumIndType == DesDayHumIndType::DewPoint) { + desDayInput.DewPointNeedsSet = true; } else { // wet-bulb - state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue = state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb; + desDayInput.HumIndValue = desDayInput.MaxDryBulb; } } } // A10, \field Solar Model Indicator - if (state.dataIPShortCut->lAlphaFieldBlanks(10) || UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "ASHRAEClearSky") || - UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "CLEARSKY")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel = DesignDaySolarModel::ASHRAE_ClearSky; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "ZhangHuang")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel = DesignDaySolarModel::Zhang_Huang; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "ASHRAETau")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel = DesignDaySolarModel::ASHRAE_Tau; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "ASHRAETau2017")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel = DesignDaySolarModel::ASHRAE_Tau2017; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(10), "Schedule")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel = DesignDaySolarModel::SolarModel_Schedule; + 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 { - ShowWarningError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(10), state.dataIPShortCut->cAlphaArgs(10))); - ShowContinueError(state, "Model used will be ASHRAE ClearSky"); - state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel = DesignDaySolarModel::ASHRAE_ClearSky; + ShowWarningInvalidKey(state, eoh, ipsc->cAlphaFieldNames(10), ipsc->cAlphaArgs(10), "ASHRAE ClearSky"); + desDayInput.solarModel = DesDaySolarModel::ASHRAE_ClearSky; } - if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::SolarModel_Schedule) { + if (desDayInput.solarModel == DesDaySolarModel::SolarModel_Schedule) { // A11, \field Beam Solar Day Schedule Name - if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).BeamSolarSchPtr = - ScheduleManager::GetDayScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(11)); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).BeamSolarSchPtr == 0) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, - format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(11), state.dataIPShortCut->cAlphaArgs(11))); - ShowContinueError(state, format("..Required when {} indicates \"Schedule\".", state.dataIPShortCut->cAlphaFieldNames(10))); + if (ipsc->lAlphaFieldBlanks(11)) { + // should have entered beam schedule + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(11), "", ""); + ErrorsFound = true; + } else if ((desDayInput.BeamSolarSchPtr = ScheduleManager::GetDayScheduleIndex(state, ipsc->cAlphaArgs(11))) == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(11), ipsc->cAlphaArgs(11)); + ErrorsFound = true; + } else { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetSingleDayScheduleValues(state, desDayInput.BeamSolarSchPtr, tmp); + auto &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) + desDayModsEnvrn(iTS, iHr).BeamSolarRad = tmp(iTS, iHr); + + unitType = OutputProcessor::Unit::W_m2; + units = "[W/m2]"; + if (std::find(state.dataWeather->spSiteSchedNums.begin(), + state.dataWeather->spSiteSchedNums.end(), + desDayInput.BeamSolarSchPtr) == state.dataWeather->spSiteSchedNums.end()) { + state.dataWeather->spSiteSchedNums.emplace_back(desDayInput.BeamSolarSchPtr); + SetupOutputVariable(state, + "Sizing Period Site Beam Solar Schedule Value", + unitType, + state.dataWeather->spSiteSchedules(EnvrnNum).BeamSolarRad, + OutputProcessor::SOVTimeStepType::Zone, + OutputProcessor::SOVStoreType::Average, + ipsc->cAlphaArgs(11)); + } + + if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.BeamSolarSchPtr, 0.0, false)) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(11), ipsc->cAlphaArgs(11))); + ShowContinueError(state, "..Specified [Schedule] Values are not >= 0.0"); ErrorsFound = true; - } else { - ScheduleManager::GetSingleDayScheduleValues(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).BeamSolarSchPtr, - state.dataWeatherManager->DDBeamSolarValues(_, _, EnvrnNum)); - int schPtr = General::FindNumberInList(state.dataWeatherManager->DesDayInput(EnvrnNum).BeamSolarSchPtr, - state.dataWeatherManager->SPSiteScheduleNamePtr, - state.dataWeatherManager->NumSPSiteScheduleNamePtrs); - units = "[W/m2]"; - unitType = OutputProcessor::Unit::W_m2; - if ((schPtr == 0) || (state.dataWeatherManager->SPSiteScheduleUnits(schPtr) != units)) { - ++state.dataWeatherManager->NumSPSiteScheduleNamePtrs; - state.dataWeatherManager->SPSiteScheduleNamePtr(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = - state.dataWeatherManager->DesDayInput(EnvrnNum).BeamSolarSchPtr; - state.dataWeatherManager->SPSiteScheduleUnits(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = units; - SetupOutputVariable(state, - "Sizing Period Site Beam Solar Schedule Value", - unitType, - state.dataWeatherManager->SPSiteBeamSolarScheduleValue(EnvrnNum), - OutputProcessor::SOVTimeStepType::Zone, - OutputProcessor::SOVStoreType::Average, - state.dataIPShortCut->cAlphaArgs(11)); - } - if (!ScheduleManager::CheckDayScheduleValueMinMax( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).BeamSolarSchPtr, 0.0, false)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(11), - state.dataIPShortCut->cAlphaArgs(11))); - ShowContinueError(state, "..Specified [Schedule] Values are not >= 0.0"); - ErrorsFound = true; - } } - } else { // should have entered beam schedule - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cAlphaFieldNames(11))); - ErrorsFound = true; } + // A12, \field Diffuse Solar Day Schedule Name - if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).DiffuseSolarSchPtr = - ScheduleManager::GetDayScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(12)); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DiffuseSolarSchPtr == 0) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, - format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(12), state.dataIPShortCut->cAlphaArgs(12))); - ShowContinueError(state, format("..Required when {} indicates \"Schedule\".", state.dataIPShortCut->cAlphaFieldNames(10))); + if (ipsc->lAlphaFieldBlanks(12)) { + // should have entered diffuse schedule + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(12), "", ""); + ErrorsFound = true; + } else if ((desDayInput.DiffuseSolarSchPtr = ScheduleManager::GetDayScheduleIndex(state, ipsc->cAlphaArgs(12))) == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(12), ipsc->cAlphaArgs(12)); + ErrorsFound = true; + } else { + Array2D tmp = Array2D(state.dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + ScheduleManager::GetSingleDayScheduleValues(state, desDayInput.DiffuseSolarSchPtr, tmp); + auto &desDayModsEnvrn = state.dataWeather->desDayMods(EnvrnNum); + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) + desDayModsEnvrn(iTS, iHr).DifSolarRad = tmp(iTS, iHr); + + units = "[W/m2]"; + unitType = OutputProcessor::Unit::W_m2; + if (std::find(state.dataWeather->spSiteSchedNums.begin(), + state.dataWeather->spSiteSchedNums.end(), + desDayInput.DiffuseSolarSchPtr) == state.dataWeather->spSiteSchedNums.end()) { + state.dataWeather->spSiteSchedNums.emplace_back(desDayInput.DiffuseSolarSchPtr); + SetupOutputVariable(state, + "Sizing Period Site Diffuse Solar Schedule Value", + unitType, + state.dataWeather->spSiteSchedules(EnvrnNum).DifSolarRad, + OutputProcessor::SOVTimeStepType::Zone, + OutputProcessor::SOVStoreType::Average, + ipsc->cAlphaArgs(12)); + } + if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.DiffuseSolarSchPtr, 0.0, false)) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(12), ipsc->cAlphaArgs(12))); + ShowContinueError(state, "..Specified [Schedule] Values are not >= 0.0"); ErrorsFound = true; - } else { - ScheduleManager::GetSingleDayScheduleValues(state, - state.dataWeatherManager->DesDayInput(EnvrnNum).DiffuseSolarSchPtr, - state.dataWeatherManager->DDDiffuseSolarValues(_, _, EnvrnNum)); - int schPtr = General::FindNumberInList(state.dataWeatherManager->DesDayInput(EnvrnNum).DiffuseSolarSchPtr, - state.dataWeatherManager->SPSiteScheduleNamePtr, - state.dataWeatherManager->NumSPSiteScheduleNamePtrs); - units = "[W/m2]"; - unitType = OutputProcessor::Unit::W_m2; - if ((schPtr == 0) || (state.dataWeatherManager->SPSiteScheduleUnits(schPtr) != units)) { - ++state.dataWeatherManager->NumSPSiteScheduleNamePtrs; - state.dataWeatherManager->SPSiteScheduleNamePtr(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = - state.dataWeatherManager->DesDayInput(EnvrnNum).DiffuseSolarSchPtr; - state.dataWeatherManager->SPSiteScheduleUnits(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = units; - SetupOutputVariable(state, - "Sizing Period Site Diffuse Solar Schedule Value", - unitType, - state.dataWeatherManager->SPSiteDiffuseSolarScheduleValue(EnvrnNum), - OutputProcessor::SOVTimeStepType::Zone, - OutputProcessor::SOVStoreType::Average, - state.dataIPShortCut->cAlphaArgs(12)); - } - if (!ScheduleManager::CheckDayScheduleValueMinMax( - state, state.dataWeatherManager->DesDayInput(EnvrnNum).DiffuseSolarSchPtr, 0.0, false)) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}\".", - state.dataIPShortCut->cAlphaFieldNames(12), - state.dataIPShortCut->cAlphaArgs(12))); - ShowContinueError(state, "..Specified [Schedule] Values are not >= 0.0"); - ErrorsFound = true; - } } - } else { // should have entered diffuse schedule - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cAlphaFieldNames(12))); - ErrorsFound = true; } - } - if (state.dataWeatherManager->DesDayInput(EnvrnNum).SolarModel == DesignDaySolarModel::ASHRAE_ClearSky) { - if (state.dataIPShortCut->lNumericFieldBlanks(14)) { - ShowWarningError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, format("..invalid field: {} is blank.", state.dataIPShortCut->cNumericFieldNames(14))); - ShowContinueError(state, "..Zero clear sky (no solar) will be used."); + } else if (desDayInput.solarModel == DesDaySolarModel::ASHRAE_ClearSky) { + if (ipsc->lNumericFieldBlanks(14)) { + ShowWarningEmptyField( + state, eoh, ipsc->cNumericFieldNames(14), ipsc->cAlphaFieldNames(10), ipsc->cAlphaArgs(10), "Zero clear sky (no solar)"); } } // Validate Design Day Month - switch (state.dataWeatherManager->DesDayInput(EnvrnNum).Month) { + switch (desDayInput.Month) { case 1: case 3: case 5: case 7: case 8: case 10: - case 12: - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth > 31) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format(".. invalid field: {}=[{}], Month=[{}].", - state.dataIPShortCut->cNumericFieldNames(2), - state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth, - state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); + case 12: { + if (desDayInput.DayOfMonth > 31) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError( + state, + format(".. invalid field: {}=[{}], Month=[{}].", ipsc->cNumericFieldNames(2), desDayInput.DayOfMonth, desDayInput.Month)); ErrorsFound = true; } - break; + } break; case 4: case 6: case 9: - case 11: - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth > 30) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format(".. invalid {}=[{}], Month=[{}].", - state.dataIPShortCut->cNumericFieldNames(2), - state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth, - state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); + case 11: { + if (desDayInput.DayOfMonth > 30) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError( + state, format(".. invalid {}=[{}], Month=[{}].", ipsc->cNumericFieldNames(2), desDayInput.DayOfMonth, desDayInput.Month)); ErrorsFound = true; } - break; - case 2: - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth > 28) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format(".. invalid {}=[{}], Month=[{}].", - state.dataIPShortCut->cNumericFieldNames(2), - state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth, - state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); + } break; + case 2: { + if (desDayInput.DayOfMonth > 28) { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError( + state, format(".. invalid {}=[{}], Month=[{}].", ipsc->cNumericFieldNames(2), desDayInput.DayOfMonth, desDayInput.Month)); ErrorsFound = true; } - break; - default: - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format(".. invalid {} invalid (Month) [{}].", - state.dataIPShortCut->cNumericFieldNames(1), - state.dataWeatherManager->DesDayInput(EnvrnNum).Month)); + } break; + default: { + ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); + ShowContinueError(state, format(".. invalid {} invalid (Month) [{}].", ipsc->cNumericFieldNames(1), desDayInput.Month)); ErrorsFound = true; - break; - } + } break; + } // switch (desDayInput.Month) // A9, \field Daylight Saving Time Indicator - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "Yes")) { - state.dataWeatherManager->DesDayInput(EnvrnNum).DSTIndicator = 1; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "No") || state.dataIPShortCut->lAlphaFieldBlanks(9)) { - state.dataWeatherManager->DesDayInput(EnvrnNum).DSTIndicator = 0; + if (ipsc->lAlphaFieldBlanks(9)) { + desDayInput.DSTIndicator = 0; + } else if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(9)))) != BooleanSwitch::Invalid) { + desDayInput.DSTIndicator = (int)b; } else { - ShowWarningError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError(state, - format("..invalid field: {}=\"{}{}", - state.dataIPShortCut->cAlphaFieldNames(9), - state.dataIPShortCut->cAlphaArgs(9), - R"(". "No" will be used.)")); - state.dataWeatherManager->DesDayInput(EnvrnNum).DSTIndicator = 0; + ShowWarningInvalidBool(state, eoh, ipsc->cAlphaFieldNames(9), ipsc->cAlphaArgs(9), "No"); + desDayInput.DSTIndicator = 0; } // A2, \field Day Type - state.dataWeatherManager->DesDayInput(EnvrnNum).DayType = - getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayType <= 0) { - ShowSevereError(state, - format("{}=\"{}\", invalid data.", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->DesDayInput(EnvrnNum).Title)); - ShowContinueError( - state, format("..invalid field: {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, - "Valid values are " - "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Holiday,SummerDesignDay,WinterDesignDay,CustomDay1," - "CustomDay2."); + desDayInput.DayType = getEnumValue(ScheduleManager::dayTypeNamesUC, ipsc->cAlphaArgs(2)); + if (desDayInput.DayType <= 0) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } - state.dataWeatherManager->Environment(EnvrnNum).Title = state.dataWeatherManager->DesDayInput(EnvrnNum).Title; - state.dataWeatherManager->Environment(EnvrnNum).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state.dataWeatherManager->Environment(EnvrnNum).DesignDayNum = EnvrnNum; - state.dataWeatherManager->Environment(EnvrnNum).RunPeriodDesignNum = 0; - state.dataWeatherManager->Environment(EnvrnNum).TotalDays = 1; - state.dataWeatherManager->Environment(EnvrnNum).StartMonth = state.dataWeatherManager->DesDayInput(EnvrnNum).Month; - state.dataWeatherManager->Environment(EnvrnNum).StartDay = state.dataWeatherManager->DesDayInput(EnvrnNum).DayOfMonth; - state.dataWeatherManager->Environment(EnvrnNum).EndMonth = state.dataWeatherManager->Environment(EnvrnNum).StartMonth; - state.dataWeatherManager->Environment(EnvrnNum).EndDay = state.dataWeatherManager->Environment(EnvrnNum).StartDay; - state.dataWeatherManager->Environment(EnvrnNum).DayOfWeek = 0; - state.dataWeatherManager->Environment(EnvrnNum).UseDST = false; - state.dataWeatherManager->Environment(EnvrnNum).UseHolidays = false; - state.dataWeatherManager->Environment(EnvrnNum).StartJDay = state.dataWeatherManager->DesignDay(EnvrnNum).DayOfYear; - state.dataWeatherManager->Environment(EnvrnNum).EndJDay = state.dataWeatherManager->Environment(EnvrnNum).StartJDay; + auto &designDay = state.dataWeather->DesignDay(EnvrnNum); + envCurr.Title = desDayInput.Title; + envCurr.KindOfEnvrn = Constant::KindOfSim::DesignDay; + envCurr.DesignDayNum = EnvrnNum; + envCurr.RunPeriodDesignNum = 0; + envCurr.TotalDays = 1; + envCurr.StartMonth = desDayInput.Month; + envCurr.StartDay = desDayInput.DayOfMonth; + envCurr.EndMonth = envCurr.StartMonth; + envCurr.EndDay = envCurr.StartDay; + envCurr.DayOfWeek = 0; + envCurr.UseDST = false; + envCurr.UseHolidays = false; + envCurr.StartJDay = designDay.DayOfYear; + envCurr.EndJDay = envCurr.StartJDay; // create predefined report on design day - std::string envTitle = state.dataWeatherManager->DesDayInput(EnvrnNum).Title; - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchDDmaxDB, envTitle, state.dataWeatherManager->DesDayInput(EnvrnNum).MaxDryBulb); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchDDrange, envTitle, state.dataWeatherManager->DesDayInput(EnvrnNum).DailyDBRange); - if (state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType != DDHumIndType::RelHumSch) { - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchDDhumid, envTitle, state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndValue); + std::string envTitle = desDayInput.Title; + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDDmaxDB, envTitle, desDayInput.MaxDryBulb); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDDrange, envTitle, desDayInput.DailyDBRange); + if (desDayInput.HumIndType != DesDayHumIndType::RelHumSch) { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDDhumid, envTitle, desDayInput.HumIndValue); } else { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDDhumid, envTitle, "N/A"); } OutputReportPredefined::PreDefTableEntry( - state, - state.dataOutRptPredefined->pdchDDhumTyp, - envTitle, - DDHumIndTypeStringRep[static_cast(state.dataWeatherManager->DesDayInput(EnvrnNum).HumIndType)]); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchDDwindSp, envTitle, state.dataWeatherManager->DesDayInput(EnvrnNum).WindSpeed); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchDDwindDr, envTitle, state.dataWeatherManager->DesDayInput(EnvrnNum).WindDir); + state, state.dataOutRptPredefined->pdchDDhumTyp, envTitle, DesDayHumIndTypeStringRep[(int)desDayInput.HumIndType]); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDDwindSp, envTitle, desDayInput.WindSpeed); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDDwindDr, envTitle, desDayInput.WindDir); } } @@ -7473,18 +6456,17 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Richard Liesen // DATE WRITTEN October 1997 - // MODIFIED - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine gets the location info from the IDF file; latitude, // longitude and time zone number. - state.dataIPShortCut->cCurrentModuleObject = "Site:Location"; - int const NumLocations = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "Site:Location"; + int const NumLocations = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (NumLocations > 1) { - ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } @@ -7496,15 +6478,15 @@ namespace WeatherManager { Array1D LocProps(4); // Temporary array to transfer location info // Call Input Get routine to retrieve Location information state.dataInputProcessing->inputProcessor->getObjectItem( - state, state.dataIPShortCut->cCurrentModuleObject, 1, LocNames, LocNumAlpha, LocProps, LocNumProp, IOStat); + state, ipsc->cCurrentModuleObject, 1, LocNames, LocNumAlpha, LocProps, LocNumProp, IOStat); // set latitude, longitude, and time zone number variables - state.dataWeatherManager->LocationTitle = LocNames(1); + state.dataWeather->LocationTitle = LocNames(1); state.dataEnvrn->Latitude = LocProps(1); state.dataEnvrn->Longitude = LocProps(2); state.dataEnvrn->TimeZoneNumber = LocProps(3); state.dataEnvrn->Elevation = LocProps(4); - state.dataWeatherManager->LocationGathered = true; + state.dataWeather->LocationGathered = true; } } @@ -7514,8 +6496,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN July 2009 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Weather properties are an advanced concept for simulation. Primarily, these properties are @@ -7540,61 +6520,62 @@ namespace WeatherManager { // \object-list DayScheduleNames // \object-list ScheduleNames - static constexpr std::string_view RoutineName("GetWeatherProperties:"); + static constexpr std::string_view routineName = "GetWeatherProperties"; int Found; int envFound; - state.dataIPShortCut->cCurrentModuleObject = "WeatherProperty:SkyTemperature"; - state.dataWeatherManager->NumWPSkyTemperatures = - state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "WeatherProperty:SkyTemperature"; + state.dataWeather->NumWPSkyTemperatures = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - state.dataWeatherManager->WPSkyTemperature.allocate(state.dataWeatherManager->NumWPSkyTemperatures); // by default, not used. + state.dataWeather->WPSkyTemperature.allocate(state.dataWeather->NumWPSkyTemperatures); // by default, not used. - for (int i = 1; i <= state.dataWeatherManager->NumWPSkyTemperatures; ++i) { + for (int i = 1; i <= state.dataWeather->NumWPSkyTemperatures; ++i) { int IOStat; int NumAlpha; int NumNumerics; state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, i, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumerics, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - if (state.dataIPShortCut->cAlphaArgs(1).empty()) { + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + auto &wpSkyTemp = state.dataWeather->WPSkyTemperature(i); + if (ipsc->cAlphaArgs(1).empty()) { Found = 0; - for (int j = 1; j <= state.dataWeatherManager->NumOfEnvrn; ++j) { - if (state.dataWeatherManager->Environment(j).KindOfEnvrn != Constant::KindOfSim::RunPeriodWeather) continue; - if (state.dataWeatherManager->Environment(j).WP_Type1 != 0) { + for (int j = 1; j <= state.dataWeather->NumOfEnvrn; ++j) { + auto &environJ = state.dataWeather->Environment(j); + if (environJ.KindOfEnvrn != Constant::KindOfSim::RunPeriodWeather) continue; + if (environJ.WP_Type1 != 0) { ShowSevereError(state, - format("{}{}=\"{}\", indicated Environment Name already assigned.", - RoutineName, - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1))); - if (!state.dataWeatherManager->Environment(j).Title.empty()) { - ShowContinueError( - state, - format("...Environment=\"{}\", already using {}=\"{}\".", - state.dataWeatherManager->Environment(j).Title, - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(j).WP_Type1).Name)); + format("{}: {}=\"{}\", indicated Environment Name already assigned.", + routineName, + ipsc->cCurrentModuleObject, + ipsc->cAlphaArgs(1))); + if (!environJ.Title.empty()) { + ShowContinueError(state, + format("...Environment=\"{}\", already using {}=\"{}\".", + environJ.Title, + ipsc->cCurrentModuleObject, + state.dataWeather->WPSkyTemperature(environJ.WP_Type1).Name)); } else { - ShowContinueError( - state, - format("... Runperiod Environment, already using {}=\"{}\".", - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(j).WP_Type1).Name)); + ShowContinueError(state, + format("... Runperiod Environment, already using {}=\"{}\".", + ipsc->cCurrentModuleObject, + state.dataWeather->WPSkyTemperature(environJ.WP_Type1).Name)); } ErrorsFound = true; } else { - state.dataWeatherManager->Environment(j).WP_Type1 = i; + environJ.WP_Type1 = i; Found = j; } } @@ -7604,77 +6585,56 @@ namespace WeatherManager { continue; } } else { // really a name - Found = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(1), state.dataWeatherManager->Environment, &EnvironmentData::Title); + Found = Util::FindItemInList(ipsc->cAlphaArgs(1), state.dataWeather->Environment, &EnvironmentData::Title); envFound = Found; if (Found == 0) { - ShowSevereError(state, - format("{}{}=\"{}\", invalid Environment Name referenced.", - RoutineName, - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "...remainder of object not processed."); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; continue; + } + + auto &envrnFound = state.dataWeather->Environment(Found); + if (envrnFound.WP_Type1 != 0) { + ShowSevereError(state, + format("{}:{}=\"{}\", indicated Environment Name already assigned.", + routineName, + ipsc->cCurrentModuleObject, + ipsc->cAlphaArgs(1))); + ShowContinueError(state, + format("...Environment=\"{}\", already using {}=\"{}\".", + envrnFound.Title, + ipsc->cCurrentModuleObject, + state.dataWeather->WPSkyTemperature(envrnFound.WP_Type1).Name)); + ErrorsFound = true; } else { - if (state.dataWeatherManager->Environment(Found).WP_Type1 != 0) { - ShowSevereError(state, - format("{}{}=\"{}\", indicated Environment Name already assigned.", - RoutineName, - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError( - state, - format("...Environment=\"{}\", already using {}=\"{}\".", - state.dataWeatherManager->Environment(Found).Title, - state.dataIPShortCut->cCurrentModuleObject, - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(Found).WP_Type1).Name)); - ErrorsFound = true; - } else { - state.dataWeatherManager->Environment(Found).WP_Type1 = i; - } + state.dataWeather->Environment(Found).WP_Type1 = i; } } - if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) { - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), state.dataIPShortCut->cCurrentModuleObject, ErrorsFound); - state.dataWeatherManager->WPSkyTemperature(i).Name = state.dataIPShortCut->cAlphaArgs(1); // Name - } else { - state.dataWeatherManager->WPSkyTemperature(i).Name = "All RunPeriods"; - } + wpSkyTemp.Name = !ipsc->lAlphaFieldBlanks(1) ? ipsc->cAlphaArgs(1) : "All RunPeriods"; + // Validate Calculation Type. std::string units; OutputProcessor::Unit unitType; - state.dataWeatherManager->WPSkyTemperature(i).CalculationType = - static_cast(getEnumValue(WeatherManager::SkyTempModelInputNamesUC, state.dataIPShortCut->cAlphaArgs(2))); + wpSkyTemp.skyTempModel = static_cast(getEnumValue(Weather::SkyTempModelNamesUC, ipsc->cAlphaArgs(2))); - switch (state.dataWeatherManager->WPSkyTemperature(i).CalculationType) { - case SkyTempCalcType::ScheduleValue: { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = true; + switch (wpSkyTemp.skyTempModel) { + case SkyTempModel::ScheduleValue: { + wpSkyTemp.IsSchedule = true; units = "[C]"; unitType = OutputProcessor::Unit::C; } break; - case SkyTempCalcType::DryBulbDelta: { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = true; - units = "[deltaC]"; - unitType = OutputProcessor::Unit::deltaC; - } break; - case SkyTempCalcType::DewPointDelta: { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = true; + case SkyTempModel::DryBulbDelta: + case SkyTempModel::DewPointDelta: { + wpSkyTemp.IsSchedule = true; units = "[deltaC]"; unitType = OutputProcessor::Unit::deltaC; } break; - case SkyTempCalcType::BruntModel: { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = false; - } break; - case SkyTempCalcType::IdsoModel: { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = false; - } break; - case SkyTempCalcType::BerdahlMartinModel: { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = false; - } break; - case SkyTempCalcType::ClarkAllenModel: { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = false; + case SkyTempModel::Brunt: + case SkyTempModel::Idso: + case SkyTempModel::BerdahlMartin: + case SkyTempModel::ClarkAllen: { + wpSkyTemp.IsSchedule = false; } break; default: { // Bad inputs are trapped by input processor @@ -7682,92 +6642,61 @@ namespace WeatherManager { } } - if (state.dataWeatherManager->WPSkyTemperature(i).IsSchedule) { - state.dataWeatherManager->WPSkyTemperature(i).ScheduleName = state.dataIPShortCut->cAlphaArgs(3); - if (state.dataWeatherManager->Environment(Found).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather || - state.dataWeatherManager->Environment(Found).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { - state.dataWeatherManager->WPSkyTemperature(i).ScheduleName = state.dataIPShortCut->cAlphaArgs(3); + if (wpSkyTemp.IsSchedule) { + wpSkyTemp.ScheduleName = ipsc->cAlphaArgs(3); + if (state.dataWeather->Environment(Found).KindOfEnvrn == Constant::KindOfSim::RunPeriodWeather || + state.dataWeather->Environment(Found).KindOfEnvrn == Constant::KindOfSim::RunPeriodDesign) { + wpSkyTemp.ScheduleName = ipsc->cAlphaArgs(3); // See if it's a schedule. - Found = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); + Found = ScheduleManager::GetScheduleIndex(state, ipsc->cAlphaArgs(3)); if (Found == 0) { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}.", - RoutineName, - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cAlphaFieldNames(3))); - ShowContinueError(state, format("...Entered name=\"{}\".", state.dataIPShortCut->cAlphaArgs(3))); - ShowContinueError(state, - "...Should be a full year schedule (\"Schedule:Year\", \"Schedule:Compact\", \"Schedule:File\", or " - "\"Schedule:Constant\" objects."); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } else { - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = true; - state.dataWeatherManager->WPSkyTemperature(i).SchedulePtr = Found; + wpSkyTemp.IsSchedule = true; + wpSkyTemp.SchedulePtr = Found; } } else { // See if it's a valid schedule. - Found = ScheduleManager::GetDayScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); + Found = ScheduleManager::GetDayScheduleIndex(state, ipsc->cAlphaArgs(3)); if (Found == 0) { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}.", - RoutineName, - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cAlphaFieldNames(3))); - ShowContinueError(state, format("...Entered name=\"{}\".", state.dataIPShortCut->cAlphaArgs(3))); - ShowContinueError( - state, - R"(...Should be a single day schedule ("Schedule:Day:Hourly", "Schedule:Day:Interval", or "Schedule:Day:List" objects.)"); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } else { if (envFound != 0) { - int schPtr = General::FindNumberInList( - Found, state.dataWeatherManager->SPSiteScheduleNamePtr, state.dataWeatherManager->NumSPSiteScheduleNamePtrs); - if ((schPtr == 0) || (state.dataWeatherManager->SPSiteScheduleUnits(schPtr) != units)) { - ++state.dataWeatherManager->NumSPSiteScheduleNamePtrs; - state.dataWeatherManager->SPSiteScheduleNamePtr(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = Found; - state.dataWeatherManager->SPSiteScheduleUnits(state.dataWeatherManager->NumSPSiteScheduleNamePtrs) = units; + if (std::find(state.dataWeather->spSiteSchedNums.begin(), state.dataWeather->spSiteSchedNums.end(), Found) == + state.dataWeather->spSiteSchedNums.end()) { + state.dataWeather->spSiteSchedNums.emplace_back(Found); SetupOutputVariable(state, "Sizing Period Site Sky Temperature Schedule Value", unitType, - state.dataWeatherManager->SPSiteSkyTemperatureScheduleValue(envFound), + state.dataWeather->spSiteSchedules(envFound).SkyTemp, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataIPShortCut->cAlphaArgs(3)); + ipsc->cAlphaArgs(3)); } - state.dataWeatherManager->WPSkyTemperature(i).IsSchedule = true; - state.dataWeatherManager->WPSkyTemperature(i).SchedulePtr = Found; + wpSkyTemp.IsSchedule = true; + wpSkyTemp.SchedulePtr = Found; } } } } - if (!state.dataWeatherManager->WPSkyTemperature(i).IsSchedule && !state.dataIPShortCut->lAlphaFieldBlanks(4)) { - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "Yes")) { - state.dataWeatherManager->WPSkyTemperature(i).UseWeatherFileHorizontalIR = true; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(4), "No")) { - state.dataWeatherManager->WPSkyTemperature(i).UseWeatherFileHorizontalIR = false; + BooleanSwitch b; + if (!wpSkyTemp.IsSchedule && !ipsc->lAlphaFieldBlanks(4)) { + if ((b = getYesNoValue(Util::makeUPPER(ipsc->cAlphaArgs(4)))) != BooleanSwitch::Invalid) { + wpSkyTemp.UseWeatherFileHorizontalIR = static_cast(b); } else { - ShowSevereError(state, - format("{}{}=\"{}\", invalid {}.", - RoutineName, - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cAlphaFieldNames(4))); - ShowContinueError(state, format("...entered value=\"{}\", should be Yes or No.", state.dataIPShortCut->cAlphaArgs(4))); + ShowSevereInvalidBool(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4)); ErrorsFound = true; } } else { - state.dataWeatherManager->WPSkyTemperature(i).UseWeatherFileHorizontalIR = true; + wpSkyTemp.UseWeatherFileHorizontalIR = true; } } - for (int envrn = 1; envrn <= state.dataWeatherManager->NumOfEnvrn; ++envrn) { - if (state.dataWeatherManager->Environment(envrn).WP_Type1 != 0 && - state.dataWeatherManager->NumWPSkyTemperatures >= state.dataWeatherManager->Environment(envrn).WP_Type1) { - state.dataWeatherManager->Environment(envrn).SkyTempModel = - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(envrn).WP_Type1).CalculationType; - state.dataWeatherManager->Environment(envrn).UseWeatherFileHorizontalIR = - state.dataWeatherManager->WPSkyTemperature(state.dataWeatherManager->Environment(envrn).WP_Type1).UseWeatherFileHorizontalIR; + for (auto &envCurr : state.dataWeather->Environment) { + if (envCurr.WP_Type1 != 0 && state.dataWeather->NumWPSkyTemperatures >= envCurr.WP_Type1) { + envCurr.skyTempModel = state.dataWeather->WPSkyTemperature(envCurr.WP_Type1).skyTempModel; + envCurr.UseWeatherFileHorizontalIR = state.dataWeather->WPSkyTemperature(envCurr.WP_Type1).UseWeatherFileHorizontalIR; } } } @@ -7778,27 +6707,25 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Richard Liesen // DATE WRITTEN October 1997 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This file reads the Ground Temps from the input file and puts them // in a new variable. // Initialize Site:GroundTemperature:BuildingSurface object - state.dataWeatherManager->siteBuildingSurfaceGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( - state, GroundTemperatureManager::groundTempModelNamesUC[static_cast(GroundTempObjType::SiteBuildingSurfaceGroundTemp)], ""); + state.dataWeather->siteBuildingSurfaceGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( + state, GroundTemperatureManager::groundTempModelNamesUC[(int)GroundTempObjType::SiteBuildingSurfaceGroundTemp], ""); // Initialize Site:GroundTemperature:FCFactorMethod object - state.dataWeatherManager->siteFCFactorMethodGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( + state.dataWeather->siteFCFactorMethodGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( state, GroundTemperatureManager::groundTempModelNamesUC[static_cast(GroundTempObjType::SiteFCFactorMethodGroundTemp)], ""); // Initialize Site:GroundTemperature:Shallow object - state.dataWeatherManager->siteShallowGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( + state.dataWeather->siteShallowGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( state, GroundTemperatureManager::groundTempModelNamesUC[static_cast(GroundTempObjType::SiteShallowGroundTemp)], ""); // Initialize Site:GroundTemperature:Deep object - state.dataWeatherManager->siteDeepGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( + state.dataWeather->siteDeepGroundTempsPtr = GroundTemperatureManager::GetGroundTempModelAndInit( state, GroundTemperatureManager::groundTempModelNamesUC[static_cast(GroundTempObjType::SiteDeepGroundTemp)], ""); } @@ -7808,15 +6735,14 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN March 2002 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This file reads the Ground Reflectances from the input file (optional) and // places them in the monthly array. - state.dataIPShortCut->cCurrentModuleObject = "Site:GroundReflectance"; - int nObjs = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "Site:GroundReflectance"; + int nObjs = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (nObjs != 0) { Array1D_string GndAlphas(1); // Construction Alpha names defined Array1D GndProps(12); // Temporary array to transfer ground reflectances @@ -7826,18 +6752,18 @@ namespace WeatherManager { int IOStat; // IO Status when calling get input subroutine // Get the object names for each construction from the input processor state.dataInputProcessing->inputProcessor->getObjectItem( - state, state.dataIPShortCut->cCurrentModuleObject, 1, GndAlphas, GndNumAlpha, GndProps, GndNumProp, IOStat); + state, ipsc->cCurrentModuleObject, 1, GndAlphas, GndNumAlpha, GndProps, GndNumProp, IOStat); if (GndNumProp < 12) { - ShowSevereError(state, format("{}: Less than 12 values entered.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Less than 12 values entered.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } // Assign the ground reflectances to the variable - state.dataWeatherManager->GroundReflectances({1, 12}) = GndProps({1, 12}); + state.dataWeather->GroundReflectances({1, 12}) = GndProps({1, 12}); } else { - ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } } @@ -7852,7 +6778,7 @@ namespace WeatherManager { print(state.files.eio, " Site:GroundReflectance"); for (int i = 1; i <= 12; ++i) { - print(state.files.eio, ", {:5.2F}", state.dataWeatherManager->GroundReflectances(i)); + print(state.files.eio, ", {:5.2F}", state.dataWeather->GroundReflectances(i)); } print(state.files.eio, "\n"); } @@ -7863,15 +6789,14 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN March 2002 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This file reads the Snow Ground Reflectance Modifiers from the input file (optional) and // places them in the variables. - state.dataIPShortCut->cCurrentModuleObject = "Site:GroundReflectance:SnowModifier"; - int nObjs = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "Site:GroundReflectance:SnowModifier"; + int nObjs = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (nObjs != 0) { Array1D_string GndAlphas(1); // Construction Alpha names defined Array1D GndProps(2); // Temporary array to transfer ground reflectances @@ -7881,14 +6806,14 @@ namespace WeatherManager { int IOStat; // IO Status when calling get input subroutine // Get the object names for each construction from the input processor state.dataInputProcessing->inputProcessor->getObjectItem( - state, state.dataIPShortCut->cCurrentModuleObject, 1, GndAlphas, GndNumAlpha, GndProps, GndNumProp, IOStat); + state, ipsc->cCurrentModuleObject, 1, GndAlphas, GndNumAlpha, GndProps, GndNumProp, IOStat); // Assign the ground reflectances to the variable - state.dataWeatherManager->SnowGndRefModifier = GndProps(1); - state.dataWeatherManager->SnowGndRefModifierForDayltg = GndProps(2); + state.dataWeather->SnowGndRefModifier = GndProps(1); + state.dataWeather->SnowGndRefModifierForDayltg = GndProps(2); } else { - ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } } @@ -7896,7 +6821,7 @@ namespace WeatherManager { // Write Final Ground Reflectance Modifier Information to the initialization output file print(state.files.eio, "{}\n", "! , Normal, Daylighting {dimensionless}"); static constexpr std::string_view Format_720(" Site:GroundReflectance:SnowModifier, {:7.3F}, {:7.3F}\n"); - print(state.files.eio, Format_720, state.dataWeatherManager->SnowGndRefModifier, state.dataWeatherManager->SnowGndRefModifierForDayltg); + print(state.files.eio, Format_720, state.dataWeather->SnowGndRefModifier, state.dataWeather->SnowGndRefModifierForDayltg); print(state.files.eio, "{}\n", @@ -7906,9 +6831,7 @@ namespace WeatherManager { "dimensionless},Oct{dimensionless},Nov{dimensionless},Dec{dimensionless}"); print(state.files.eio, "{}", " Site:GroundReflectance:Snow"); for (int i = 1; i <= 12; ++i) { - print(state.files.eio, - ", {:5.2F}", - max(min(state.dataWeatherManager->GroundReflectances(i) * state.dataWeatherManager->SnowGndRefModifier, 1.0), 0.0)); + print(state.files.eio, ", {:5.2F}", max(min(state.dataWeather->GroundReflectances(i) * state.dataWeather->SnowGndRefModifier, 1.0), 0.0)); } print(state.files.eio, "\n"); print(state.files.eio, @@ -7921,7 +6844,7 @@ namespace WeatherManager { for (nObjs = 1; nObjs <= 12; ++nObjs) { print(state.files.eio, ", {:5.2F}", - max(min(state.dataWeatherManager->GroundReflectances(nObjs) * state.dataWeatherManager->SnowGndRefModifierForDayltg, 1.0), 0.0)); + max(min(state.dataWeather->GroundReflectances(nObjs) * state.dataWeather->SnowGndRefModifierForDayltg, 1.0), 0.0)); } print(state.files.eio, "\n"); } @@ -7932,14 +6855,15 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Peter Graham Ellis // DATE WRITTEN January 2005 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Reads the input data for the WATER MAINS TEMPERATURES object. - state.dataIPShortCut->cCurrentModuleObject = "Site:WaterMainsTemperature"; - int NumObjects = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + constexpr std::string_view routineName = "GetWaterMainsTemperatures"; + + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "Site:WaterMainsTemperature"; + int NumObjects = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (NumObjects == 1) { int NumAlphas; // Number of elements in the alpha array @@ -7948,55 +6872,55 @@ namespace WeatherManager { Array1D_string AlphArray(2); // Character string data Array1D NumArray(2); // Numeric data state.dataInputProcessing->inputProcessor->getObjectItem(state, - state.dataIPShortCut->cCurrentModuleObject, + ipsc->cCurrentModuleObject, 1, AlphArray, NumAlphas, NumArray, NumNums, IOStat, - state.dataIPShortCut->lNumericFieldBlanks, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - state.dataWeatherManager->WaterMainsTempsMethod = - static_cast(getEnumValue(waterMainsCalcMethodNamesUC, AlphArray(1))); - if (state.dataWeatherManager->WaterMainsTempsMethod == WaterMainsTempCalcMethod::Schedule) { - state.dataWeatherManager->WaterMainsTempsScheduleName = AlphArray(2); - state.dataWeatherManager->WaterMainsTempsSchedule = ScheduleManager::GetScheduleIndex(state, AlphArray(2)); - if (state.dataWeatherManager->WaterMainsTempsSchedule == 0) { - ShowSevereError(state, - format("{}: invalid {}={}", - state.dataIPShortCut->cCurrentModuleObject, - state.dataIPShortCut->cAlphaFieldNames(2), - AlphArray(2))); + ipsc->lNumericFieldBlanks, + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ""}; + + state.dataWeather->WaterMainsTempsMethod = + static_cast(getEnumValue(waterMainsCalcMethodNamesUC, AlphArray(1))); + + switch (state.dataWeather->WaterMainsTempsMethod) { + case WaterMainsTempCalcMethod::Schedule: { + state.dataWeather->WaterMainsTempsScheduleName = AlphArray(2); + state.dataWeather->WaterMainsTempsSchedule = ScheduleManager::GetScheduleIndex(state, AlphArray(2)); + if (state.dataWeather->WaterMainsTempsSchedule == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), AlphArray(2)); ErrorsFound = true; } - - } else if (state.dataWeatherManager->WaterMainsTempsMethod == WaterMainsTempCalcMethod::Correlation) { + } break; + case WaterMainsTempCalcMethod::Correlation: { if (NumNums == 0) { - ShowSevereError(state, - format("{}: Missing Annual Average and Maximum Difference fields.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Missing Annual Average and Maximum Difference fields.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } else if (NumNums == 1) { - ShowSevereError(state, format("{}: Missing Maximum Difference field.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Missing Maximum Difference field.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } else { - state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp = NumArray(1); - state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp = NumArray(2); + state.dataWeather->WaterMainsTempsAnnualAvgAirTemp = NumArray(1); + state.dataWeather->WaterMainsTempsMaxDiffAirTemp = NumArray(2); } - } else if (state.dataWeatherManager->WaterMainsTempsMethod == WaterMainsTempCalcMethod::CorrelationFromWeatherFile) { + } break; + case WaterMainsTempCalcMethod::CorrelationFromWeatherFile: { // No action - } else { - ShowSevereError( - state, - format("{}: invalid {}={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(1), AlphArray(1))); + } break; + default: { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(1), AlphArray(1)); ErrorsFound = true; - } + } break; + } // switch } else if (NumObjects > 1) { - ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } } @@ -8008,7 +6932,6 @@ namespace WeatherManager { // AUTHOR Peter Graham Ellis // DATE WRITTEN January 2005 // MODIFIED June 2018, B. Nigusse - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the daily water mains temperature based on input data from the WATER MAINS TEMPERATURES object. @@ -8018,20 +6941,19 @@ namespace WeatherManager { // is fit to Fahrenheit units, so the air temperature values are first convert to F, then mains temperature // is calculated and converted back to C. - switch (state.dataWeatherManager->WaterMainsTempsMethod) { + switch (state.dataWeather->WaterMainsTempsMethod) { case WaterMainsTempCalcMethod::Schedule: - state.dataEnvrn->WaterMainsTemp = ScheduleManager::GetCurrentScheduleValue(state, state.dataWeatherManager->WaterMainsTempsSchedule); + state.dataEnvrn->WaterMainsTemp = ScheduleManager::GetCurrentScheduleValue(state, state.dataWeather->WaterMainsTempsSchedule); break; case WaterMainsTempCalcMethod::Correlation: state.dataEnvrn->WaterMainsTemp = WaterMainsTempFromCorrelation( - state, state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp); + state, state.dataWeather->WaterMainsTempsAnnualAvgAirTemp, state.dataWeather->WaterMainsTempsMaxDiffAirTemp); break; case WaterMainsTempCalcMethod::CorrelationFromWeatherFile: - if (state.dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed) { - state.dataEnvrn->WaterMainsTemp = - WaterMainsTempFromCorrelation(state, - state.dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp, - state.dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff); + if (state.dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed) { + state.dataEnvrn->WaterMainsTemp = WaterMainsTempFromCorrelation(state, + state.dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp, + state.dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff); } else { state.dataEnvrn->WaterMainsTemp = 10.0; // 50 F } @@ -8048,8 +6970,7 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Peter Graham Ellis // DATE WRITTEN January 2005 - // MODIFIED na B Nigusse June 2018 (Refactored) - // RE-ENGINEERED na + // MODIFIED B Nigusse June 2018 (Refactored) // PURPOSE OF THIS SUBROUTINE: // Calculates the daily water mains temperature based on input data from the WATER MAINS TEMPERATURES object. @@ -8091,14 +7012,13 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Peter Graham Ellis // DATE WRITTEN January 2006 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Reads the input data for the WEATHER STATION object. - state.dataIPShortCut->cCurrentModuleObject = "Site:WeatherStation"; - int const NumObjects = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject); + auto const &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "Site:WeatherStation"; + int const NumObjects = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); // Default conditions for a weather station in an open field at a height of 10 m. (These should match the IDD defaults.) Real64 WeatherFileWindSensorHeight = 10.0; // Height of the wind sensor at the weather station, i.e., weather file @@ -8113,7 +7033,7 @@ namespace WeatherManager { Array1D_string AlphArray(1); // Character string data Array1D NumArray(4); // Numeric data state.dataInputProcessing->inputProcessor->getObjectItem( - state, state.dataIPShortCut->cCurrentModuleObject, 1, AlphArray, NumAlphas, NumArray, NumNums, IOStat); + state, ipsc->cCurrentModuleObject, 1, AlphArray, NumAlphas, NumArray, NumNums, IOStat); if (NumNums > 0) WeatherFileWindSensorHeight = NumArray(1); if (NumNums > 1) WeatherFileWindExp = NumArray(2); @@ -8121,7 +7041,7 @@ namespace WeatherManager { if (NumNums > 3) WeatherFileTempSensorHeight = NumArray(4); } else if (NumObjects > 1) { - ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", state.dataIPShortCut->cCurrentModuleObject)); + ShowSevereError(state, format("{}: Too many objects entered. Only one allowed.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } @@ -8155,7 +7075,6 @@ namespace WeatherManager { // AUTHOR Fred Winkelmann // DATE WRITTEN July 1997 // MODIFIED Nov98 (FW); Nov 2000 (FW) - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // CALCULATES EXTERIOR DAYLIGHT ILLUMINANCE AND LUMINOUS EFFICACY @@ -8172,7 +7091,7 @@ namespace WeatherManager { // SOLCOS(3), below, is the cosine of the solar zenith angle. if (state.dataEnvrn->SunIsUp) { // Exterior horizontal beam irradiance (W/m2) - Real64 SDIRH = state.dataEnvrn->BeamSolarRad * state.dataEnvrn->SOLCOS(3); + Real64 SDIRH = state.dataEnvrn->BeamSolarRad * state.dataEnvrn->SOLCOS.z; // Exterior horizontal sky diffuse irradiance (W/m2) Real64 SDIFH = state.dataEnvrn->DifSolarRad; // Fraction of sky covered by clouds @@ -8206,7 +7125,6 @@ namespace WeatherManager { // AUTHOR Fred Winkelmann // DATE WRITTEN July 1997 // MODIFIED August 2009, BG fixed upper bound for sky clearness bin 7 - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Uses diffuse horizontal solar irradiance, direct normal solar @@ -8219,32 +7137,22 @@ namespace WeatherManager { // global irradiance components from direct and global irradiance," // Solar Energy 44 (1990) 271-289. - static Array1D const ADiffLumEff( - 8, {97.24, 107.22, 104.97, 102.39, 100.71, 106.42, 141.88, 152.23}); // Diffuse luminous efficacy coefficients - static Array1D const BDiffLumEff(8, {-0.46, 1.15, 2.96, 5.59, 5.94, 3.83, 1.90, 0.35}); - static Array1D const CDiffLumEff(8, {12.00, 0.59, -5.53, -13.95, -22.75, -36.15, -53.24, -45.27}); - static Array1D const DDiffLumEff(8, {-8.91, -3.95, -8.77, -13.90, -23.74, -28.83, -14.03, -7.98}); - static Array1D const ADirLumEff( - 8, {57.20, 98.99, 109.83, 110.34, 106.36, 107.19, 105.75, 101.18}); // Direct luminous efficacy coefficients - static Array1D const BDirLumEff(8, {-4.55, -3.46, -4.90, -5.84, -3.97, -1.25, 0.77, 1.58}); - static Array1D const CDirLumEff(8, {-2.98, -1.21, -1.71, -1.99, -1.75, -1.51, -1.26, -1.10}); - static Array1D const DDirLumEff(8, {117.12, 12.38, -8.81, -4.56, -6.16, -26.73, -34.44, -8.29}); - static Array1D const ExtraDirNormIll(12, - {131153.0, - 130613.0, - 128992.0, - 126816.0, - 124731.0, - 123240.0, - 122652.0, - 123120.0, - 124576.0, - 126658.0, - 128814.0, - 130471.0}); // Monthly exterrestrial direct normal illuminance (lum/m2) - - Real64 const SunZenith = std::acos(state.dataEnvrn->SOLCOS(3)); // Solar zenith angle (radians) - Real64 const SunAltitude = Constant::PiOvr2 - SunZenith; // Solar altitude angle (radians) + // Diffuse luminous efficacy coefficients + static constexpr std::array ADiffLumEff = {97.24, 107.22, 104.97, 102.39, 100.71, 106.42, 141.88, 152.23}; + static constexpr std::array BDiffLumEff = {-0.46, 1.15, 2.96, 5.59, 5.94, 3.83, 1.90, 0.35}; + static constexpr std::array CDiffLumEff = {12.00, 0.59, -5.53, -13.95, -22.75, -36.15, -53.24, -45.27}; + static constexpr std::array DDiffLumEff = {-8.91, -3.95, -8.77, -13.90, -23.74, -28.83, -14.03, -7.98}; + // Direct luminous efficacy coefficients + static constexpr std::array ADirLumEff = {57.20, 98.99, 109.83, 110.34, 106.36, 107.19, 105.75, 101.18}; + static constexpr std::array BDirLumEff = {-4.55, -3.46, -4.90, -5.84, -3.97, -1.25, 0.77, 1.58}; + static constexpr std::array CDirLumEff = {-2.98, -1.21, -1.71, -1.99, -1.75, -1.51, -1.26, -1.10}; + static constexpr std::array DDirLumEff = {117.12, 12.38, -8.81, -4.56, -6.16, -26.73, -34.44, -8.29}; + // Monthly exterrestrial direct normal illuminance (lum/m2) + static constexpr std::array ExtraDirNormIll = { + 131153.0, 130613.0, 128992.0, 126816.0, 124731.0, 123240.0, 122652.0, 123120.0, 124576.0, 126658.0, 128814.0, 130471.0}; + + Real64 const SunZenith = std::acos(state.dataEnvrn->SOLCOS.z); // Solar zenith angle (radians) + Real64 const SunAltitude = Constant::PiOvr2 - SunZenith; // Solar altitude angle (radians) Real64 const SinSunAltitude = std::sin(SunAltitude); // Clearness of sky. SkyClearness close to 1.0 corresponds to an overcast sky. // SkyClearness > 6 is a clear sky. @@ -8257,34 +7165,35 @@ namespace WeatherManager { Real64 const AirMass = (1.0 - 0.1 * state.dataEnvrn->Elevation / 1000.0) / (SinSunAltitude + 0.15 / std::pow(SunAltitude / Constant::DegToRadians + 3.885, 1.253)); // In the following, 93.73 is the extraterrestrial luminous efficacy - state.dataEnvrn->SkyBrightness = (state.dataEnvrn->DifSolarRad * 93.73) * AirMass / ExtraDirNormIll(state.dataEnvrn->Month); + state.dataEnvrn->SkyBrightness = (state.dataEnvrn->DifSolarRad * 93.73) * AirMass / ExtraDirNormIll[state.dataEnvrn->Month - 1]; int ISkyClearness; // Sky clearness bin if (state.dataEnvrn->SkyClearness <= 1.065) { - ISkyClearness = 1; + ISkyClearness = 0; } else if (state.dataEnvrn->SkyClearness <= 1.23) { - ISkyClearness = 2; + ISkyClearness = 1; } else if (state.dataEnvrn->SkyClearness <= 1.50) { - ISkyClearness = 3; + ISkyClearness = 2; } else if (state.dataEnvrn->SkyClearness <= 1.95) { - ISkyClearness = 4; + ISkyClearness = 3; } else if (state.dataEnvrn->SkyClearness <= 2.80) { - ISkyClearness = 5; + ISkyClearness = 4; } else if (state.dataEnvrn->SkyClearness <= 4.50) { - ISkyClearness = 6; + ISkyClearness = 5; } else if (state.dataEnvrn->SkyClearness <= 6.20) { - ISkyClearness = 7; + ISkyClearness = 6; } else { - ISkyClearness = 8; + ISkyClearness = 7; } + // Atmospheric moisture (cm of precipitable water) Real64 const AtmosMoisture = std::exp(0.07 * state.dataEnvrn->OutDewPointTemp - 0.075); // Sky diffuse luminous efficacy if (state.dataEnvrn->SkyBrightness <= 0.0) { DiffLumEff = 0.0; } else { - DiffLumEff = ADiffLumEff(ISkyClearness) + BDiffLumEff(ISkyClearness) * AtmosMoisture + - CDiffLumEff(ISkyClearness) * state.dataEnvrn->SOLCOS(3) + - DDiffLumEff(ISkyClearness) * std::log(state.dataEnvrn->SkyBrightness); + DiffLumEff = ADiffLumEff[ISkyClearness] + BDiffLumEff[ISkyClearness] * AtmosMoisture + + CDiffLumEff[ISkyClearness] * state.dataEnvrn->SOLCOS.z + + DDiffLumEff[ISkyClearness] * std::log(state.dataEnvrn->SkyBrightness); } // Direct normal luminous efficacy if (state.dataEnvrn->SkyBrightness <= 0.0) { @@ -8292,8 +7201,8 @@ namespace WeatherManager { } else { DirLumEff = max(0.0, - ADirLumEff(ISkyClearness) + BDirLumEff(ISkyClearness) * AtmosMoisture + - CDirLumEff(ISkyClearness) * std::exp(5.73 * SunZenith - 5.0) + DDirLumEff(ISkyClearness) * state.dataEnvrn->SkyBrightness); + ADirLumEff[ISkyClearness] + BDirLumEff[ISkyClearness] * AtmosMoisture + + CDirLumEff[ISkyClearness] * std::exp(5.73 * SunZenith - 5.0) + DDirLumEff[ISkyClearness] * state.dataEnvrn->SkyBrightness); } } @@ -8302,8 +7211,6 @@ namespace WeatherManager { // FUNCTION INFORMATION: // AUTHOR Linda K. Lawrie // DATE WRITTEN August 2003 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // This function determines the "standard time meridian" from the input @@ -8349,8 +7256,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN December 1999 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine processes each header line in the EPW weather file. @@ -8359,7 +7264,7 @@ namespace WeatherManager { // File is positioned to the correct line, then backspaced. This routine // reads in the line and processes as appropriate. - WeatherManager::DateType dateType; + Weather::DateType dateType; int NumHdArgs; // Strip off Header value from Line @@ -8372,7 +7277,7 @@ namespace WeatherManager { if (Pos != std::string::npos) Line.erase(0, Pos + 1); switch (headerType) { - case WeatherManager::EpwHeaderType::Location: { + case Weather::EpwHeaderType::Location: { // LOCATION, A1 [City], A2 [State/Province/Region], A3 [Country], // A4 [Source], N1 [WMO], N2 [Latitude], @@ -8397,35 +7302,35 @@ namespace WeatherManager { switch (i) { case 1: - state.dataWeatherManager->EPWHeaderTitle = stripped(Line.substr(0, Pos)); + state.dataWeather->EPWHeaderTitle = stripped(Line.substr(0, Pos)); break; case 2: case 3: case 4: - state.dataWeatherManager->EPWHeaderTitle = strip(state.dataWeatherManager->EPWHeaderTitle) + ' ' + stripped(Line.substr(0, Pos)); + state.dataWeather->EPWHeaderTitle = strip(state.dataWeather->EPWHeaderTitle) + ' ' + stripped(Line.substr(0, Pos)); break; case 5: - state.dataWeatherManager->EPWHeaderTitle += " WMO#=" + stripped(Line.substr(0, Pos)); + state.dataWeather->EPWHeaderTitle += " WMO#=" + stripped(Line.substr(0, Pos)); break; case 6: case 7: case 8: case 9: { bool errFlag; - Real64 const Number = UtilityRoutines::ProcessNumber(Line.substr(0, Pos), errFlag); + Real64 const Number = Util::ProcessNumber(Line.substr(0, Pos), errFlag); if (!errFlag) { switch (i) { case 6: - state.dataWeatherManager->WeatherFileLatitude = Number; + state.dataWeather->WeatherFileLatitude = Number; break; case 7: - state.dataWeatherManager->WeatherFileLongitude = Number; + state.dataWeather->WeatherFileLongitude = Number; break; case 8: - state.dataWeatherManager->WeatherFileTimeZone = Number; + state.dataWeather->WeatherFileTimeZone = Number; break; case 9: - state.dataWeatherManager->WeatherFileElevation = Number; + state.dataWeather->WeatherFileElevation = Number; break; default: break; @@ -8439,9 +7344,9 @@ namespace WeatherManager { } Line.erase(0, Pos + 1); } - state.dataEnvrn->WeatherFileLocationTitle = stripped(state.dataWeatherManager->EPWHeaderTitle); + state.dataEnvrn->WeatherFileLocationTitle = stripped(state.dataWeather->EPWHeaderTitle); } break; - case WeatherManager::EpwHeaderType::TypicalExtremePeriods: { + case Weather::EpwHeaderType::TypicalExtremePeriods: { strip(Line); Pos = index(Line, ','); if (Pos == std::string::npos) { @@ -8456,99 +7361,99 @@ namespace WeatherManager { } } bool IOStatus; - state.dataWeatherManager->NumEPWTypExtSets = UtilityRoutines::ProcessNumber(Line.substr(0, Pos), IOStatus); + state.dataWeather->NumEPWTypExtSets = Util::ProcessNumber(Line.substr(0, Pos), IOStatus); Line.erase(0, Pos + 1); - state.dataWeatherManager->TypicalExtremePeriods.allocate(state.dataWeatherManager->NumEPWTypExtSets); + state.dataWeather->TypicalExtremePeriods.allocate(state.dataWeather->NumEPWTypExtSets); int TropExtremeCount = 0; - for (int i = 1; i <= state.dataWeatherManager->NumEPWTypExtSets; ++i) { + for (int i = 1; i <= state.dataWeather->NumEPWTypExtSets; ++i) { strip(Line); Pos = index(Line, ','); if (Pos != std::string::npos) { - state.dataWeatherManager->TypicalExtremePeriods(i).Title = Line.substr(0, Pos); + state.dataWeather->TypicalExtremePeriods(i).Title = Line.substr(0, Pos); Line.erase(0, Pos + 1); } else { ShowWarningError(state, format("ProcessEPWHeader: Invalid Typical/Extreme Periods Header(WeatherFile)={}", Line.substr(0, Pos))); ShowContinueError(state, format("...on processing Typical/Extreme period #{}", i)); - state.dataWeatherManager->NumEPWTypExtSets = i - 1; + state.dataWeather->NumEPWTypExtSets = i - 1; break; } Pos = index(Line, ','); if (Pos != std::string::npos) { - state.dataWeatherManager->TypicalExtremePeriods(i).TEType = Line.substr(0, Pos); + state.dataWeather->TypicalExtremePeriods(i).TEType = Line.substr(0, Pos); Line.erase(0, Pos + 1); - if (UtilityRoutines::SameString(state.dataWeatherManager->TypicalExtremePeriods(i).TEType, "EXTREME")) { - if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO DRY SEASON - WEEK NEAR ANNUAL MAX")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMax"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO DRY SEASON - WEEK NEAR ANNUAL MIN")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMin"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO WET SEASON - WEEK NEAR ANNUAL MAX")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoWetSeasonMax"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO WET SEASON - WEEK NEAR ANNUAL MIN")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoWetSeasonMin"; + if (Util::SameString(state.dataWeather->TypicalExtremePeriods(i).TEType, "EXTREME")) { + if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO DRY SEASON - WEEK NEAR ANNUAL MAX")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMax"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO DRY SEASON - WEEK NEAR ANNUAL MIN")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMin"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO WET SEASON - WEEK NEAR ANNUAL MAX")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoWetSeasonMax"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO WET SEASON - WEEK NEAR ANNUAL MIN")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoWetSeasonMin"; // to account for problems earlier in weather files: - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO DRY")) { + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO DRY")) { if (TropExtremeCount == 0) { - state.dataWeatherManager->TypicalExtremePeriods(i).Title = "No Dry Season - Week Near Annual Max"; - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMax"; + state.dataWeather->TypicalExtremePeriods(i).Title = "No Dry Season - Week Near Annual Max"; + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMax"; ++TropExtremeCount; } else if (TropExtremeCount == 1) { - state.dataWeatherManager->TypicalExtremePeriods(i).Title = "No Dry Season - Week Near Annual Min"; - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMin"; + state.dataWeather->TypicalExtremePeriods(i).Title = "No Dry Season - Week Near Annual Min"; + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoDrySeasonMin"; ++TropExtremeCount; } } else { // make new short titles - if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "SUMMER")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Summer"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "WINTER")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Winter"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "TROPICAL HOT")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "TropicalHot"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "TROPICAL COLD")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "TropicalCold"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "AUTUMN")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Autumn"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO DRY")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoDrySeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO WET")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoWetSeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "WET ")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "WetSeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "DRY ")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "DrySeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "SPRING")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Spring"; + if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "SUMMER")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Summer"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "WINTER")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Winter"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "TROPICAL HOT")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "TropicalHot"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "TROPICAL COLD")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "TropicalCold"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "AUTUMN")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Autumn"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO DRY")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoDrySeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO WET")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoWetSeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "WET ")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "WetSeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "DRY ")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "DrySeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "SPRING")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Spring"; } } } else { // not extreme - if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "SUMMER")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Summer"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "WINTER")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Winter"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "TROPICAL HOT")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "TropicalHot"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "TROPICAL COLD")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "TropicalCold"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "AUTUMN")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Autumn"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO DRY")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoDrySeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "NO WET")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "NoWetSeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "WET ")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "WetSeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "DRY ")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "DrySeason"; - } else if (has_prefixi(state.dataWeatherManager->TypicalExtremePeriods(i).Title, "SPRING")) { - state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle = "Spring"; + if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "SUMMER")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Summer"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "WINTER")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Winter"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "TROPICAL HOT")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "TropicalHot"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "TROPICAL COLD")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "TropicalCold"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "AUTUMN")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Autumn"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO DRY")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoDrySeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "NO WET")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "NoWetSeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "WET ")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "WetSeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "DRY ")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "DrySeason"; + } else if (has_prefixi(state.dataWeather->TypicalExtremePeriods(i).Title, "SPRING")) { + state.dataWeather->TypicalExtremePeriods(i).ShortTitle = "Spring"; } } } else { ShowWarningError(state, format("ProcessEPWHeader: Invalid Typical/Extreme Periods Header(WeatherFile)={} {}", - state.dataWeatherManager->TypicalExtremePeriods(i).Title, + state.dataWeather->TypicalExtremePeriods(i).Title, Line.substr(0, Pos))); ShowContinueError(state, format("...on processing Typical/Extreme period #{}", i)); - state.dataWeatherManager->NumEPWTypExtSets = i - 1; + state.dataWeather->NumEPWTypExtSets = i - 1; break; } int PMonth; @@ -8561,8 +7466,8 @@ namespace WeatherManager { General::ProcessDateString(state, dateStringUC, PMonth, PDay, PWeekDay, dateType, ErrorsFound); if (dateType != DateType::Invalid) { if (PMonth != 0 && PDay != 0) { - state.dataWeatherManager->TypicalExtremePeriods(i).StartMonth = PMonth; - state.dataWeatherManager->TypicalExtremePeriods(i).StartDay = PDay; + state.dataWeather->TypicalExtremePeriods(i).StartMonth = PMonth; + state.dataWeather->TypicalExtremePeriods(i).StartDay = PDay; } } else { ShowSevereError( @@ -8579,8 +7484,8 @@ namespace WeatherManager { General::ProcessDateString(state, dateStringUC, PMonth, PDay, PWeekDay, dateType, ErrorsFound); if (dateType != DateType::Invalid) { if (PMonth != 0 && PDay != 0) { - state.dataWeatherManager->TypicalExtremePeriods(i).EndMonth = PMonth; - state.dataWeatherManager->TypicalExtremePeriods(i).EndDay = PDay; + state.dataWeather->TypicalExtremePeriods(i).EndMonth = PMonth; + state.dataWeather->TypicalExtremePeriods(i).EndDay = PDay; } } else { ShowSevereError( @@ -8594,8 +7499,8 @@ namespace WeatherManager { General::ProcessDateString(state, dateStringUC, PMonth, PDay, PWeekDay, dateType, ErrorsFound); if (dateType != DateType::Invalid) { if (PMonth != 0 && PDay != 0) { - state.dataWeatherManager->TypicalExtremePeriods(i).EndMonth = PMonth; - state.dataWeatherManager->TypicalExtremePeriods(i).EndDay = PDay; + state.dataWeather->TypicalExtremePeriods(i).EndMonth = PMonth; + state.dataWeather->TypicalExtremePeriods(i).EndDay = PDay; } } else { ShowSevereError( @@ -8605,90 +7510,87 @@ namespace WeatherManager { } } // Process periods to set up other values. - for (int i = 1; i <= state.dataWeatherManager->NumEPWTypExtSets; ++i) { + for (int i = 1; i <= state.dataWeather->NumEPWTypExtSets; ++i) { + auto &typicalExtPer = state.dataWeather->TypicalExtremePeriods(i); // JulianDay (Month,Day,LeapYearValue) - std::string const ExtremePeriodTitle = UtilityRoutines::makeUPPER(state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle); + std::string const ExtremePeriodTitle = Util::makeUPPER(typicalExtPer.ShortTitle); if (ExtremePeriodTitle == "SUMMER") { - if (UtilityRoutines::SameString(state.dataWeatherManager->TypicalExtremePeriods(i).TEType, "EXTREME")) { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "SummerExtreme"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue1 = "TropicalHot"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue2 = "NoDrySeasonMax"; + if (Util::SameString(typicalExtPer.TEType, "EXTREME")) { + typicalExtPer.MatchValue = "SummerExtreme"; + typicalExtPer.MatchValue1 = "TropicalHot"; + typicalExtPer.MatchValue2 = "NoDrySeasonMax"; } else { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "SummerTypical"; + typicalExtPer.MatchValue = "SummerTypical"; } } else if (ExtremePeriodTitle == "WINTER") { - if (UtilityRoutines::SameString(state.dataWeatherManager->TypicalExtremePeriods(i).TEType, "EXTREME")) { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "WinterExtreme"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue1 = "TropicalCold"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue2 = "NoDrySeasonMin"; + if (Util::SameString(typicalExtPer.TEType, "EXTREME")) { + typicalExtPer.MatchValue = "WinterExtreme"; + typicalExtPer.MatchValue1 = "TropicalCold"; + typicalExtPer.MatchValue2 = "NoDrySeasonMin"; } else { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "WinterTypical"; + typicalExtPer.MatchValue = "WinterTypical"; } } else if (ExtremePeriodTitle == "AUTUMN") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "AutumnTypical"; + typicalExtPer.MatchValue = "AutumnTypical"; } else if (ExtremePeriodTitle == "SPRING") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "SpringTypical"; + typicalExtPer.MatchValue = "SpringTypical"; } else if (ExtremePeriodTitle == "WETSEASON") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "WetSeason"; + typicalExtPer.MatchValue = "WetSeason"; } else if (ExtremePeriodTitle == "DRYSEASON") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "DrySeason"; + typicalExtPer.MatchValue = "DrySeason"; } else if (ExtremePeriodTitle == "NOWETSEASON") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "NoWetSeason"; + typicalExtPer.MatchValue = "NoWetSeason"; } else if (ExtremePeriodTitle == "NODRYSEASON") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "NoDrySeason"; + typicalExtPer.MatchValue = "NoDrySeason"; } else if ((ExtremePeriodTitle == "NODRYSEASONMAX") || (ExtremePeriodTitle == "NOWETSEASONMAX")) { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue1 = "TropicalHot"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue2 = "SummerExtreme"; + typicalExtPer.MatchValue = typicalExtPer.ShortTitle; + typicalExtPer.MatchValue1 = "TropicalHot"; + typicalExtPer.MatchValue2 = "SummerExtreme"; } else if ((ExtremePeriodTitle == "NODRYSEASONMIN") || (ExtremePeriodTitle == "NOWETSEASONMIN")) { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue1 = "TropicalCold"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue2 = "WinterExtreme"; + typicalExtPer.MatchValue = typicalExtPer.ShortTitle; + typicalExtPer.MatchValue1 = "TropicalCold"; + typicalExtPer.MatchValue2 = "WinterExtreme"; } else if (ExtremePeriodTitle == "TROPICALHOT") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "TropicalHot"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue1 = "SummerExtreme"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue2 = "NoDrySeasonMax"; + typicalExtPer.MatchValue = "TropicalHot"; + typicalExtPer.MatchValue1 = "SummerExtreme"; + typicalExtPer.MatchValue2 = "NoDrySeasonMax"; } else if (ExtremePeriodTitle == "TROPICALCOLD") { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "TropicalCold"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue1 = "WinterExtreme"; - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue2 = "NoDrySeasonMin"; + typicalExtPer.MatchValue = "TropicalCold"; + typicalExtPer.MatchValue1 = "WinterExtreme"; + typicalExtPer.MatchValue2 = "NoDrySeasonMin"; } else { - state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "Invalid - no match"; - } - state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay = General::OrdinalDay( - state.dataWeatherManager->TypicalExtremePeriods(i).StartMonth, state.dataWeatherManager->TypicalExtremePeriods(i).StartDay, 0); - state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay = General::OrdinalDay( - state.dataWeatherManager->TypicalExtremePeriods(i).EndMonth, state.dataWeatherManager->TypicalExtremePeriods(i).EndDay, 0); - if (state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay <= state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay) { - state.dataWeatherManager->TypicalExtremePeriods(i).TotalDays = - state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay - state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay + 1; + typicalExtPer.MatchValue = "Invalid - no match"; + } + typicalExtPer.StartJDay = General::OrdinalDay(typicalExtPer.StartMonth, typicalExtPer.StartDay, 0); + typicalExtPer.EndJDay = General::OrdinalDay(typicalExtPer.EndMonth, typicalExtPer.EndDay, 0); + if (typicalExtPer.StartJDay <= typicalExtPer.EndJDay) { + typicalExtPer.TotalDays = typicalExtPer.EndJDay - typicalExtPer.StartJDay + 1; } else { - state.dataWeatherManager->TypicalExtremePeriods(i).TotalDays = - General::OrdinalDay(12, 31, state.dataWeatherManager->LeapYearAdd) - - state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay + 1 + state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay; + typicalExtPer.TotalDays = + General::OrdinalDay(12, 31, state.dataWeather->LeapYearAdd) - typicalExtPer.StartJDay + 1 + typicalExtPer.EndJDay; } } } break; - case WeatherManager::EpwHeaderType::GroundTemperatures: { + case Weather::EpwHeaderType::GroundTemperatures: { // Added for ground surfaces defined with F or c factor method. TH 7/2009 // Assume the 0.5 m set of ground temperatures // or first set on a weather file, if any. Pos = index(Line, ','); if (Pos != std::string::npos) { bool errFlag; - int NumGrndTemps = UtilityRoutines::ProcessNumber(Line.substr(0, Pos), errFlag); + int NumGrndTemps = Util::ProcessNumber(Line.substr(0, Pos), errFlag); if (!errFlag && NumGrndTemps >= 1) { Line.erase(0, Pos + 1); // skip depth, soil conductivity, soil density, soil specific heat @@ -8700,28 +7602,27 @@ namespace WeatherManager { } Line.erase(0, Pos + 1); } - state.dataWeatherManager->GroundTempsFCFromEPWHeader = 0.0; + state.dataWeather->GroundTempsFCFromEPWHeader = 0.0; int actcount = 0; for (int i = 1; i <= 12; ++i) { // take the first set of ground temperatures. Pos = index(Line, ','); if (Pos != std::string::npos) { - state.dataWeatherManager->GroundTempsFCFromEPWHeader(i) = UtilityRoutines::ProcessNumber(Line.substr(0, Pos), errFlag); + state.dataWeather->GroundTempsFCFromEPWHeader(i) = Util::ProcessNumber(Line.substr(0, Pos), errFlag); ++actcount; } else { if (len(Line) > 0) { - state.dataWeatherManager->GroundTempsFCFromEPWHeader(i) = - UtilityRoutines::ProcessNumber(Line.substr(0, Pos), errFlag); + state.dataWeather->GroundTempsFCFromEPWHeader(i) = Util::ProcessNumber(Line.substr(0, Pos), errFlag); ++actcount; } break; } Line.erase(0, Pos + 1); } - if (actcount == 12) state.dataWeatherManager->wthFCGroundTemps = true; + if (actcount == 12) state.dataWeather->wthFCGroundTemps = true; } } } break; - case WeatherManager::EpwHeaderType::HolidaysDST: { + case Weather::EpwHeaderType::HolidaysDST: { // A1, \field LeapYear Observed // \type choice // \key Yes @@ -8759,7 +7660,7 @@ namespace WeatherManager { int PWeekDay; bool IOStatus; if (i == 1) { - state.dataWeatherManager->WFAllowsLeapYears = (Line[0] == 'Y'); + state.dataWeather->WFAllowsLeapYears = (Line[0] == 'Y'); } else if (i == 2) { // In this section, we call ProcessDateString, and if that fails, we can recover from it // by setting DST to false, so we don't affect ErrorsFound @@ -8770,13 +7671,13 @@ namespace WeatherManager { if (dateType != DateType::Invalid) { // ErrorsFound is still false after ProcessDateString if (PMonth == 0 && PDay == 0) { - state.dataWeatherManager->EPWDaylightSaving = false; + state.dataWeather->EPWDaylightSaving = false; } else { - state.dataWeatherManager->EPWDaylightSaving = true; - state.dataWeatherManager->EPWDST.StDateType = dateType; - state.dataWeatherManager->EPWDST.StMon = PMonth; - state.dataWeatherManager->EPWDST.StDay = PDay; - state.dataWeatherManager->EPWDST.StWeekDay = PWeekDay; + state.dataWeather->EPWDaylightSaving = true; + state.dataWeather->EPWDST.StDateType = dateType; + state.dataWeather->EPWDST.StMon = PMonth; + state.dataWeather->EPWDST.StDay = PDay; + state.dataWeather->EPWDST.StWeekDay = PWeekDay; } } else { // ErrorsFound is untouched @@ -8784,66 +7685,67 @@ namespace WeatherManager { state, format("ProcessEPWHeader: Invalid Daylight Saving Period Start Date Field(WeatherFile)={}", Line.substr(0, Pos))); ShowContinueError(state, format("...invalid header={}", epwHeaders[static_cast(headerType)])); ShowContinueError(state, "...Setting Weather File DST to false."); - state.dataWeatherManager->EPWDaylightSaving = false; + state.dataWeather->EPWDaylightSaving = false; } } else if (i == 3) { General::ProcessDateString(state, Line.substr(0, Pos), PMonth, PDay, PWeekDay, dateType, ErrorsFound); - if (state.dataWeatherManager->EPWDaylightSaving) { + if (state.dataWeather->EPWDaylightSaving) { if (dateType != DateType::Invalid) { - state.dataWeatherManager->EPWDST.EnDateType = dateType; - state.dataWeatherManager->EPWDST.EnMon = PMonth; - state.dataWeatherManager->EPWDST.EnDay = PDay; - state.dataWeatherManager->EPWDST.EnWeekDay = PWeekDay; + state.dataWeather->EPWDST.EnDateType = dateType; + state.dataWeather->EPWDST.EnMon = PMonth; + state.dataWeather->EPWDST.EnDay = PDay; + state.dataWeather->EPWDST.EnWeekDay = PWeekDay; } else { ShowWarningError( state, format("ProcessEPWHeader: Invalid Daylight Saving Period End Date Field(WeatherFile)={}", Line.substr(0, Pos))); ShowContinueError(state, "...Setting Weather File DST to false."); - state.dataWeatherManager->EPWDaylightSaving = false; + state.dataWeather->EPWDaylightSaving = false; } - state.dataWeatherManager->DST = state.dataWeatherManager->EPWDST; + state.dataWeather->DST = state.dataWeather->EPWDST; } } else if (i == 4) { - int NumEPWHolidays = UtilityRoutines::ProcessNumber(Line.substr(0, Pos), IOStatus); - state.dataWeatherManager->NumSpecialDays = + int NumEPWHolidays = Util::ProcessNumber(Line.substr(0, Pos), IOStatus); + state.dataWeather->NumSpecialDays = NumEPWHolidays + state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "RunPeriodControl:SpecialDays"); - state.dataWeatherManager->SpecialDays.allocate(state.dataWeatherManager->NumSpecialDays); + state.dataWeather->SpecialDays.allocate(state.dataWeather->NumSpecialDays); NumHdArgs = 4 + NumEPWHolidays * 2; } else if ((i >= 5)) { if (mod(i, 2) != 0) { ++CurCount; - if (CurCount > state.dataWeatherManager->NumSpecialDays) { + if (CurCount > state.dataWeather->NumSpecialDays) { ShowSevereError(state, "Too many SpecialDays"); ErrorsFound = true; } else { - state.dataWeatherManager->SpecialDays(CurCount).Name = Line.substr(0, Pos); + state.dataWeather->SpecialDays(CurCount).Name = Line.substr(0, Pos); } // Process name } else { - if (CurCount <= state.dataWeatherManager->NumSpecialDays) { + if (CurCount <= state.dataWeather->NumSpecialDays) { + auto &specialDay = state.dataWeather->SpecialDays(CurCount); // Process date General::ProcessDateString(state, Line.substr(0, Pos), PMonth, PDay, PWeekDay, dateType, ErrorsFound); if (dateType == DateType::MonthDay) { - state.dataWeatherManager->SpecialDays(CurCount).DateType = dateType; - state.dataWeatherManager->SpecialDays(CurCount).Month = PMonth; - state.dataWeatherManager->SpecialDays(CurCount).Day = PDay; - state.dataWeatherManager->SpecialDays(CurCount).WeekDay = 0; - state.dataWeatherManager->SpecialDays(CurCount).CompDate = PMonth * 32 + PDay; - state.dataWeatherManager->SpecialDays(CurCount).Duration = 1; - state.dataWeatherManager->SpecialDays(CurCount).DayType = 1; - state.dataWeatherManager->SpecialDays(CurCount).WthrFile = true; + specialDay.dateType = dateType; + specialDay.Month = PMonth; + specialDay.Day = PDay; + specialDay.WeekDay = 0; + specialDay.CompDate = PMonth * 32 + PDay; + specialDay.Duration = 1; + specialDay.DayType = 1; + specialDay.WthrFile = true; } else if (dateType != DateType::Invalid) { - state.dataWeatherManager->SpecialDays(CurCount).DateType = dateType; - state.dataWeatherManager->SpecialDays(CurCount).Month = PMonth; - state.dataWeatherManager->SpecialDays(CurCount).Day = PDay; - state.dataWeatherManager->SpecialDays(CurCount).WeekDay = PWeekDay; - state.dataWeatherManager->SpecialDays(CurCount).CompDate = 0; - state.dataWeatherManager->SpecialDays(CurCount).Duration = 1; - state.dataWeatherManager->SpecialDays(CurCount).DayType = 1; - state.dataWeatherManager->SpecialDays(CurCount).WthrFile = true; + specialDay.dateType = dateType; + specialDay.Month = PMonth; + specialDay.Day = PDay; + specialDay.WeekDay = PWeekDay; + specialDay.CompDate = 0; + specialDay.Duration = 1; + specialDay.DayType = 1; + specialDay.WthrFile = true; } else if (dateType == DateType::Invalid) { ShowSevereError(state, format("Invalid SpecialDay Date Field(WeatherFile)={}", Line.substr(0, Pos))); ErrorsFound = true; @@ -8853,32 +7755,25 @@ namespace WeatherManager { } Line.erase(0, Pos + 1); } - for (int i = 1; i <= state.dataWeatherManager->NumEPWTypExtSets; ++i) { + for (int i = 1; i <= state.dataWeather->NumEPWTypExtSets; ++i) { // General::OrdinalDay (Month,Day,LeapYearValue) - state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay = - General::OrdinalDay(state.dataWeatherManager->TypicalExtremePeriods(i).StartMonth, - state.dataWeatherManager->TypicalExtremePeriods(i).StartDay, - state.dataWeatherManager->LeapYearAdd); - state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay = - General::OrdinalDay(state.dataWeatherManager->TypicalExtremePeriods(i).EndMonth, - state.dataWeatherManager->TypicalExtremePeriods(i).EndDay, - state.dataWeatherManager->LeapYearAdd); - if (state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay <= state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay) { - state.dataWeatherManager->TypicalExtremePeriods(i).TotalDays = - state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay - state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay + 1; + auto &typicalExtPer = state.dataWeather->TypicalExtremePeriods(i); + typicalExtPer.StartJDay = General::OrdinalDay(typicalExtPer.StartMonth, typicalExtPer.StartDay, state.dataWeather->LeapYearAdd); + typicalExtPer.EndJDay = General::OrdinalDay(typicalExtPer.EndMonth, typicalExtPer.EndDay, state.dataWeather->LeapYearAdd); + if (typicalExtPer.StartJDay <= typicalExtPer.EndJDay) { + typicalExtPer.TotalDays = typicalExtPer.EndJDay - typicalExtPer.StartJDay + 1; } else { - state.dataWeatherManager->TypicalExtremePeriods(i).TotalDays = - General::OrdinalDay(12, 31, state.dataWeatherManager->LeapYearAdd) - - state.dataWeatherManager->TypicalExtremePeriods(i).StartJDay + 1 + state.dataWeatherManager->TypicalExtremePeriods(i).EndJDay; + typicalExtPer.TotalDays = + General::OrdinalDay(12, 31, state.dataWeather->LeapYearAdd) - typicalExtPer.StartJDay + 1 + typicalExtPer.EndJDay; } } } break; - case WeatherManager::EpwHeaderType::Comments1: - case WeatherManager::EpwHeaderType::Comments2: - case WeatherManager::EpwHeaderType::DesignConditions: { + case Weather::EpwHeaderType::Comments1: + case Weather::EpwHeaderType::Comments2: + case Weather::EpwHeaderType::DesignConditions: { // no action } break; - case WeatherManager::EpwHeaderType::DataPeriods: { + case Weather::EpwHeaderType::DataPeriods: { // N1, \field Number of Data Periods // N2, \field Number of Records per hour // A1, \field Data Period 1 Name/Description @@ -8914,16 +7809,16 @@ namespace WeatherManager { bool IOStatus; if (i == 1) { - state.dataWeatherManager->NumDataPeriods = UtilityRoutines::ProcessNumber(Line.substr(0, Pos), IOStatus); - state.dataWeatherManager->DataPeriods.allocate(state.dataWeatherManager->NumDataPeriods); - NumHdArgs += 4 * state.dataWeatherManager->NumDataPeriods; - if (state.dataWeatherManager->NumDataPeriods > 0) { - for (auto &e : state.dataWeatherManager->DataPeriods) + state.dataWeather->NumDataPeriods = Util::ProcessNumber(Line.substr(0, Pos), IOStatus); + state.dataWeather->DataPeriods.allocate(state.dataWeather->NumDataPeriods); + NumHdArgs += 4 * state.dataWeather->NumDataPeriods; + if (state.dataWeather->NumDataPeriods > 0) { + for (auto &e : state.dataWeather->DataPeriods) e.NumDays = 0; } } else if (i == 2) { - state.dataWeatherManager->NumIntervalsPerHour = UtilityRoutines::ProcessNumber(Line.substr(0, Pos), IOStatus); + state.dataWeather->NumIntervalsPerHour = Util::ProcessNumber(Line.substr(0, Pos), IOStatus); } else if (i >= 3) { int const CurOne = mod(i - 3, 4); int PMonth; @@ -8933,38 +7828,38 @@ namespace WeatherManager { if (CurOne == 0) { // Description of Data Period ++CurCount; - if (CurCount > state.dataWeatherManager->NumDataPeriods) { + if (CurCount > state.dataWeather->NumDataPeriods) { ShowSevereError(state, "Too many data periods"); ErrorsFound = true; } else { - state.dataWeatherManager->DataPeriods(CurCount).Name = Line.substr(0, Pos); + state.dataWeather->DataPeriods(CurCount).Name = Line.substr(0, Pos); } } else if (CurOne == 1) { // Start Day of Week - if (CurCount <= state.dataWeatherManager->NumDataPeriods) { - state.dataWeatherManager->DataPeriods(CurCount).DayOfWeek = Line.substr(0, Pos); - state.dataWeatherManager->DataPeriods(CurCount).WeekDay = - getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataWeatherManager->DataPeriods(CurCount).DayOfWeek); - if (state.dataWeatherManager->DataPeriods(CurCount).WeekDay < 1 || - state.dataWeatherManager->DataPeriods(CurCount).WeekDay > 7) { + if (CurCount <= state.dataWeather->NumDataPeriods) { + auto &dataPeriod = state.dataWeather->DataPeriods(CurCount); + dataPeriod.DayOfWeek = Line.substr(0, Pos); + dataPeriod.WeekDay = getEnumValue(ScheduleManager::dayTypeNamesUC, dataPeriod.DayOfWeek); + if (dataPeriod.WeekDay < 1 || dataPeriod.WeekDay > 7) { ShowSevereError(state, fmt::format("Weather File -- Invalid Start Day of Week for Data Period #{}, Invalid day={}", CurCount, - state.dataWeatherManager->DataPeriods(CurCount).DayOfWeek)); + dataPeriod.DayOfWeek)); ErrorsFound = true; } } } else if (CurOne == 2) { // DataPeriod Start Day - if (CurCount <= state.dataWeatherManager->NumDataPeriods) { + if (CurCount <= state.dataWeather->NumDataPeriods) { + auto &dataPeriod = state.dataWeather->DataPeriods(CurCount); General::ProcessDateString(state, Line.substr(0, Pos), PMonth, PDay, PWeekDay, dateType, ErrorsFound, PYear); if (dateType == DateType::MonthDay) { - state.dataWeatherManager->DataPeriods(CurCount).StMon = PMonth; - state.dataWeatherManager->DataPeriods(CurCount).StDay = PDay; - state.dataWeatherManager->DataPeriods(CurCount).StYear = PYear; - if (PYear != 0) state.dataWeatherManager->DataPeriods(CurCount).HasYearData = true; + dataPeriod.StMon = PMonth; + dataPeriod.StDay = PDay; + dataPeriod.StYear = PYear; + if (PYear != 0) dataPeriod.HasYearData = true; } else { ShowSevereError(state, format("Data Periods must be of the form or (WeatherFile), found={}", @@ -8974,16 +7869,17 @@ namespace WeatherManager { } } else if (CurOne == 3) { - if (CurCount <= state.dataWeatherManager->NumDataPeriods) { + auto &dataPeriod = state.dataWeather->DataPeriods(CurCount); + if (CurCount <= state.dataWeather->NumDataPeriods) { General::ProcessDateString(state, Line.substr(0, Pos), PMonth, PDay, PWeekDay, dateType, ErrorsFound, PYear); if (dateType == DateType::MonthDay) { - state.dataWeatherManager->DataPeriods(CurCount).EnMon = PMonth; - state.dataWeatherManager->DataPeriods(CurCount).EnDay = PDay; - state.dataWeatherManager->DataPeriods(CurCount).EnYear = PYear; - if (PYear == 0 && state.dataWeatherManager->DataPeriods(CurCount).HasYearData) { + dataPeriod.EnMon = PMonth; + dataPeriod.EnDay = PDay; + dataPeriod.EnYear = PYear; + if (PYear == 0 && dataPeriod.HasYearData) { ShowWarningError(state, "Data Period (WeatherFile) - Start Date contains year. End Date does not."); ShowContinueError(state, "...Assuming same year as Start Date for this data."); - state.dataWeatherManager->DataPeriods(CurCount).EnYear = state.dataWeatherManager->DataPeriods(CurCount).StYear; + dataPeriod.EnYear = dataPeriod.StYear; } } else { ShowSevereError(state, @@ -8992,40 +7888,27 @@ namespace WeatherManager { ErrorsFound = true; } } - if (state.dataWeatherManager->DataPeriods(CurCount).StYear == 0 || - state.dataWeatherManager->DataPeriods(CurCount).EnYear == 0) { - state.dataWeatherManager->DataPeriods(CurCount).DataStJDay = - General::OrdinalDay(state.dataWeatherManager->DataPeriods(CurCount).StMon, - state.dataWeatherManager->DataPeriods(CurCount).StDay, - state.dataWeatherManager->LeapYearAdd); - state.dataWeatherManager->DataPeriods(CurCount).DataEnJDay = - General::OrdinalDay(state.dataWeatherManager->DataPeriods(CurCount).EnMon, - state.dataWeatherManager->DataPeriods(CurCount).EnDay, - state.dataWeatherManager->LeapYearAdd); - if (state.dataWeatherManager->DataPeriods(CurCount).DataStJDay <= - state.dataWeatherManager->DataPeriods(CurCount).DataEnJDay) { - state.dataWeatherManager->DataPeriods(CurCount).NumDays = state.dataWeatherManager->DataPeriods(CurCount).DataEnJDay - - state.dataWeatherManager->DataPeriods(CurCount).DataStJDay + - 1; + if (dataPeriod.StYear == 0 || dataPeriod.EnYear == 0) { + dataPeriod.DataStJDay = General::OrdinalDay(dataPeriod.StMon, dataPeriod.StDay, state.dataWeather->LeapYearAdd); + dataPeriod.DataEnJDay = General::OrdinalDay(dataPeriod.EnMon, dataPeriod.EnDay, state.dataWeather->LeapYearAdd); + if (dataPeriod.DataStJDay <= dataPeriod.DataEnJDay) { + dataPeriod.NumDays = dataPeriod.DataEnJDay - dataPeriod.DataStJDay + 1; } else { - state.dataWeatherManager->DataPeriods(CurCount).NumDays = - (365 - state.dataWeatherManager->DataPeriods(CurCount).DataStJDay + 1) + - (state.dataWeatherManager->DataPeriods(CurCount).DataEnJDay - 1 + 1); + dataPeriod.NumDays = (365 - dataPeriod.DataStJDay + 1) + (dataPeriod.DataEnJDay - 1 + 1); } } else { // weather file has actual year(s) - auto &dataPeriod = state.dataWeatherManager->DataPeriods(CurCount); dataPeriod.DataStJDay = computeJulianDate(dataPeriod.StYear, dataPeriod.StMon, dataPeriod.StDay); dataPeriod.DataEnJDay = computeJulianDate(dataPeriod.EnYear, dataPeriod.EnMon, dataPeriod.EnDay); dataPeriod.NumDays = dataPeriod.DataEnJDay - dataPeriod.DataStJDay + 1; } // Have processed the last item for this, can set up Weekdays for months - state.dataWeatherManager->DataPeriods(CurCount).MonWeekDay = 0; + dataPeriod.MonWeekDay = 0; if (!ErrorsFound) { SetupWeekDaysByMonth(state, - state.dataWeatherManager->DataPeriods(CurCount).StMon, - state.dataWeatherManager->DataPeriods(CurCount).StDay, - state.dataWeatherManager->DataPeriods(CurCount).WeekDay, - state.dataWeatherManager->DataPeriods(CurCount).MonWeekDay); + state.dataWeather->DataPeriods(CurCount).StMon, + state.dataWeather->DataPeriods(CurCount).StDay, + state.dataWeather->DataPeriods(CurCount).WeekDay, + state.dataWeather->DataPeriods(CurCount).MonWeekDay); } } } @@ -9045,8 +7928,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda K. Lawrie // DATE WRITTEN August 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine skips the initial header records on the EnergyPlus Weather File (in.epw). @@ -9105,7 +7986,7 @@ namespace WeatherManager { if (i == 1) { bool IOStatus; - int const NumPeriods = UtilityRoutines::ProcessNumber(Line.data.substr(0, Pos), IOStatus); + int const NumPeriods = Util::ProcessNumber(Line.data.substr(0, Pos), IOStatus); NumHdArgs += 4 * NumPeriods; } else if ((i >= 3)) { if (mod(i - 3, 4) == 0) ++CurCount; @@ -9120,8 +8001,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN January 2002 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine reports the counts of missing/out of range data @@ -9147,22 +8026,22 @@ namespace WeatherManager { } }; - missedHeaderCheck(state.dataWeatherManager->Missed.DryBulb, "Dry Bulb Temperature"); - missedHeaderCheck(state.dataWeatherManager->Missed.StnPres, "Atmospheric Pressure"); - missedHeaderCheck(state.dataWeatherManager->Missed.RelHumid, "Relative Humidity"); - missedHeaderCheck(state.dataWeatherManager->Missed.DewPoint, "Dew Point Temperatures"); - missedHeaderCheck(state.dataWeatherManager->Missed.WindSpd, "Wind Speed"); - missedHeaderCheck(state.dataWeatherManager->Missed.WindDir, "Wind Direction"); - missedHeaderCheck(state.dataWeatherManager->Missed.DirectRad, "Direct Radiation"); - missedHeaderCheck(state.dataWeatherManager->Missed.DiffuseRad, "Diffuse Radiation"); - missedHeaderCheck(state.dataWeatherManager->Missed.TotSkyCvr, "Total Sky Cover"); - missedHeaderCheck(state.dataWeatherManager->Missed.OpaqSkyCvr, "Opaque Sky Cover"); - missedHeaderCheck(state.dataWeatherManager->Missed.SnowDepth, "Snow Depth"); - if (state.dataWeatherManager->Missed.WeathCodes > 0) { + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.OutDryBulbTemp, "Dry Bulb Temperature"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.OutBaroPress, "Atmospheric Pressure"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.OutRelHum, "Relative Humidity"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.OutDewPointTemp, "Dew Point Temperatures"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.WindSpeed, "Wind Speed"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.WindDir, "Wind Direction"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.BeamSolarRad, "Direct Radiation"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.DifSolarRad, "Diffuse Radiation"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.TotalSkyCover, "Total Sky Cover"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.OpaqueSkyCover, "Opaque Sky Cover"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.SnowDepth, "Snow Depth"); + if (state.dataWeather->wvarsMissedCounts.WeathCodes > 0) { ShowWarningError(state, std::string{InvString}); - ShowMessage(state, format(ivFmt, "\"Weather Codes\" (not equal 9 digits)", state.dataWeatherManager->Missed.WeathCodes)); + ShowMessage(state, format(ivFmt, "\"Weather Codes\" (not equal 9 digits)", state.dataWeather->wvarsMissedCounts.WeathCodes)); } - missedHeaderCheck(state.dataWeatherManager->Missed.LiquidPrecip, "Liquid Precipitation Depth"); + missedHeaderCheck(state.dataWeather->wvarsMissedCounts.LiquidPrecip, "Liquid Precipitation Depth"); bool OutOfRangeHeader = false; auto outOfRangeHeaderCheck = // (AUTO_OK_LAMBDA) @@ -9176,15 +8055,18 @@ namespace WeatherManager { if (!extraMsg.empty()) ShowMessage(state, std::string{extraMsg}); } }; - outOfRangeHeaderCheck(state.dataWeatherManager->OutOfRange.DryBulb, "Dry Bulb Temperatures", ">=-90", "<=70", ""); - outOfRangeHeaderCheck( - state.dataWeatherManager->OutOfRange.StnPres, "Atmospheric Pressure", ">31000", "<=120000", "Out of Range values set to last good value"); - outOfRangeHeaderCheck(state.dataWeatherManager->OutOfRange.RelHumid, "Relative Humidity", ">=0", "<=110", ""); - outOfRangeHeaderCheck(state.dataWeatherManager->OutOfRange.DewPoint, "Dew Point Temperatures", ">=-90", "<=70", ""); - outOfRangeHeaderCheck(state.dataWeatherManager->OutOfRange.WindSpd, "Wind Speed", ">=0", "<=40", ""); - outOfRangeHeaderCheck(state.dataWeatherManager->OutOfRange.WindDir, "Wind Direction", ">=0", "<=360", ""); - outOfRangeHeaderCheck(state.dataWeatherManager->OutOfRange.DirectRad, "Direct Radiation", ">=0", "NoLimit", ""); - outOfRangeHeaderCheck(state.dataWeatherManager->OutOfRange.DiffuseRad, "Diffuse Radiation", ">=0", "NoLimit", ""); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.OutDryBulbTemp, "Dry Bulb Temperatures", ">=-90", "<=70", ""); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.OutBaroPress, + "Atmospheric Pressure", + ">31000", + "<=120000", + "Out of Range values set to last good value"); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.OutRelHum, "Relative Humidity", ">=0", "<=110", ""); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.OutDewPointTemp, "Dew Point Temperatures", ">=-90", "<=70", ""); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.WindSpeed, "Wind Speed", ">=0", "<=40", ""); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.WindDir, "Wind Direction", ">=0", "<=360", ""); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.BeamSolarRad, "Direct Radiation", ">=0", "NoLimit", ""); + outOfRangeHeaderCheck(state.dataWeather->wvarsOutOfRangeCounts.DifSolarRad, "Diffuse Radiation", ">=0", "NoLimit", ""); } void SetupInterpolationValues(EnergyPlusData &state) @@ -9193,8 +8075,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN November 2002 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine creates the "interpolation" values / weights that are used for @@ -9206,45 +8086,45 @@ namespace WeatherManager { int halfpoint = 0; - state.dataWeatherManager->Interpolation.allocate(state.dataGlobal->NumOfTimeStepInHour); - state.dataWeatherManager->SolarInterpolation.allocate(state.dataGlobal->NumOfTimeStepInHour); - state.dataWeatherManager->Interpolation = 0.0; - state.dataWeatherManager->SolarInterpolation = 0.0; + state.dataWeather->Interpolation.allocate(state.dataGlobal->NumOfTimeStepInHour); + state.dataWeather->SolarInterpolation.allocate(state.dataGlobal->NumOfTimeStepInHour); + state.dataWeather->Interpolation = 0.0; + state.dataWeather->SolarInterpolation = 0.0; for (int tloop = 1; tloop <= state.dataGlobal->NumOfTimeStepInHour; ++tloop) { - state.dataWeatherManager->Interpolation(tloop) = + state.dataWeather->Interpolation(tloop) = (state.dataGlobal->NumOfTimeStepInHour == 1) ? 1.0 : min(1.0, (double(tloop) / double(state.dataGlobal->NumOfTimeStepInHour))); } if (mod(state.dataGlobal->NumOfTimeStepInHour, 2) == 0) { // even number of time steps. halfpoint = state.dataGlobal->NumOfTimeStepInHour / 2; - state.dataWeatherManager->SolarInterpolation(halfpoint) = 1.0; + state.dataWeather->SolarInterpolation(halfpoint) = 1.0; Real64 tweight = 1.0 / double(state.dataGlobal->NumOfTimeStepInHour); for (int tloop = halfpoint + 1, hpoint = 1; tloop <= state.dataGlobal->NumOfTimeStepInHour; ++tloop, ++hpoint) { - state.dataWeatherManager->SolarInterpolation(tloop) = 1.0 - hpoint * tweight; + state.dataWeather->SolarInterpolation(tloop) = 1.0 - hpoint * tweight; } for (int tloop = halfpoint - 1, hpoint = 1; tloop >= 1; --tloop, ++hpoint) { - state.dataWeatherManager->SolarInterpolation(tloop) = 1.0 - hpoint * tweight; + state.dataWeather->SolarInterpolation(tloop) = 1.0 - hpoint * tweight; } } else { // odd number of time steps if (state.dataGlobal->NumOfTimeStepInHour == 1) { - state.dataWeatherManager->SolarInterpolation(1) = 0.5; + state.dataWeather->SolarInterpolation(1) = 0.5; } else if (state.dataGlobal->NumOfTimeStepInHour == 3) { - state.dataWeatherManager->SolarInterpolation(1) = 5.0 / 6.0; - state.dataWeatherManager->SolarInterpolation(2) = 5.0 / 6.0; - state.dataWeatherManager->SolarInterpolation(3) = 0.5; + state.dataWeather->SolarInterpolation(1) = 5.0 / 6.0; + state.dataWeather->SolarInterpolation(2) = 5.0 / 6.0; + state.dataWeather->SolarInterpolation(3) = 0.5; } else { Real64 tweight = 1.0 / double(state.dataGlobal->NumOfTimeStepInHour); halfpoint = state.dataGlobal->NumOfTimeStepInHour / 2; Real64 tweight1 = 1.0 - tweight / 2.0; - state.dataWeatherManager->SolarInterpolation(halfpoint) = tweight1; - state.dataWeatherManager->SolarInterpolation(halfpoint + 1) = tweight1; + state.dataWeather->SolarInterpolation(halfpoint) = tweight1; + state.dataWeather->SolarInterpolation(halfpoint + 1) = tweight1; for (int tloop = halfpoint + 2, hpoint = 1; tloop <= state.dataGlobal->NumOfTimeStepInHour; ++tloop, ++hpoint) { - state.dataWeatherManager->SolarInterpolation(tloop) = tweight1 - hpoint * tweight; + state.dataWeather->SolarInterpolation(tloop) = tweight1 - hpoint * tweight; } for (int tloop = halfpoint - 1, hpoint = 1; tloop >= 1; --tloop, ++hpoint) { - state.dataWeatherManager->SolarInterpolation(tloop) = tweight1 - hpoint * tweight; + state.dataWeather->SolarInterpolation(tloop) = tweight1 - hpoint * tweight; } } } @@ -9256,141 +8136,131 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN October 2010 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Make sure Environment derived type is set prior to getting // Weather Properties // Transfer weather file information to the Environment derived type - state.dataWeatherManager->Envrn = state.dataEnvrn->TotDesDays + 1; + state.dataWeather->Envrn = state.dataEnvrn->TotDesDays + 1; // Sizing Periods from Weather File - for (int i = 1; i <= state.dataWeatherManager->TotRunDesPers; ++i) { - auto &env = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn); - auto &runPer = state.dataWeatherManager->RunPeriodDesignInput(i); - - env.StartMonth = runPer.startMonth; - env.StartDay = runPer.startDay; - env.StartJDay = General::OrdinalDay(runPer.startMonth, runPer.startDay, state.dataWeatherManager->LeapYearAdd); - env.TotalDays = runPer.totalDays; - env.EndMonth = runPer.endMonth; - env.EndDay = runPer.endDay; - env.EndJDay = General::OrdinalDay(runPer.endMonth, runPer.endDay, state.dataWeatherManager->LeapYearAdd); - env.NumSimYears = runPer.numSimYears; - if (env.StartJDay <= env.EndJDay) { - env.TotalDays = (env.EndJDay - env.StartJDay + 1) * env.NumSimYears; + for (int iRunPer = 1; iRunPer <= state.dataWeather->TotRunDesPers; ++iRunPer, ++state.dataWeather->Envrn) { + auto const &runPer = state.dataWeather->RunPeriodDesignInput(iRunPer); + auto &envCurr = state.dataWeather->Environment(state.dataWeather->Envrn); + + envCurr.StartMonth = runPer.startMonth; + envCurr.StartDay = runPer.startDay; + envCurr.StartJDay = General::OrdinalDay(runPer.startMonth, runPer.startDay, state.dataWeather->LeapYearAdd); + envCurr.TotalDays = runPer.totalDays; + envCurr.EndMonth = runPer.endMonth; + envCurr.EndDay = runPer.endDay; + envCurr.EndJDay = General::OrdinalDay(runPer.endMonth, runPer.endDay, state.dataWeather->LeapYearAdd); + envCurr.NumSimYears = runPer.numSimYears; + if (envCurr.StartJDay <= envCurr.EndJDay) { + envCurr.TotalDays = (envCurr.EndJDay - envCurr.StartJDay + 1) * envCurr.NumSimYears; } else { - env.TotalDays = - (General::OrdinalDay(12, 31, state.dataWeatherManager->LeapYearAdd) - env.StartJDay + 1 + env.EndJDay) * env.NumSimYears; - } - state.dataEnvrn->TotRunDesPersDays += env.TotalDays; - env.UseDST = runPer.useDST; - env.UseHolidays = runPer.useHolidays; - env.Title = runPer.title; - env.cKindOfEnvrn = runPer.periodType; - env.KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; - env.DesignDayNum = 0; - env.RunPeriodDesignNum = i; - env.DayOfWeek = runPer.dayOfWeek; - env.MonWeekDay = runPer.monWeekDay; - env.SetWeekDays = false; - env.ApplyWeekendRule = runPer.applyWeekendRule; - env.UseRain = runPer.useRain; - env.UseSnow = runPer.useSnow; - env.firstHrInterpUseHr1 = runPer.firstHrInterpUsingHr1; // this will just the default - ++state.dataWeatherManager->Envrn; + envCurr.TotalDays = + (General::OrdinalDay(12, 31, state.dataWeather->LeapYearAdd) - envCurr.StartJDay + 1 + envCurr.EndJDay) * envCurr.NumSimYears; + } + state.dataEnvrn->TotRunDesPersDays += envCurr.TotalDays; + envCurr.UseDST = runPer.useDST; + envCurr.UseHolidays = runPer.useHolidays; + envCurr.Title = runPer.title; + envCurr.cKindOfEnvrn = runPer.periodType; + envCurr.KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; + envCurr.DesignDayNum = 0; + envCurr.RunPeriodDesignNum = iRunPer; + envCurr.DayOfWeek = runPer.dayOfWeek; + envCurr.MonWeekDay = runPer.monWeekDay; + envCurr.SetWeekDays = false; + envCurr.ApplyWeekendRule = runPer.applyWeekendRule; + envCurr.UseRain = runPer.useRain; + envCurr.UseSnow = runPer.useSnow; + envCurr.firstHrInterpUseHr1 = runPer.firstHrInterpUsingHr1; // this will just the default } // RunPeriods from weather file - for (int i = 1; i <= state.dataWeatherManager->TotRunPers; ++i) { // Run Periods. - auto &env = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn); - auto &runPer = state.dataWeatherManager->RunPeriodInput(i); - - env.StartMonth = runPer.startMonth; - env.StartDay = runPer.startDay; - env.StartYear = runPer.startYear; - env.EndMonth = runPer.endMonth; - env.EndDay = runPer.endDay; - env.EndYear = runPer.endYear; - env.NumSimYears = runPer.numSimYears; - env.CurrentYear = runPer.startYear; - env.IsLeapYear = runPer.isLeapYear; - env.TreatYearsAsConsecutive = true; + for (int iRunPer = 1; iRunPer <= state.dataWeather->TotRunPers; ++iRunPer, ++state.dataWeather->Envrn) { + auto const &runPer = state.dataWeather->RunPeriodInput(iRunPer); + auto &envCurr = state.dataWeather->Environment(state.dataWeather->Envrn); + + envCurr.StartMonth = runPer.startMonth; + envCurr.StartDay = runPer.startDay; + envCurr.StartYear = runPer.startYear; + envCurr.EndMonth = runPer.endMonth; + envCurr.EndDay = runPer.endDay; + envCurr.EndYear = runPer.endYear; + envCurr.NumSimYears = runPer.numSimYears; + envCurr.CurrentYear = runPer.startYear; + envCurr.IsLeapYear = runPer.isLeapYear; + envCurr.TreatYearsAsConsecutive = true; if (runPer.actualWeather) { // This will require leap years to be present, thus Julian days can be used for all the calculations - env.StartJDay = env.StartDate = runPer.startJulianDate; - env.EndJDay = env.EndDate = runPer.endJulianDate; - env.TotalDays = env.EndDate - env.StartDate + 1; - env.RawSimDays = env.EndDate - env.StartDate + 1; - env.MatchYear = true; - env.ActualWeather = true; + envCurr.StartJDay = envCurr.StartDate = runPer.startJulianDate; + envCurr.EndJDay = envCurr.EndDate = runPer.endJulianDate; + envCurr.TotalDays = envCurr.EndDate - envCurr.StartDate + 1; + envCurr.RawSimDays = envCurr.EndDate - envCurr.StartDate + 1; + envCurr.MatchYear = true; + envCurr.ActualWeather = true; } else { // std RunPeriod - env.RollDayTypeOnRepeat = runPer.RollDayTypeOnRepeat; - if (env.StartYear == env.EndYear) { + envCurr.RollDayTypeOnRepeat = runPer.RollDayTypeOnRepeat; + if (envCurr.StartYear == envCurr.EndYear) { // Short-circuit all the calculations, we're in a single year - int LocalLeapYearAdd = 0; - if (isLeapYear(env.StartYear)) { - // If a leap year is supported by the weather file, do it. - if (state.dataWeatherManager->WFAllowsLeapYears) { - env.IsLeapYear = true; // explicit set, this might be unwise - LocalLeapYearAdd = 1; - } else { - env.IsLeapYear = false; // explicit set, this might be unwise - } - } - env.StartJDay = General::OrdinalDay(runPer.startMonth, runPer.startDay, LocalLeapYearAdd); - env.EndJDay = General::OrdinalDay(runPer.endMonth, runPer.endDay, LocalLeapYearAdd); - env.RawSimDays = (env.EndJDay - env.StartJDay + 1); - env.TotalDays = env.RawSimDays; + + envCurr.IsLeapYear = isLeapYear(envCurr.StartYear) && state.dataWeather->WFAllowsLeapYears; + int LocalLeapYearAdd = (int)envCurr.IsLeapYear; + + envCurr.StartJDay = General::OrdinalDay(runPer.startMonth, runPer.startDay, LocalLeapYearAdd); + envCurr.EndJDay = General::OrdinalDay(runPer.endMonth, runPer.endDay, LocalLeapYearAdd); + envCurr.RawSimDays = (envCurr.EndJDay - envCurr.StartJDay + 1); + envCurr.TotalDays = envCurr.RawSimDays; } else { // Environment crosses year boundaries - env.RollDayTypeOnRepeat = runPer.RollDayTypeOnRepeat; - env.StartJDay = General::OrdinalDay(runPer.startMonth, runPer.startDay, runPer.isLeapYear ? 1 : 0); - env.EndJDay = General::OrdinalDay( - runPer.endMonth, runPer.endDay, isLeapYear(runPer.endYear) && state.dataWeatherManager->WFAllowsLeapYears ? 1 : 0); - env.TotalDays = 366 - env.StartJDay + env.EndJDay + 365 * std::max(env.NumSimYears - 2, 0); - if (state.dataWeatherManager->WFAllowsLeapYears) { + envCurr.RollDayTypeOnRepeat = runPer.RollDayTypeOnRepeat; + envCurr.StartJDay = General::OrdinalDay(runPer.startMonth, runPer.startDay, (int)runPer.isLeapYear); + envCurr.EndJDay = General::OrdinalDay( + runPer.endMonth, runPer.endDay, (int)(isLeapYear(runPer.endYear) && state.dataWeather->WFAllowsLeapYears)); + envCurr.TotalDays = 366 - envCurr.StartJDay + envCurr.EndJDay + 365 * std::max(envCurr.NumSimYears - 2, 0); + if (state.dataWeather->WFAllowsLeapYears) { // First year - if (env.StartJDay < 59) { - if (isLeapYear(env.StartYear)) { - ++env.TotalDays; + if (envCurr.StartJDay < 59) { + if (isLeapYear(envCurr.StartYear)) { + ++envCurr.TotalDays; } } // Middle years - for (int yr = env.StartYear + 1; yr < env.EndYear; ++yr) { + for (int yr = envCurr.StartYear + 1; yr < envCurr.EndYear; ++yr) { if (isLeapYear(yr)) { - ++env.TotalDays; + ++envCurr.TotalDays; } } // Last year not needed, the end ordinal date will take this into account } - env.RawSimDays = env.TotalDays; + envCurr.RawSimDays = envCurr.TotalDays; } } - env.UseDST = runPer.useDST; - env.UseHolidays = runPer.useHolidays; + envCurr.UseDST = runPer.useDST; + envCurr.UseHolidays = runPer.useHolidays; if (runPer.title.empty()) { - env.Title = state.dataEnvrn->WeatherFileLocationTitle; + envCurr.Title = state.dataEnvrn->WeatherFileLocationTitle; } else { - env.Title = runPer.title; + envCurr.Title = runPer.title; } - if (env.KindOfEnvrn == Constant::KindOfSim::ReadAllWeatherData) { - env.cKindOfEnvrn = "ReadAllWeatherDataRunPeriod"; + if (envCurr.KindOfEnvrn == Constant::KindOfSim::ReadAllWeatherData) { + envCurr.cKindOfEnvrn = "ReadAllWeatherDataRunPeriod"; } else { - env.cKindOfEnvrn = "WeatherFileRunPeriod"; - env.KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; - } - env.DayOfWeek = runPer.dayOfWeek; - env.MonWeekDay = runPer.monWeekDay; - env.SetWeekDays = false; - env.ApplyWeekendRule = runPer.applyWeekendRule; - env.UseRain = runPer.useRain; - env.UseSnow = runPer.useSnow; - env.firstHrInterpUseHr1 = runPer.firstHrInterpUsingHr1; // first hour interpolation choice - ++state.dataWeatherManager->Envrn; - } + envCurr.cKindOfEnvrn = "WeatherFileRunPeriod"; + envCurr.KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; + } + envCurr.DayOfWeek = runPer.dayOfWeek; + envCurr.MonWeekDay = runPer.monWeekDay; + envCurr.SetWeekDays = false; + envCurr.ApplyWeekendRule = runPer.applyWeekendRule; + envCurr.UseRain = runPer.useRain; + envCurr.UseSnow = runPer.useSnow; + envCurr.firstHrInterpUseHr1 = runPer.firstHrInterpUsingHr1; // first hour interpolation choice + } // for (i) } bool isLeapYear(int const Year) @@ -9413,8 +8283,6 @@ namespace WeatherManager { // SUBROUTINE INFORMATION: // AUTHOR Jason DeGraw // DATE WRITTEN 10/25/2017 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Split the former JGDate function in two. Convert a gregorian @@ -9434,7 +8302,7 @@ namespace WeatherManager { return tdd - 32075 + 1461 * (tyyyy + 4800 + l) / 4 + 367 * (tmm - 2 - l * 12) / 12 - 3 * ((tyyyy + 4900 + l) / 100) / 4; } - int computeJulianDate(GregorianDate const gdate) + int computeJulianDate(GregorianDate const &gdate) { return computeJulianDate(gdate.year, gdate.month, gdate.day); } @@ -9494,8 +8362,6 @@ namespace WeatherManager { // FUNCTION INFORMATION: // AUTHOR Jason DeGraw // DATE WRITTEN October 10, 2017 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Compute the day of the year for leap and non-leap years. @@ -9517,8 +8383,6 @@ namespace WeatherManager { // FUNCTION INFORMATION: // AUTHOR Jason DeGraw // DATE WRITTEN October 31, 2017 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Determine if a month/day+leapyear combination is valid. @@ -9610,10 +8474,10 @@ namespace WeatherManager { int AnnualNumberOfDays = 0; for (int i = 1; i <= 12; ++i) { MonthlyAverageDryBulbTemp(i) = OutputReportTabular::StrToReal(OutputReportTabular::GetColumnUsingTabs(lineAvg, i + 2)); - AnnualDailyAverageDryBulbTempSum += MonthlyAverageDryBulbTemp(i) * state.dataWeatherManager->EndDayOfMonth(i); + AnnualDailyAverageDryBulbTempSum += MonthlyAverageDryBulbTemp(i) * state.dataWeather->EndDayOfMonth(i); MonthlyDailyDryBulbMin = min(MonthlyDailyDryBulbMin, MonthlyAverageDryBulbTemp(i)); MonthlyDailyDryBulbMax = max(MonthlyDailyDryBulbMax, MonthlyAverageDryBulbTemp(i)); - AnnualNumberOfDays += state.dataWeatherManager->EndDayOfMonth(i); + AnnualNumberOfDays += state.dataWeather->EndDayOfMonth(i); } this->AnnualAvgOADryBulbTemp = AnnualDailyAverageDryBulbTempSum / AnnualNumberOfDays; this->MonthlyAvgOADryBulbTempMaxDiff = MonthlyDailyDryBulbMax - MonthlyDailyDryBulbMin; @@ -9637,14 +8501,14 @@ namespace WeatherManager { std::string::size_type pos = index(epwLine.data, ','); epwLine.data.erase(0, pos + 1); pos = index(epwLine.data, ','); - std::string LeapYear = UtilityRoutines::makeUPPER(epwLine.data.substr(0, pos)); + std::string LeapYear = Util::makeUPPER(epwLine.data.substr(0, pos)); if (LeapYear[0] == 'Y') { epwHasLeapYear = true; } } } Array1D EndDayOfMonthLocal; - EndDayOfMonthLocal = state.dataWeatherManager->EndDayOfMonth; + EndDayOfMonthLocal = state.dataWeather->EndDayOfMonth; if (epwHasLeapYear) { // increase number of days for february by one day if weather data has leap year EndDayOfMonthLocal(2) = EndDayOfMonthLocal(2) + 1; @@ -9713,32 +8577,32 @@ namespace WeatherManager { ",Maximum Difference In Monthly Average Outdoor Air Temperatures{deltaC}" ",Fixed Default Water Mains Temperature{C}\n"; - switch (state.dataWeatherManager->WaterMainsTempsMethod) { + switch (state.dataWeather->WaterMainsTempsMethod) { case WaterMainsTempCalcMethod::Schedule: *eiostream << "Site Water Mains Temperature Information,"; - *eiostream << waterMainsCalcMethodNames[static_cast(state.dataWeatherManager->WaterMainsTempsMethod)] << "," - << state.dataWeatherManager->WaterMainsTempsScheduleName << ","; - *eiostream << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp) << "," - << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp) << ","; + *eiostream << waterMainsCalcMethodNames[static_cast(state.dataWeather->WaterMainsTempsMethod)] << "," + << state.dataWeather->WaterMainsTempsScheduleName << ","; + *eiostream << format("{:.2R}", state.dataWeather->WaterMainsTempsAnnualAvgAirTemp) << "," + << format("{:.2R}", state.dataWeather->WaterMainsTempsMaxDiffAirTemp) << ","; *eiostream << "NA\n"; break; case WaterMainsTempCalcMethod::Correlation: *eiostream << "Site Water Mains Temperature Information,"; - *eiostream << waterMainsCalcMethodNames[static_cast(state.dataWeatherManager->WaterMainsTempsMethod)] << "," + *eiostream << waterMainsCalcMethodNames[static_cast(state.dataWeather->WaterMainsTempsMethod)] << "," << "NA" << ","; - *eiostream << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp) << "," - << format("{:.2R}", state.dataWeatherManager->WaterMainsTempsMaxDiffAirTemp) << ","; + *eiostream << format("{:.2R}", state.dataWeather->WaterMainsTempsAnnualAvgAirTemp) << "," + << format("{:.2R}", state.dataWeather->WaterMainsTempsMaxDiffAirTemp) << ","; *eiostream << "NA\n"; break; case WaterMainsTempCalcMethod::CorrelationFromWeatherFile: - if (state.dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed) { + if (state.dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed) { *eiostream << "Site Water Mains Temperature Information,"; - *eiostream << waterMainsCalcMethodNames[static_cast(state.dataWeatherManager->WaterMainsTempsMethod)] << "," + *eiostream << waterMainsCalcMethodNames[static_cast(state.dataWeather->WaterMainsTempsMethod)] << "," << "NA" << ","; - *eiostream << format("{:.2R}", state.dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp) << "," - << format("{:.2R}", state.dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff) << "," + *eiostream << format("{:.2R}", state.dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp) << "," + << format("{:.2R}", state.dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff) << "," << "NA\n"; } else { *eiostream << "Site Water Mains Temperature Information,"; @@ -9777,41 +8641,38 @@ namespace WeatherManager { Real64 RelHum, Real64 IRHoriz) { - Real64 ESky; - if (IRHoriz <= 0.0) IRHoriz = 9999.0; - if (!state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseWeatherFileHorizontalIR || IRHoriz >= 9999.0) { + auto const &envCurr = state.dataWeather->Environment(state.dataWeather->Envrn); + if (!envCurr.UseWeatherFileHorizontalIR || IRHoriz >= 9999.0) { // Missing or user defined to not use IRHoriz from weather, using sky cover and clear sky emissivity - ESky = CalcSkyEmissivity(state, - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel, - OpaqueSkyCover, - DryBulb, - DewPoint, - RelHum); - HorizIRSky = ESky * state.dataWeatherManager->Sigma * pow_4(DryBulb + Constant::KelvinConv); - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::BruntModel || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::IdsoModel || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::BerdahlMartinModel || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::ClarkAllenModel) { - SkyTemp = (DryBulb + Constant::KelvinConv) * root_4(ESky) - Constant::KelvinConv; + Real64 ESky = CalcSkyEmissivity(state, envCurr.skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum); + HorizIRSky = ESky * Constant::StefanBoltzmann * pow_4(DryBulb + Constant::Kelvin); + if (envCurr.skyTempModel == SkyTempModel::Brunt || envCurr.skyTempModel == SkyTempModel::Idso || + envCurr.skyTempModel == SkyTempModel::BerdahlMartin || envCurr.skyTempModel == SkyTempModel::ClarkAllen) { + SkyTemp = (DryBulb + Constant::Kelvin) * root_4(ESky) - Constant::Kelvin; } else { SkyTemp = 0.0; // dealt with later } } else { // Valid IR from weather files HorizIRSky = IRHoriz; - if (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::BruntModel || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::IdsoModel || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::BerdahlMartinModel || - state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).SkyTempModel == SkyTempCalcType::ClarkAllenModel) { - SkyTemp = root_4(IRHoriz / state.dataWeatherManager->Sigma) - Constant::KelvinConv; + if (envCurr.skyTempModel == SkyTempModel::Brunt || envCurr.skyTempModel == SkyTempModel::Idso || + envCurr.skyTempModel == SkyTempModel::BerdahlMartin || envCurr.skyTempModel == SkyTempModel::ClarkAllen) { + SkyTemp = root_4(IRHoriz / Constant::StefanBoltzmann) - Constant::Kelvin; } else { SkyTemp = 0.0; // dealt with later } } } -} // namespace WeatherManager + void ForAllHrTs(EnergyPlusData &state, std::function f) + { + for (int iHr = 1; iHr <= Constant::HoursInDay; ++iHr) + for (int iTS = 1; iTS <= state.dataGlobal->NumOfTimeStepInHour; ++iTS) + f(iHr, iTS); + } + +} // namespace Weather } // namespace EnergyPlus diff --git a/src/EnergyPlus/WeatherManager.hh b/src/EnergyPlus/WeatherManager.hh index f3c990a79b2..0dccbe25875 100644 --- a/src/EnergyPlus/WeatherManager.hh +++ b/src/EnergyPlus/WeatherManager.hh @@ -49,7 +49,6 @@ #define WeatherManager_hh_INCLUDED // C++ Headers -#include #include // ObjexxFCL Headers @@ -70,7 +69,7 @@ namespace EnergyPlus { class BaseGroundTempsModel; struct EnergyPlusData; -namespace WeatherManager { +namespace Weather { enum class EpwHeaderType { @@ -107,7 +106,7 @@ namespace WeatherManager { Num }; - enum class DesignDaySolarModel + enum class DesDaySolarModel { Invalid = -1, ASHRAE_ClearSky, // Design Day solar model ASHRAE ClearSky (default) @@ -118,8 +117,14 @@ namespace WeatherManager { Num }; + static constexpr std::array DesDaySolarModelNames = { + "ASHRAEClearSky", "ZhangHuang", "Schedule", "ASHRAETau", "ASHRAETau2017"}; + + static constexpr std::array DesDaySolarModelNamesUC = { + "ASHRAECLEARSKY", "ZHANGHUANG", "SCHEDULE", "ASHRAETAU", "ASHRAETAU2017"}; + // Design Day Humidity Indicating Type - enum class DDHumIndType + enum class DesDayHumIndType { Invalid = -1, WetBulb, // Wetbulb (default) @@ -133,8 +138,17 @@ namespace WeatherManager { Num }; + static constexpr std::array DesDayHumIndTypeNamesUC = {"WETBULB", + "DEWPOINT", + "ENTHALPY", + "HUMIDITYRATIO", + "RELATIVEHUMIDITYSCHEDULE", + "WETBULBPROFILEDEFAULTMULTIPLIERS", + "WETBULBPROFILEDIFFERENCESCHEDULE", + "WETBULBPROFILEMULTIPLIERSCHEDULE"}; + // Design Day DryBulb Range Type - enum class DDDBRangeType + enum class DesDayDryBulbRangeType { Invalid = -1, Default, // Default Multipliers @@ -144,146 +158,120 @@ namespace WeatherManager { Num }; - enum class SkyTempCalcType + static constexpr std::array DesDayDryBulbRangeTypeNamesUC = { + "DEFAULTMULTIPLIERS", "MULTIPLIERSCHEDULE", "DIFFERENCESCHEDULE", "TEMPERATUREPROFILESCHEDULE"}; + + enum class SkyTempModel { Invalid = -1, - ClarkAllenModel, // Use Clark & Allen model for sky emissivity calculation - ScheduleValue, // User entered Schedule value for Weather Property - DryBulbDelta, // User entered DryBulb difference Schedule value for Weather Property - DewPointDelta, // User entered Dewpoint difference Schedule value for Weather Property - BruntModel, // Use Brunt model for sky emissivity calculation - IdsoModel, // Use Isdo model for sky emissivity calculation - BerdahlMartinModel, // Use Martin & Berdahl model for sky emissivity calculation + ClarkAllen, // Use Clark & Allen model for sky emissivity calculation + ScheduleValue, // User entered Schedule value for Weather Property + DryBulbDelta, // User entered DryBulb difference Schedule value for Weather Property + DewPointDelta, // User entered Dewpoint difference Schedule value for Weather Property + Brunt, // Use Brunt model for sky emissivity calculation + Idso, // Use Isdo model for sky emissivity calculation + BerdahlMartin, // Use Martin & Berdahl model for sky emissivity calculation Num }; struct EnvironmentData { // Members - std::string Title; // Environment name - std::string cKindOfEnvrn; // kind of environment - Constant::KindOfSim KindOfEnvrn; // Type of environment (see Parameters for KindOfSim in DataGlobals) - int DesignDayNum; // index in DesignDay structure and DesignDayInput - int RunPeriodDesignNum; // for WeatherFileDays, index in RunPeriodDesign and RunPeriodDesignInput - int SeedEnvrnNum; // for HVAC sizing sim, new environments are copies of original environments, this is the index for original - int HVACSizingIterationNum; // environments for HVAC sizing simulations are associated with iteration - int TotalDays; // Number of days in environment - int StartJDay; // Day of year of first day of environment - int StartMonth; - int StartDay; - int StartYear; - int StartDate; - int EndMonth; - int EndDay; - int EndJDay; - int EndYear; - int EndDate; - int DayOfWeek; // Starting Day of Week for the (Weather) RunPeriod (User Input) - bool UseDST; // True if DaylightSavingTime is used for this RunPeriod - bool UseHolidays; // True if Holidays are used for this RunPeriod (from WeatherFile) - bool ApplyWeekendRule; // True if "Weekend Rule" is to be applied to RunPeriod - bool UseRain; // True if Rain from weather file should be used (set rain to true) - bool UseSnow; // True if Snow from weather file should be used (set Snow to true) - Array1D_int MonWeekDay; - bool SetWeekDays; // true when weekdays will be reset (after first year or on repeat) - int NumSimYears; // Total Number of times this period to be performed - int CurrentCycle; // Current cycle through weather file in NumSimYears repeats - int WP_Type1; // WeatherProperties SkyTemperature Pointer - SkyTempCalcType SkyTempModel; // WeatherProperties SkyTemperature CalculationType - bool UseWeatherFileHorizontalIR; // If false, horizontal IR and sky temperature are calculated with WP models - int CurrentYear; // Current year - bool IsLeapYear; // True if current year is leap year. - bool RollDayTypeOnRepeat; // If repeating run period, increment day type on repeat. - bool TreatYearsAsConsecutive; // When year rolls over, increment year and recalculate Leap Year - bool MatchYear; // for actual weather will be true - bool ActualWeather; // true when using actual weather data - int RawSimDays; // number of basic sim days. - bool firstHrInterpUseHr1; // true when using Hour 1 for first hour interpolations; false to use Hour 24 + std::string Title = ""; // Environment name + std::string cKindOfEnvrn = ""; // kind of environment + Constant::KindOfSim KindOfEnvrn = Constant::KindOfSim::Invalid; // Type of environment (see Parameters for KindOfSim in DataGlobals) + int DesignDayNum = 0; // index in DesignDay structure and DesignDayInput + int RunPeriodDesignNum = 0; // for WeatherFileDays, index in RunPeriodDesign and RunPeriodDesignInput + int SeedEnvrnNum = 0; // for HVAC sizing sim, new environments are copies of original environments, this is the index for original + int HVACSizingIterationNum = 0; // environments for HVAC sizing simulations are associated with iteration + int TotalDays = 0; // Number of days in environment + int StartJDay = 0; // Day of year of first day of environment + int StartMonth = 0; + int StartDay = 0; + int StartYear = 0; + int StartDate = 0; + int EndMonth = 0; + int EndDay = 0; + int EndJDay = 0; + int EndYear = 0; + int EndDate = 0; + int DayOfWeek = 0; // Starting Day of Week for the (Weather) RunPeriod (User Input) + bool UseDST = false; // True if DaylightSavingTime is used for this RunPeriod + bool UseHolidays = false; // True if Holidays are used for this RunPeriod (from WeatherFile) + bool ApplyWeekendRule = false; // True if "Weekend Rule" is to be applied to RunPeriod + bool UseRain = true; // True if Rain from weather file should be used (set rain to true) + bool UseSnow = true; // True if Snow from weather file should be used (set Snow to true) + Array1D_int MonWeekDay = Array1D_int(12, 0); + bool SetWeekDays = false; // true when weekdays will be reset (after first year or on repeat) + int NumSimYears = 1; // Total Number of times this period to be performed + int CurrentCycle = 0; // Current cycle through weather file in NumSimYears repeats + int WP_Type1 = 0; // WeatherProperties SkyTemperature Pointer + SkyTempModel skyTempModel = SkyTempModel::ClarkAllen; // WeatherProperties SkyTemperature CalculationType + bool UseWeatherFileHorizontalIR = true; // If false, horizontal IR and sky temperature are calculated with WP models + int CurrentYear = 0; // Current year + bool IsLeapYear = false; // True if current year is leap year. + bool RollDayTypeOnRepeat = true; // If repeating run period, increment day type on repeat. + bool TreatYearsAsConsecutive = true; // When year rolls over, increment year and recalculate Leap Year + bool MatchYear = false; // for actual weather will be true + bool ActualWeather = false; // true when using actual weather data + int RawSimDays = 0; // number of basic sim days. + bool firstHrInterpUseHr1 = false; // true when using Hour 1 for first hour interpolations; false to use Hour 24 Real64 maxCoolingOATSizing = -1000.0; // max outdoor dry-bulb for DesignDay or RunPeriodDesign type weather Real64 maxCoolingOADPSizing = -1000.0; // outdoor dew point at max outdoor dry-bulb for DesignDay or RunPeriodDesign type weather Real64 minHeatingOATSizing = 1000.0; // min outdoor dry-bulb for DesignDay or RunPeriodDesign type weather Real64 minHeatingOADPSizing = 1000.0; // outdoor dew point at min outdoor dry-bulb for DesignDay or RunPeriodDesign type weather - - // Default Constructor - EnvironmentData() - : KindOfEnvrn(Constant::KindOfSim::Invalid), DesignDayNum(0), RunPeriodDesignNum(0), SeedEnvrnNum(0), HVACSizingIterationNum(0), - TotalDays(0), StartJDay(0), StartMonth(0), StartDay(0), StartYear(0), StartDate(0), EndMonth(0), EndDay(0), EndJDay(0), EndYear(0), - EndDate(0), DayOfWeek(0), UseDST(false), UseHolidays(false), ApplyWeekendRule(false), UseRain(true), UseSnow(true), MonWeekDay(12, 0), - SetWeekDays(false), NumSimYears(1), CurrentCycle(0), WP_Type1(0), SkyTempModel(SkyTempCalcType::ClarkAllenModel), - UseWeatherFileHorizontalIR(true), CurrentYear(0), IsLeapYear(false), RollDayTypeOnRepeat(true), TreatYearsAsConsecutive(true), - MatchYear(false), ActualWeather(false), RawSimDays(0), firstHrInterpUseHr1(false) - { - } }; struct DesignDayData { // Members - std::string Title; // Environment name - Real64 MaxDryBulb; // Maximum Dry-Bulb Temperature (C) - Real64 DailyDBRange; // Daily Temperature Range (deltaC) - Real64 HumIndValue; // Humidity Indicating Value at Max Dry-bulb Temperature - DDHumIndType HumIndType; // Humidity Indicating type (see Parameters) - Real64 PressBarom; // Atmospheric/Barometric Pressure (Pascals) - Real64 WindSpeed; // Wind Speed (m/s) - Real64 WindDir; // Wind Direction (degrees clockwise from North, N=0, E=90, S=180, W=270) - Real64 SkyClear; // Sky Clearness (0 to 1) - int RainInd; // Rain Indicator (1 = raining and surfaces are wet, else 0) - int SnowInd; // Snow Indicator (1 = snow on ground, else 0) - int DayOfMonth; // Day of Month ( 1 - 31 ) - int Month; // Month of Year ( 1 - 12 ) - int DayType; // Day Type Sunday = 1 - Saturday = 7 - int DSTIndicator; // Daylight Saving Time Period Indicator (1=yes, 0=no) for this DesignDay - DesignDaySolarModel SolarModel; // Solar Model for creating solar values for design day. - DDDBRangeType DBTempRangeType; // Drybulb Range Type (see Parameters) - int TempRangeSchPtr; // Schedule pointer to a day schedule for dry-bulb temperature range multipliers - int HumIndSchPtr; // Schedule pointer to a day schedule that specifies + std::string Title = ""; // Environment name + Real64 MaxDryBulb = 0.0; // Maximum Dry-Bulb Temperature (C) + Real64 DailyDBRange = 0.0; // Daily Temperature Range (deltaC) + Real64 HumIndValue = 0.0; // Humidity Indicating Value at Max Dry-bulb Temperature + DesDayHumIndType HumIndType = DesDayHumIndType::WetBulb; // Humidity Indicating type (see Parameters) + Real64 PressBarom = 0.0; // Atmospheric/Barometric Pressure (Pascals) + Real64 WindSpeed = 0.0; // Wind Speed (m/s) + Real64 WindDir = 0.0; // Wind Direction (degrees clockwise from North, N=0, E=90, S=180, W=270) + Real64 SkyClear = 0.0; // Sky Clearness (0 to 1) + int RainInd = 0; // Rain Indicator (1 = raining and surfaces are wet, else 0) + int SnowInd = 0; // Snow Indicator (1 = snow on ground, else 0) + int DayOfMonth = 0; // Day of Month ( 1 - 31 ) + int Month = 0; // Month of Year ( 1 - 12 ) + int DayType = 0; // Day Type Sunday = 1 - Saturday = 7 + int DSTIndicator = 0; // Daylight Saving Time Period Indicator (1=yes, 0=no) for this DesignDay + DesDaySolarModel solarModel = DesDaySolarModel::ASHRAE_ClearSky; // Solar Model for creating solar values for design day. + DesDayDryBulbRangeType dryBulbRangeType = DesDayDryBulbRangeType::Default; // Drybulb Range Type (see Parameters) + int TempRangeSchPtr = 0; // Schedule pointer to a day schedule for dry-bulb temperature range multipliers + int HumIndSchPtr = 0; // Schedule pointer to a day schedule that specifies // relative humidity (%) or wet-bulb range multipliers per HumIndType - int BeamSolarSchPtr; // Schedule pointer to a day schedule for beam solar - int DiffuseSolarSchPtr; // Schedule pointer to a day schedule for diffuse solar - Real64 TauB; // beam pseudo optical depth for ASHRAE tau model - Real64 TauD; // diffuse pseudo optical depth for ASHRAE tau model - Real64 DailyWBRange; // daily range of wetbulb (deltaC) - bool PressureEntered; // true if a pressure was entered in design day data - bool DewPointNeedsSet; // true if the Dewpoint humidicating value needs to be set (after location determined) - int maxWarmupDays; // Maximum warmup days between sizing periods - bool suppressBegEnvReset; // true if this design day should be run without thermal history being reset at begin environment - - // Default Constructor - DesignDayData() - : MaxDryBulb(0.0), DailyDBRange(0.0), HumIndValue(0.0), HumIndType(DDHumIndType::WetBulb), PressBarom(0.0), WindSpeed(0.0), WindDir(0.0), - SkyClear(0.0), RainInd(0), SnowInd(0), DayOfMonth(0), Month(0), DayType(0), DSTIndicator(0), - SolarModel(DesignDaySolarModel::ASHRAE_ClearSky), DBTempRangeType(DDDBRangeType::Default), TempRangeSchPtr(0), HumIndSchPtr(0), - BeamSolarSchPtr(0), DiffuseSolarSchPtr(0), TauB(0.0), TauD(0.0), DailyWBRange(0.0), PressureEntered(false), - DewPointNeedsSet(false), //**Trane:BEG: Sizing Speed Up - maxWarmupDays(-1), suppressBegEnvReset(false) //**Trane:END: Sizing Speed Up - { - } + int BeamSolarSchPtr = 0; // Schedule pointer to a day schedule for beam solar + int DiffuseSolarSchPtr = 0; // Schedule pointer to a day schedule for diffuse solar + Real64 TauB = 0.0; // beam pseudo optical depth for ASHRAE tau model + Real64 TauD = 0.0; // diffuse pseudo optical depth for ASHRAE tau model + Real64 DailyWBRange = 0.0; // daily range of wetbulb (deltaC) + bool PressureEntered = false; // true if a pressure was entered in design day data + bool DewPointNeedsSet = false; // true if the Dewpoint humidicating value needs to be set (after location determined) + int maxWarmupDays = -1; // Maximum warmup days between sizing periods + bool suppressBegEnvReset = false; // true if this design day should be run without thermal history being reset at begin environment }; struct ReportPeriodData { - std::string title; - std::string reportName; - int startYear; - int startMonth; - int startDay; - int startHour; - int startJulianDate; - int endYear; - int endMonth; - int endDay; - int endHour; - int endJulianDate; - Real64 totalElectricityUse; - - // Default Constructor - ReportPeriodData() - : startYear(2017), startMonth(1), startDay(1), startHour(1), startJulianDate(2457755), endYear(2017), endMonth(12), endDay(31), - endHour(24), endJulianDate(2458119), totalElectricityUse(0.0) - { - } + std::string title = ""; + std::string reportName = ""; + int startYear = 2017; + int startMonth = 1; + int startDay = 1; + int startHour = 1; + int startJulianDate = 2457755; + int endYear = 2017; + int endMonth = 12; + int endDay = 31; + int endHour = 24; + int endJulianDate = 2458119; + Real64 totalElectricityUse = 0.0; // What is this doing here? }; struct RunPeriodData @@ -319,233 +307,133 @@ namespace WeatherManager { struct DayWeatherVariables // Derived Type for Storing Weather "Header" Data { // Members - int DayOfYear; // Day of year for weather data - int DayOfYear_Schedule; // Day of year in schedule - int Year; // Year of weather data - int Month; // Month of weather data - int DayOfMonth; // Day of month for weather data - int DayOfWeek; // Day of week for weather data - int DaylightSavingIndex; // Daylight Saving Time Period indicator (0=no,1=yes) - int HolidayIndex; // Holiday indicator (0=no holiday, non-zero=holiday type) - Real64 SinSolarDeclinAngle; // Sine of the solar declination angle - Real64 CosSolarDeclinAngle; // Cosine of the solar declination angle - Real64 EquationOfTime; // Value of the equation of time formula - - // Default Constructor - DayWeatherVariables() - : DayOfYear(0), DayOfYear_Schedule(0), Year(0), Month(0), DayOfMonth(0), DayOfWeek(0), DaylightSavingIndex(0), HolidayIndex(0), - SinSolarDeclinAngle(0.0), CosSolarDeclinAngle(0.0), EquationOfTime(0.0) - { - } + int DayOfYear = 0; // Day of year for weather data + int DayOfYear_Schedule = 0; // Day of year in schedule + int Year = 0; // Year of weather data + int Month = 0; // Month of weather data + int DayOfMonth = 0; // Day of month for weather data + int DayOfWeek = 0; // Day of week for weather data + int DaylightSavingIndex = 0; // Daylight Saving Time Period indicator (0=no,1=yes) + int HolidayIndex = 0; // Holiday indicator (0=no holiday, non-zero=holiday type) + Real64 SinSolarDeclinAngle = 0.0; // Sine of the solar declination angle + Real64 CosSolarDeclinAngle = 0.0; // Cosine of the solar declination angle + Real64 EquationOfTime = 0.0; // Value of the equation of time formula }; struct SpecialDayData { // Members - std::string Name; // Name - WeatherManager::DateType DateType; // Date type as read in from IDF - int Month; // Start Month - int Day; // Start Day of month or Count for DateTypes=NthDayOfMonth - int WeekDay; // For Date types=NthDayOfMonth and LastDayOfMonth - int CompDate; // Start Date in "compressed date" format, only if Month/Day - bool WthrFile; // True if this Special Day came from weather file (EPW) - int Duration; // Number of days this special Day is used for - int DayType; // Day Type desigation for this Special Day period - int ActStMon; - int ActStDay; - bool Used; // Set to true in a run period after use (NthDayOfMonth and LastDayOfMonth only) - - // Default Constructor - SpecialDayData() - : DateType(DateType::Invalid), Month(0), Day(0), WeekDay(0), CompDate(0), WthrFile(false), Duration(0), DayType(0), ActStMon(0), - ActStDay(0), Used(false) - { - } + std::string Name = ""; // Name + DateType dateType = DateType::Invalid; // Date type as read in from IDF + int Month = 0; // Start Month + int Day = 0; // Start Day of month or Count for DateTypes=NthDayOfMonth + int WeekDay = 0; // For Date types=NthDayOfMonth and LastDayOfMonth + int CompDate = 0; // Start Date in "compressed date" format, only if Month/Day + bool WthrFile = false; // True if this Special Day came from weather file (EPW) + int Duration = 0; // Number of days this special Day is used for + int DayType = 0; // Day Type desigation for this Special Day period + int ActStMon = 0; + int ActStDay = 0; + bool Used = false; // Set to true in a run period after use (NthDayOfMonth and LastDayOfMonth only) }; struct DataPeriodData { // Members - std::string Name; // DataPeriod Title - std::string DayOfWeek; // Start Day of Week for DataPeriod - int NumYearsData; // Number of years for which data is present in EPW. - int WeekDay; - int StMon; - int StDay; - int StYear; - int EnMon; - int EnDay; - int EnYear; - int NumDays; - Array1D_int MonWeekDay; - int DataStJDay; - int DataEnJDay; - bool HasYearData; - - // Default Constructor - DataPeriodData() - : NumYearsData(1), WeekDay(0), StMon(0), StDay(0), StYear(0), EnMon(0), EnDay(0), EnYear(0), NumDays(0), MonWeekDay(12, 0), DataStJDay(0), - DataEnJDay(0), HasYearData(false) - { - } - }; - - struct DaylightSavingPeriodData - { - // Members - DateType StDateType; // Start Date type as from EPW or IDF - int StWeekDay; // For DateTypes=NthDayOfMonth or LastDayOfMonth - int StMon; // DaylightSavingTime (DST) Start Month - int StDay; // DaylightSavingTime (DST) Start Day - DateType EnDateType; // End Date type as from EPW or IDF - int EnMon; // DaylightSavingTime (DST) End Month - int EnDay; // DaylightSavingTime (DST) End Day - int EnWeekDay; // For DateTypes=NthDayOfMonth or LastDayOfMonth - - // Default Constructor - DaylightSavingPeriodData() - : StDateType(DateType::Invalid), StWeekDay(0), StMon(0), StDay(0), EnDateType(DateType::Invalid), EnMon(0), EnDay(0), EnWeekDay(0) - { - } + std::string Name = ""; // DataPeriod Title + std::string DayOfWeek = ""; // Start Day of Week for DataPeriod + int NumYearsData = 1; // Number of years for which data is present in EPW. + int WeekDay = 0; + int StMon = 0; + int StDay = 0; + int StYear = 0; + int EnMon = 0; + int EnDay = 0; + int EnYear = 0; + int NumDays = 0; + Array1D_int MonWeekDay = Array1D_int(12, 0); + int DataStJDay = 0; + int DataEnJDay = 0; + bool HasYearData = false; }; - // This struct carries the default missing data for those data elements that would be best replaced with the previous hour's data for missing - // data. - struct MissingData + struct DSTPeriod { // Members - Real64 DryBulb; // Dry Bulb Temperature (C) - Real64 DewPoint; // Dew Point Temperature (C) - int RelHumid; // Relative Humidity (%) - Real64 StnPres; // Atmospheric Pressure (Pa) - int WindDir; // Wind Direction (deg) - Real64 WindSpd; // Wind Speed/Velocity (m/s) - int TotSkyCvr; // Total Sky Cover (tenths) - int OpaqSkyCvr; // Opaque Sky Cover (tenths) - Real64 Visibility; // Visibility (km) - int Ceiling; // Ceiling Height (m) - int PrecipWater; // Precipitable Water (mm) - Real64 AerOptDepth; // Aerosol Optical Depth - int SnowDepth; // Snow Depth (cm) - int DaysLastSnow; // Number of Days since last snow - Real64 Albedo; // Albedo - Real64 LiquidPrecip; // Rain/Liquid Precipitation (mm) - - // Default Constructor - MissingData() - : DryBulb(0.0), DewPoint(0.0), RelHumid(0), StnPres(0.0), WindDir(0), WindSpd(0.0), TotSkyCvr(0), OpaqSkyCvr(0), Visibility(0.0), - Ceiling(0), PrecipWater(0), AerOptDepth(0.0), SnowDepth(0), DaysLastSnow(0), Albedo(0.0), LiquidPrecip(0.0) - { - } + DateType StDateType = DateType::Invalid; // Start Date type as from EPW or IDF + int StWeekDay = 0; // For DateTypes=NthDayOfMonth or LastDayOfMonth + int StMon = 0; // DaylightSavingTime (DST) Start Month + int StDay = 0; // DaylightSavingTime (DST) Start Day + DateType EnDateType = DateType::Invalid; // End Date type as from EPW or IDF + int EnMon = 0; // DaylightSavingTime (DST) End Month + int EnDay = 0; // DaylightSavingTime (DST) End Day + int EnWeekDay = 0; // For DateTypes=NthDayOfMonth or LastDayOfMonth }; // This Derived type carries the counts of missing data items in the weather reading process. It will count only items that are on the source file // -- not those that are derived from data on the source file. - struct MissingDataCounts - { - // Members - // Comments below illustrate the data that is being counted: - int DryBulb; // Dry Bulb Temperature (C) - int DewPoint; // Dew Point Temperature (C) - int RelHumid; // Relative Humidity (%) - int StnPres; // Atmospheric Pressure (Pa) - int WindDir; // Wind Direction (deg) - int WindSpd; // Wind Speed/Velocity (m/s) - int DirectRad; // Direct Radiation (wh/m2) - int DiffuseRad; // Diffuse Radiation (wh/m2) - int TotSkyCvr; // Total Sky Cover (tenths) - int OpaqSkyCvr; // Opaque Sky Cover (tenths) - int Visibility; // Visibility (km) - int Ceiling; // Ceiling Height (m) - int PrecipWater; // Precipitable Water (mm) - int AerOptDepth; // Aerosol Optical Depth - int SnowDepth; // Snow Depth (cm) - int DaysLastSnow; // Number of Days since last snow - int WeathCodes; // Weather codes invalid - int Albedo; // Albedo - int LiquidPrecip; // Liquid Precip Depth - - // Default Constructor - MissingDataCounts() - : DryBulb(0), DewPoint(0), RelHumid(0), StnPres(0), WindDir(0), WindSpd(0), DirectRad(0), DiffuseRad(0), TotSkyCvr(0), OpaqSkyCvr(0), - Visibility(0), Ceiling(0), PrecipWater(0), AerOptDepth(0), SnowDepth(0), DaysLastSnow(0), WeathCodes(0), Albedo(0), LiquidPrecip(0) - { - } - }; - - // This Derived type carries the counts of out of range items in the weather reading process. It will count only items that are on the source file - // -- not those that are derived from data on the source file. - struct RangeDataCounts + struct WeatherVarCounts { // Members // Comments below illustrate the data that is being counted: - int DryBulb; // Dry Bulb Temperature (C) - int DewPoint; // Dew Point Temperature (C) - int RelHumid; // Relative Humidity (%) - int StnPres; // Atmospheric Pressure (Pa) - int WindDir; // Wind Direction (deg) - int WindSpd; // Wind Speed/Velocity (m/s) - int DirectRad; // Direct Radiation (wh/m2) - int DiffuseRad; // Diffuse Radiation (wh/m2) - - // Default Constructor - RangeDataCounts() : DryBulb(0), DewPoint(0), RelHumid(0), StnPres(0), WindDir(0), WindSpd(0), DirectRad(0), DiffuseRad(0) - { - } + int OutDryBulbTemp = 0; // Dry Bulb Temperature (C) + int OutDewPointTemp = 0; // Dew Point Temperature (C) + int OutRelHum = 0; // Relative Humidity (%) + int OutBaroPress = 0; // Atmospheric Pressure (Pa) + int WindDir = 0; // Wind Direction (deg) + int WindSpeed = 0; // Wind Speed/Velocity (m/s) + int BeamSolarRad = 0; // Direct Radiation (wh/m2) + int DifSolarRad = 0; // Diffuse Radiation (wh/m2) + int TotalSkyCover = 0; // Total Sky Cover (tenths) + int OpaqueSkyCover = 0; // Opaque Sky Cover (tenths) + int Visibility = 0; // Visibility (km) + int Ceiling = 0; // Ceiling Height (m) + int LiquidPrecip = 0; // Precipitable Water (mm) + int WaterPrecip = 0; // Precipitable Water (mm) + int AerOptDepth = 0; // Aerosol Optical Depth + int SnowDepth = 0; // Snow Depth (cm) + int DaysLastSnow = 0; // Number of Days since last snow + int WeathCodes = 0; // Weather codes invalid + int Albedo = 0; // Albedo }; struct TypicalExtremeData { // Members - std::string Title; // Environment name - std::string ShortTitle; // Environment name - std::string MatchValue; // String to be matched for input/running these periods for design. - std::string MatchValue1; // String to be also matched (synonym) - std::string MatchValue2; // String to be also matched (synonym) - std::string TEType; // Typical or Extreme - int TotalDays; // Number of days in environment - int StartJDay; // Day of year of first day of environment - int StartMonth; - int StartDay; - int EndMonth; - int EndDay; - int EndJDay; - - // Default Constructor - TypicalExtremeData() : TotalDays(0), StartJDay(0), StartMonth(0), StartDay(0), EndMonth(0), EndDay(0), EndJDay(0) - { - } + std::string Title = ""; // Environment name + std::string ShortTitle = ""; // Environment name + std::string MatchValue = ""; // String to be matched for input/running these periods for design. + std::string MatchValue1 = ""; // String to be also matched (synonym) + std::string MatchValue2 = ""; // String to be also matched (synonym) + std::string TEType = ""; // Typical or Extreme + int TotalDays = 0; // Number of days in environment + int StartJDay = 0; // Day of year of first day of environment + int StartMonth = 0; + int StartDay = 0; + int EndMonth = 0; + int EndDay = 0; + int EndJDay = 0; }; struct WeatherProperties { // Members - std::string Name; // Reference Name - std::string ScheduleName; // Schedule Name or Algorithm Name - bool IsSchedule; // Default is using Schedule - SkyTempCalcType CalculationType; - int SchedulePtr; // pointer to schedule when used - bool UsedForEnvrn; - bool UseWeatherFileHorizontalIR; // If false, horizontal IR and sky temperature are calculated with WP models - - // Default Constructor - WeatherProperties() - : IsSchedule(true), CalculationType(SkyTempCalcType::ClarkAllenModel), SchedulePtr(0), UsedForEnvrn(false), - UseWeatherFileHorizontalIR(true) - { - } + std::string Name = ""; // Reference Name + std::string ScheduleName = ""; // Schedule Name or Algorithm Name + bool IsSchedule = true; // Default is using Schedule + SkyTempModel skyTempModel = SkyTempModel::ClarkAllen; + int SchedulePtr = 0; // pointer to schedule when used + bool UsedForEnvrn = false; + bool UseWeatherFileHorizontalIR = true; // If false, horizontal IR and sky temperature are calculated with WP models }; struct UnderwaterBoundary { - std::string Name; - Real64 distanceFromLeadingEdge; - int OSCMIndex; - int WaterTempScheduleIndex; - int VelocityScheduleIndex; - UnderwaterBoundary() : Name(""), distanceFromLeadingEdge(0.0), OSCMIndex(0), WaterTempScheduleIndex(0), VelocityScheduleIndex(0) - { - } + std::string Name = ""; + Real64 distanceFromLeadingEdge = 0.0; + int OSCMIndex = 0; + int WaterTempScheduleIndex = 0; + int VelocityScheduleIndex = 0; }; // Functions @@ -661,17 +549,17 @@ namespace WeatherManager { Real64 AirMass(Real64 CosZen); // COS( solar zenith), 0 - 1 // Calculate sky temperature from weather data - Real64 CalcSkyEmissivity(EnergyPlusData &state, SkyTempCalcType ESkyCalcType, Real64 OSky, Real64 DryBulb, Real64 DewPoint, Real64 RelHum); + Real64 CalcSkyEmissivity(EnergyPlusData &state, SkyTempModel skyTempModel, Real64 OSky, Real64 DryBulb, Real64 DewPoint, Real64 RelHum); void ASHRAETauModel([[maybe_unused]] EnergyPlusData &state, - DesignDaySolarModel TauModelType, // ASHRAETau solar model type ASHRAE_Tau or ASHRAE_Tau2017 - Real64 ETR, // extraterrestrial normal irradiance, W/m2 - Real64 CosZen, // COS( solar zenith angle), 0 - 1 - Real64 TauB, // beam tau factor - Real64 TauD, // dif tau factor - Real64 &IDirN, // returned: direct (beam) irradiance on normal surface, W/m2 - Real64 &IDifH, // returned: diffuse irradiance on horiz surface, W/m2 - Real64 &IGlbH // returned: global irradiance on horiz surface, W/m2 + DesDaySolarModel TauModel, // ASHRAETau solar model type ASHRAE_Tau or ASHRAE_Tau2017 + Real64 ETR, // extraterrestrial normal irradiance, W/m2 + Real64 CosZen, // COS( solar zenith angle), 0 - 1 + Real64 TauB, // beam tau factor + Real64 TauD, // dif tau factor + Real64 &IDirN, // returned: direct (beam) irradiance on normal surface, W/m2 + Real64 &IDifH, // returned: diffuse irradiance on horiz surface, W/m2 + Real64 &IGlbH // returned: global irradiance on horiz surface, W/m2 ); void AllocateWeatherData(EnergyPlusData &state); @@ -692,9 +580,9 @@ namespace WeatherManager { Real64 EqOfTime, // Equation of Time Real64 SinSolDeclin, // Sine of Solar Declination Real64 CosSolDeclin, // Cosine of Solar Declination - Array1D &SUNCOS); + Vector3 &SUNCOS); - void DetermineSunUpDown(EnergyPlusData &state, Vector3 &SunDirectionCosines); + void DetermineSunUpDown(EnergyPlusData &state, Vector3 &SUNCOS); void OpenWeatherFile(EnergyPlusData &state, bool &ErrorsFound); @@ -718,20 +606,14 @@ namespace WeatherManager { void ReadUserWeatherInput(EnergyPlusData &state); - // copy report period data from source to target - void CopyReportPeriodObject(const Array1D &source, - const int sourceIdx, - Array1D &target, - const int targetIdx); - void GroupReportPeriodByType(EnergyPlusData &state, const int nReportPeriods); void GetReportPeriodData(EnergyPlusData &state, - int &nReportPeriods, // Total number of Report Periods requested + int nReportPeriods, // Total number of Report Periods requested bool &ErrorsFound); void GetRunPeriodData(EnergyPlusData &state, - int &nRunPeriods, // Total number of Run Periods requested + int nRunPeriods, // Total number of Run Periods requested bool &ErrorsFound); void GetRunPeriodDesignData(EnergyPlusData &state, bool &ErrorsFound); @@ -743,7 +625,7 @@ namespace WeatherManager { void GetDSTData(EnergyPlusData &state, bool &ErrorsFound); // will be set to true if severe errors are found in inputs void GetDesignDayData(EnergyPlusData &state, - int &TotDesDays, // Total number of Design days to Setup + int TotDesDays, // Total number of Design days to Setup bool &ErrorsFound); void GetLocationInfo(EnergyPlusData &state, bool &ErrorsFound); @@ -790,18 +672,14 @@ namespace WeatherManager { struct GregorianDate { - int year; - int month; - int day; - - GregorianDate(int year, int month, int day) : year(year), month(month), day(day) - { - } + int year = 0; + int month = 0; + int day = 0; }; int computeJulianDate(int gyyyy, int gmm, int gdd); - int computeJulianDate(GregorianDate gdate); + int computeJulianDate(GregorianDate const &gdate); GregorianDate computeGregorianDate(int jdate); @@ -815,17 +693,11 @@ namespace WeatherManager { struct AnnualMonthlyDryBulbWeatherData { // Members - bool OADryBulbWeatherDataProcessed; // if false stat or weather file OA Dry-bulb temp is not processed yet - Real64 AnnualAvgOADryBulbTemp; // annual average outdoor air temperature (C) - Real64 MonthlyAvgOADryBulbTempMaxDiff; // monthly daily average OA drybulb temperature maximum difference (deltaC) - Array1D MonthlyDailyAverageDryBulbTemp; // monthly-daily average outdoor air temperatures (C) - - // Default Constructor - AnnualMonthlyDryBulbWeatherData() - : OADryBulbWeatherDataProcessed(false), AnnualAvgOADryBulbTemp(0.0), MonthlyAvgOADryBulbTempMaxDiff(0.0), - MonthlyDailyAverageDryBulbTemp(12, 0.0) - { - } + bool OADryBulbWeatherDataProcessed = false; // if false stat or weather file OA Dry-bulb temp is not processed yet + Real64 AnnualAvgOADryBulbTemp = 0.0; // annual average outdoor air temperature (C) + Real64 MonthlyAvgOADryBulbTempMaxDiff = 0.0; // monthly daily average OA drybulb temperature maximum difference (deltaC) + Array1D MonthlyDailyAverageDryBulbTemp = Array1D(12, 0.0); // monthly-daily average outdoor air temperatures (C) + void CalcAnnualAndMonthlyDryBulbTemp(EnergyPlusData &state); // true if this is CorrelationFromWeatherFile }; @@ -839,7 +711,60 @@ namespace WeatherManager { Real64 RelHum, Real64 IRHoriz); -} // namespace WeatherManager + struct WeatherVars + { + bool IsRain = false; + bool IsSnow = false; + Real64 OutDryBulbTemp = 0.0; + Real64 OutDewPointTemp = 0.0; + Real64 OutBaroPress = 0.0; + Real64 OutRelHum = 0.0; + Real64 WindSpeed = 0.0; + Real64 WindDir = 0.0; + Real64 SkyTemp = 0.0; + Real64 HorizIRSky = 0.0; + Real64 BeamSolarRad = 0.0; + Real64 DifSolarRad = 0.0; + Real64 Albedo = 0.0; + Real64 WaterPrecip = 0.0; // What is the difference between WaterPrecip and LiquidPrecip? + Real64 LiquidPrecip = 0.0; + Real64 TotalSkyCover = 0.0; + Real64 OpaqueSkyCover = 0.0; + }; + + // This struct carries the default missing data for those data elements that would be best replaced with the previous hour's data for missing + // data. + struct ExtWeatherVars : public WeatherVars + { + // Members + Real64 Visibility = 0.0; // Visibility (km) + Real64 Ceiling = 0.0; // Ceiling Height (m) + Real64 AerOptDepth = 0.0; // Aerosol Optical Depth + Real64 SnowDepth = 0.0; // Snow Depth (cm) + int DaysLastSnow = 0; // Number of Days since last snow + }; + + struct DesDayMods + { + Real64 OutDryBulbTemp = 0.0; + Real64 OutRelHum = 0.0; + Real64 BeamSolarRad = 0.0; + Real64 DifSolarRad = 0.0; + Real64 SkyTemp = 0.0; + }; + + struct SPSiteSchedules + { + Real64 OutDryBulbTemp = 0.0; + Real64 OutRelHum = 0.0; + Real64 BeamSolarRad = 0.0; + Real64 DifSolarRad = 0.0; + Real64 SkyTemp = 0.0; + }; + + // Here's a fun little function + void ForAllHrTs(EnergyPlusData &state, std::function f); +} // namespace Weather struct WeatherManagerData : BaseGlobalStruct { @@ -857,8 +782,6 @@ struct WeatherManagerData : BaseGlobalStruct bool PrintEnvrnStamp; // Set to true when the environment header should be printed bool PrintDDHeader; - Real64 const Sigma; // Stefan-Boltzmann constant - int YearOfSim; // The Present year of Simulation. int const NumDaysInYear; int EnvironmentReportNbr; // Report number for the environment stamp @@ -875,11 +798,11 @@ struct WeatherManagerData : BaseGlobalStruct Array1D GroundReflectances; // User Specified Ground Reflectances !EPTeam: Using DP causes big diffs NOLINT(cert-err58-cpp) Real64 SnowGndRefModifier; // Modifier to ground reflectance during snow Real64 SnowGndRefModifierForDayltg; // Modifier to ground reflectance during snow for daylighting - WeatherManager::WaterMainsTempCalcMethod WaterMainsTempsMethod; // Water mains temperature calculation method - int WaterMainsTempsSchedule; // Water mains temperature schedule - Real64 WaterMainsTempsAnnualAvgAirTemp; // Annual average outdoor air temperature (C) - Real64 WaterMainsTempsMaxDiffAirTemp; // Maximum difference in monthly average outdoor air temperatures (deltaC) - std::string WaterMainsTempsScheduleName; // water mains tempeature schedule name + Weather::WaterMainsTempCalcMethod WaterMainsTempsMethod; // Water mains temperature calculation method + int WaterMainsTempsSchedule; // Water mains temperature schedule + Real64 WaterMainsTempsAnnualAvgAirTemp; // Annual average outdoor air temperature (C) + Real64 WaterMainsTempsMaxDiffAirTemp; // Maximum difference in monthly average outdoor air temperatures (deltaC) + std::string WaterMainsTempsScheduleName; // water mains tempeature schedule name bool wthFCGroundTemps; int TotRunPers; // Total number of Run Periods (Weather data) to Setup @@ -912,64 +835,24 @@ struct WeatherManagerData : BaseGlobalStruct int NumEPWTypExtSets; // Number of Typical/Extreme on weather file. int NumWPSkyTemperatures; // Number of WeatherProperty:SkyTemperature items in input file - Array2D_bool TodayIsRain; // Rain indicator, true=rain NOLINT(cert-err58-cpp) - Array2D_bool TodayIsSnow; // Snow indicator, true=snow NOLINT(cert-err58-cpp) - Array2D TodayOutDryBulbTemp; // Dry bulb temperature of outside air NOLINT(cert-err58-cpp) - Array2D TodayOutDewPointTemp; // Dew Point Temperature of outside air NOLINT(cert-err58-cpp) - Array2D TodayOutBaroPress; // Barometric pressure of outside air NOLINT(cert-err58-cpp) - Array2D TodayOutRelHum; // Relative Humidity of outside air NOLINT(cert-err58-cpp) - Array2D TodayWindSpeed; // Wind speed of outside air NOLINT(cert-err58-cpp) - Array2D TodayWindDir; // Wind direction of outside air NOLINT(cert-err58-cpp) - Array2D TodaySkyTemp; // Sky temperature NOLINT(cert-err58-cpp) - Array2D TodayHorizIRSky; // Horizontal IR from Sky NOLINT(cert-err58-cpp) - Array2D TodayBeamSolarRad; // Direct normal solar irradiance NOLINT(cert-err58-cpp) - Array2D TodayDifSolarRad; // Sky diffuse horizontal solar irradiance NOLINT(cert-err58-cpp) - Array2D TodayAlbedo; // Albedo NOLINT(cert-err58-cpp) - Array2D TodayLiquidPrecip; // Liquid Precipitation Depth (mm) NOLINT(cert-err58-cpp) - Array2D TodayTotalSkyCover; // Total Sky Cover(cert-err58-cpp) - Array2D TodayOpaqueSkyCover; // Opaque Sky Cover(cert-err58-cpp) - - Array2D_bool TomorrowIsRain; // Rain indicator, true=rain NOLINT(cert-err58-cpp) - Array2D_bool TomorrowIsSnow; // Snow indicator, true=snow NOLINT(cert-err58-cpp) - Array2D TomorrowOutDryBulbTemp; // Dry bulb temperature of outside air NOLINT(cert-err58-cpp) - Array2D TomorrowOutDewPointTemp; // Dew Point Temperature of outside air NOLINT(cert-err58-cpp) - Array2D TomorrowOutBaroPress; // Barometric pressure of outside air NOLINT(cert-err58-cpp) - Array2D TomorrowOutRelHum; // Relative Humidity of outside air NOLINT(cert-err58-cpp) - Array2D TomorrowWindSpeed; // Wind speed of outside air NOLINT(cert-err58-cpp) - Array2D TomorrowWindDir; // Wind direction of outside air NOLINT(cert-err58-cpp) - Array2D TomorrowSkyTemp; // Sky temperature NOLINT(cert-err58-cpp) - Array2D TomorrowHorizIRSky; // Horizontal IR from Sky NOLINT(cert-err58-cpp) - Array2D TomorrowBeamSolarRad; // Direct normal solar irradiance NOLINT(cert-err58-cpp) - Array2D TomorrowDifSolarRad; // Sky diffuse horizontal solar irradiance NOLINT(cert-err58-cpp) - Array2D TomorrowAlbedo; // Albedo NOLINT(cert-err58-cpp) - Array2D TomorrowLiquidPrecip; // Liquid Precipitation Depth NOLINT(cert-err58-cpp) - Array2D TomorrowTotalSkyCover; // Total Sky Cover {tenth of sky}(cert-err58-cpp) - Array2D TomorrowOpaqueSkyCover; // Opaque Sky Cover {tenth of sky}(cert-err58-cpp) - - Array3D DDDBRngModifier; // Design Day Dry-bulb Temperature Range Modifier NOLINT(cert-err58-cpp) - Array3D DDHumIndModifier; // Design Day relative humidity values or wet-bulb modifiers (per HumIndType) NOLINT(cert-err58-cpp) - Array3D DDBeamSolarValues; // Design Day Beam Solar Values NOLINT(cert-err58-cpp) - Array3D DDDiffuseSolarValues; // Design Day Relative Humidity Values NOLINT(cert-err58-cpp) - - Array3D DDSkyTempScheduleValues; // Sky temperature - DesignDay input NOLINT(cert-err58-cpp) + Array2D wvarsHrTsToday; + Array2D wvarsHrTsTomorrow; + + EPVector> desDayMods; int RptIsRain; // Rain Report Value int RptIsSnow; // Snow Report Value int RptDayType; // DayType Report Value - Real64 HrAngle; // Current Hour Angle - Real64 SolarAltitudeAngle; // Angle of Solar Altitude (degrees) - Real64 SolarAzimuthAngle; // Angle of Solar Azimuth (degrees) - Real64 HorizIRSky; // Horizontal Infrared Radiation Intensity (W/m2) - Real64 TimeStepFraction; // Fraction of hour each time step represents - Array1D SPSiteDryBulbRangeModScheduleValue; // reporting Drybulb Temperature Range Modifier Schedule Value NOLINT(cert-err58-cpp) - Array1D SPSiteHumidityConditionScheduleValue; // reporting Humidity Condition Schedule Value NOLINT(cert-err58-cpp) - Array1D SPSiteBeamSolarScheduleValue; // reporting Beam Solar Schedule Value NOLINT(cert-err58-cpp) - Array1D SPSiteDiffuseSolarScheduleValue; // reporting Diffuse Solar Schedule Value NOLINT(cert-err58-cpp) - Array1D SPSiteSkyTemperatureScheduleValue; // reporting SkyTemperature Modifier Schedule Value NOLINT(cert-err58-cpp) - Array1D_int SPSiteScheduleNamePtr; // SP Site Schedule Name Ptrs NOLINT(cert-err58-cpp) - Array1D_string SPSiteScheduleUnits; // SP Site Schedule Units NOLINT(cert-err58-cpp) - int NumSPSiteScheduleNamePtrs; // Number of SP Site Schedules (DesignDay only) + Real64 HrAngle; // Current Hour Angle + Real64 SolarAltitudeAngle; // Angle of Solar Altitude (degrees) + Real64 SolarAzimuthAngle; // Angle of Solar Azimuth (degrees) + Real64 HorizIRSky; // Horizontal Infrared Radiation Intensity (W/m2) + Real64 TimeStepFraction; // Fraction of hour each time step represents + + EPVector spSiteSchedules; + std::vector spSiteSchedNums; + // Number of hours of missing data Array1D Interpolation; // Interpolation values based on Number of Time Steps in Hour NOLINT(cert-err58-cpp) Array1D SolarInterpolation; // Solar Interpolation values based on Number of Time Steps in Hour NOLINT(cert-err58-cpp) @@ -983,54 +866,49 @@ struct WeatherManagerData : BaseGlobalStruct // Object Data // NOLINTNEXTLINE(cert-err58-cpp) - WeatherManager::DayWeatherVariables - TodayVariables; // Today's daily weather variables | Derived Type for Storing Weather "Header" Data | Day of year for weather - // data | Year of weather data | Month of weather data | Day of month for weather data | Day of week for - // weather data | Daylight Saving Time Period indicator (0=no,1=yes) | Holiday indicator (0=no holiday, - // non-zero=holiday type) | Sine of the solar declination angle | Cosine of the solar declination angle | - // Value of the equation of time formula + Weather::DayWeatherVariables TodayVariables; // Today's daily weather variables | Derived Type for Storing Weather "Header" Data | Day of year for + // weather data | Year of weather data | Month of weather data | Day of month for weather data | Day + // of week for weather data | Daylight Saving Time Period indicator (0=no,1=yes) | Holiday indicator + // (0=no holiday, non-zero=holiday type) | Sine of the solar declination angle | Cosine of the solar + // declination angle | Value of the equation of time formula // NOLINTNEXTLINE(cert-err58-cpp) - WeatherManager::DayWeatherVariables - TomorrowVariables; // Tomorrow's daily weather variables | Derived Type for Storing Weather "Header" Data | Day of year for - // weather data | Year of weather data | Month of weather data | Day of month for weather data | Day of - // week for weather data | Daylight Saving Time Period indicator (0=no,1=yes) | Holiday indicator (0=no - // holiday, non-zero=holiday type) | Sine of the solar declination angle | Cosine of the solar declination - // angle | Value of the equation of time formula + Weather::DayWeatherVariables TomorrowVariables; // Tomorrow's daily weather variables | Derived Type for Storing Weather "Header" Data | Day of + // year for weather data | Year of weather data | Month of weather data | Day of month for weather + // data | Day of week for weather data | Daylight Saving Time Period indicator (0=no,1=yes) | + // Holiday indicator (0=no holiday, non-zero=holiday type) | Sine of the solar declination angle | + // Cosine of the solar declination angle | Value of the equation of time formula // NOLINTNEXTLINE(cert-err58-cpp) - EPVector DesignDay; // Design day environments + EPVector DesignDay; // Design day environments // NOLINTNEXTLINE(cert-err58-cpp) - WeatherManager::MissingData Missing; // Dry Bulb Temperature (C) | Dew Point Temperature (C) | Relative Humidity (%) | Atmospheric Pressure (Pa) | - // Wind Direction (deg) | Wind Speed/Velocity (m/s) | Total Sky Cover (tenths) | Opaque Sky Cover (tenths) | - // Visibility (km) | Ceiling Height (m) | Precipitable Water (mm) | Aerosol Optical Depth | Snow Depth (cm) | - // Number of Days since last snow | Albedo | Rain/Liquid Precipitation (mm) - WeatherManager::MissingDataCounts Missed; // NOLINT(cert-err58-cpp) - WeatherManager::RangeDataCounts OutOfRange; // NOLINT(cert-err58-cpp) - EPVector DesDayInput; // Design day Input Data NOLINT(cert-err58-cpp) - Array1D Environment; // Environment data NOLINT(cert-err58-cpp) - Array1D RunPeriodInput; // NOLINT(cert-err58-cpp) - std::unordered_map RunPeriodInputUniqueNames; - EPVector RunPeriodDesignInput; // NOLINT(cert-err58-cpp) - std::unordered_map RunPeriodDesignInputUniqueNames; - Array1D ReportPeriodInput; - Array1D ThermalReportPeriodInput; - Array1D CO2ReportPeriodInput; - Array1D VisualReportPeriodInput; - std::unordered_map ReportPeriodInputUniqueNames; - EPVector TypicalExtremePeriods; // NOLINT(cert-err58-cpp) - WeatherManager::DaylightSavingPeriodData EPWDST; // Daylight Saving Period Data from EPW file NOLINT(cert-err58-cpp) - WeatherManager::DaylightSavingPeriodData IDFDST; // Daylight Saving Period Data from IDF file NOLINT(cert-err58-cpp) - WeatherManager::DaylightSavingPeriodData DST; // Daylight Saving Period Data, if active NOLINT(cert-err58-cpp) - EPVector WPSkyTemperature; // NOLINT(cert-err58-cpp) - EPVector SpecialDays; // NOLINT(cert-err58-cpp) - EPVector DataPeriods; // NOLINT(cert-err58-cpp) + Weather::ExtWeatherVars wvarsMissing; // Dry Bulb Temperature (C) | Dew Point Temperature (C) | Relative Humidity (%) | Atmospheric Pressure (Pa) + // | Wind Direction (deg) | Wind Speed/Velocity (m/s) | Total Sky Cover (tenths) | Opaque Sky Cover (tenths) + // | Visibility (km) | Ceiling Height (m) | Precipitable Water (mm) | Aerosol Optical Depth | Snow Depth + // (cm) | Number of Days since last snow | Albedo | Rain/Liquid Precipitation (mm) + Weather::WeatherVarCounts wvarsMissedCounts; // NOLINT(cert-err58-cpp) + Weather::WeatherVarCounts wvarsOutOfRangeCounts; // NOLINT(cert-err58-cpp) + EPVector DesDayInput; // Design day Input Data NOLINT(cert-err58-cpp) + Array1D Environment; // Environment data NOLINT(cert-err58-cpp) + Array1D RunPeriodInput; // NOLINT(cert-err58-cpp) + EPVector RunPeriodDesignInput; // NOLINT(cert-err58-cpp) + Array1D ReportPeriodInput; + Array1D ThermalReportPeriodInput; + Array1D CO2ReportPeriodInput; + Array1D VisualReportPeriodInput; + EPVector TypicalExtremePeriods; // NOLINT(cert-err58-cpp) + Weather::DSTPeriod EPWDST; // Daylight Saving Period Data from EPW file NOLINT(cert-err58-cpp) + Weather::DSTPeriod IDFDST; // Daylight Saving Period Data from IDF file NOLINT(cert-err58-cpp) + Weather::DSTPeriod DST; // Daylight Saving Period Data, if active NOLINT(cert-err58-cpp) + EPVector WPSkyTemperature; // NOLINT(cert-err58-cpp) + EPVector SpecialDays; // NOLINT(cert-err58-cpp) + EPVector DataPeriods; // NOLINT(cert-err58-cpp) std::shared_ptr siteShallowGroundTempsPtr; std::shared_ptr siteBuildingSurfaceGroundTempsPtr; std::shared_ptr siteFCFactorMethodGroundTempsPtr; std::shared_ptr siteDeepGroundTempsPtr; - std::vector underwaterBoundaries; - WeatherManager::AnnualMonthlyDryBulbWeatherData OADryBulbAverage; // processes outside air drybulb temperature + std::vector underwaterBoundaries; + Weather::AnnualMonthlyDryBulbWeatherData OADryBulbAverage; // processes outside air drybulb temperature // SetCurrentWeather static vars int NextHour; @@ -1039,23 +917,10 @@ struct WeatherManagerData : BaseGlobalStruct int CurDayOfWeek; Real64 ReadEPlusWeatherCurTime; bool LastHourSet; - Real64 LastHrOutDryBulbTemp; - Real64 LastHrOutDewPointTemp; - Real64 LastHrOutBaroPress; - Real64 LastHrOutRelHum; - Real64 LastHrWindSpeed; - Real64 LastHrWindDir; - Real64 LastHrSkyTemp; - Real64 LastHrHorizIRSky; - Real64 LastHrBeamSolarRad; - Real64 LastHrDifSolarRad; - Real64 LastHrAlbedo; - Real64 LastHrLiquidPrecip; - Real64 LastHrTotalSkyCover; - Real64 LastHrOpaqueSkyCover; - Real64 NextHrBeamSolarRad; - Real64 NextHrDifSolarRad; - Real64 NextHrLiquidPrecip; + + Weather::WeatherVars wvarsLastHr; + Weather::WeatherVars wvarsNextHr; + Real64 IsRainThreshold; // precipitation threshold (m) for a rainy day // ProcessEPWHeader static vars @@ -1086,7 +951,7 @@ struct WeatherManagerData : BaseGlobalStruct this->SnowGndRefModifier = 1.0; // Modifier to ground reflectance during snow this->SnowGndRefModifierForDayltg = 1.0; // Modifier to ground reflectance during snow for daylighting - this->WaterMainsTempsMethod = WeatherManager::WaterMainsTempCalcMethod::FixedDefault; + this->WaterMainsTempsMethod = Weather::WaterMainsTempCalcMethod::FixedDefault; this->WaterMainsTempsSchedule = 0; // Water mains temperature schedule this->WaterMainsTempsAnnualAvgAirTemp = 0.0; // Annual average outdoor air temperature (C) this->WaterMainsTempsMaxDiffAirTemp = 0.0; // Maximum difference in monthly average outdoor air temperatures (deltaC) @@ -1106,125 +971,61 @@ struct WeatherManagerData : BaseGlobalStruct this->NumDataPeriods = 0; this->NumIntervalsPerHour = 1; - this->UseDaylightSaving = true; // True if user says to use Weather File specified DaylightSaving Period - this->UseSpecialDays = true; // True if user says to use Weather File specified Special Days for current RunPeriod - this->UseRainValues = true; // True if rain values from weather file are to be used - this->UseSnowValues = true; // True if snow values from weather file are to be used - this->EPWDaylightSaving = false; // True if a DaylightSaving Time Period is input (EPW files) - this->IDFDaylightSaving = false; // True if a DaylightSaving Time Period is input (IDF files) - this->DaylightSavingIsActive = false; // True if a DaylightSavingPeriod should be used for Environment - this->WFAllowsLeapYears = false; // True if the Weather File (WF) header has "Yes" for Leap Years - this->curSimDayForEndOfRunPeriod = 0; // normal=number days in sim, but different when repeating runperiods or multi-year files - this->Envrn = 0; // Counter for environments - this->NumOfEnvrn = 0; // Number of environments to be simulated - this->NumEPWTypExtSets = 0; // Number of Typical/Extreme on weather file. - this->NumWPSkyTemperatures = 0; // Number of WeatherProperty:SkyTemperature items in input file - this->TodayIsRain.deallocate(); // Rain indicator, true=rain - this->TodayIsSnow.deallocate(); // Snow indicator, true=snow - this->TodayOutDryBulbTemp.deallocate(); // Dry bulb temperature of outside air - this->TodayOutDewPointTemp.deallocate(); // Dew Point Temperature of outside air - this->TodayOutBaroPress.deallocate(); // Barometric pressure of outside air - this->TodayOutRelHum.deallocate(); // Relative Humidity of outside air - this->TodayWindSpeed.deallocate(); // Wind speed of outside air - this->TodayWindDir.deallocate(); // Wind direction of outside air - this->TodaySkyTemp.deallocate(); // Sky temperature - this->TodayHorizIRSky.deallocate(); // Horizontal IR from Sky - this->TodayBeamSolarRad.deallocate(); // Direct normal solar irradiance - this->TodayDifSolarRad.deallocate(); // Sky diffuse horizontal solar irradiance - this->TodayAlbedo.deallocate(); // Albedo - this->TodayLiquidPrecip.deallocate(); // Liquid Precipitation Depth (mm) - this->TodayTotalSkyCover.deallocate(); // Total Sky Cover - this->TomorrowOpaqueSkyCover.deallocate(); // Opaque Sky Cover {tenth of sky} - this->TomorrowIsRain.deallocate(); // Rain indicator, true=rain - this->TomorrowIsSnow.deallocate(); // Snow indicator, true=snow - this->TomorrowOutDryBulbTemp.deallocate(); // Dry bulb temperature of outside air - this->TomorrowOutDewPointTemp.deallocate(); // Dew Point Temperature of outside air - this->TomorrowOutBaroPress.deallocate(); // Barometric pressure of outside air - this->TomorrowOutRelHum.deallocate(); // Relative Humidity of outside air - this->TomorrowWindSpeed.deallocate(); // Wind speed of outside air - this->TomorrowWindDir.deallocate(); // Wind direction of outside air - this->TomorrowSkyTemp.deallocate(); // Sky temperature - this->TomorrowHorizIRSky.deallocate(); // Horizontal IR from Sky - this->TomorrowBeamSolarRad.deallocate(); // Direct normal solar irradiance - this->TomorrowDifSolarRad.deallocate(); // Sky diffuse horizontal solar irradiance - this->TomorrowAlbedo.deallocate(); // Albedo - this->TomorrowLiquidPrecip.deallocate(); // Liquid Precipitation Depth - this->TomorrowTotalSkyCover.deallocate(); // Total Sky Cover {tenth of sky} - this->TomorrowOpaqueSkyCover.deallocate(); // Opaque Sky Cover {tenth of sky} - this->DDDBRngModifier.deallocate(); // Design Day Dry-bulb Temperature Range Modifier - this->DDHumIndModifier.deallocate(); // Design Day relative humidity values - this->DDBeamSolarValues.deallocate(); // Design Day Beam Solar Values - this->DDDiffuseSolarValues.deallocate(); // Design Day Relative Humidity Values - this->DDSkyTempScheduleValues.deallocate(); // Sky temperature - DesignDay input - this->RptIsRain = 0; // Rain Report Value - this->RptIsSnow = 0; // Snow Report Value - this->RptDayType = 0; // DayType Report Value - - this->HrAngle = 0.0; // Current Hour Angle - this->SolarAltitudeAngle = 0.0; // Angle of Solar Altitude (degrees) - this->SolarAzimuthAngle = 0.0; // Angle of Solar Azimuth (degrees) - this->HorizIRSky = 0.0; // Horizontal Infrared Radiation Intensity (W/m2) - this->TimeStepFraction = 0.0; // Fraction of hour each time step represents - this->SPSiteDryBulbRangeModScheduleValue.deallocate(); // reporting Drybulb Temperature Range Modifier Schedule Value - this->SPSiteHumidityConditionScheduleValue.deallocate(); // reporting Humidity Condition Schedule Value - this->SPSiteBeamSolarScheduleValue.deallocate(); // reporting Beam Solar Schedule Value - this->SPSiteDiffuseSolarScheduleValue.deallocate(); // reporting Diffuse Solar Schedule Value - this->SPSiteSkyTemperatureScheduleValue.deallocate(); // reporting SkyTemperature Modifier Schedule Value - this->SPSiteScheduleNamePtr.deallocate(); // SP Site Schedule Name Ptrs - this->SPSiteScheduleUnits.deallocate(); // SP Site Schedule Units - this->NumSPSiteScheduleNamePtrs = 0; // Number of SP Site Schedules (DesignDay only) - this->Interpolation.deallocate(); // Interpolation values based on Number of Time Steps in Hour - this->SolarInterpolation.deallocate(); // Solar Interpolation values based on + this->UseDaylightSaving = true; // True if user says to use Weather File specified DaylightSaving Period + this->UseSpecialDays = true; // True if user says to use Weather File specified Special Days for current RunPeriod + this->UseRainValues = true; // True if rain values from weather file are to be used + this->UseSnowValues = true; // True if snow values from weather file are to be used + this->EPWDaylightSaving = false; // True if a DaylightSaving Time Period is input (EPW files) + this->IDFDaylightSaving = false; // True if a DaylightSaving Time Period is input (IDF files) + this->DaylightSavingIsActive = false; // True if a DaylightSavingPeriod should be used for Environment + this->WFAllowsLeapYears = false; // True if the Weather File (WF) header has "Yes" for Leap Years + this->curSimDayForEndOfRunPeriod = 0; // normal=number days in sim, but different when repeating runperiods or multi-year files + this->Envrn = 0; // Counter for environments + this->NumOfEnvrn = 0; // Number of environments to be simulated + this->NumEPWTypExtSets = 0; // Number of Typical/Extreme on weather file. + this->NumWPSkyTemperatures = 0; // Number of WeatherProperty:SkyTemperature items in input file + this->wvarsHrTsToday.deallocate(); + this->wvarsHrTsTomorrow.deallocate(); + this->desDayMods.deallocate(); + this->RptIsRain = 0; // Rain Report Value + this->RptIsSnow = 0; // Snow Report Value + this->RptDayType = 0; // DayType Report Value + + this->HrAngle = 0.0; // Current Hour Angle + this->SolarAltitudeAngle = 0.0; // Angle of Solar Altitude (degrees) + this->SolarAzimuthAngle = 0.0; // Angle of Solar Azimuth (degrees) + this->HorizIRSky = 0.0; // Horizontal Infrared Radiation Intensity (W/m2) + this->TimeStepFraction = 0.0; // Fraction of hour each time step represents + this->spSiteSchedules.deallocate(); + this->spSiteSchedNums.clear(); + + this->Interpolation.deallocate(); // Interpolation values based on Number of Time Steps in Hour + this->SolarInterpolation.deallocate(); // Solar Interpolation values based on this->LeapYearAdd = 0; this->DatesShouldBeReset = false; this->StartDatesCycleShouldBeReset = false; // True when start dates on repeat should be reset this->Jan1DatesShouldBeReset = false; // True if Jan 1 should signal reset of dates - this->TodayVariables = WeatherManager::DayWeatherVariables(); - this->TomorrowVariables = WeatherManager::DayWeatherVariables(); + this->TodayVariables = Weather::DayWeatherVariables(); + this->TomorrowVariables = Weather::DayWeatherVariables(); this->DesignDay.deallocate(); - this->Missing = WeatherManager::MissingData(); - this->Missed = WeatherManager::MissingDataCounts(); - this->OutOfRange = WeatherManager::RangeDataCounts(); + this->wvarsMissing = Weather::ExtWeatherVars(); + this->wvarsMissedCounts = Weather::WeatherVarCounts(); + this->wvarsOutOfRangeCounts = Weather::WeatherVarCounts(); this->DesDayInput.deallocate(); // Design day Input Data this->Environment.deallocate(); // Environment data this->RunPeriodInput.deallocate(); - this->RunPeriodInputUniqueNames.clear(); this->RunPeriodDesignInput.deallocate(); - this->RunPeriodDesignInputUniqueNames.clear(); this->ReportPeriodInput.deallocate(); this->ThermalReportPeriodInput.deallocate(); this->CO2ReportPeriodInput.deallocate(); this->VisualReportPeriodInput.deallocate(); - this->ReportPeriodInputUniqueNames.clear(); this->TypicalExtremePeriods.deallocate(); - this->EPWDST.StDateType = WeatherManager::DateType::Invalid; - this->EPWDST.StWeekDay = 0; - this->EPWDST.StMon = 0; - this->EPWDST.StDay = 0; - this->EPWDST.EnDateType = WeatherManager::DateType::Invalid; - this->EPWDST.EnMon = 0; - this->EPWDST.EnDay = 0; - this->EPWDST.EnWeekDay = 0; - - this->IDFDST.StDateType = WeatherManager::DateType::Invalid; - this->IDFDST.StWeekDay = 0; - this->IDFDST.StMon = 0; - this->IDFDST.StDay = 0; - this->IDFDST.EnDateType = WeatherManager::DateType::Invalid; - this->IDFDST.EnMon = 0; - this->IDFDST.EnDay = 0; - this->IDFDST.EnWeekDay = 0; - - this->DST.StDateType = WeatherManager::DateType::Invalid; - this->DST.StWeekDay = 0; - this->DST.StMon = 0; - this->DST.StDay = 0; - this->DST.EnDateType = WeatherManager::DateType::Invalid; - this->DST.EnMon = 0; - this->DST.EnDay = 0; - this->DST.EnWeekDay = 0; + this->EPWDST = Weather::DSTPeriod(); + this->IDFDST = Weather::DSTPeriod(); + this->DST = Weather::DSTPeriod(); + this->WPSkyTemperature.deallocate(); this->SpecialDays.deallocate(); this->DataPeriods.deallocate(); @@ -1249,23 +1050,8 @@ struct WeatherManagerData : BaseGlobalStruct // SetUpDesignDay static vars this->PrintDDHeader = true; - this->LastHrOutDryBulbTemp = 0.0; - this->LastHrOutDewPointTemp = 0.0; - this->LastHrOutBaroPress = 0.0; - this->LastHrOutRelHum = 0.0; - this->LastHrWindSpeed = 0.0; - this->LastHrWindDir = 0.0; - this->LastHrSkyTemp = 0.0; - this->LastHrHorizIRSky = 0.0; - this->LastHrBeamSolarRad = 0.0; - this->LastHrDifSolarRad = 0.0; - this->LastHrAlbedo = 0.0; - this->LastHrLiquidPrecip = 0.0; - this->LastHrTotalSkyCover = 0.0; - this->LastHrOpaqueSkyCover = 0.0; - this->NextHrBeamSolarRad = 0.0; - this->NextHrDifSolarRad = 0.0; - this->NextHrLiquidPrecip = 0.0; + this->wvarsLastHr = Weather::WeatherVars(); + this->wvarsNextHr = Weather::WeatherVars(); // ProcessEPWHeader static vars this->EPWHeaderTitle = ""; @@ -1274,17 +1060,17 @@ struct WeatherManagerData : BaseGlobalStruct // Default Constructor WeatherManagerData() : GetBranchInputOneTimeFlag(true), GetEnvironmentFirstCall(true), PrntEnvHeaders(true), FirstCall(true), WaterMainsParameterReport(true), - PrintEnvrnStamp(false), Sigma(5.6697e-8), YearOfSim(1), NumDaysInYear(365), EnvironmentReportNbr(0), EnvironmentReportChr(""), - WeatherFileExists(false), LocationGathered(false), WeatherFileLatitude(0.0), WeatherFileLongitude(0.0), WeatherFileTimeZone(0.0), - WeatherFileElevation(0.0), GroundTempsFCFromEPWHeader(12, 0.0), GroundReflectances(12, 0.2), SnowGndRefModifier(1.0), - SnowGndRefModifierForDayltg(1.0), WaterMainsTempsMethod{WeatherManager::WaterMainsTempCalcMethod::FixedDefault}, WaterMainsTempsSchedule(0), + PrintEnvrnStamp(false), YearOfSim(1), NumDaysInYear(365), EnvironmentReportNbr(0), EnvironmentReportChr(""), WeatherFileExists(false), + LocationGathered(false), WeatherFileLatitude(0.0), WeatherFileLongitude(0.0), WeatherFileTimeZone(0.0), WeatherFileElevation(0.0), + GroundTempsFCFromEPWHeader(12, 0.0), GroundReflectances(12, 0.2), SnowGndRefModifier(1.0), + SnowGndRefModifierForDayltg(1.0), WaterMainsTempsMethod{Weather::WaterMainsTempCalcMethod::FixedDefault}, WaterMainsTempsSchedule(0), WaterMainsTempsAnnualAvgAirTemp(0.0), WaterMainsTempsMaxDiffAirTemp(0.0), WaterMainsTempsScheduleName(""), wthFCGroundTemps(false), TotRunPers(0), TotRunDesPers(0), TotReportPers(0), TotThermalReportPers(0), TotCO2ReportPers(0), TotVisualReportPers(0), NumSpecialDays(0), SpecialDayTypes(366, 0), WeekDayTypes(366, 0), DSTIndex(366, 0), NumDataPeriods(0), NumIntervalsPerHour(1), UseDaylightSaving(true), UseSpecialDays(true), UseRainValues(true), UseSnowValues(true), EPWDaylightSaving(false), IDFDaylightSaving(false), DaylightSavingIsActive(false), WFAllowsLeapYears(false), curSimDayForEndOfRunPeriod(0), Envrn(0), NumOfEnvrn(0), NumEPWTypExtSets(0), NumWPSkyTemperatures(0), RptIsRain(0), RptIsSnow(0), RptDayType(0), HrAngle(0.0), SolarAltitudeAngle(0.0), SolarAzimuthAngle(0.0), - HorizIRSky(0.0), TimeStepFraction(0.0), NumSPSiteScheduleNamePtrs(0), EndDayOfMonth(12, {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}), + HorizIRSky(0.0), TimeStepFraction(0.0), EndDayOfMonth(12, {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}), EndDayOfMonthWithLeapDay(12, {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}), LeapYearAdd(0), DatesShouldBeReset(false), StartDatesCycleShouldBeReset(false), Jan1DatesShouldBeReset(false), RPReadAllWeatherData(false) { diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 9225de5cdac..27f8e787e5d 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -136,7 +136,7 @@ namespace WindTurbine { } if (GeneratorIndex == 0) { - WindTurbineNum = UtilityRoutines::FindItemInList(GeneratorName, state.dataWindTurbine->WindTurbineSys); + WindTurbineNum = Util::FindItemInList(GeneratorName, state.dataWindTurbine->WindTurbineSys); if (WindTurbineNum == 0) { ShowFatalError(state, format("SimWindTurbine: Specified Generator not one of Valid Wind Turbine Generators {}", GeneratorName)); } @@ -259,7 +259,7 @@ namespace WindTurbine { lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound); auto &windTurbine = state.dataWindTurbine->WindTurbineSys(WindTurbineNum); @@ -282,7 +282,7 @@ namespace WindTurbine { } // Select rotor type windTurbine.rotorType = - static_cast(getEnumValue(WindTurbine::RotorNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + static_cast(getEnumValue(WindTurbine::RotorNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); if (windTurbine.rotorType == RotorType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(3).empty()) { windTurbine.rotorType = RotorType::HorizontalAxis; @@ -299,7 +299,7 @@ namespace WindTurbine { // Select control type windTurbine.controlType = - static_cast(getEnumValue(WindTurbine::ControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + static_cast(getEnumValue(WindTurbine::ControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (windTurbine.controlType == ControlType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(4).empty()) { windTurbine.controlType = ControlType::VariableSpeedVariablePitch; @@ -814,7 +814,7 @@ namespace WindTurbine { if ((lnPtr == std::string::npos) || (!stripped(lineIn.data.substr(0, lnPtr)).empty())) { if (lnPtr != std::string::npos) { bool error = false; - MonthWS(mon) = UtilityRoutines::ProcessNumber(lineIn.data.substr(0, lnPtr), error); + MonthWS(mon) = Util::ProcessNumber(lineIn.data.substr(0, lnPtr), error); if (error) { // probably should throw some error here diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index 2dd5a9fd39c..bde19976705 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -155,7 +155,7 @@ namespace WindowAC { // Find the correct Window AC Equipment if (CompIndex == 0) { - WindACNum = UtilityRoutines::FindItemInList(CompName, state.dataWindowAC->WindAC); + WindACNum = Util::FindItemInList(CompName, state.dataWindowAC->WindAC); if (WindACNum == 0) { ShowFatalError(state, format("SimWindowAC: Unit not found={}", CompName)); } @@ -307,7 +307,7 @@ namespace WindowAC { state.dataWindowAC->WindACNumericFields(WindACNum).FieldNames.allocate(NumNumbers); state.dataWindowAC->WindACNumericFields(WindACNum).FieldNames = ""; state.dataWindowAC->WindACNumericFields(WindACNum).FieldNames = cNumericFields; - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); state.dataWindowAC->WindAC(WindACNum).Name = Alphas(1); state.dataWindowAC->WindAC(WindACNum).UnitType = state.dataWindowAC->WindowAC_UnitType; // 'ZoneHVAC:WindowAirConditioner' @@ -382,7 +382,7 @@ namespace WindowAC { ShowContinueError(state, format("specified in {} = \"{}\".", CurrentModuleObject, state.dataWindowAC->WindAC(WindACNum).Name)); ErrorsFound = true; } else { - if (UtilityRoutines::SameString(state.dataWindowAC->WindAC(WindACNum).FanType, "Fan:SystemModel")) { + if (Util::SameString(state.dataWindowAC->WindAC(WindACNum).FanType, "Fan:SystemModel")) { state.dataWindowAC->WindAC(WindACNum).FanType_Num = DataHVACGlobals::FanType_SystemModelObject; state.dataHVACFan->fanObjs.emplace_back( new HVACFan::FanSystem(state, state.dataWindowAC->WindAC(WindACNum).FanName)); // call constructor @@ -464,20 +464,20 @@ namespace WindowAC { state.dataWindowAC->WindAC(WindACNum).DXCoilName = Alphas(10); - if (UtilityRoutines::SameString(Alphas(9), "Coil:Cooling:DX:SingleSpeed") || - UtilityRoutines::SameString(Alphas(9), "CoilSystem:Cooling:DX:HeatExchangerAssisted") || - UtilityRoutines::SameString(Alphas(9), "Coil:Cooling:DX:VariableSpeed")) { + if (Util::SameString(Alphas(9), "Coil:Cooling:DX:SingleSpeed") || + Util::SameString(Alphas(9), "CoilSystem:Cooling:DX:HeatExchangerAssisted") || + Util::SameString(Alphas(9), "Coil:Cooling:DX:VariableSpeed")) { state.dataWindowAC->WindAC(WindACNum).DXCoilType = Alphas(9); CoilNodeErrFlag = false; - if (UtilityRoutines::SameString(Alphas(9), "Coil:Cooling:DX:SingleSpeed")) { + if (Util::SameString(Alphas(9), "Coil:Cooling:DX:SingleSpeed")) { state.dataWindowAC->WindAC(WindACNum).DXCoilType_Num = CoilDX_CoolingSingleSpeed; state.dataWindowAC->WindAC(WindACNum).CoilOutletNodeNum = GetDXCoilOutletNode( state, state.dataWindowAC->WindAC(WindACNum).DXCoilType, state.dataWindowAC->WindAC(WindACNum).DXCoilName, CoilNodeErrFlag); - } else if (UtilityRoutines::SameString(Alphas(9), "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { + } else if (Util::SameString(Alphas(9), "CoilSystem:Cooling:DX:HeatExchangerAssisted")) { state.dataWindowAC->WindAC(WindACNum).DXCoilType_Num = CoilDX_CoolingHXAssisted; state.dataWindowAC->WindAC(WindACNum).CoilOutletNodeNum = GetDXHXAsstdCoilOutletNode( state, state.dataWindowAC->WindAC(WindACNum).DXCoilType, state.dataWindowAC->WindAC(WindACNum).DXCoilName, CoilNodeErrFlag); - } else if (UtilityRoutines::SameString(Alphas(9), "Coil:Cooling:DX:VariableSpeed")) { + } else if (Util::SameString(Alphas(9), "Coil:Cooling:DX:VariableSpeed")) { state.dataWindowAC->WindAC(WindACNum).DXCoilType_Num = DataHVACGlobals::Coil_CoolingAirToAirVariableSpeed; state.dataWindowAC->WindAC(WindACNum).CoilOutletNodeNum = VariableSpeedCoils::GetCoilOutletNodeVariableSpeed( state, state.dataWindowAC->WindAC(WindACNum).DXCoilType, state.dataWindowAC->WindAC(WindACNum).DXCoilName, CoilNodeErrFlag); @@ -508,8 +508,8 @@ namespace WindowAC { state.dataWindowAC->WindAC(WindACNum).OpMode = CycFanCycCoil; } - if (UtilityRoutines::SameString(Alphas(12), "BlowThrough")) state.dataWindowAC->WindAC(WindACNum).FanPlace = BlowThru; - if (UtilityRoutines::SameString(Alphas(12), "DrawThrough")) state.dataWindowAC->WindAC(WindACNum).FanPlace = DrawThru; + if (Util::SameString(Alphas(12), "BlowThrough")) state.dataWindowAC->WindAC(WindACNum).FanPlace = BlowThru; + if (Util::SameString(Alphas(12), "DrawThrough")) state.dataWindowAC->WindAC(WindACNum).FanPlace = DrawThru; if (state.dataWindowAC->WindAC(WindACNum).FanPlace == 0) { ShowSevereError(state, format("Invalid {} = {}", cAlphaFields(12), Alphas(12))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, state.dataWindowAC->WindAC(WindACNum).Name)); @@ -524,7 +524,7 @@ namespace WindowAC { state.dataWindowAC->WindAC(WindACNum).HVACSizingIndex = 0; if (!lAlphaBlanks(14)) { - state.dataWindowAC->WindAC(WindACNum).HVACSizingIndex = UtilityRoutines::FindItemInList(Alphas(14), state.dataSize->ZoneHVACSizing); + state.dataWindowAC->WindAC(WindACNum).HVACSizingIndex = Util::FindItemInList(Alphas(14), state.dataSize->ZoneHVACSizing); if (state.dataWindowAC->WindAC(WindACNum).HVACSizingIndex == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(14), Alphas(14))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, state.dataWindowAC->WindAC(WindACNum).Name)); diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index bbb8d505ba9..b75586f705e 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -2744,7 +2744,7 @@ namespace WindowComplexManager { CalcDeflection = state.dataMaterial->WindowThermalModel(ThermalModelNum).DeflectionModel; SDScalar = state.dataMaterial->WindowThermalModel(ThermalModelNum).SDScalar; VacuumPressure = state.dataMaterial->WindowThermalModel(ThermalModelNum).VacuumPressureLimit; - Tini = state.dataMaterial->WindowThermalModel(ThermalModelNum).InitialTemperature - Constant::KelvinConv; + Tini = state.dataMaterial->WindowThermalModel(ThermalModelNum).InitialTemperature - Constant::Kelvin; Pini = state.dataMaterial->WindowThermalModel(ThermalModelNum).InitialPressure; nlayer = state.dataConstruction->Construct(ConstrNum).TotSolidLayers; @@ -2754,17 +2754,17 @@ namespace WindowComplexManager { if (CalcCondition == DataBSDFWindow::Condition::Invalid) { ZoneNum = state.dataSurface->Surface(SurfNum).Zone; Real64 RefAirTemp = state.dataSurface->Surface(SurfNum).getInsideAirTemperature(state, SurfNum); - tind = RefAirTemp + Constant::KelvinConv; // Inside air temperature + tind = RefAirTemp + Constant::Kelvin; // Inside air temperature // now get "outside" air temperature if (SurfNumAdj > 0) { // Interzone window int enclNumAdj = state.dataSurface->Surface(SurfNumAdj).RadEnclIndex; RefAirTemp = state.dataSurface->Surface(SurfNumAdj).getInsideAirTemperature(state, SurfNumAdj); - tout = RefAirTemp + Constant::KelvinConv; // outside air temperature + tout = RefAirTemp + Constant::Kelvin; // outside air temperature tsky = state.dataViewFactor->EnclRadInfo(enclNumAdj).MRT + - Constant::KelvinConv; // TODO this misses IR from sources such as high temp radiant and baseboards + Constant::Kelvin; // TODO this misses IR from sources such as high temp radiant and baseboards // ! Add long-wave radiation from adjacent zone absorbed by glass layer closest to the adjacent zone. // AbsRadGlassFace(1) = AbsRadGlassFace(1) + SurfQRadThermInAbs(SurfNumAdj) @@ -2777,18 +2777,18 @@ namespace WindowComplexManager { OutSrdIR = 0; if (state.dataGlobal->AnyLocalEnvironmentsInModel) { if (state.dataSurface->Surface(SurfNum).SurfHasSurroundingSurfProperty) { - SrdSurfTempAbs = state.dataSurface->Surface(SurfNum).SrdSurfTemp + Constant::KelvinConv; + SrdSurfTempAbs = state.dataSurface->Surface(SurfNum).SrdSurfTemp + Constant::Kelvin; OutSrdIR = Constant::StefanBoltzmann * state.dataSurface->Surface(SurfNum).ViewFactorSrdSurfs * pow_4(SrdSurfTempAbs); } } if (state.dataSurface->Surface(SurfNum).ExtWind) { // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + Constant::KelvinConv; + tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + Constant::Kelvin; } else { // Dry - tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::KelvinConv; + tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::Kelvin; } } else { // Window not exposed to wind - tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::KelvinConv; + tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::Kelvin; } // tsky = SkyTemp + TKelvin tsky = state.dataEnvrn->SkyTempKelvin; @@ -3213,9 +3213,9 @@ namespace WindowComplexManager { // For all cases, get total window heat gain for reporting. See CalcWinFrameAndDividerTemps for // contribution of frame and divider. - SurfInsideTemp = theta(2 * nlayer) - Constant::KelvinConv; + SurfInsideTemp = theta(2 * nlayer) - Constant::Kelvin; state.dataSurface->SurfWinEffInsSurfTemp(SurfNum) = SurfInsideTemp; - SurfOutsideTemp = theta(1) - Constant::KelvinConv; + SurfOutsideTemp = theta(1) - Constant::Kelvin; SurfOutsideEmiss = emis(1); IncidentSolar = state.dataSurface->Surface(SurfNum).Area * state.dataHeatBal->SurfQRadSWOutIncident(SurfNum); @@ -3284,8 +3284,8 @@ namespace WindowComplexManager { // WinGapConvHtFlowRep(SurfNum) = 0.0d0 // WinGapConvHtFlowRepEnergy(SurfNum) = 0.0d0 TotAirflowGap = state.dataSurface->SurfWinAirflowThisTS(SurfNum) * state.dataSurface->Surface(SurfNum).Width; - TAirflowGapOutlet = Constant::KelvinConv; // TODO Need to calculate this - TAirflowGapOutletC = TAirflowGapOutlet - Constant::KelvinConv; + TAirflowGapOutlet = Constant::Kelvin; // TODO Need to calculate this + TAirflowGapOutletC = TAirflowGapOutlet - Constant::Kelvin; state.dataSurface->SurfWinTAirflowGapOutlet(SurfNum) = TAirflowGapOutletC; if (state.dataSurface->SurfWinAirflowThisTS(SurfNum) > 0.0) { ConvHeatFlowForced = sum(qv); // TODO. figure forced ventilation heat flow in Watts @@ -3374,17 +3374,17 @@ namespace WindowComplexManager { if (ShadeFlag == WinShadingType::IntShade) state.dataSurface->SurfWinConvCoeffWithShade(SurfNum) = 0.0; if (ShadeFlag == WinShadingType::IntShade) { - SurfInsideTemp = theta(2 * ngllayer + 2) - Constant::KelvinConv; + SurfInsideTemp = theta(2 * ngllayer + 2) - Constant::Kelvin; // // Get properties of inside shading layer Real64 EffShBlEmiss = state.dataSurface->SurfaceWindow(SurfNum).EffShBlindEmiss[0]; Real64 EffGlEmiss = state.dataSurface->SurfaceWindow(SurfNum).EffGlassEmiss[0]; state.dataSurface->SurfWinEffInsSurfTemp(SurfNum) = - (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (theta(2 * ngllayer) - Constant::KelvinConv)) / (EffShBlEmiss + EffGlEmiss); + (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (theta(2 * ngllayer) - Constant::Kelvin)) / (EffShBlEmiss + EffGlEmiss); } else { - SurfOutsideTemp = theta(1) - Constant::KelvinConv; + SurfOutsideTemp = theta(1) - Constant::Kelvin; } for (k = 1; k <= nlayer; ++k) { @@ -3392,8 +3392,8 @@ namespace WindowComplexManager { state.dataSurface->SurfaceWindow(SurfNum).ThetaFace(2 * k) = theta(2 * k); // temperatures for reporting - state.dataHeatBal->SurfWinFenLaySurfTempFront(SurfNum, k) = theta(2 * k - 1) - Constant::KelvinConv; - state.dataHeatBal->SurfWinFenLaySurfTempBack(SurfNum, k) = theta(2 * k) - Constant::KelvinConv; + state.dataHeatBal->SurfWinFenLaySurfTempFront(SurfNum, k) = theta(2 * k - 1) - Constant::Kelvin; + state.dataHeatBal->SurfWinFenLaySurfTempBack(SurfNum, k) = theta(2 * k) - Constant::Kelvin; // thetas(k) = theta(k) } } diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index fe4a2dd87ec..240b7bdc06a 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -427,13 +427,13 @@ void CalcEQLWindowUvalue(EnergyPlusData &state, for (I = 1; I <= 10; ++I) { TGO = TOUT + U * DT / HXO; // update glazing surface temps TGI = TIN - U * DT / HXI; - HRO = Constant::StefanBoltzmann * EO * (pow_2(TGO + Constant::KelvinConv) + pow_2(TOUT + Constant::KelvinConv)) * - ((TGO + Constant::KelvinConv) + (TOUT + Constant::KelvinConv)); - HRI = Constant::StefanBoltzmann * EI * (pow_2(TGI + Constant::KelvinConv) + pow_2(TIN + Constant::KelvinConv)) * - ((TGI + Constant::KelvinConv) + (TIN + Constant::KelvinConv)); + HRO = Constant::StefanBoltzmann * EO * (pow_2(TGO + Constant::Kelvin) + pow_2(TOUT + Constant::Kelvin)) * + ((TGO + Constant::Kelvin) + (TOUT + Constant::Kelvin)); + HRI = Constant::StefanBoltzmann * EI * (pow_2(TGI + Constant::Kelvin) + pow_2(TIN + Constant::Kelvin)) * + ((TGI + Constant::Kelvin) + (TIN + Constant::Kelvin)); // HCI = HIC_ASHRAE( Height, TGI, TI) ! BAN June 2103 Raplaced with ISO Std 15099 - TGIK = TGI + Constant::KelvinConv; - TIK = TIN + Constant::KelvinConv; + TGIK = TGI + Constant::Kelvin; + TIK = TIN + Constant::Kelvin; HCI = HCInWindowStandardRatings(state, Height, TGIK, TIK); if (HCI < 0.001) break; HXI = HCI + HRI; @@ -719,7 +719,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, SurfNumAdj = state.dataSurface->Surface(SurfNum).ExtBoundCond; Real64 RefAirTemp = state.dataSurface->Surface(SurfNum).getInsideAirTemperature(state, SurfNum); TaIn = RefAirTemp; - TIN = TaIn + Constant::KelvinConv; // Inside air temperature, K + TIN = TaIn + Constant::Kelvin; // Inside air temperature, K // now get "outside" air temperature if (SurfNumAdj > 0) { @@ -727,9 +727,9 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, // condition int enclNumAdj = state.dataSurface->Surface(SurfNumAdj).RadEnclIndex; RefAirTemp = state.dataSurface->Surface(SurfNumAdj).getInsideAirTemperature(state, SurfNumAdj); - Tout = RefAirTemp + Constant::KelvinConv; // outside air temperature + Tout = RefAirTemp + Constant::Kelvin; // outside air temperature tsky = state.dataViewFactor->EnclRadInfo(enclNumAdj).MRT + - Constant::KelvinConv; // TODO this misses IR from sources such as high temp radiant and baseboards + Constant::Kelvin; // TODO this misses IR from sources such as high temp radiant and baseboards // The IR radiance of this window's "exterior" surround is the IR radiance // from surfaces and high-temp radiant sources in the adjacent zone @@ -741,18 +741,18 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, OutSrdIR = 0; if (state.dataGlobal->AnyLocalEnvironmentsInModel) { if (state.dataSurface->Surface(SurfNum).SurfHasSurroundingSurfProperty) { - SrdSurfTempAbs = state.dataSurface->Surface(SurfNum).SrdSurfTemp + Constant::KelvinConv; + SrdSurfTempAbs = state.dataSurface->Surface(SurfNum).SrdSurfTemp + Constant::Kelvin; OutSrdIR = Constant::StefanBoltzmann * state.dataSurface->Surface(SurfNum).ViewFactorSrdSurfs * pow_4(SrdSurfTempAbs); } } if (state.dataSurface->Surface(SurfNum).ExtWind) { // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - Tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + Constant::KelvinConv; + Tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + Constant::Kelvin; } else { // Dry - Tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::KelvinConv; + Tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::Kelvin; } } else { // Window not exposed to wind - Tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::KelvinConv; + Tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::Kelvin; } tsky = state.dataEnvrn->SkyTempKelvin; Ebout = Constant::StefanBoltzmann * pow_4(Tout); @@ -799,7 +799,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, // effective surface temperature is set to surface temperature calculated // by the fenestration layers temperature solver - SurfInsideTemp = T(NL) - Constant::KelvinConv; + SurfInsideTemp = T(NL) - Constant::Kelvin; // Convective to room QCONV = H(NL) * (T(NL) - TIN); // Other convective = total conv - standard model prediction @@ -807,7 +807,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, // Save the extra convection term. This term is added to the zone air heat // balance equation state.dataSurface->SurfWinOtherConvHeatGain(SurfNum) = state.dataSurface->Surface(SurfNum).Area * QXConv; - SurfOutsideTemp = T(1) - Constant::KelvinConv; + SurfOutsideTemp = T(1) - Constant::Kelvin; // Various reporting calculations InSideLayerType = state.dataWindowEquivLayer->CFS(EQLNum).L(NL).LTYPE; if (InSideLayerType == LayerType::GLAZE) { @@ -817,7 +817,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, } state.dataSurface->SurfWinEffInsSurfTemp(SurfNum) = SurfInsideTemp; NetIRHeatGainWindow = - state.dataSurface->Surface(SurfNum).Area * LWAbsIn * (Constant::StefanBoltzmann * pow_4(SurfInsideTemp + Constant::KelvinConv) - rmir); + state.dataSurface->Surface(SurfNum).Area * LWAbsIn * (Constant::StefanBoltzmann * pow_4(SurfInsideTemp + Constant::Kelvin) - rmir); ConvHeatGainWindow = state.dataSurface->Surface(SurfNum).Area * HcIn * (SurfInsideTemp - TaIn); // Window heat gain (or loss) is calculated here state.dataSurface->SurfWinHeatGain(SurfNum) = @@ -6362,9 +6362,9 @@ bool CFSUFactor(EnergyPlusData &state, return CFSUFactor; } - TOABS = TOUT + Constant::KelvinConv; + TOABS = TOUT + Constant::Kelvin; TRMOUT = TOABS; - TIABS = TIN + Constant::KelvinConv; + TIABS = TIN + Constant::Kelvin; TRMIN = TIABS; NL = FS.NL; @@ -8085,7 +8085,7 @@ Real64 TRadC(Real64 const J, // radiosity, W/m2 // PURPOSE OF THIS FUNCTION: // Returns equivalent celsius scale temperature from radiosity - return root_4(J / (Constant::StefanBoltzmann * max(Emiss, 0.001))) - Constant::KelvinConv; + return root_4(J / (Constant::StefanBoltzmann * max(Emiss, 0.001))) - Constant::Kelvin; } void CalcEQLOpticalProperty(EnergyPlusData &state, diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 6cf334c42da..ed57e35debc 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2515,7 +2515,7 @@ namespace WindowManager { OutSrdIR = 0; if (state.dataGlobal->AnyLocalEnvironmentsInModel) { if (state.dataSurface->Surface(SurfNum).SurfHasSurroundingSurfProperty) { - SrdSurfTempAbs = surface.SrdSurfTemp + Constant::KelvinConv; + SrdSurfTempAbs = surface.SrdSurfTemp + Constant::Kelvin; OutSrdIR = state.dataWindowManager->sigma * surface.ViewFactorSrdSurfs * pow_4(SrdSurfTempAbs); } } @@ -3647,8 +3647,8 @@ namespace WindowManager { } CalcISO15099WindowIntConvCoeff(state, SurfNum, - state.dataWindowManager->thetas[InsideFaceIndex - 1] - Constant::KelvinConv, - state.dataWindowManager->tin - Constant::KelvinConv); + state.dataWindowManager->thetas[InsideFaceIndex - 1] - Constant::Kelvin, + state.dataWindowManager->tin - Constant::Kelvin); state.dataWindowManager->hcin = state.dataHeatBalSurf->SurfHConvInt(SurfNum); } @@ -3909,8 +3909,8 @@ namespace WindowManager { ShowContinueError(state, format("Glazing face index = {} ; new temperature ={:.4R}C ; previous temperature = {:.4R}C", i, - state.dataWindowManager->thetas[i - 1] - Constant::KelvinConv, - state.dataWindowManager->thetasPrev[i - 1] - Constant::KelvinConv)); + state.dataWindowManager->thetas[i - 1] - Constant::Kelvin, + state.dataWindowManager->thetasPrev[i - 1] - Constant::Kelvin)); } } @@ -7926,7 +7926,7 @@ namespace WindowManager { state.dataMaterial->Screens(ScreenNum).ScreenDiameterToSpacingRatio = 1.0 - std::sqrt(thisMaterial->Trans); state.dataMaterial->Screens(ScreenNum).screenBeamReflectanceModel = static_cast( - getEnumValue(ScreenBeamReflectanceModelNamesUC, UtilityRoutines::makeUPPER(thisMaterial->ReflectanceModeling))); + getEnumValue(ScreenBeamReflectanceModelNamesUC, Util::makeUPPER(thisMaterial->ReflectanceModeling))); // Reflectance of screen material only state.dataMaterial->Screens(ScreenNum).ReflectCylinder = thisMaterial->ReflectShade / (1 - thisMaterial->Trans); @@ -9132,7 +9132,7 @@ namespace WindowManager { IOStatus); // use default spectrum data, done! - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "Default")) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(2), "Default")) { state.dataWindowManager->RunMeOnceFlag = true; return; } @@ -9167,7 +9167,7 @@ namespace WindowManager { state.dataIPShortCut->rNumericArgs, NumNumbers, IOStatus); - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), cSolarSpectrum)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), cSolarSpectrum)) { iSolarSpectrum = Loop; // overwrite the default solar spectrum if (NumNumbers > 2 * state.dataWindowManager->nume) { @@ -9188,7 +9188,7 @@ namespace WindowManager { } } } - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(1), cVisibleSpectrum)) { + if (Util::SameString(state.dataIPShortCut->cAlphaArgs(1), cVisibleSpectrum)) { iVisibleSpectrum = Loop; // overwrite the default solar spectrum if (NumNumbers > 2 * state.dataWindowManager->numt3) { diff --git a/src/EnergyPlus/WindowManager.hh b/src/EnergyPlus/WindowManager.hh index bf677e8ae88..79457bd6898 100644 --- a/src/EnergyPlus/WindowManager.hh +++ b/src/EnergyPlus/WindowManager.hh @@ -428,10 +428,10 @@ namespace WindowManager { struct WindowManagerData : BaseGlobalStruct { - static Real64 constexpr sigma = 5.6697e-8; // Stefan-Boltzmann constant - static Real64 constexpr TKelvin = Constant::KelvinConv; // conversion from Kelvin to Celsius - static int constexpr nume = 107; // Number of wavelength values in solar spectrum - static int constexpr numt3 = 81; // Number of wavelength values in the photopic response + static Real64 constexpr sigma = 5.6697e-8; // Stefan-Boltzmann constant + static Real64 constexpr TKelvin = Constant::Kelvin; // conversion from Kelvin to Celsius + static int constexpr nume = 107; // Number of wavelength values in solar spectrum + static int constexpr numt3 = 81; // Number of wavelength values in the photopic response // Dens dDens/dT Con dCon/dT Vis dVis/dT Prandtl dPrandtl/dT std::array const AirProps = {1.29, -0.4e-2, 2.41e-2, 7.6e-5, 1.73e-5, 1.0e-7, 0.72, 1.8e-3}; diff --git a/src/EnergyPlus/WindowManagerExteriorThermal.cc b/src/EnergyPlus/WindowManagerExteriorThermal.cc index 0b92ee9acc2..e364ec17d9a 100644 --- a/src/EnergyPlus/WindowManagerExteriorThermal.cc +++ b/src/EnergyPlus/WindowManagerExteriorThermal.cc @@ -134,11 +134,11 @@ namespace WindowManager { aTemp = aLayer->getTemperature(aSide); state.dataWindowManager->thetas[i - 1] = aTemp; if (i == 1) { - SurfOutsideTemp = aTemp - Constant::KelvinConv; + SurfOutsideTemp = aTemp - Constant::Kelvin; } ++i; } - SurfInsideTemp = aTemp - Constant::KelvinConv; + SurfInsideTemp = aTemp - Constant::Kelvin; if (ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { Real64 EffShBlEmiss; Real64 EffGlEmiss; @@ -193,7 +193,7 @@ namespace WindowManager { Real64 NetIRHeatGainGlass = ShadeArea * (glassEmiss * TauShIR / ShGlReflFacIR) * (state.dataWindowManager->sigma * pow(state.dataWindowManager->thetas[state.dataWindowManager->nglface - 1], 4) - rmir); - Real64 tind = surface.getInsideAirTemperature(state, SurfNum) + Constant::KelvinConv; + Real64 tind = surface.getInsideAirTemperature(state, SurfNum) + Constant::Kelvin; Real64 ConvHeatGainFrZoneSideOfShade = ShadeArea * state.dataHeatBalSurf->SurfHConvInt(SurfNum) * (state.dataWindowManager->thetas[state.dataWindowManager->nglfacep - 1] - tind); state.dataSurface->SurfWinHeatGain(SurfNum) = @@ -211,7 +211,7 @@ namespace WindowManager { Real64 glassTemperature = aGlassLayer->getSurface(FenestrationCommon::Side::Back)->getTemperature(); state.dataSurface->SurfWinEffInsSurfTemp(SurfNum) = - (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (glassTemperature - Constant::KelvinConv)) / (EffShBlEmiss + EffGlEmiss); + (EffShBlEmiss * SurfInsideTemp + EffGlEmiss * (glassTemperature - Constant::Kelvin)) / (EffShBlEmiss + EffGlEmiss); } else { // Another adoptation to old source that looks suspicious. Check if heat flow through @@ -251,8 +251,8 @@ namespace WindowManager { state.dataSurface->SurfaceWindow(SurfNum).ThetaFace(2 * k) = state.dataWindowManager->thetas[2 * k - 1]; // temperatures for reporting - state.dataHeatBal->SurfWinFenLaySurfTempFront(SurfNum, k) = state.dataWindowManager->thetas[2 * k - 2] - Constant::KelvinConv; - state.dataHeatBal->SurfWinFenLaySurfTempBack(SurfNum, k) = state.dataWindowManager->thetas[2 * k - 1] - Constant::KelvinConv; + state.dataHeatBal->SurfWinFenLaySurfTempFront(SurfNum, k) = state.dataWindowManager->thetas[2 * k - 2] - Constant::Kelvin; + state.dataHeatBal->SurfWinFenLaySurfTempBack(SurfNum, k) = state.dataWindowManager->thetas[2 * k - 1] - Constant::Kelvin; } } @@ -798,7 +798,7 @@ namespace WindowManager { // PURPOSE OF THIS SUBROUTINE: // Creates indoor environment object from surface properties in EnergyPlus - Real64 tin = m_Surface.getInsideAirTemperature(state, m_SurfNum) + Constant::KelvinConv; + Real64 tin = m_Surface.getInsideAirTemperature(state, m_SurfNum) + Constant::Kelvin; Real64 hcin = state.dataHeatBalSurf->SurfHConvInt(m_SurfNum); Real64 IR = state.dataSurface->SurfWinIRfromParentZone(m_SurfNum) + state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(m_SurfNum); @@ -821,7 +821,7 @@ namespace WindowManager { // PURPOSE OF THIS SUBROUTINE: // Creates outdoor environment object from surface properties in EnergyPlus - double tout = m_Surface.getOutsideAirTemperature(state, m_SurfNum) + Constant::KelvinConv; + double tout = m_Surface.getOutsideAirTemperature(state, m_SurfNum) + Constant::Kelvin; double IR = m_Surface.getOutsideIR(state, m_SurfNum); // double dirSolRad = SurfQRadSWOutIncident( t_SurfNum ) + QS( Surface( t_SurfNum ).Zone ); double swRadiation = m_Surface.getSWIncident(state, m_SurfNum); @@ -892,15 +892,15 @@ namespace WindowManager { std::shared_ptr CWCEHeatTransferFactory::getOutdoorNfrc(bool const useSummerConditions) { // NFRC 100 Section 4.3.1 - Real64 airTemperature = -18.0 + Constant::KelvinConv; // Kelvins - Real64 airSpeed = 5.5; // meters per second - Real64 tSky = -18.0 + Constant::KelvinConv; // Kelvins - Real64 solarRadiation = 0.; // W/m2 + Real64 airTemperature = -18.0 + Constant::Kelvin; // Kelvins + Real64 airSpeed = 5.5; // meters per second + Real64 tSky = -18.0 + Constant::Kelvin; // Kelvins + Real64 solarRadiation = 0.; // W/m2 if (useSummerConditions) { // NFRC 200 Section 4.3.1 - airTemperature = 32.0 + Constant::KelvinConv; + airTemperature = 32.0 + Constant::Kelvin; airSpeed = 2.75; - tSky = 32.0 + Constant::KelvinConv; + tSky = 32.0 + Constant::Kelvin; solarRadiation = 783.; } auto Outdoor = // (AUTO_OK_SPTR) @@ -912,10 +912,10 @@ namespace WindowManager { std::shared_ptr CWCEHeatTransferFactory::getIndoorNfrc(bool const useSummerConditions) { // NFRC 100 Section 4.3.1 - Real64 roomTemperature = 21. + Constant::KelvinConv; + Real64 roomTemperature = 21. + Constant::Kelvin; if (useSummerConditions) { // NFRC 200 Section 4.3.1 - roomTemperature = 24. + Constant::KelvinConv; + roomTemperature = 24. + Constant::Kelvin; } return Tarcog::ISO15099::Environments::indoor(roomTemperature); } diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 23e1556d8ff..6e612c51fc0 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -154,7 +154,7 @@ namespace ZoneAirLoopEquipmentManager { // Find the correct Zone Air Distribution Unit Equipment if (CompIndex == 0) { - AirDistUnitNum = UtilityRoutines::FindItemInList(ZoneAirLoopEquipName, state.dataDefineEquipment->AirDistUnit); + AirDistUnitNum = Util::FindItemInList(ZoneAirLoopEquipName, state.dataDefineEquipment->AirDistUnit); if (AirDistUnitNum == 0) { ShowFatalError(state, format("ManageZoneAirLoopEquipment: Unit not found={}", ZoneAirLoopEquipName)); } @@ -252,7 +252,7 @@ namespace ZoneAirLoopEquipmentManager { lAlphaBlanks, cAlphaFields, cNumericFields); // data for one zone - UtilityRoutines::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); airDistUnit.Name = AlphArray(1); // Input Outlet Node Num @@ -301,7 +301,7 @@ namespace ZoneAirLoopEquipmentManager { // DesignSpecification:AirTerminal:Sizing name airDistUnit.AirTerminalSizingSpecIndex = 0; if (!lAlphaBlanks(5)) { - airDistUnit.AirTerminalSizingSpecIndex = UtilityRoutines::FindItemInList(AlphArray(5), state.dataSize->AirTerminalSizingSpec); + airDistUnit.AirTerminalSizingSpecIndex = Util::FindItemInList(AlphArray(5), state.dataSize->AirTerminalSizingSpec); if (airDistUnit.AirTerminalSizingSpecIndex == 0) { ShowSevereError(state, format("{} = {} not found.", cAlphaFields(5), AlphArray(5))); ShowContinueError(state, format("Occurs in {} = {}", CurrentModuleObject, airDistUnit.Name)); @@ -309,7 +309,7 @@ namespace ZoneAirLoopEquipmentManager { } } - const std::string typeNameUC = UtilityRoutines::makeUPPER(airDistUnit.EquipType(AirDistCompUnitNum)); + const std::string typeNameUC = Util::makeUPPER(airDistUnit.EquipType(AirDistCompUnitNum)); airDistUnit.EquipTypeEnum(AirDistCompUnitNum) = static_cast(getEnumValue(ZnAirLoopEquipTypeNamesUC, typeNameUC)); // Validate EquipType for Air Distribution Unit switch (airDistUnit.EquipTypeEnum(AirDistCompUnitNum)) { diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index 21e8235b308..6a5352b1e21 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -235,12 +235,11 @@ void GetZoneContaminanInputs(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ZoneContamGenericConstant(Loop).Name = AlphaName(1); state.dataContaminantBalance->ZoneContamGenericConstant(Loop).ZoneName = AlphaName(2); - state.dataContaminantBalance->ZoneContamGenericConstant(Loop).ActualZoneNum = - UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + state.dataContaminantBalance->ZoneContamGenericConstant(Loop).ActualZoneNum = Util::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); if (state.dataContaminantBalance->ZoneContamGenericConstant(Loop).ActualZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid {} entered={}", @@ -400,12 +399,12 @@ void GetZoneContaminanInputs(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ZoneContamGenericPDriven(Loop).Name = AlphaName(1); state.dataContaminantBalance->ZoneContamGenericPDriven(Loop).SurfName = AlphaName(2); state.dataContaminantBalance->ZoneContamGenericPDriven(Loop).SurfNum = - UtilityRoutines::FindItemInList(AlphaName(2), state.afn->MultizoneSurfaceData, &AirflowNetwork::MultizoneSurfaceProp::SurfName); + Util::FindItemInList(AlphaName(2), state.afn->MultizoneSurfaceData, &AirflowNetwork::MultizoneSurfaceProp::SurfName); if (state.dataContaminantBalance->ZoneContamGenericPDriven(Loop).SurfNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid {} entered={}", @@ -566,12 +565,11 @@ void GetZoneContaminanInputs(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ZoneContamGenericCutoff(Loop).Name = AlphaName(1); state.dataContaminantBalance->ZoneContamGenericCutoff(Loop).ZoneName = AlphaName(2); - state.dataContaminantBalance->ZoneContamGenericCutoff(Loop).ActualZoneNum = - UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + state.dataContaminantBalance->ZoneContamGenericCutoff(Loop).ActualZoneNum = Util::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); if (state.dataContaminantBalance->ZoneContamGenericCutoff(Loop).ActualZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid {} entered={}", @@ -704,12 +702,11 @@ void GetZoneContaminanInputs(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ZoneContamGenericDecay(Loop).Name = AlphaName(1); state.dataContaminantBalance->ZoneContamGenericDecay(Loop).ZoneName = AlphaName(2); - state.dataContaminantBalance->ZoneContamGenericDecay(Loop).ActualZoneNum = - UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + state.dataContaminantBalance->ZoneContamGenericDecay(Loop).ActualZoneNum = Util::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); if (state.dataContaminantBalance->ZoneContamGenericDecay(Loop).ActualZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid {} entered={}", @@ -849,12 +846,11 @@ void GetZoneContaminanInputs(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).Name = AlphaName(1); state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfName = AlphaName(2); - state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum = - UtilityRoutines::FindItemInList(AlphaName(2), state.dataSurface->Surface); + state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum = Util::FindItemInList(AlphaName(2), state.dataSurface->Surface); if (state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid {} entered={}", @@ -995,11 +991,11 @@ void GetZoneContaminanInputs(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ZoneContamGenericDVS(Loop).Name = AlphaName(1); state.dataContaminantBalance->ZoneContamGenericDVS(Loop).SurfName = AlphaName(2); - state.dataContaminantBalance->ZoneContamGenericDVS(Loop).SurfNum = UtilityRoutines::FindItemInList(AlphaName(2), state.dataSurface->Surface); + state.dataContaminantBalance->ZoneContamGenericDVS(Loop).SurfNum = Util::FindItemInList(AlphaName(2), state.dataSurface->Surface); if (state.dataContaminantBalance->ZoneContamGenericDVS(Loop).SurfNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid {} entered={}", @@ -1120,12 +1116,11 @@ void GetZoneContaminanInputs(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphaName(1), CurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ZoneContamGenericDRS(Loop).Name = AlphaName(1); state.dataContaminantBalance->ZoneContamGenericDRS(Loop).ZoneName = AlphaName(2); - state.dataContaminantBalance->ZoneContamGenericDRS(Loop).ActualZoneNum = - UtilityRoutines::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); + state.dataContaminantBalance->ZoneContamGenericDRS(Loop).ActualZoneNum = Util::FindItemInList(AlphaName(2), state.dataHeatBal->Zone); if (state.dataContaminantBalance->ZoneContamGenericDRS(Loop).ActualZoneNum == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid {} entered={}", @@ -1310,12 +1305,12 @@ void GetZoneContaminanSetPoints(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataContaminantBalance->ContaminantControlledZone(ContControlledZoneNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataContaminantBalance->ContaminantControlledZone(ContControlledZoneNum).ZoneName = state.dataIPShortCut->cAlphaArgs(2); state.dataContaminantBalance->ContaminantControlledZone(ContControlledZoneNum).ActualZoneNum = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (state.dataContaminantBalance->ContaminantControlledZone(ContControlledZoneNum).ActualZoneNum == 0) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" not found.", diff --git a/src/EnergyPlus/ZoneDehumidifier.cc b/src/EnergyPlus/ZoneDehumidifier.cc index 61567360334..3876677bb9a 100644 --- a/src/EnergyPlus/ZoneDehumidifier.cc +++ b/src/EnergyPlus/ZoneDehumidifier.cc @@ -144,7 +144,7 @@ namespace ZoneDehumidifier { // Find the correct zone dehumidifier if (CompIndex == 0) { - ZoneDehumidNum = UtilityRoutines::FindItemInList(CompName, state.dataZoneDehumidifier->ZoneDehumid); + ZoneDehumidNum = Util::FindItemInList(CompName, state.dataZoneDehumidifier->ZoneDehumid); if (ZoneDehumidNum == 0) { ShowFatalError(state, format("SimZoneDehumidifier: Unit not found= {}", CompName)); } @@ -251,7 +251,7 @@ namespace ZoneDehumidifier { lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound); // A1, \field Name state.dataZoneDehumidifier->ZoneDehumid(ZoneDehumidIndex).Name = Alphas(1); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 563b6a8544a..f0f4943ed02 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -762,7 +762,7 @@ void SetUpZoneSizingArrays(EnergyPlusData &state) } for (int ZoneSizIndex = 1; ZoneSizIndex <= state.dataSize->NumZoneSizingInput; ++ZoneSizIndex) { - int ZoneIndex = UtilityRoutines::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName, state.dataHeatBal->Zone); + int ZoneIndex = Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName, state.dataHeatBal->Zone); if (ZoneIndex == 0) { ShowSevereError( state, @@ -772,7 +772,7 @@ void SetUpZoneSizingArrays(EnergyPlusData &state) if (std::any_of(state.dataZoneEquip->ZoneEquipConfig.begin(), state.dataZoneEquip->ZoneEquipConfig.end(), [](EquipConfiguration const &e) { return e.IsControlled; })) { - ZoneIndex = UtilityRoutines::FindItemInList( + ZoneIndex = Util::FindItemInList( state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); if (ZoneIndex == 0) { if (!state.dataGlobal->isPulseZoneSizing) { @@ -835,7 +835,7 @@ void SetUpZoneSizingArrays(EnergyPlusData &state) if (!zoneEquipConfig.IsControlled) continue; // For each Zone Sizing object, find the corresponding controlled zone - int ZoneSizNum = UtilityRoutines::FindItemInList(zoneEquipConfig.ZoneName, state.dataSize->ZoneSizingInput, &ZoneSizingInputData::ZoneName); + int ZoneSizNum = Util::FindItemInList(zoneEquipConfig.ZoneName, state.dataSize->ZoneSizingInput, &ZoneSizingInputData::ZoneName); auto &zoneSizingInput = (ZoneSizNum > 0) ? state.dataSize->ZoneSizingInput(ZoneSizNum) : state.dataSize->ZoneSizingInput(1); if (ZoneSizNum == 0) { // LKL I think this is sufficient for warning -- no need for array if (!state.dataGlobal->isPulseZoneSizing) { @@ -970,7 +970,7 @@ void SetUpZoneSizingArrays(EnergyPlusData &state) if (thisOAReq.numDSOA > 0) { for (int spaceCounter = 1; spaceCounter <= thisOAReq.numDSOA; ++spaceCounter) { std::string thisSpaceName = thisOAReq.dsoaSpaceNames(spaceCounter); - int thisSpaceNum = UtilityRoutines::FindItemInList(thisSpaceName, state.dataHeatBal->space); + int thisSpaceNum = Util::FindItemInList(thisSpaceName, state.dataHeatBal->space); if (thisSpaceNum > 0) { thisOAReq.dsoaSpaceIndexes.emplace_back(thisSpaceNum); } else { diff --git a/src/EnergyPlus/ZonePlenum.cc b/src/EnergyPlus/ZonePlenum.cc index eea630a90b6..efde7184d91 100644 --- a/src/EnergyPlus/ZonePlenum.cc +++ b/src/EnergyPlus/ZonePlenum.cc @@ -123,8 +123,7 @@ void SimAirZonePlenum(EnergyPlusData &state, if (iCompType == DataZoneEquipment::AirLoopHVACZone::ReturnPlenum) { // 'AirLoopHVAC:ReturnPlenum' // Find the correct ZonePlenumNumber if (CompIndex == 0) { - ZonePlenumNum = - UtilityRoutines::FindItemInList(CompName, state.dataZonePlenum->ZoneRetPlenCond, &ZoneReturnPlenumConditions::ZonePlenumName); + ZonePlenumNum = Util::FindItemInList(CompName, state.dataZonePlenum->ZoneRetPlenCond, &ZoneReturnPlenumConditions::ZonePlenumName); if (ZonePlenumNum == 0) { ShowFatalError(state, format("SimAirZonePlenum: AirLoopHVAC:ReturnPlenum not found={}", CompName)); } @@ -161,8 +160,7 @@ void SimAirZonePlenum(EnergyPlusData &state, } else if (iCompType == DataZoneEquipment::AirLoopHVACZone::SupplyPlenum) { // 'AirLoopHVAC:SupplyPlenum' // Find the correct ZonePlenumNumber if (CompIndex == 0) { - ZonePlenumNum = - UtilityRoutines::FindItemInList(CompName, state.dataZonePlenum->ZoneSupPlenCond, &ZoneSupplyPlenumConditions::ZonePlenumName); + ZonePlenumNum = Util::FindItemInList(CompName, state.dataZonePlenum->ZoneSupPlenCond, &ZoneSupplyPlenumConditions::ZonePlenumName); if (ZonePlenumNum == 0) { ShowFatalError(state, format("SimAirZonePlenum: AirLoopHVAC:SupplyPlenum not found={}", CompName)); } @@ -298,14 +296,13 @@ void GetZonePlenumInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); auto &thisRetPlenum = state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum); thisRetPlenum.ZonePlenumName = AlphArray(1); // Check if this zone is also used in another return plenum - IOStat = UtilityRoutines::FindItemInList( - AlphArray(2), state.dataZonePlenum->ZoneRetPlenCond, &ZoneReturnPlenumConditions::ZoneName, ZonePlenumNum - 1); + IOStat = Util::FindItemInList(AlphArray(2), state.dataZonePlenum->ZoneRetPlenCond, &ZoneReturnPlenumConditions::ZoneName, ZonePlenumNum - 1); if (IOStat != 0) { ShowSevereError(state, format("{}{} \"{}\" is used more than once as a {}.", RoutineName, cAlphaFields(2), AlphArray(2), CurrentModuleObject)); @@ -315,7 +312,7 @@ void GetZonePlenumInput(EnergyPlusData &state) } thisRetPlenum.ZoneName = AlphArray(2); // put the X-Ref to the zone heat balance data structure - thisRetPlenum.ActualZoneNum = UtilityRoutines::FindItemInList(AlphArray(2), state.dataHeatBal->Zone); + thisRetPlenum.ActualZoneNum = Util::FindItemInList(AlphArray(2), state.dataHeatBal->Zone); if (thisRetPlenum.ActualZoneNum == 0) { ShowSevereError(state, format("For {} = {}, {} = {} not found.", CurrentModuleObject, AlphArray(1), cAlphaFields(2), AlphArray(2))); ErrorsFound = true; @@ -325,7 +322,7 @@ void GetZonePlenumInput(EnergyPlusData &state) state.dataHeatBal->Zone(thisRetPlenum.ActualZoneNum).PlenumCondNum = ZonePlenumNum; } // Check if this zone is used as a controlled zone - ZoneEquipConfigLoop = UtilityRoutines::FindItemInList(AlphArray(2), state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); + ZoneEquipConfigLoop = Util::FindItemInList(AlphArray(2), state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); if (ZoneEquipConfigLoop != 0) { ShowSevereError( state, @@ -484,14 +481,13 @@ void GetZonePlenumInput(EnergyPlusData &state) lAlphaBlanks, cAlphaFields, cNumericFields); - UtilityRoutines::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, AlphArray(1), CurrentModuleObject, ErrorsFound); auto &thisSupPlenum = state.dataZonePlenum->ZoneSupPlenCond(ZonePlenumNum); thisSupPlenum.ZonePlenumName = AlphArray(1); // Check if this zone is also used in another plenum - IOStat = UtilityRoutines::FindItemInList( - AlphArray(2), state.dataZonePlenum->ZoneSupPlenCond, &ZoneSupplyPlenumConditions::ZoneName, ZonePlenumNum - 1); + IOStat = Util::FindItemInList(AlphArray(2), state.dataZonePlenum->ZoneSupPlenCond, &ZoneSupplyPlenumConditions::ZoneName, ZonePlenumNum - 1); if (IOStat != 0) { ShowSevereError(state, format("{}{} \"{}\" is used more than once as a {}.", RoutineName, cAlphaFields(2), AlphArray(2), CurrentModuleObject)); @@ -500,7 +496,7 @@ void GetZonePlenumInput(EnergyPlusData &state) ErrorsFound = true; } if (state.dataZonePlenum->NumZoneReturnPlenums > 0) { // Check if this zone is also used in another plenum - IOStat = UtilityRoutines::FindItemInList(AlphArray(2), state.dataZonePlenum->ZoneRetPlenCond, &ZoneReturnPlenumConditions::ZoneName); + IOStat = Util::FindItemInList(AlphArray(2), state.dataZonePlenum->ZoneRetPlenCond, &ZoneReturnPlenumConditions::ZoneName); if (IOStat != 0) { ShowSevereError(state, format("{}{} \"{}\" is used more than once as a {} or AirLoopHVAC:ReturnPlenum.", @@ -516,7 +512,7 @@ void GetZonePlenumInput(EnergyPlusData &state) } thisSupPlenum.ZoneName = AlphArray(2); // put the X-Ref to the zone heat balance data structure - thisSupPlenum.ActualZoneNum = UtilityRoutines::FindItemInList(AlphArray(2), state.dataHeatBal->Zone); + thisSupPlenum.ActualZoneNum = Util::FindItemInList(AlphArray(2), state.dataHeatBal->Zone); if (thisSupPlenum.ActualZoneNum == 0) { ShowSevereError(state, format("For {} = {}, {} = {} not found.", CurrentModuleObject, AlphArray(1), cAlphaFields(2), AlphArray(2))); ErrorsFound = true; @@ -529,7 +525,7 @@ void GetZonePlenumInput(EnergyPlusData &state) if (std::any_of(state.dataZoneEquip->ZoneEquipConfig.begin(), state.dataZoneEquip->ZoneEquipConfig.end(), [](EquipConfiguration const &e) { return e.IsControlled; })) { - ZoneEquipConfigLoop = UtilityRoutines::FindItemInList(AlphArray(2), state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); + ZoneEquipConfigLoop = Util::FindItemInList(AlphArray(2), state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); if (ZoneEquipConfigLoop != 0) { ShowSevereError(state, format("{}{} \"{}\" is a controlled zone. It cannot be used as a {} or AirLoopHVAC:ReturnPlenum.", @@ -544,7 +540,7 @@ void GetZonePlenumInput(EnergyPlusData &state) // Check if this is also used as a return plenum // *** This next IF loop looks wrong. Sent e-mail to Peter/Brent 8/14/08 for clarification **** // IF (NumZoneReturnPlenums > 0) THEN - // IOSTAT=UtilityRoutines::FindItemInList(AlphArray(1),ZoneRetPlenCond%ZoneName,NumZoneReturnPlenums) + // IOSTAT=Util::FindItemInList(AlphArray(1),ZoneRetPlenCond%ZoneName,NumZoneReturnPlenums) // IF (IOStat /= 0) THEN // CALL ShowSevereError(state, RoutineName//'Plenum "'//TRIM(AlphArray(2))// & // '" is a controlled zone. It cannot be used as a '// & diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 7aa5e14e895..76eda94be44 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -367,12 +367,12 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); TStatObjects(Item).Name = cAlphaArgs(1); - Item1 = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + Item1 = Util::FindItemInList(cAlphaArgs(2), Zone); ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = UtilityRoutines::FindItemInList(cAlphaArgs(2), ZoneList); + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = Util::FindItemInList(cAlphaArgs(2), ZoneList); if (Item1 > 0) { TStatObjects(Item).TempControlledZoneStartPtr = state.dataZoneCtrls->NumTempControlledZones + 1; ++state.dataZoneCtrls->NumTempControlledZones; @@ -423,11 +423,11 @@ void GetZoneAirSetPoints(EnergyPlusData &state) if (TStatObjects(Item).ZoneListActive) { cAlphaArgs(2) = Zone(ZoneList(TStatObjects(Item).ZoneOrZoneListPtr).Zone(Item1)).Name; } - int ZoneAssigned = UtilityRoutines::FindItemInList( - cAlphaArgs(2), TempControlledZone, &DataZoneControls::ZoneTempControls::ZoneName, TempControlledZoneNum - 1); + int ZoneAssigned = + Util::FindItemInList(cAlphaArgs(2), TempControlledZone, &DataZoneControls::ZoneTempControls::ZoneName, TempControlledZoneNum - 1); if (ZoneAssigned == 0) { TempControlledZone(TempControlledZoneNum).ZoneName = cAlphaArgs(2); - TempControlledZone(TempControlledZoneNum).ActualZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + TempControlledZone(TempControlledZoneNum).ActualZoneNum = Util::FindItemInList(cAlphaArgs(2), Zone); if (TempControlledZone(TempControlledZoneNum).ActualZoneNum == 0) { ShowSevereError( state, @@ -543,8 +543,8 @@ void GetZoneAirSetPoints(EnergyPlusData &state) } if (TempControlledZone(TempControlledZoneNum).DeltaTCutSet > 0.0) { for (ControlTypeNum = 1; ControlTypeNum <= TempControlledZone(TempControlledZoneNum).NumControlTypes; ++ControlTypeNum) { - if (UtilityRoutines::SameString(TempControlledZone(TempControlledZoneNum).ControlType(ControlTypeNum), - "ThermostatSetpoint:SingleHeatingOrCooling")) { + if (Util::SameString(TempControlledZone(TempControlledZoneNum).ControlType(ControlTypeNum), + "ThermostatSetpoint:SingleHeatingOrCooling")) { ShowWarningError(state, format("{}=\"{}: The choice of Temperature Difference Between Cutout And Setpoint will not be applied " "to ThermostatSetpoint:SingleHeatingOrCooling.", @@ -576,7 +576,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &singleHtgSetpoint = SetPointSingleHeating(idx); singleHtgSetpoint.Name = cAlphaArgs(1); singleHtgSetpoint.TempSchedName = cAlphaArgs(2); @@ -608,7 +608,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &singleClgSetpoint = SetPointSingleCooling(idx); singleClgSetpoint.Name = cAlphaArgs(1); singleClgSetpoint.TempSchedName = cAlphaArgs(2); @@ -671,7 +671,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &dualHeatCoolSetpoint = SetPointDualHeatCool(idx); dualHeatCoolSetpoint.Name = cAlphaArgs(1); dualHeatCoolSetpoint.HeatTempSetptSchedName = cAlphaArgs(2); @@ -697,26 +697,24 @@ void GetZoneAirSetPoints(EnergyPlusData &state) for (int ct = 1; ct <= state.dataZoneCtrls->TempControlledZone(TempControlledZoneNum).NumControlTypes; ct++) { switch (state.dataZoneCtrls->TempControlledZone(TempControlledZoneNum).ControlTypeEnum(ct)) { case DataHVACGlobals::ThermostatType::SingleHeating: - setPointObjectArrayIndex = - UtilityRoutines::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), SetPointSingleHeating); + setPointObjectArrayIndex = Util::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), SetPointSingleHeating); TempControlledZone(TempControlledZoneNum).SchIndx_SingleHeatSetPoint = state.dataZoneTempPredictorCorrector->SetPointSingleHeating(setPointObjectArrayIndex).TempSchedIndex; break; case DataHVACGlobals::ThermostatType::SingleCooling: - setPointObjectArrayIndex = - UtilityRoutines::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), SetPointSingleCooling); + setPointObjectArrayIndex = Util::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), SetPointSingleCooling); TempControlledZone(TempControlledZoneNum).SchIndx_SingleCoolSetPoint = state.dataZoneTempPredictorCorrector->SetPointSingleCooling(setPointObjectArrayIndex).TempSchedIndex; break; case DataHVACGlobals::ThermostatType::SingleHeatCool: - setPointObjectArrayIndex = UtilityRoutines::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), - state.dataZoneTempPredictorCorrector->SetPointSingleHeatCool); + setPointObjectArrayIndex = Util::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), + state.dataZoneTempPredictorCorrector->SetPointSingleHeatCool); TempControlledZone(TempControlledZoneNum).SchIndx_SingleHeatCoolSetPoint = state.dataZoneTempPredictorCorrector->SetPointSingleHeatCool(setPointObjectArrayIndex).TempSchedIndex; break; case DataHVACGlobals::ThermostatType::DualSetPointWithDeadBand: - setPointObjectArrayIndex = UtilityRoutines::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), - state.dataZoneTempPredictorCorrector->SetPointDualHeatCool); + setPointObjectArrayIndex = Util::FindItem(TempControlledZone(TempControlledZoneNum).ControlTypeName(ct), + state.dataZoneTempPredictorCorrector->SetPointDualHeatCool); TempControlledZone(TempControlledZoneNum).SchIndx_DualSetPointWDeadBandHeat = state.dataZoneTempPredictorCorrector->SetPointDualHeatCool(setPointObjectArrayIndex).HeatTempSchedIndex; TempControlledZone(TempControlledZoneNum).SchIndx_DualSetPointWDeadBandCool = @@ -923,7 +921,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); HumidityControlZone(HumidControlledZoneNum).ControlName = cAlphaArgs(1); GlobalNames::IntraObjUniquenessCheck(state, @@ -934,7 +932,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) ErrorsFound); HumidityControlZone(HumidControlledZoneNum).ZoneName = cAlphaArgs(2); - HumidityControlZone(HumidControlledZoneNum).ActualZoneNum = UtilityRoutines::FindItem(cAlphaArgs(2), Zone); + HumidityControlZone(HumidControlledZoneNum).ActualZoneNum = Util::FindItem(cAlphaArgs(2), Zone); if (HumidityControlZone(HumidControlledZoneNum).ActualZoneNum == 0) { ShowSevereError(state, format("{}=\"{} invalid {}=\"{}\" not found.", cCurrentModuleObject, cAlphaArgs(1), cAlphaFieldNames(2), cAlphaArgs(2))); @@ -985,11 +983,11 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - Item1 = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + Item1 = Util::FindItemInList(cAlphaArgs(2), Zone); ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = UtilityRoutines::FindItemInList(cAlphaArgs(2), ZoneList); + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = Util::FindItemInList(cAlphaArgs(2), ZoneList); ComfortTStatObjects(Item).Name = cAlphaArgs(1); if (Item1 > 0) { ComfortTStatObjects(Item).ComfortControlledZoneStartPtr = state.dataZoneCtrls->NumComfortControlledZones + 1; @@ -1041,11 +1039,11 @@ void GetZoneAirSetPoints(EnergyPlusData &state) if (ComfortTStatObjects(Item).ZoneListActive) { cAlphaArgs(2) = state.dataHeatBal->Zone(ZoneList(ComfortTStatObjects(Item).ZoneOrZoneListPtr).Zone(Item1)).Name; } - int ZoneAssigned = UtilityRoutines::FindItemInList( + int ZoneAssigned = Util::FindItemInList( cAlphaArgs(2), ComfortControlledZone, &DataZoneControls::ZoneComfortControls::ZoneName, ComfortControlledZoneNum - 1); if (ZoneAssigned == 0) { ComfortControlledZone(ComfortControlledZoneNum).ZoneName = cAlphaArgs(2); - ComfortControlledZone(ComfortControlledZoneNum).ActualZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + ComfortControlledZone(ComfortControlledZoneNum).ActualZoneNum = Util::FindItemInList(cAlphaArgs(2), Zone); if (ComfortControlledZone(ComfortControlledZoneNum).ActualZoneNum == 0) { ShowSevereError( state, @@ -1095,13 +1093,13 @@ void GetZoneAirSetPoints(EnergyPlusData &state) ComfortControlledZone(ComfortControlledZoneNum).AverageMethod = DataZoneControls::AverageMethod::NO; if (IZoneCount > 1) { ComfortControlledZone(ComfortControlledZoneNum).AverageMethodName = cAlphaArgs(3); - if (UtilityRoutines::SameString(cAlphaArgs(3), "SpecificObject")) { + if (Util::SameString(cAlphaArgs(3), "SpecificObject")) { ComfortControlledZone(ComfortControlledZoneNum).AverageMethod = DataZoneControls::AverageMethod::SPE; } - if (UtilityRoutines::SameString(cAlphaArgs(3), "ObjectAverage")) { + if (Util::SameString(cAlphaArgs(3), "ObjectAverage")) { ComfortControlledZone(ComfortControlledZoneNum).AverageMethod = DataZoneControls::AverageMethod::OBJ; } - if (UtilityRoutines::SameString(cAlphaArgs(3), "PeopleAverage")) { + if (Util::SameString(cAlphaArgs(3), "PeopleAverage")) { ComfortControlledZone(ComfortControlledZoneNum).AverageMethod = DataZoneControls::AverageMethod::PEO; } if (ComfortControlledZone(ComfortControlledZoneNum).AverageMethod == DataZoneControls::AverageMethod::NO) { @@ -1112,13 +1110,13 @@ void GetZoneAirSetPoints(EnergyPlusData &state) } if (ComfortControlledZone(ComfortControlledZoneNum).AverageMethod == DataZoneControls::AverageMethod::SPE) { ComfortControlledZone(ComfortControlledZoneNum).AverageObjectName = cAlphaArgs(4); - if (UtilityRoutines::FindItem(cAlphaArgs(4), state.dataHeatBal->People) == 0) { + if (Util::FindItem(cAlphaArgs(4), state.dataHeatBal->People) == 0) { ShowSevereError( state, format("{}=\"{} invalid {}=\"{}\".", cCurrentModuleObject, cAlphaArgs(1), cAlphaFieldNames(4), cAlphaArgs(4))); ErrorsFound = true; } else { ComfortControlledZone(ComfortControlledZoneNum).SpecificObjectNum = - UtilityRoutines::FindItem(cAlphaArgs(4), state.dataHeatBal->People); + Util::FindItem(cAlphaArgs(4), state.dataHeatBal->People); } } } else { @@ -1259,9 +1257,8 @@ void GetZoneAirSetPoints(EnergyPlusData &state) ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum) = cAlphaArgs(nint(2.0 * ControlTypeNum - 1 + 5)); ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ControlTypeNum) = cAlphaArgs(nint(2.0 * ControlTypeNum + 5)); if (ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum) != "") { - CTIndex = - getEnumValue(ValidComfortControlTypesUC, - UtilityRoutines::makeUPPER(ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum))); + CTIndex = getEnumValue(ValidComfortControlTypesUC, + Util::makeUPPER(ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum))); if (CTIndex == 0) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\"", @@ -1316,7 +1313,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &singleSetpointHtgFanger = state.dataZoneTempPredictorCorrector->SetPointSingleHeatingFanger(idx); singleSetpointHtgFanger.Name = cAlphaArgs(1); singleSetpointHtgFanger.PMVSchedName = cAlphaArgs(2); @@ -1359,7 +1356,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &singleSetpointClgFanger = state.dataZoneTempPredictorCorrector->SetPointSingleCoolingFanger(idx); singleSetpointClgFanger.Name = cAlphaArgs(1); singleSetpointClgFanger.PMVSchedName = cAlphaArgs(2); @@ -1402,7 +1399,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &singleSetpointHeatCoolFanger = state.dataZoneTempPredictorCorrector->SetPointSingleHeatCoolFanger(idx); singleSetpointHeatCoolFanger.Name = cAlphaArgs(1); singleSetpointHeatCoolFanger.PMVSchedName = cAlphaArgs(2); @@ -1445,7 +1442,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); auto &dualSetpointHeatCoolFanger = state.dataZoneTempPredictorCorrector->SetPointDualHeatCoolFanger(idx); dualSetpointHeatCoolFanger.Name = cAlphaArgs(1); dualSetpointHeatCoolFanger.HeatPMVSetptSchedName = cAlphaArgs(2); @@ -1487,48 +1484,47 @@ void GetZoneAirSetPoints(EnergyPlusData &state) // Finish filling in Schedule pointing indexes for Thermal Comfort Control for (ComfortControlledZoneNum = 1; ComfortControlledZoneNum <= state.dataZoneCtrls->NumComfortControlledZones; ++ComfortControlledZoneNum) { - int ComfortIndex = UtilityRoutines::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::SingleHeating)], - ComfortControlledZone(ComfortControlledZoneNum).ControlType, - ComfortControlledZone(ComfortControlledZoneNum).NumControlTypes); + int ComfortIndex = Util::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::SingleHeating)], + ComfortControlledZone(ComfortControlledZoneNum).ControlType, + ComfortControlledZone(ComfortControlledZoneNum).NumControlTypes); ComfortControlledZone(ComfortControlledZoneNum).SchIndx_SingleHeating = ComfortIndex; if (ComfortIndex > 0) { ComfortControlledZone(ComfortControlledZoneNum).ControlTypeSchIndx(ComfortIndex) = - UtilityRoutines::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), - state.dataZoneTempPredictorCorrector->SetPointSingleHeatingFanger); + Util::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), + state.dataZoneTempPredictorCorrector->SetPointSingleHeatingFanger); TComfortControlTypes(ComfortControlledZoneNum).MustHave[static_cast(DataHVACGlobals::ThermostatType::SingleHeating)] = true; } - ComfortIndex = UtilityRoutines::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::SingleCooling)], - ComfortControlledZone(ComfortControlledZoneNum).ControlType, - ComfortControlledZone(ComfortControlledZoneNum).NumControlTypes); + ComfortIndex = Util::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::SingleCooling)], + ComfortControlledZone(ComfortControlledZoneNum).ControlType, + ComfortControlledZone(ComfortControlledZoneNum).NumControlTypes); ComfortControlledZone(ComfortControlledZoneNum).SchIndx_SingleCooling = ComfortIndex; if (ComfortIndex > 0) { ComfortControlledZone(ComfortControlledZoneNum).ControlTypeSchIndx(ComfortIndex) = - UtilityRoutines::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), - state.dataZoneTempPredictorCorrector->SetPointSingleCoolingFanger); + Util::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), + state.dataZoneTempPredictorCorrector->SetPointSingleCoolingFanger); TComfortControlTypes(ComfortControlledZoneNum).MustHave[static_cast(DataHVACGlobals::ThermostatType::SingleCooling)] = true; } - ComfortIndex = UtilityRoutines::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::SingleHeatCool)], - ComfortControlledZone(ComfortControlledZoneNum).ControlType, - ComfortControlledZone(ComfortControlledZoneNum).NumControlTypes); + ComfortIndex = Util::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::SingleHeatCool)], + ComfortControlledZone(ComfortControlledZoneNum).ControlType, + ComfortControlledZone(ComfortControlledZoneNum).NumControlTypes); ComfortControlledZone(ComfortControlledZoneNum).SchIndx_SingleHeatCool = ComfortIndex; if (ComfortIndex > 0) { ComfortControlledZone(ComfortControlledZoneNum).ControlTypeSchIndx(ComfortIndex) = - UtilityRoutines::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), - state.dataZoneTempPredictorCorrector->SetPointSingleHeatCoolFanger); + Util::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), + state.dataZoneTempPredictorCorrector->SetPointSingleHeatCoolFanger); TComfortControlTypes(ComfortControlledZoneNum).MustHave[static_cast(DataHVACGlobals::ThermostatType::SingleHeatCool)] = true; } - ComfortIndex = - UtilityRoutines::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::DualSetPointWithDeadBand)], + ComfortIndex = Util::FindItem(ValidComfortControlTypes[static_cast(DataHVACGlobals::ThermostatType::DualSetPointWithDeadBand)], ComfortControlledZone(ComfortControlledZoneNum).ControlType, ComfortControlledZone(ComfortControlledZoneNum).NumControlTypes); ComfortControlledZone(ComfortControlledZoneNum).SchIndx_DualSetPointWithDeadBand = ComfortIndex; if (ComfortIndex > 0) { ComfortControlledZone(ComfortControlledZoneNum).ControlTypeSchIndx(ComfortIndex) = - UtilityRoutines::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), - state.dataZoneTempPredictorCorrector->SetPointDualHeatCoolFanger); + Util::FindItem(ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ComfortIndex), + state.dataZoneTempPredictorCorrector->SetPointDualHeatCoolFanger); TComfortControlTypes(ComfortControlledZoneNum).MustHave[static_cast(DataHVACGlobals::ThermostatType::DualSetPointWithDeadBand)] = true; } @@ -1802,8 +1798,8 @@ void GetZoneAirSetPoints(EnergyPlusData &state) // multiplier values for the specified zone(s) int ZoneNum = 0; ZLItem = 0; - Item1 = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = UtilityRoutines::FindItemInList(cAlphaArgs(2), ZoneList); + Item1 = Util::FindItemInList(cAlphaArgs(2), Zone); + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = Util::FindItemInList(cAlphaArgs(2), ZoneList); if (Item1 > 0) { ZoneNum = Item1; Zone(ZoneNum).FlagCustomizedZoneCap = true; @@ -1886,10 +1882,10 @@ void GetZoneAirSetPoints(EnergyPlusData &state) cAlphaFieldNames, cNumericFieldNames); // find matching name of ZONECONTROL:THERMOSTAT object - found = UtilityRoutines::FindItem(cAlphaArgs(1), TStatObjects); + found = Util::FindItem(cAlphaArgs(1), TStatObjects); if (found == 0) { // It might be in the TempControlledZones - found = UtilityRoutines::FindItem(cAlphaArgs(1), TempControlledZone); + found = Util::FindItem(cAlphaArgs(1), TempControlledZone); if (found == 0) { // throw error ShowSevereError(state, format("{}={} invalid {} reference not found.", @@ -1900,10 +1896,10 @@ void GetZoneAirSetPoints(EnergyPlusData &state) } else { TempControlledZoneNum = found; TempControlledZone(TempControlledZoneNum).OperativeTempControl = true; - if (UtilityRoutines::SameString(cAlphaArgs(2), "Scheduled")) { + if (Util::SameString(cAlphaArgs(2), "Scheduled")) { TempControlledZone(TempControlledZoneNum).OpTempCntrlModeScheduled = true; } - if ((!(UtilityRoutines::SameString(cAlphaArgs(2), "Scheduled"))) && (!(UtilityRoutines::SameString(cAlphaArgs(2), "Constant")))) { + if ((!(Util::SameString(cAlphaArgs(2), "Scheduled"))) && (!(Util::SameString(cAlphaArgs(2), "Constant")))) { ShowSevereError(state, format("{}={} invalid {}=\"{}\".", cCurrentModuleObject, cAlphaArgs(1), cAlphaFieldNames(2), cAlphaArgs(2))); ErrorsFound = true; @@ -1959,7 +1955,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) if (TempControlledZone(TempControlledZoneNum).OperativeTempControl) { if (NumAlphas >= 4 && !lAlphaFieldBlanks(4)) { int adaptiveComfortModelTypeIndex = - UtilityRoutines::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); + Util::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); if (!adaptiveComfortModelTypeIndex) { ShowSevereError(state, format("{}={} invalid {}=\"{}\" not found.", @@ -1971,10 +1967,10 @@ void GetZoneAirSetPoints(EnergyPlusData &state) } else if (adaptiveComfortModelTypeIndex != static_cast(AdaptiveComfortModel::ADAP_NONE)) { TempControlledZone(TempControlledZoneNum).AdaptiveComfortTempControl = true; TempControlledZone(TempControlledZoneNum).AdaptiveComfortModelTypeIndex = - UtilityRoutines::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); + Util::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); if (!state.dataZoneTempPredictorCorrector->AdapComfortDailySetPointSchedule.initialized) { - Array1D runningAverageASH(state.dataWeatherManager->NumDaysInYear, 0.0); - Array1D runningAverageCEN(state.dataWeatherManager->NumDaysInYear, 0.0); + Array1D runningAverageASH(state.dataWeather->NumDaysInYear, 0.0); + Array1D runningAverageCEN(state.dataWeather->NumDaysInYear, 0.0); CalculateMonthlyRunningAverageDryBulb(state, runningAverageASH, runningAverageCEN); CalculateAdaptiveComfortSetPointSchl(state, runningAverageASH, runningAverageCEN); } @@ -1996,12 +1992,11 @@ void GetZoneAirSetPoints(EnergyPlusData &state) TempControlledZoneNum = TStatObjects(found).TempControlledZoneStartPtr + Item - 1; if (state.dataZoneCtrls->NumTempControlledZones == 0) continue; TempControlledZone(TempControlledZoneNum).OperativeTempControl = true; - if (UtilityRoutines::SameString(cAlphaArgs(2), "Scheduled")) { + if (Util::SameString(cAlphaArgs(2), "Scheduled")) { TempControlledZone(TempControlledZoneNum).OpTempCntrlModeScheduled = true; } if (Item == 1) { - if ((!(UtilityRoutines::SameString(cAlphaArgs(2), "Scheduled"))) && - (!(UtilityRoutines::SameString(cAlphaArgs(2), "Constant")))) { + if ((!(Util::SameString(cAlphaArgs(2), "Scheduled"))) && (!(Util::SameString(cAlphaArgs(2), "Constant")))) { ShowSevereError( state, format("{}={} invalid {}=\"{}\".", cCurrentModuleObject, cAlphaArgs(1), cAlphaFieldNames(2), cAlphaArgs(2))); ErrorsFound = true; @@ -2068,7 +2063,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) if (TempControlledZone(TempControlledZoneNum).OperativeTempControl) { if (NumAlphas >= 4 && !lAlphaFieldBlanks(4)) { int adaptiveComfortModelTypeIndex = - UtilityRoutines::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); + Util::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); if (!adaptiveComfortModelTypeIndex) { ShowSevereError(state, format("{}={} invalid {}=\"{}\" not found.", @@ -2080,10 +2075,10 @@ void GetZoneAirSetPoints(EnergyPlusData &state) } else if (adaptiveComfortModelTypeIndex != static_cast(AdaptiveComfortModel::ADAP_NONE)) { TempControlledZone(TempControlledZoneNum).AdaptiveComfortTempControl = true; TempControlledZone(TempControlledZoneNum).AdaptiveComfortModelTypeIndex = - UtilityRoutines::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); + Util::FindItem(cAlphaArgs(4), AdaptiveComfortModelTypes, AdaptiveComfortModelTypes.isize()); if (!state.dataZoneTempPredictorCorrector->AdapComfortDailySetPointSchedule.initialized) { - Array1D runningAverageASH(state.dataWeatherManager->NumDaysInYear, 0.0); - Array1D runningAverageCEN(state.dataWeatherManager->NumDaysInYear, 0.0); + Array1D runningAverageASH(state.dataWeather->NumDaysInYear, 0.0); + Array1D runningAverageCEN(state.dataWeather->NumDaysInYear, 0.0); CalculateMonthlyRunningAverageDryBulb(state, runningAverageASH, runningAverageCEN); CalculateAdaptiveComfortSetPointSchl(state, runningAverageASH, runningAverageCEN); } @@ -2125,10 +2120,10 @@ void GetZoneAirSetPoints(EnergyPlusData &state) cAlphaFieldNames, cNumericFieldNames); // find matching name of ZONECONTROL:THERMOSTAT object - found = UtilityRoutines::FindItem(cAlphaArgs(1), TStatObjects); + found = Util::FindItem(cAlphaArgs(1), TStatObjects); if (found == 0) { // It might be in the TempControlledZones - found = UtilityRoutines::FindItem(cAlphaArgs(1), TempControlledZone); + found = Util::FindItem(cAlphaArgs(1), TempControlledZone); if (found == 0) { // throw error ShowSevereError(state, format("{}={} invalid {} reference not found.", @@ -2147,13 +2142,13 @@ void GetZoneAirSetPoints(EnergyPlusData &state) ErrorsFound = true; } TempControlledZone(TempControlledZoneNum).ZoneOvercoolControl = true; - if ((UtilityRoutines::SameString(cAlphaArgs(3), "None"))) { + if ((Util::SameString(cAlphaArgs(3), "None"))) { TempControlledZone(TempControlledZoneNum).ZoneOvercoolControl = false; } - if (UtilityRoutines::SameString(cAlphaArgs(4), "Scheduled")) { + if (Util::SameString(cAlphaArgs(4), "Scheduled")) { TempControlledZone(TempControlledZoneNum).OvercoolCntrlModeScheduled = true; } - if ((!(UtilityRoutines::SameString(cAlphaArgs(4), "Scheduled"))) && (!(UtilityRoutines::SameString(cAlphaArgs(4), "Constant")))) { + if ((!(Util::SameString(cAlphaArgs(4), "Scheduled"))) && (!(Util::SameString(cAlphaArgs(4), "Constant")))) { ShowSevereError(state, format("{}={} invalid {}=\"{}\".", cCurrentModuleObject, cAlphaArgs(1), cAlphaFieldNames(4), cAlphaArgs(4))); ErrorsFound = true; @@ -2227,15 +2222,14 @@ void GetZoneAirSetPoints(EnergyPlusData &state) ErrorsFound = true; } TempControlledZone(TempControlledZoneNum).ZoneOvercoolControl = true; - if ((UtilityRoutines::SameString(cAlphaArgs(3), "None"))) { + if ((Util::SameString(cAlphaArgs(3), "None"))) { TempControlledZone(TempControlledZoneNum).ZoneOvercoolControl = false; } - if (UtilityRoutines::SameString(cAlphaArgs(4), "Scheduled")) { + if (Util::SameString(cAlphaArgs(4), "Scheduled")) { TempControlledZone(TempControlledZoneNum).OvercoolCntrlModeScheduled = false; } if (Item == 1) { - if ((!(UtilityRoutines::SameString(cAlphaArgs(4), "Scheduled"))) && - (!(UtilityRoutines::SameString(cAlphaArgs(4), "Constant")))) { + if ((!(Util::SameString(cAlphaArgs(4), "Scheduled"))) && (!(Util::SameString(cAlphaArgs(4), "Constant")))) { ShowSevereError( state, format("{}={} invalid {}=\"{}\".", cCurrentModuleObject, cAlphaArgs(1), cAlphaFieldNames(4), cAlphaArgs(4))); ErrorsFound = true; @@ -2332,12 +2326,12 @@ void GetZoneAirSetPoints(EnergyPlusData &state) lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + Util::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataZoneCtrls->StagedTStatObjects(Item).Name = cAlphaArgs(1); - Item1 = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + Item1 = Util::FindItemInList(cAlphaArgs(2), Zone); ZLItem = 0; - if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = UtilityRoutines::FindItemInList(cAlphaArgs(2), ZoneList); + if (Item1 == 0 && state.dataHeatBal->NumOfZoneLists > 0) ZLItem = Util::FindItemInList(cAlphaArgs(2), ZoneList); if (Item1 > 0) { state.dataZoneCtrls->StagedTStatObjects(Item).StageControlledZoneStartPtr = state.dataZoneTempPredictorCorrector->NumStageCtrZone + 1; ++state.dataZoneTempPredictorCorrector->NumStageCtrZone; @@ -2387,11 +2381,11 @@ void GetZoneAirSetPoints(EnergyPlusData &state) cAlphaArgs(2) = state.dataHeatBal->Zone(ZoneList(state.dataZoneCtrls->StagedTStatObjects(Item).ZoneOrZoneListPtr).Zone(Item1)).Name; } - int ZoneAssigned = UtilityRoutines::FindItemInList( + int ZoneAssigned = Util::FindItemInList( cAlphaArgs(2), StageControlledZone, &DataZoneControls::ZoneStagedControls::ZoneName, StageControlledZoneNum - 1); if (ZoneAssigned == 0) { StageControlledZone(StageControlledZoneNum).ZoneName = cAlphaArgs(2); - StageControlledZone(StageControlledZoneNum).ActualZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + StageControlledZone(StageControlledZoneNum).ActualZoneNum = Util::FindItemInList(cAlphaArgs(2), Zone); if (StageControlledZone(StageControlledZoneNum).ActualZoneNum == 0) { ShowSevereError( state, @@ -2624,8 +2618,8 @@ void CalculateMonthlyRunningAverageDryBulb(EnergyPlusData &state, Array1D adaptiveTemp(state.dataWeatherManager->NumDaysInYear, 0.0); - Array1D dailyDryTemp(state.dataWeatherManager->NumDaysInYear, 0.0); + Array1D adaptiveTemp(state.dataWeather->NumDaysInYear, 0.0); + Array1D dailyDryTemp(state.dataWeather->NumDaysInYear, 0.0); readStat = 0; if (FileSystem::fileExists(state.files.inputWeatherFilePath.filePath)) { @@ -2634,7 +2628,7 @@ void CalculateMonthlyRunningAverageDryBulb(EnergyPlusData &state, Array1DNumDaysInYear; ++i) { + for (i = 1; i <= state.dataWeather->NumDaysInYear; ++i) { avgDryBulb = 0.0; for (j = 1; j <= 24; ++j) { epwLine = epwFile.readLine().data; @@ -2652,7 +2646,7 @@ void CalculateMonthlyRunningAverageDryBulb(EnergyPlusData &state, Array1DNumDaysInYear) { + while (dayOfYear < state.dataWeather->NumDaysInYear) { dayOfYear++; calcEndDay = dayOfYear - 1; calcStartDayASH = calcEndDay - 30; @@ -2665,12 +2659,12 @@ void CalculateMonthlyRunningAverageDryBulb(EnergyPlusData &state, Array1DNumDaysInYear; + calcStartDayASH += state.dataWeather->NumDaysInYear; for (i = 1; i <= calcEndDay; i++) { avgDryBulb = dailyDryTemp(i); runningAverageASH(dayOfYear) = runningAverageASH(dayOfYear) + avgDryBulb; } - for (i = calcStartDayASH; i < state.dataWeatherManager->NumDaysInYear; i++) { + for (i = calcStartDayASH; i < state.dataWeather->NumDaysInYear; i++) { avgDryBulb = dailyDryTemp(i); runningAverageASH(dayOfYear) = runningAverageASH(dayOfYear) + avgDryBulb; } @@ -2684,12 +2678,12 @@ void CalculateMonthlyRunningAverageDryBulb(EnergyPlusData &state, Array1DNumDaysInYear; + calcStartDayCEN += state.dataWeather->NumDaysInYear; for (i = 1; i <= calcEndDay; i++) { avgDryBulb = dailyDryTemp(i); runningAverageCEN(dayOfYear) = runningAverageCEN(dayOfYear) + avgDryBulb; } - for (i = calcStartDayCEN; i < state.dataWeatherManager->NumDaysInYear; i++) { + for (i = calcStartDayCEN; i < state.dataWeather->NumDaysInYear; i++) { avgDryBulb = dailyDryTemp(i); runningAverageCEN(dayOfYear) = runningAverageCEN(dayOfYear) + avgDryBulb; } @@ -2720,13 +2714,12 @@ void CalculateAdaptiveComfortSetPointSchl(EnergyPlusData &state, Array1D auto &AdapComfortDailySetPointSchedule = state.dataZoneTempPredictorCorrector->AdapComfortDailySetPointSchedule; auto &AdapComfortSetPointSummerDesDay = state.dataZoneTempPredictorCorrector->AdapComfortSetPointSummerDesDay; - for (size_t i = 1; i <= state.dataWeatherManager->DesDayInput.size(); i++) { + for (size_t i = 1; i <= state.dataWeather->DesDayInput.size(); i++) { // Summer design day - if (state.dataWeatherManager->DesDayInput(i).DayType == summerDesignDayTypeIndex) { - GrossApproxAvgDryBulbDesignDay = - (state.dataWeatherManager->DesDayInput(i).MaxDryBulb + - (state.dataWeatherManager->DesDayInput(i).MaxDryBulb - state.dataWeatherManager->DesDayInput(i).DailyDBRange)) / - 2.0; + if (state.dataWeather->DesDayInput(i).DayType == summerDesignDayTypeIndex) { + GrossApproxAvgDryBulbDesignDay = (state.dataWeather->DesDayInput(i).MaxDryBulb + + (state.dataWeather->DesDayInput(i).MaxDryBulb - state.dataWeather->DesDayInput(i).DailyDBRange)) / + 2.0; if (GrossApproxAvgDryBulbDesignDay > 10 && GrossApproxAvgDryBulbDesignDay < 33.5) { AdapComfortSetPointSummerDesDay[0] = 0.31 * GrossApproxAvgDryBulbDesignDay + 17.8; AdapComfortSetPointSummerDesDay[1] = 0.31 * GrossApproxAvgDryBulbDesignDay + 20.3; @@ -2744,16 +2737,16 @@ void CalculateAdaptiveComfortSetPointSchl(EnergyPlusData &state, Array1D } } - AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Central.allocate(state.dataWeatherManager->NumDaysInYear); - AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Upper_90.allocate(state.dataWeatherManager->NumDaysInYear); - AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Upper_80.allocate(state.dataWeatherManager->NumDaysInYear); - AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Central.allocate(state.dataWeatherManager->NumDaysInYear); - AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Upper_I.allocate(state.dataWeatherManager->NumDaysInYear); - AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Upper_II.allocate(state.dataWeatherManager->NumDaysInYear); - AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Upper_III.allocate(state.dataWeatherManager->NumDaysInYear); + AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Central.allocate(state.dataWeather->NumDaysInYear); + AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Upper_90.allocate(state.dataWeather->NumDaysInYear); + AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Upper_80.allocate(state.dataWeather->NumDaysInYear); + AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Central.allocate(state.dataWeather->NumDaysInYear); + AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Upper_I.allocate(state.dataWeather->NumDaysInYear); + AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Upper_II.allocate(state.dataWeather->NumDaysInYear); + AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveCEN15251_Upper_III.allocate(state.dataWeather->NumDaysInYear); // Calculate the set points based on different models, set flag as -1 when running average temperature is not in the range. - for (int day = 1; day <= state.dataWeatherManager->NumDaysInYear; day++) { + for (int day = 1; day <= state.dataWeather->NumDaysInYear; day++) { if (runningAverageASH(day) > 10 && runningAverageASH(day) < 33.5) { AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Central(day) = 0.31 * runningAverageASH(day) + 17.8; AdapComfortDailySetPointSchedule.ThermalComfortAdaptiveASH55_Upper_90(day) = 0.31 * runningAverageASH(day) + 20.3; @@ -3845,8 +3838,8 @@ void CalcZoneAirTempSetPoints(EnergyPlusData &state) // loop through the FaultsThermostatOffset objects to find the one for the zone for (int iFault = 1; iFault <= state.dataFaultsMgr->NumFaultyThermostat; ++iFault) { - if (UtilityRoutines::SameString(TempControlledZone(RelativeZoneNum).Name, - state.dataFaultsMgr->FaultsThermostatOffset(iFault).FaultyThermostatName)) { + if (Util::SameString(TempControlledZone(RelativeZoneNum).Name, + state.dataFaultsMgr->FaultsThermostatOffset(iFault).FaultyThermostatName)) { // Check fault availability schedules if (ScheduleManager::GetCurrentScheduleValue(state, state.dataFaultsMgr->FaultsThermostatOffset(iFault).AvaiSchedPtr) > 0.0) { @@ -3927,11 +3920,9 @@ void ZoneSpaceHeatBalanceData::calcPredictedHumidityRatio(EnergyPlusData &state, // loop through the FaultsHumidistatOffset objects to find the one for the zone for (int iFault = 1; iFault <= state.dataFaultsMgr->NumFaultyHumidistat; ++iFault) { - if (UtilityRoutines::SameString(humidityControlZone.ControlName, - state.dataFaultsMgr->FaultsHumidistatOffset(iFault).FaultyHumidistatName)) { + if (Util::SameString(humidityControlZone.ControlName, state.dataFaultsMgr->FaultsHumidistatOffset(iFault).FaultyHumidistatName)) { - if (UtilityRoutines::SameString(state.dataFaultsMgr->FaultsHumidistatOffset(iFault).FaultyHumidistatType, - "ThermostatOffsetDependent")) { + if (Util::SameString(state.dataFaultsMgr->FaultsHumidistatOffset(iFault).FaultyHumidistatType, "ThermostatOffsetDependent")) { // For Humidistat Offset Type I: ThermostatOffsetDependent bool IsThermostatFound = false; @@ -3947,8 +3938,8 @@ void ZoneSpaceHeatBalanceData::calcPredictedHumidityRatio(EnergyPlusData &state, // loop through the FaultsThermostatOffset objects to find the one causes the Humidistat Offset for (int iFaultThermo = 1; iFaultThermo <= state.dataFaultsMgr->NumFaultyThermostat; ++iFaultThermo) { - if (UtilityRoutines::SameString(state.dataFaultsMgr->FaultsHumidistatOffset(iFault).FaultyThermostatName, - state.dataFaultsMgr->FaultsThermostatOffset(iFaultThermo).Name)) { + if (Util::SameString(state.dataFaultsMgr->FaultsHumidistatOffset(iFault).FaultyThermostatName, + state.dataFaultsMgr->FaultsThermostatOffset(iFaultThermo).Name)) { IsThermostatFound = true; // Check fault availability schedules @@ -4058,8 +4049,7 @@ void ZoneSpaceHeatBalanceData::calcPredictedHumidityRatio(EnergyPlusData &state, for (size_t zoneEqConfigNum = 1; zoneEqConfigNum <= state.dataZoneEquip->ZoneEquipConfig.size(); ++zoneEqConfigNum) { auto &zoneEqConfig = state.dataZoneEquip->ZoneEquipConfig(zoneEqConfigNum); if (!zoneEqConfig.IsControlled) continue; - int ZoneSizNum = - UtilityRoutines::FindItemInList(zoneEqConfig.ZoneName, state.dataSize->ZoneSizingInput, &DataSizing::ZoneSizingInputData::ZoneName); + int ZoneSizNum = Util::FindItemInList(zoneEqConfig.ZoneName, state.dataSize->ZoneSizingInput, &DataSizing::ZoneSizingInputData::ZoneName); // should use the first Sizing:Zone object if not found if (ZoneSizNum == 0 && !state.dataSize->ZoneSizingInput.empty()) ZoneSizNum = 1; if (ZoneSizNum > 0) { @@ -6047,7 +6037,7 @@ bool VerifyThermostatInZone(EnergyPlusData &state, std::string const &ZoneName) state.dataZoneCtrls->GetZoneAirStatsInputFlag = false; } if (state.dataZoneCtrls->NumTempControlledZones > 0) { - if (UtilityRoutines::FindItemInList(ZoneName, state.dataZoneCtrls->TempControlledZone, &DataZoneControls::ZoneTempControls::ZoneName) > 0) { + if (Util::FindItemInList(ZoneName, state.dataZoneCtrls->TempControlledZone, &DataZoneControls::ZoneTempControls::ZoneName) > 0) { return true; } else { return false; @@ -6066,7 +6056,7 @@ bool VerifyControlledZoneForThermostat(EnergyPlusData &state, std::string const // PURPOSE OF THIS FUNCTION: // This function verifies that a zone (by name) has a ZoneHVAC:EquipmentConnections object entered. - return (UtilityRoutines::FindItemInList(ZoneName, state.dataZoneEquip->ZoneEquipConfig, &DataZoneEquipment::EquipConfiguration::ZoneName) > 0); + return (Util::FindItemInList(ZoneName, state.dataZoneEquip->ZoneEquipConfig, &DataZoneEquipment::EquipConfiguration::ZoneName) > 0); } void DetectOscillatingZoneTemp(EnergyPlusData &state) @@ -6270,8 +6260,8 @@ void AdjustOperativeSetPointsforAdapComfort(EnergyPlusData &state, int const Tem // adjust zone operative setpoint if (!(tempControlledZone.AdaptiveComfortTempControl)) return; // do nothing to setpoint - if ((state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != Constant::KindOfSim::DesignDay) && - (state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).KindOfEnvrn != Constant::KindOfSim::HVACSizeDesignDay)) { + if ((state.dataWeather->Environment(state.dataWeather->Envrn).KindOfEnvrn != Constant::KindOfSim::DesignDay) && + (state.dataWeather->Environment(state.dataWeather->Envrn).KindOfEnvrn != Constant::KindOfSim::HVACSizeDesignDay)) { // Adjust run period cooling set point switch (AdaptiveComfortModelTypeIndex) { case static_cast(AdaptiveComfortModel::ASH55_CENTRAL): @@ -6299,10 +6289,10 @@ void AdjustOperativeSetPointsforAdapComfort(EnergyPlusData &state, int const Tem break; } } else { - int const envrnDayNum(state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).DesignDayNum); + int const envrnDayNum(state.dataWeather->Environment(state.dataWeather->Envrn).DesignDayNum); int constexpr summerDesignDayTypeIndex(9); // Adjust summer design day set point - if (state.dataWeatherManager->DesDayInput(envrnDayNum).DayType == summerDesignDayTypeIndex) { + if (state.dataWeather->DesDayInput(envrnDayNum).DayType == summerDesignDayTypeIndex) { ZoneAirSetPoint = state.dataZoneTempPredictorCorrector->AdapComfortSetPointSummerDesDay[AdaptiveComfortModelTypeIndex - 2]; } } @@ -7057,7 +7047,7 @@ temperatureAndCountInSch(EnergyPlusData &state, int const scheduleIndex, bool co // should adjust date if lands on a holiday but for now assume that it does not // adjust time of day for daylight savings time - int hourSelect = hourOfDay + state.dataWeatherManager->DSTIndex(jdateSelect); + int hourSelect = hourOfDay + state.dataWeather->DSTIndex(jdateSelect); // get the value at the selected time int constexpr firstTimeStep = 1; diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index ef0565f6577..f93cf9e4076 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -270,7 +270,7 @@ void commonInitialize(EnergyPlus::EnergyPlusData &state) #endif #endif - state.dataSysVars->Time_Start = UtilityRoutines::epElapsedTime(); + state.dataSysVars->Time_Start = Util::epElapsedTime(); state.dataStrGlobals->CurrentDateTime = CreateCurrentDateTimeString(); diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index ca8a01f4848..624c3fe2c54 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -249,8 +249,8 @@ void freeObjectNames(const char **objectNames, unsigned int arraySize) int getNumNodesInCondFDSurfaceLayer(EnergyPlusState state, const char *surfName, const char *matName) { auto *thisState = reinterpret_cast(state); - std::string UCsurfName = EnergyPlus::UtilityRoutines::makeUPPER(surfName); - std::string UCmatName = EnergyPlus::UtilityRoutines::makeUPPER(matName); + std::string UCsurfName = EnergyPlus::Util::makeUPPER(surfName); + std::string UCmatName = EnergyPlus::Util::makeUPPER(matName); return EnergyPlus::HeatBalFiniteDiffManager::numNodesInMaterialLayer(*thisState, UCsurfName, UCmatName); } @@ -278,8 +278,8 @@ int getVariableHandle(EnergyPlusState state, const char *type, const char *key) // In this function, it is as simple as looping over both types and continuing to increment // the handle carefully. In the getValue function it is just a matter of checking array sizes. auto *thisState = reinterpret_cast(state); - std::string const typeUC = EnergyPlus::UtilityRoutines::makeUPPER(type); - std::string const keyUC = EnergyPlus::UtilityRoutines::makeUPPER(key); + std::string const typeUC = EnergyPlus::Util::makeUPPER(type); + std::string const keyUC = EnergyPlus::Util::makeUPPER(key); int handle = -1; // initialize to -1 as a flag if (thisState->dataOutputProcessor->RVariableTypes.allocated()) { handle = 0; // initialize to 0 to get a 1 based Array1D index @@ -347,7 +347,7 @@ Real64 getVariableValue(EnergyPlusState state, const int handle) int getMeterHandle(EnergyPlusState state, const char *meterName) { auto *thisState = reinterpret_cast(state); - std::string const meterNameUC = EnergyPlus::UtilityRoutines::makeUPPER(meterName); + std::string const meterNameUC = EnergyPlus::Util::makeUPPER(meterName); int i = EnergyPlus::GetMeterIndex(*thisState, meterNameUC); if (i == 0) { // inside E+, zero is meaningful, but through the API, I want to use negative one as a signal of a bad lookup @@ -381,16 +381,16 @@ Real64 getMeterValue(EnergyPlusState state, int handle) int getActuatorHandle(EnergyPlusState state, const char *componentType, const char *controlType, const char *uniqueKey) { int handle = 0; - std::string const typeUC = EnergyPlus::UtilityRoutines::makeUPPER(componentType); - std::string const keyUC = EnergyPlus::UtilityRoutines::makeUPPER(uniqueKey); - std::string const controlUC = EnergyPlus::UtilityRoutines::makeUPPER(controlType); + std::string const typeUC = EnergyPlus::Util::makeUPPER(componentType); + std::string const keyUC = EnergyPlus::Util::makeUPPER(uniqueKey); + std::string const controlUC = EnergyPlus::Util::makeUPPER(controlType); auto *thisState = reinterpret_cast(state); for (int ActuatorLoop = 1; ActuatorLoop <= thisState->dataRuntimeLang->numEMSActuatorsAvailable; ++ActuatorLoop) { auto &availActuator = thisState->dataRuntimeLang->EMSActuatorAvailable(ActuatorLoop); handle++; - std::string const actuatorTypeUC = EnergyPlus::UtilityRoutines::makeUPPER(availActuator.ComponentTypeName); - std::string const actuatorIDUC = EnergyPlus::UtilityRoutines::makeUPPER(availActuator.UniqueIDName); - std::string const actuatorControlUC = EnergyPlus::UtilityRoutines::makeUPPER(availActuator.ControlTypeName); + std::string const actuatorTypeUC = EnergyPlus::Util::makeUPPER(availActuator.ComponentTypeName); + std::string const actuatorIDUC = EnergyPlus::Util::makeUPPER(availActuator.UniqueIDName); + std::string const actuatorControlUC = EnergyPlus::Util::makeUPPER(availActuator.ControlTypeName); if (typeUC == actuatorTypeUC && keyUC == actuatorIDUC && controlUC == actuatorControlUC) { if (availActuator.handleCount > 0) { @@ -517,13 +517,13 @@ Real64 getActuatorValue(EnergyPlusState state, const int handle) int getInternalVariableHandle(EnergyPlusState state, const char *type, const char *key) { int handle = 0; - std::string const typeUC = EnergyPlus::UtilityRoutines::makeUPPER(type); - std::string const keyUC = EnergyPlus::UtilityRoutines::makeUPPER(key); + std::string const typeUC = EnergyPlus::Util::makeUPPER(type); + std::string const keyUC = EnergyPlus::Util::makeUPPER(key); auto *thisState = reinterpret_cast(state); for (auto const &availVariable : thisState->dataRuntimeLang->EMSInternalVarsAvailable) { // TODO: this should stop at numEMSInternalVarsAvailable handle++; - std::string const variableTypeUC = EnergyPlus::UtilityRoutines::makeUPPER(availVariable.DataTypeName); - std::string const variableIDUC = EnergyPlus::UtilityRoutines::makeUPPER(availVariable.UniqueIDName); + std::string const variableTypeUC = EnergyPlus::Util::makeUPPER(availVariable.DataTypeName); + std::string const variableIDUC = EnergyPlus::Util::makeUPPER(availVariable.UniqueIDName); if (typeUC == variableTypeUC && keyUC == variableIDUC) { return handle; } @@ -871,31 +871,19 @@ int holidayIndex(EnergyPlusState state) int sunIsUp(EnergyPlusState state) { // maintain response convention from previous (EMS) implementation auto *thisState = reinterpret_cast(state); - if (thisState->dataEnvrn->SunIsUp) { - return 1; - } else { - return 0; - } + return (int)thisState->dataEnvrn->SunIsUp; } int isRaining(EnergyPlusState state) { auto *thisState = reinterpret_cast(state); - if (thisState->dataEnvrn->IsRain) { - return 1; - } else { - return 0; - } + return (int)thisState->dataEnvrn->IsRain; } int warmupFlag(EnergyPlusState state) { auto *thisState = reinterpret_cast(state); - if (thisState->dataGlobal->WarmupFlag) { - return 1; - } else { - return 0; - } + return (int)thisState->dataGlobal->WarmupFlag; } Real64 zoneTimeStep(EnergyPlusState state) @@ -925,11 +913,11 @@ int kindOfSim(EnergyPlusState state) int getConstructionHandle(EnergyPlusState state, const char *constructionName) { int handle = 0; - std::string const nameUC = EnergyPlus::UtilityRoutines::makeUPPER(constructionName); + std::string const nameUC = EnergyPlus::Util::makeUPPER(constructionName); auto *thisState = reinterpret_cast(state); for (auto const &construct : thisState->dataConstruction->Construct) { handle++; - std::string const thisNameUC = EnergyPlus::UtilityRoutines::makeUPPER(construct.Name); + std::string const thisNameUC = EnergyPlus::Util::makeUPPER(construct.Name); if (nameUC == thisNameUC) { return handle; } @@ -955,345 +943,377 @@ int actualDateTime(EnergyPlusState) int todayWeatherIsRainAtTime(EnergyPlusState state, int hour, int timeStepNum) { - int value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = - EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather(*thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayIsRain, value); - if (returnStatus != 0) { + + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).IsRain; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0; } - return value; } int todayWeatherIsSnowAtTime(EnergyPlusState state, int hour, int timeStepNum) { - int value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = - EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather(*thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayIsSnow, value); - if (returnStatus != 0) { + + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).IsSnow; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0; } - return value; } + Real64 todayWeatherOutDryBulbAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayOutDryBulbTemp, value); - if (returnStatus != 0) { + + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutDryBulbTemp; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherOutDewPointAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayOutDewPointTemp, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutDewPointTemp; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherOutBarometricPressureAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayOutBaroPress, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutBaroPress; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherOutRelativeHumidityAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayOutRelHum, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutRelHum; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherWindSpeedAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayWindSpeed, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).WindSpeed; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherWindDirectionAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = - EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather(*thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayWindDir, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).WindDir; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherSkyTemperatureAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = - EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather(*thisState, hour, timeStepNum, thisState->dataWeatherManager->TodaySkyTemp, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).SkyTemp; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherHorizontalIRSkyAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayHorizIRSky, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).HorizIRSky; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherBeamSolarRadiationAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayBeamSolarRad, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).BeamSolarRad; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherDiffuseSolarRadiationAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayDifSolarRad, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).DifSolarRad; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherAlbedoAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = - EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather(*thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayAlbedo, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).Albedo; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 todayWeatherLiquidPrecipitationAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TodayLiquidPrecip, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).LiquidPrecip; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } int tomorrowWeatherIsRainAtTime(EnergyPlusState state, int hour, int timeStepNum) { - int value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowIsRain, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).IsRain; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0; } - return value; } int tomorrowWeatherIsSnowAtTime(EnergyPlusState state, int hour, int timeStepNum) { - int value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowIsSnow, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).IsSnow; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0; } - return value; } Real64 tomorrowWeatherOutDryBulbAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowOutDryBulbTemp, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutDryBulbTemp; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherOutDewPointAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowOutDewPointTemp, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutDewPointTemp; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherOutBarometricPressureAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowOutBaroPress, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutBaroPress; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherOutRelativeHumidityAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowOutRelHum, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutRelHum; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherWindSpeedAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowWindSpeed, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).WindSpeed; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherWindDirectionAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowWindDir, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).WindDir; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherSkyTemperatureAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowSkyTemp, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).SkyTemp; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherHorizontalIRSkyAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowHorizIRSky, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).HorizIRSky; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherBeamSolarRadiationAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowBeamSolarRad, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).BeamSolarRad; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherDiffuseSolarRadiationAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowDifSolarRad, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).DifSolarRad; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherAlbedoAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowAlbedo, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).Albedo; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 tomorrowWeatherLiquidPrecipitationAtTime(EnergyPlusState state, int hour, int timeStepNum) { - Real64 value = 0; auto *thisState = reinterpret_cast(state); - int returnStatus = EnergyPlus::RuntimeLanguageProcessor::TodayTomorrowWeather( - *thisState, hour, timeStepNum, thisState->dataWeatherManager->TomorrowLiquidPrecip, value); - if (returnStatus != 0) { + int iHour = hour + 1; + if ((iHour > 0) && (iHour <= EnergyPlus::Constant::HoursInDay) && (timeStepNum > 0) && + (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { + return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).LiquidPrecip; + } else { EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; + return 0.0; } - return value; } Real64 currentSimTime(EnergyPlusState state) { auto *thisState = reinterpret_cast(state); - Real64 value = (thisState->dataGlobal->DayOfSim - 1) * 24 + currentTime(state); + Real64 value = (thisState->dataGlobal->DayOfSim - 1) * EnergyPlus::Constant::HoursInDay + currentTime(state); return value; } diff --git a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc index a858469aba7..3576115adc2 100644 --- a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc +++ b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc @@ -4033,7 +4033,7 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOASTest) SimAirServingZones::GetAirPathData(*state); auto getNodeByName = [this](std::string_view nodeName) -> NodeData & { - const int idx = UtilityRoutines::FindItemInList(nodeName, state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + const int idx = Util::FindItemInList(nodeName, state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); if (idx == 0) { throw; } @@ -4355,56 +4355,56 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_TestGetDesignDayConditions) { AirLoopHVACDOAS::AirLoopDOAS thisDOAS; - state->dataWeatherManager->DesDayInput.allocate(2); - state->dataWeatherManager->Environment.allocate(4); + state->dataWeather->DesDayInput.allocate(2); + state->dataWeather->Environment.allocate(4); - state->dataWeatherManager->Environment(1).DesignDayNum = 1; // Environment(3) & (4) will be = 0 - state->dataWeatherManager->Environment(2).DesignDayNum = 2; + state->dataWeather->Environment(1).DesignDayNum = 1; // Environment(3) & (4) will be = 0 + state->dataWeather->Environment(2).DesignDayNum = 2; - state->dataWeatherManager->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(3).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; - state->dataWeatherManager->Environment(4).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; + state->dataWeather->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(3).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; + state->dataWeather->Environment(4).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; // set up environments such that day 2 is cooling peak and day 4 is heating peak - state->dataWeatherManager->Environment(1).maxCoolingOATSizing = 27.0; - state->dataWeatherManager->Environment(1).maxCoolingOADPSizing = 21.0; - state->dataWeatherManager->Environment(2).maxCoolingOATSizing = 31.0; - state->dataWeatherManager->Environment(2).maxCoolingOADPSizing = 22.0; - state->dataWeatherManager->Environment(3).maxCoolingOATSizing = 29.0; - state->dataWeatherManager->Environment(3).maxCoolingOADPSizing = 8.0; - state->dataWeatherManager->Environment(4).maxCoolingOATSizing = 26.0; - state->dataWeatherManager->Environment(4).maxCoolingOADPSizing = 5.0; - - state->dataWeatherManager->Environment(1).minHeatingOATSizing = 17.0; - state->dataWeatherManager->Environment(1).minHeatingOADPSizing = 16.0; - state->dataWeatherManager->Environment(2).minHeatingOATSizing = 16.0; - state->dataWeatherManager->Environment(2).minHeatingOADPSizing = 14.0; - state->dataWeatherManager->Environment(3).minHeatingOATSizing = 19.0; - state->dataWeatherManager->Environment(3).minHeatingOADPSizing = 18.0; - state->dataWeatherManager->Environment(4).minHeatingOATSizing = 4.0; - state->dataWeatherManager->Environment(4).minHeatingOADPSizing = 3.0; + state->dataWeather->Environment(1).maxCoolingOATSizing = 27.0; + state->dataWeather->Environment(1).maxCoolingOADPSizing = 21.0; + state->dataWeather->Environment(2).maxCoolingOATSizing = 31.0; + state->dataWeather->Environment(2).maxCoolingOADPSizing = 22.0; + state->dataWeather->Environment(3).maxCoolingOATSizing = 29.0; + state->dataWeather->Environment(3).maxCoolingOADPSizing = 8.0; + state->dataWeather->Environment(4).maxCoolingOATSizing = 26.0; + state->dataWeather->Environment(4).maxCoolingOADPSizing = 5.0; + + state->dataWeather->Environment(1).minHeatingOATSizing = 17.0; + state->dataWeather->Environment(1).minHeatingOADPSizing = 16.0; + state->dataWeather->Environment(2).minHeatingOATSizing = 16.0; + state->dataWeather->Environment(2).minHeatingOADPSizing = 14.0; + state->dataWeather->Environment(3).minHeatingOATSizing = 19.0; + state->dataWeather->Environment(3).minHeatingOADPSizing = 18.0; + state->dataWeather->Environment(4).minHeatingOATSizing = 4.0; + state->dataWeather->Environment(4).minHeatingOADPSizing = 3.0; state->dataEnvrn->StdBaroPress = DataEnvironment::StdPressureSeaLevel; Real64 envrnCoolingHumRat = - Psychrometrics::PsyWFnTdpPb(*state, state->dataWeatherManager->Environment(2).maxCoolingOADPSizing, state->dataEnvrn->StdBaroPress); + Psychrometrics::PsyWFnTdpPb(*state, state->dataWeather->Environment(2).maxCoolingOADPSizing, state->dataEnvrn->StdBaroPress); Real64 envrnHeatingHumRat = - Psychrometrics::PsyWFnTdpPb(*state, state->dataWeatherManager->Environment(4).minHeatingOADPSizing, DataEnvironment::StdPressureSeaLevel); + Psychrometrics::PsyWFnTdpPb(*state, state->dataWeather->Environment(4).minHeatingOADPSizing, DataEnvironment::StdPressureSeaLevel); // test peak conditions used for sizing thisDOAS.GetDesignDayConditions(*state); - EXPECT_NEAR(thisDOAS.SizingCoolOATemp, state->dataWeatherManager->Environment(2).maxCoolingOATSizing, 0.000001); + EXPECT_NEAR(thisDOAS.SizingCoolOATemp, state->dataWeather->Environment(2).maxCoolingOATSizing, 0.000001); EXPECT_NEAR(thisDOAS.SizingCoolOAHumRat, envrnCoolingHumRat, 0.000001); - EXPECT_NEAR(thisDOAS.HeatOutTemp, state->dataWeatherManager->Environment(4).minHeatingOATSizing, 0.000001); + EXPECT_NEAR(thisDOAS.HeatOutTemp, state->dataWeather->Environment(4).minHeatingOATSizing, 0.000001); EXPECT_NEAR(thisDOAS.HeatOutHumRat, envrnHeatingHumRat, 0.000001); AirLoopHVACDOAS::AirLoopDOAS anotherDOAS; // a second DOAS system should find the same sizing conditions anotherDOAS.GetDesignDayConditions(*state); - EXPECT_NEAR(anotherDOAS.SizingCoolOATemp, state->dataWeatherManager->Environment(2).maxCoolingOATSizing, 0.000001); + EXPECT_NEAR(anotherDOAS.SizingCoolOATemp, state->dataWeather->Environment(2).maxCoolingOATSizing, 0.000001); EXPECT_NEAR(anotherDOAS.SizingCoolOAHumRat, envrnCoolingHumRat, 0.000001); - EXPECT_NEAR(anotherDOAS.HeatOutTemp, state->dataWeatherManager->Environment(4).minHeatingOATSizing, 0.000001); + EXPECT_NEAR(anotherDOAS.HeatOutTemp, state->dataWeather->Environment(4).minHeatingOATSizing, 0.000001); EXPECT_NEAR(anotherDOAS.HeatOutHumRat, envrnHeatingHumRat, 0.000001); // reset for next test @@ -4415,20 +4415,20 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_TestGetDesignDayConditions) // note in these descriptions that DOAS systems do not use time of peak to select weather data used for sizing // test higher summer dew point for non-peak summer day (non-peak summer design day has lower OAT than peak summer day) - state->dataWeatherManager->Environment(1).maxCoolingOADPSizing = 24.0; - state->dataWeatherManager->Environment(3).maxCoolingOADPSizing = 24.0; - state->dataWeatherManager->Environment(4).maxCoolingOADPSizing = 24.0; + state->dataWeather->Environment(1).maxCoolingOADPSizing = 24.0; + state->dataWeather->Environment(3).maxCoolingOADPSizing = 24.0; + state->dataWeather->Environment(4).maxCoolingOADPSizing = 24.0; // test lower winter dew point for non-peak winter day (non-peak winter design day has higher OAT then winter peak day) - state->dataWeatherManager->Environment(1).minHeatingOADPSizing = 2.0; - state->dataWeatherManager->Environment(2).minHeatingOADPSizing = 2.0; - state->dataWeatherManager->Environment(3).minHeatingOADPSizing = 2.0; + state->dataWeather->Environment(1).minHeatingOADPSizing = 2.0; + state->dataWeather->Environment(2).minHeatingOADPSizing = 2.0; + state->dataWeather->Environment(3).minHeatingOADPSizing = 2.0; thisDOAS.GetDesignDayConditions(*state); // design conditions should only be selected based on outdoor temperature so same conditions as before - EXPECT_NEAR(anotherDOAS.SizingCoolOATemp, state->dataWeatherManager->Environment(2).maxCoolingOATSizing, 0.000001); + EXPECT_NEAR(anotherDOAS.SizingCoolOATemp, state->dataWeather->Environment(2).maxCoolingOATSizing, 0.000001); EXPECT_NEAR(anotherDOAS.SizingCoolOAHumRat, envrnCoolingHumRat, 0.000001); - EXPECT_NEAR(anotherDOAS.HeatOutTemp, state->dataWeatherManager->Environment(4).minHeatingOATSizing, 0.000001); + EXPECT_NEAR(anotherDOAS.HeatOutTemp, state->dataWeather->Environment(4).minHeatingOATSizing, 0.000001); EXPECT_NEAR(anotherDOAS.HeatOutHumRat, envrnHeatingHumRat, 0.000001); // reset for next test @@ -4438,15 +4438,15 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_TestGetDesignDayConditions) thisDOAS.HeatOutHumRat = 999.0; // test results using user entered design day pressure - state->dataWeatherManager->DesDayInput(2).PressureEntered = true; - state->dataWeatherManager->DesDayInput(2).PressBarom = 0.9 * DataEnvironment::StdPressureSeaLevel; - envrnCoolingHumRat = Psychrometrics::PsyWFnTdpPb( - *state, state->dataWeatherManager->Environment(2).maxCoolingOADPSizing, state->dataWeatherManager->DesDayInput(2).PressBarom); + state->dataWeather->DesDayInput(2).PressureEntered = true; + state->dataWeather->DesDayInput(2).PressBarom = 0.9 * DataEnvironment::StdPressureSeaLevel; + envrnCoolingHumRat = + Psychrometrics::PsyWFnTdpPb(*state, state->dataWeather->Environment(2).maxCoolingOADPSizing, state->dataWeather->DesDayInput(2).PressBarom); thisDOAS.GetDesignDayConditions(*state); // design conditions should only be selected based on outdoor temperature so same temperature as before but different humrat - EXPECT_NEAR(thisDOAS.SizingCoolOATemp, state->dataWeatherManager->Environment(2).maxCoolingOATSizing, 0.000001); + EXPECT_NEAR(thisDOAS.SizingCoolOATemp, state->dataWeather->Environment(2).maxCoolingOATSizing, 0.000001); EXPECT_NEAR(thisDOAS.SizingCoolOAHumRat, envrnCoolingHumRat, 0.000001); } @@ -8373,7 +8373,7 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_ReportVariableResetTest) SimAirServingZones::GetAirPathData(*state); auto getNodeByName = [this](std::string_view nodeName) -> NodeData & { - const int idx = UtilityRoutines::FindItemInList(nodeName, state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + const int idx = Util::FindItemInList(nodeName, state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); if (idx == 0) { throw; } @@ -11538,7 +11538,7 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_TestFanDrawThroughPlacement) SimulationManager::ManageSimulation(*state); // run the design day over the warmup period (24 hrs, 25 days) auto getNodeByName = [this](std::string_view nodeName) -> NodeData & { - const int idx = UtilityRoutines::FindItemInList(nodeName, state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + const int idx = Util::FindItemInList(nodeName, state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); if (idx == 0) { throw; } diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc index 6d9caaf2407..ef21a98a1a0 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc @@ -1051,8 +1051,8 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatAirTerminal_MinFlowTurnDownTest) Real64 SysMaxMassFlowRes = 1.0 * state->dataEnvrn->StdRhoAir; // inputs from VAV reheat AT // test with heating load and turndown fraction schedule value set 1.0 - int ZoneNodeNum = UtilityRoutines::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); - int InletNodeNum = UtilityRoutines::FindItemInList("NODE 24", state->dataLoopNodes->NodeID); + int ZoneNodeNum = Util::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); + int InletNodeNum = Util::FindItemInList("NODE 24", state->dataLoopNodes->NodeID); state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputRequired = 2000.0; state->dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // state->dataLoopNodes->Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; @@ -1248,8 +1248,8 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFanAirTerminal_MinFlowTurnDownTes SingleDuct::GetSysInput(*state); EXPECT_TRUE(compare_err_stream("")); // check VAV reheat air terminal inputs - int ZoneNodeNum = UtilityRoutines::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); - int InletNodeNum = UtilityRoutines::FindItemInList("SPACE1-1 ATU IN NODE", state->dataLoopNodes->NodeID); + int ZoneNodeNum = Util::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); + int InletNodeNum = Util::FindItemInList("SPACE1-1 ATU IN NODE", state->dataLoopNodes->NodeID); EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", state->dataSingleDuct->sd_airterminal(SysNum).sysType); // VAV Reheat Type EXPECT_EQ("VAV REHEAT VS FAN AT", state->dataSingleDuct->sd_airterminal(SysNum).SysName); // VAV Reheat Name EXPECT_TRUE(state->dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist); // turndown schdule exists @@ -1436,8 +1436,8 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVHeatCoolReheatAirTerminal_MinFlowTurnDown Real64 SysMaxMassFlowRes = 1.0 * state->dataEnvrn->StdRhoAir; // inputs from VAV coolheat reheat AT // test with heating load and turndown fraction schedule value set 1.0 - int ZoneNodeNum = UtilityRoutines::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); - int InletNodeNum = UtilityRoutines::FindItemInList("NODE 7", state->dataLoopNodes->NodeID); + int ZoneNodeNum = Util::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); + int InletNodeNum = Util::FindItemInList("NODE 7", state->dataLoopNodes->NodeID); state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputRequired = 2000.0; state->dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // state->dataLoopNodes->Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; @@ -1615,8 +1615,8 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFan_DamperPositionTest) auto &thisAirTerminalOutlet = state->dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet; // check VAV reheat VS Fan air terminal inputs - int ZoneNodeNum = UtilityRoutines::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); - int InletNodeNum = UtilityRoutines::FindItemInList("ZONE 1 ATU IN NODE", state->dataLoopNodes->NodeID); + int ZoneNodeNum = Util::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); + 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); @@ -1765,7 +1765,7 @@ TEST_F(EnergyPlusFixture, VAVHeatCoolReheatAirTerminal_ZoneOAVolumeFlowRateTest) EXPECT_EQ(thisHeatCoolAT.MaxAirVolFlowRate, 1.0); // input from VAV HeatCool reheat air terminal ; - int ZoneNodeNum = UtilityRoutines::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); + int ZoneNodeNum = Util::FindItemInList("ZONE 1 AIR NODE", state->dataLoopNodes->NodeID); int InletNodeNum = thisHeatCoolAT.InletNodeNum; state->dataZoneEquip->ZoneEquipConfig(thisHeatCoolAT.CtrlZoneNum).InletNodeAirLoopNum(thisHeatCoolAT.CtrlZoneInNodeIndex) = 1; // set heating zone and AT unit inlet conditions diff --git a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc index b524d37dcff..fcf8870db71 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc @@ -197,8 +197,8 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneVentingSch) state->afn->get_input(); // MultizoneZoneData has only 1 element so may be hardcoded - auto GetIndex = UtilityRoutines::FindItemInList(state->afn->MultizoneZoneData(1).VentingSchName, - state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules})); + auto GetIndex = Util::FindItemInList(state->afn->MultizoneZoneData(1).VentingSchName, + state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules})); EXPECT_EQ(GetIndex, state->afn->MultizoneZoneData(1).VentingSchNum); state->dataHeatBal->Zone.deallocate(); @@ -2138,21 +2138,18 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestPressureStat) Real64 PressureSet = 0.5; state->dataScheduleMgr - ->Schedule(UtilityRoutines::FindItemInList("PRESSURE SETPOINT SCHEDULE", - state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) + ->Schedule(Util::FindItemInList("PRESSURE SETPOINT SCHEDULE", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) .CurrentValue = PressureSet; // Pressure setpoint state->dataScheduleMgr - ->Schedule( - UtilityRoutines::FindItemInList("FANANDCOILAVAILSCHED", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) + ->Schedule(Util::FindItemInList("FANANDCOILAVAILSCHED", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) .CurrentValue = 1.0; // set availability and fan schedule to 1 - state->dataScheduleMgr - ->Schedule(UtilityRoutines::FindItemInList("ON", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) + state->dataScheduleMgr->Schedule(Util::FindItemInList("ON", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) .CurrentValue = 1.0; // On state->dataScheduleMgr - ->Schedule(UtilityRoutines::FindItemInList("VENTINGSCHED", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) + ->Schedule(Util::FindItemInList("VENTINGSCHED", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) .CurrentValue = 25.55; // VentingSched state->dataScheduleMgr - ->Schedule(UtilityRoutines::FindItemInList("WINDOWVENTSCHED", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) + ->Schedule(Util::FindItemInList("WINDOWVENTSCHED", state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules}))) .CurrentValue = 1.0; // WindowVentSched state->afn->AirflowNetworkFanActivated = true; @@ -2163,7 +2160,7 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestPressureStat) state->dataEnvrn->WindDir = 270.0; state->dataEnvrn->StdRhoAir = 1.2; - int index = UtilityRoutines::FindItemInList("OA INLET NODE", state->afn->AirflowNetworkNodeData); + int index = Util::FindItemInList("OA INLET NODE", state->afn->AirflowNetworkNodeData); for (i = 1; i <= 36; ++i) { state->afn->AirflowNetworkNodeSimu(i).TZ = 23.0; state->afn->AirflowNetworkNodeSimu(i).WZ = 0.0008400; @@ -2383,8 +2380,8 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneVentingSchWithAdaptiveCtrl) // changed index 2 to 1 because in new sorted scheedule MultizoneZone(1).VentingSchName ("FREERUNNINGSEASON") // has index 1 which is the .VentSchNum - auto GetIndex = UtilityRoutines::FindItemInList(state->afn->MultizoneZoneData(1).VentingSchName, - state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules})); + auto GetIndex = Util::FindItemInList(state->afn->MultizoneZoneData(1).VentingSchName, + state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules})); EXPECT_EQ(GetIndex, state->afn->MultizoneZoneData(1).VentingSchNum); state->dataHeatBal->Zone.deallocate(); @@ -10628,8 +10625,8 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneVentingAirBoundary) // MultizoneSurfaceData(1) is connected to a normal heat transfer surface - // venting schedule should be non-zero and venting method should be ZoneLevel - auto GetIndex = UtilityRoutines::FindItemInList(state->afn->MultizoneSurfaceData(1).VentingSchName, - state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules})); + auto GetIndex = Util::FindItemInList(state->afn->MultizoneSurfaceData(1).VentingSchName, + state->dataScheduleMgr->Schedule({1, state->dataScheduleMgr->NumSchedules})); EXPECT_GT(GetIndex, 0); EXPECT_EQ(GetIndex, state->afn->MultizoneSurfaceData(1).VentingSchNum); EXPECT_TRUE(compare_enums(state->afn->MultizoneSurfaceData(1).VentSurfCtrNum, AirflowNetwork::VentControlType::Temp)); diff --git a/tst/EnergyPlus/unit/Autosizing/BaseClassSizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/BaseClassSizing.unit.cc index 9c189395835..8e677ea9ef0 100644 --- a/tst/EnergyPlus/unit/Autosizing/BaseClassSizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/BaseClassSizing.unit.cc @@ -954,11 +954,11 @@ TEST_F(EnergyPlusFixture, BaseSizer_FanPeak) state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).TimeStepNumAtCoolMax = 72; // Fake a design day - state->dataWeatherManager->DesDayInput.allocate(1); + state->dataWeather->DesDayInput.allocate(1); std::string DDTitle = "CHICAGO ANN CLG 1% CONDNS DB=>MWB"; - state->dataWeatherManager->DesDayInput(state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDDNum).Title = DDTitle; - state->dataWeatherManager->DesDayInput(state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDDNum).Month = 7; - state->dataWeatherManager->DesDayInput(state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDDNum).DayOfMonth = 15; + state->dataWeather->DesDayInput(state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDDNum).Title = DDTitle; + state->dataWeather->DesDayInput(state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDDNum).Month = 7; + state->dataWeather->DesDayInput(state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDDNum).DayOfMonth = 15; // Also need to set this, it's used to check if DDNum <= TotDesDays state->dataEnvrn->TotDesDays = 1; diff --git a/tst/EnergyPlus/unit/Autosizing/CoolingAirFlowSizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/CoolingAirFlowSizing.unit.cc index 25bb49d3549..685ce0cb6f8 100644 --- a/tst/EnergyPlus/unit/Autosizing/CoolingAirFlowSizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/CoolingAirFlowSizing.unit.cc @@ -126,13 +126,13 @@ TEST_F(AutoSizingFixture, CoolingAirFlowSizingGauntlet) state->dataGlobal->NumOfTimeStepInHour = 1; state->dataGlobal->MinutesPerTimeStep = 60; state->dataEnvrn->TotDesDays = 2; - state->dataWeatherManager->DesDayInput.allocate(2); - state->dataWeatherManager->DesDayInput(1).Month = 7; - state->dataWeatherManager->DesDayInput(1).DayOfMonth = 7; - state->dataWeatherManager->DesDayInput(2).Month = 1; - state->dataWeatherManager->DesDayInput(2).DayOfMonth = 1; - state->dataWeatherManager->DesDayInput(1).Title = "CoolingDD"; - state->dataWeatherManager->DesDayInput(2).Title = "HeatingDD"; + state->dataWeather->DesDayInput.allocate(2); + state->dataWeather->DesDayInput(1).Month = 7; + state->dataWeather->DesDayInput(1).DayOfMonth = 7; + state->dataWeather->DesDayInput(2).Month = 1; + state->dataWeather->DesDayInput(2).DayOfMonth = 1; + state->dataWeather->DesDayInput(1).Title = "CoolingDD"; + state->dataWeather->DesDayInput(2).Title = "HeatingDD"; // Test 2 - Zone Equipment, sizes to greater of zone cooling and heating flow // start with an auto-sized value as the user input diff --git a/tst/EnergyPlus/unit/Autosizing/HeatingAirFlowSizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/HeatingAirFlowSizing.unit.cc index af24e35bdd6..5f108039a97 100644 --- a/tst/EnergyPlus/unit/Autosizing/HeatingAirFlowSizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/HeatingAirFlowSizing.unit.cc @@ -126,13 +126,13 @@ TEST_F(AutoSizingFixture, HeatingAirFlowSizingGauntlet) state->dataGlobal->NumOfTimeStepInHour = 1; state->dataGlobal->MinutesPerTimeStep = 60; state->dataEnvrn->TotDesDays = 2; - state->dataWeatherManager->DesDayInput.allocate(2); - state->dataWeatherManager->DesDayInput(1).Month = 7; - state->dataWeatherManager->DesDayInput(1).DayOfMonth = 7; - state->dataWeatherManager->DesDayInput(2).Month = 1; - state->dataWeatherManager->DesDayInput(2).DayOfMonth = 1; - state->dataWeatherManager->DesDayInput(1).Title = "CoolingDD"; - state->dataWeatherManager->DesDayInput(2).Title = "HeatingDD"; + state->dataWeather->DesDayInput.allocate(2); + state->dataWeather->DesDayInput(1).Month = 7; + state->dataWeather->DesDayInput(1).DayOfMonth = 7; + state->dataWeather->DesDayInput(2).Month = 1; + state->dataWeather->DesDayInput(2).DayOfMonth = 1; + state->dataWeather->DesDayInput(1).Title = "CoolingDD"; + state->dataWeather->DesDayInput(2).Title = "HeatingDD"; // Test 2 - Zone Equipment, sizes to greater of zone cooling and heating flow // start with an auto-sized value as the user input diff --git a/tst/EnergyPlus/unit/Autosizing/SystemAirFlowSizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/SystemAirFlowSizing.unit.cc index 07e503d1154..1e67b904342 100644 --- a/tst/EnergyPlus/unit/Autosizing/SystemAirFlowSizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/SystemAirFlowSizing.unit.cc @@ -123,13 +123,13 @@ TEST_F(AutoSizingFixture, SystemAirFlowSizingGauntlet) state->dataGlobal->NumOfTimeStepInHour = 1; state->dataGlobal->MinutesPerTimeStep = 60; state->dataEnvrn->TotDesDays = 2; - state->dataWeatherManager->DesDayInput.allocate(2); - state->dataWeatherManager->DesDayInput(1).Month = 7; - state->dataWeatherManager->DesDayInput(1).DayOfMonth = 7; - state->dataWeatherManager->DesDayInput(2).Month = 1; - state->dataWeatherManager->DesDayInput(2).DayOfMonth = 1; - state->dataWeatherManager->DesDayInput(1).Title = "CoolingDD"; - state->dataWeatherManager->DesDayInput(2).Title = "HeatingDD"; + state->dataWeather->DesDayInput.allocate(2); + state->dataWeather->DesDayInput(1).Month = 7; + state->dataWeather->DesDayInput(1).DayOfMonth = 7; + state->dataWeather->DesDayInput(2).Month = 1; + state->dataWeather->DesDayInput(2).DayOfMonth = 1; + state->dataWeather->DesDayInput(1).Title = "CoolingDD"; + state->dataWeather->DesDayInput(2).Title = "HeatingDD"; // Test 2 - Zone Equipment, sizes to greater of zone cooling and heating flow // start with an auto-sized value as the user input diff --git a/tst/EnergyPlus/unit/BranchInputManager.unit.cc b/tst/EnergyPlus/unit/BranchInputManager.unit.cc index 484ba40aef5..799e8af80e2 100644 --- a/tst/EnergyPlus/unit/BranchInputManager.unit.cc +++ b/tst/EnergyPlus/unit/BranchInputManager.unit.cc @@ -131,8 +131,7 @@ TEST_F(EnergyPlusFixture, GetBranchInput_One_SingleComponentBranch) cNumericFields); IsNotOK = false; IsBlank = false; - UtilityRoutines::VerifyName( - *state, Alphas(1), state->dataBranchInputManager->Branch, BCount, IsNotOK, IsBlank, CurrentModuleObject + " Name"); + Util::VerifyName(*state, Alphas(1), state->dataBranchInputManager->Branch, BCount, IsNotOK, IsBlank, CurrentModuleObject + " Name"); if (IsNotOK) { if (IsBlank) { continue; @@ -147,12 +146,12 @@ TEST_F(EnergyPlusFixture, GetBranchInput_One_SingleComponentBranch) EXPECT_EQ(NumOfBranches, 1); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(1), "VAV Sys 1 Main Branch")); + EXPECT_TRUE(Util::SameString(Alphas(1), "VAV Sys 1 Main Branch")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(3), "AirLoopHVAC:OutdoorAirSystem")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(4), "OA Sys 1")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(5), "VAV Sys 1 Inlet Node")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(6), "Mixed Air Node 1")); + EXPECT_TRUE(Util::SameString(Alphas(3), "AirLoopHVAC:OutdoorAirSystem")); + EXPECT_TRUE(Util::SameString(Alphas(4), "OA Sys 1")); + EXPECT_TRUE(Util::SameString(Alphas(5), "VAV Sys 1 Inlet Node")); + EXPECT_TRUE(Util::SameString(Alphas(6), "Mixed Air Node 1")); NodeNums.deallocate(); Alphas.deallocate(); @@ -297,8 +296,7 @@ TEST_F(EnergyPlusFixture, GetBranchInput_One_FourComponentBranch) cNumericFields); IsNotOK = false; IsBlank = false; - UtilityRoutines::VerifyName( - *state, Alphas(1), state->dataBranchInputManager->Branch, BCount, IsNotOK, IsBlank, CurrentModuleObject + " Name"); + Util::VerifyName(*state, Alphas(1), state->dataBranchInputManager->Branch, BCount, IsNotOK, IsBlank, CurrentModuleObject + " Name"); if (IsNotOK) { if (IsBlank) { continue; @@ -313,27 +311,27 @@ TEST_F(EnergyPlusFixture, GetBranchInput_One_FourComponentBranch) EXPECT_EQ(NumOfBranches, 1); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(1), "VAV Sys 1 Main Branch")); + EXPECT_TRUE(Util::SameString(Alphas(1), "VAV Sys 1 Main Branch")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(3), "AirLoopHVAC:OutdoorAirSystem")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(4), "OA Sys 1")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(5), "VAV Sys 1 Inlet Node")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(6), "Mixed Air Node 1")); + EXPECT_TRUE(Util::SameString(Alphas(3), "AirLoopHVAC:OutdoorAirSystem")); + EXPECT_TRUE(Util::SameString(Alphas(4), "OA Sys 1")); + EXPECT_TRUE(Util::SameString(Alphas(5), "VAV Sys 1 Inlet Node")); + EXPECT_TRUE(Util::SameString(Alphas(6), "Mixed Air Node 1")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(7), "Coil:Cooling:Water")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(8), "Main Cooling Coil 1")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(9), "Mixed Air Node 1")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(10), "Main Cooling Coil 1 Outlet Node")); + EXPECT_TRUE(Util::SameString(Alphas(7), "Coil:Cooling:Water")); + EXPECT_TRUE(Util::SameString(Alphas(8), "Main Cooling Coil 1")); + EXPECT_TRUE(Util::SameString(Alphas(9), "Mixed Air Node 1")); + EXPECT_TRUE(Util::SameString(Alphas(10), "Main Cooling Coil 1 Outlet Node")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(11), "Coil:Heating:Water")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(12), "Main Heating Coil 1")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(13), "Main Cooling Coil 1 Outlet Node")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(14), "Main Heating Coil 1 Outlet Node")); + EXPECT_TRUE(Util::SameString(Alphas(11), "Coil:Heating:Water")); + EXPECT_TRUE(Util::SameString(Alphas(12), "Main Heating Coil 1")); + EXPECT_TRUE(Util::SameString(Alphas(13), "Main Cooling Coil 1 Outlet Node")); + EXPECT_TRUE(Util::SameString(Alphas(14), "Main Heating Coil 1 Outlet Node")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(15), "Fan:VariableVolume")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(16), "Supply Fan 1")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(17), "Main Heating Coil 1 Outlet Node")); - EXPECT_TRUE(UtilityRoutines::SameString(Alphas(18), "VAV Sys 1 Outlet Node")); + EXPECT_TRUE(Util::SameString(Alphas(15), "Fan:VariableVolume")); + EXPECT_TRUE(Util::SameString(Alphas(16), "Supply Fan 1")); + EXPECT_TRUE(Util::SameString(Alphas(17), "Main Heating Coil 1 Outlet Node")); + EXPECT_TRUE(Util::SameString(Alphas(18), "VAV Sys 1 Outlet Node")); NodeNums.deallocate(); Alphas.deallocate(); diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index 60bd4a648d8..64f155597bc 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -507,7 +507,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelNoCooling) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); CondenserLoopTowers::GetTowerInput(*state); @@ -900,7 +900,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); CondenserLoopTowers::GetTowerInput(*state); @@ -1337,7 +1337,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUserInputTowerSizing) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); CondenserLoopTowers::GetTowerInput(*state); @@ -1757,7 +1757,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedUserInputTowerSizing) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); CondenserLoopTowers::GetTowerInput(*state); @@ -2247,7 +2247,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelUserInputTowerSizing) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); CondenserLoopTowers::GetTowerInput(*state); @@ -2680,7 +2680,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedTowerLowSpeedNomCapSizing) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); // get inputs of cooling tower object @@ -4176,7 +4176,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_CoolingTowersDefaultValuesTest) CondenserLoopTowers::GetTowerInput(*state); int index; // index to cooling tower - index = UtilityRoutines::FindItemInList("SINGLESPEED COOLINGTOWER", state->dataCondenserLoopTowers->towers); + index = Util::FindItemInList("SINGLESPEED COOLINGTOWER", state->dataCondenserLoopTowers->towers); auto &singleSpd_tower = state->dataCondenserLoopTowers->towers(index); // some inputs and default values checks EXPECT_EQ(singleSpd_tower.Name, "SINGLESPEED COOLINGTOWER"); @@ -4202,7 +4202,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_CoolingTowersDefaultValuesTest) EXPECT_EQ(singleSpd_tower.cellCtrl, CondenserLoopTowers::CellCtrl::MaxCell); EXPECT_EQ(singleSpd_tower.EndUseSubcategory, "General"); - index = UtilityRoutines::FindItemInList("TWOSPEED COOLINGTOWER", state->dataCondenserLoopTowers->towers); + index = Util::FindItemInList("TWOSPEED COOLINGTOWER", state->dataCondenserLoopTowers->towers); auto &twoSpd_tower = state->dataCondenserLoopTowers->towers(index); // some inputs and default values checks EXPECT_EQ(twoSpd_tower.Name, "TWOSPEED COOLINGTOWER"); @@ -4217,7 +4217,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_CoolingTowersDefaultValuesTest) EXPECT_EQ(twoSpd_tower.cellCtrl, CondenserLoopTowers::CellCtrl::MaxCell); EXPECT_EQ(twoSpd_tower.EndUseSubcategory, "General"); - index = UtilityRoutines::FindItemInList("VARSPEED COOLINGTOWER", state->dataCondenserLoopTowers->towers); + index = Util::FindItemInList("VARSPEED COOLINGTOWER", state->dataCondenserLoopTowers->towers); auto &varSpd_tower = state->dataCondenserLoopTowers->towers(index); // some inputs and default values checks EXPECT_EQ(varSpd_tower.Name, "VARSPEED COOLINGTOWER"); @@ -4234,7 +4234,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_CoolingTowersDefaultValuesTest) EXPECT_EQ(varSpd_tower.PerformanceInputMethod_Num, CondenserLoopTowers::PIM::UFactor); // hard coded EXPECT_EQ(varSpd_tower.HeatRejectCapNomCapSizingRatio, 1.25); - index = UtilityRoutines::FindItemInList("VSMERKEL COOLINGTOWER", state->dataCondenserLoopTowers->towers); + index = Util::FindItemInList("VSMERKEL COOLINGTOWER", state->dataCondenserLoopTowers->towers); auto &vSpdMerkel_tower = state->dataCondenserLoopTowers->towers(index); // some inputs and default values checks EXPECT_EQ(vSpdMerkel_tower.Name, "VSMERKEL COOLINGTOWER"); diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 931dbacf629..8a91d189adf 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -1930,109 +1930,109 @@ TEST_F(EnergyPlusFixture, AdaptiveModelSelections_ProperConstruction) Convect::HcInt algo; - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FohannoPolidoriVerticalWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondUnstableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq3WallAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq4CeilingAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_HeatedFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_HeatedFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AwbiHattonHeatedFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_ChilledCeil)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_ChilledCeil]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KaradagChilledCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_VertWallsNonHeated)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_VertWallsNonHeated]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq6NonHeatedWalls)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_HeatedVerticalWall)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_HeatedVerticalWall]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AwbiHattonHeatedWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq7Ceiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FohannoPolidoriVerticalWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_VertWallsNearHeat)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_VertWallsNearHeat]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq5WallNearHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq7Ceiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Walls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Walls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWalls)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Ceiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Ceiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FisherPedersenCeilDiffuserCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Floor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Floor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWindow)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_Walls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_Walls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq3WallAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq4CeilingAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_AssistFlowWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_AssistFlowWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedAssistingWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_OpposFlowWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_OpposFlowWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedOppossingWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_StableFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_StableFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedStableFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_UnstableFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_UnstableFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedUnstableFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_StableCeiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_StableCeiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedStableCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_UnstableCeiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_UnstableCeiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedUnstableCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWindow)); Convect::HcExt algo2; - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_WallWindward)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_WallWindward]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::SparrowWindward)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_WallLeeward)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_WallLeeward]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::SparrowLeeward)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_HorizRoof)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_HorizRoof]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::ClearRoof)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_VertWall)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_VertWall]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalASHRAEVerticalWall)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_StableHoriz)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_StableHoriz]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalWaltonStableHorizontalOrTilt)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_UnstableHoriz)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalWaltonUnstableHorizontalOrTilt)); } @@ -2067,109 +2067,109 @@ TEST_F(EnergyPlusFixture, AdaptiveModelSelections_Implicit) Convect::HcInt algo; - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FohannoPolidoriVerticalWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondUnstableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq3WallAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq4CeilingAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_HeatedFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_HeatedFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AwbiHattonHeatedFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_ChilledCeil)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_ChilledCeil]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KaradagChilledCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_VertWallsNonHeated)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_VertWallsNonHeated]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq6NonHeatedWalls)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_HeatedVerticalWall)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_HeatedVerticalWall]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AwbiHattonHeatedWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq7Ceiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FohannoPolidoriVerticalWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_VertWallsNearHeat)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_VertWallsNearHeat]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq5WallNearHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq7Ceiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Walls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Walls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWalls)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Ceiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Ceiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FisherPedersenCeilDiffuserCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Floor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Floor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWindow)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_Walls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_Walls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq3WallAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq4CeilingAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_AssistFlowWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_AssistFlowWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedAssistingWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_OpposFlowWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_OpposFlowWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedOppossingWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_StableFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_StableFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedStableFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_UnstableFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_UnstableFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedUnstableFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_StableCeiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_StableCeiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedStableCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_UnstableCeiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_UnstableCeiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedUnstableCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWindow)); Convect::HcExt algo2; - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_WallWindward)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_WallWindward]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::SparrowWindward)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_WallLeeward)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_WallLeeward]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::SparrowLeeward)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_HorizRoof)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_HorizRoof]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::ClearRoof)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_VertWall)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_VertWall]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalASHRAEVerticalWall)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_StableHoriz)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_StableHoriz]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalWaltonStableHorizontalOrTilt)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_UnstableHoriz)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalWaltonUnstableHorizontalOrTilt)); state->dataHeatBalSurf->SurfTempInTmp.deallocate(); @@ -2308,109 +2308,109 @@ TEST_F(EnergyPlusFixture, AdaptiveModelSelections_ExplicitSelection) Convect::HcInt algo; - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondUnstableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq3WallAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq4CeilingAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_HeatedFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_HeatedFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AwbiHattonHeatedFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_ChilledCeil)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_ChilledCeil]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KaradagChilledCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A1_FloorHeatCeilCool_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A1_FloorHeatCeilCool_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_VertWallsNonHeated)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_VertWallsNonHeated]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq6NonHeatedWalls)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_HeatedVerticalWall)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_HeatedVerticalWall]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AwbiHattonHeatedWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq7Ceiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A2_WallPanelHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A2_WallPanelHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_VertWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FohannoPolidoriVerticalWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_VertWallsNearHeat)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_VertWallsNearHeat]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq5WallNearHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq7Ceiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::B_ConvectiveHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::B_ConvectiveHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Walls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Walls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWalls)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Ceiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Ceiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::FisherPedersenCeilDiffuserCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Floor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Floor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::C_CentralAirHeat_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::C_CentralAirHeat_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWindow)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_Walls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_Walls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq3WallAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_StableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_StableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::AlamdariHammondStableHorizontal)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_UnstableHoriz)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::KhalifaEq4CeilingAwayFromHeat)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_StableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_StableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonStableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_UnstableTilted)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_UnstableTilted]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::WaltonUnstableHorizontalOrTilt)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::D_ZoneFanCirc_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::D_ZoneFanCirc_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::ISO15099Windows)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_AssistFlowWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_AssistFlowWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedAssistingWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_OpposFlowWalls)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_OpposFlowWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedOppossingWall)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_StableFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_StableFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedStableFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_UnstableFloor)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_UnstableFloor]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedUnstableFloor)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_StableCeiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_StableCeiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedStableCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_UnstableCeiling)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_UnstableCeiling]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::BeausoleilMorrisonMixedUnstableCeiling)); - algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::E_MixedBuoy_Windows)]; + algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::E_MixedBuoy_Windows]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::GoldsteinNovoselacCeilingDiffuserWindow)); Convect::HcExt algo2; - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_WallWindward)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_WallWindward]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::SparrowWindward)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_WallLeeward)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_WallLeeward]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::SparrowLeeward)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_HorizRoof)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_HorizRoof]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::ClearRoof)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_VertWall)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_VertWall]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalASHRAEVerticalWall)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_StableHoriz)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_StableHoriz]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalWaltonStableHorizontalOrTilt)); - algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::NaturalConvection_UnstableHoriz)]; + algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::NaturalConvection_UnstableHoriz]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::NaturalWaltonUnstableHorizontalOrTilt)); state->dataHeatBalSurf->SurfTempInTmp.deallocate(); @@ -2648,18 +2648,16 @@ TEST_F(ConvectionCoefficientsFixture, TestSetAdaptiveConvectionAlgoCoefficient) int curve; int expected_curve; - Convect::HcInt algo = - state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_VertWalls)]; + Convect::HcInt algo = state->dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)Convect::IntConvClass::A3_SimpleBuoy_VertWalls]; EXPECT_TRUE(compare_enums(algo, Convect::HcInt::UserCurve)); - curve = state->dataConvect->intAdaptiveConvAlgo.intConvClassUserCurveNums[static_cast(Convect::IntConvClass::A3_SimpleBuoy_VertWalls)]; - expected_curve = UtilityRoutines::FindItemInList("ASHRAE VERT DUPLICATE", state->dataConvect->hcIntUserCurve); + curve = state->dataConvect->intAdaptiveConvAlgo.intConvClassUserCurveNums[(int)Convect::IntConvClass::A3_SimpleBuoy_VertWalls]; + expected_curve = Util::FindItemInList("ASHRAE VERT DUPLICATE", state->dataConvect->hcIntUserCurve); ASSERT_EQ(curve, expected_curve); - Convect::HcExt algo2 = - state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[static_cast(Convect::ExtConvClass2::WindConvection_WallWindward)]; + Convect::HcExt algo2 = state->dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)Convect::ExtConvClass2::WindConvection_WallWindward]; EXPECT_TRUE(compare_enums(algo2, Convect::HcExt::UserCurve)); - curve = state->dataConvect->extAdaptiveConvAlgo.extConvClass2UserCurveNums[static_cast(Convect::ExtConvClass2::WindConvection_WallWindward)]; - expected_curve = UtilityRoutines::FindItemInList("NUSSELTJURGESDUPCURVE", state->dataConvect->hcExtUserCurve); + curve = state->dataConvect->extAdaptiveConvAlgo.extConvClass2UserCurveNums[(int)Convect::ExtConvClass2::WindConvection_WallWindward]; + expected_curve = Util::FindItemInList("NUSSELTJURGESDUPCURVE", state->dataConvect->hcExtUserCurve); } TEST_F(ConvectionCoefficientsFixture, TestCalcWindSurfaceTheta) @@ -4046,9 +4044,9 @@ TEST_F(ConvectionCoefficientsFixture, SurroundingSurfacesHRadCoefTest) int srdSurfsNum = 0; int srdSurfsPropNum = 0; // test 1: exterior north wall radiation coefficient - srdSurfsPropNum = UtilityRoutines::FindItemInList("SRDSURFS:NORTH-WALL", state->dataSurface->SurroundingSurfsProperty); + srdSurfsPropNum = Util::FindItemInList("SRDSURFS:NORTH-WALL", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(srdSurfsPropNum).SurroundingSurfsPtr); - surfNum = UtilityRoutines::FindItemInList("NORTH-WALL", state->dataSurface->Surface); + surfNum = Util::FindItemInList("NORTH-WALL", state->dataSurface->Surface); auto &surface_north_wall = state->dataSurface->Surface(surfNum); srdSurfsNum = state->dataSurface->Surface(surfNum).SurfSurroundingSurfacesNum; auto &srdSurfsProperty_north = state->dataSurface->SurroundingSurfsProperty(srdSurfsNum); @@ -4065,12 +4063,12 @@ TEST_F(ConvectionCoefficientsFixture, SurroundingSurfacesHRadCoefTest) srdSurfsProperty_north.SurroundingSurfs(1).ViewFactor + srdSurfsProperty_north.SurroundingSurfs(2).ViewFactor; EXPECT_DOUBLE_EQ(0.5, srdSurfacesViewFactorSum_result1); // calculate surrounding surface radiation coeffient - Real64 surf_tempExtK = state->dataHeatBalSurf->SurfOutsideTempHist(1)(surfNum) + Constant::KelvinConv; + Real64 surf_tempExtK = state->dataHeatBalSurf->SurfOutsideTempHist(1)(surfNum) + Constant::Kelvin; auto &north_wall_const = state->dataConstruction->Construct(surface_north_wall.Construction); auto *north_wall_mat = dynamic_cast(state->dataMaterial->Material(north_wall_const.LayerPoint(1))); Real64 surf_absExt_north_wall = north_wall_mat->AbsorpThermal; // LW emitance of the exterior surface // calculate surrounding surfaces radiation exchange coefficient - Real64 north_wall_srdSurfsTK = surface_north_wall.SrdSurfTemp + Constant::KelvinConv; + Real64 north_wall_srdSurfsTK = surface_north_wall.SrdSurfTemp + Constant::Kelvin; EXPECT_NEAR(10.80, surface_north_wall.SrdSurfTemp, 1.0e-02); EXPECT_NEAR(0.9, surf_absExt_north_wall, 1.0e-06); Real64 HRadSrdSurf_result1 = @@ -4085,9 +4083,9 @@ TEST_F(ConvectionCoefficientsFixture, SurroundingSurfacesHRadCoefTest) srdSurfsNum = 0; srdSurfsPropNum = 0; // test 2: exterior east wall radiation coefficient - srdSurfsPropNum = UtilityRoutines::FindItemInList("SRDSURFS:EAST-WALL", state->dataSurface->SurroundingSurfsProperty); + srdSurfsPropNum = Util::FindItemInList("SRDSURFS:EAST-WALL", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(2, state->dataSurface->SurfLocalEnvironment(srdSurfsPropNum).SurroundingSurfsPtr); - surfNum = UtilityRoutines::FindItemInList("EAST-WALL", state->dataSurface->Surface); + surfNum = Util::FindItemInList("EAST-WALL", state->dataSurface->Surface); auto &surface_east_wall = state->dataSurface->Surface(surfNum); srdSurfsNum = state->dataSurface->Surface(surfNum).SurfSurroundingSurfacesNum; auto &srdSurfsProperty_east = state->dataSurface->SurroundingSurfsProperty(srdSurfsNum); @@ -4104,12 +4102,12 @@ TEST_F(ConvectionCoefficientsFixture, SurroundingSurfacesHRadCoefTest) srdSurfsProperty_east.SurroundingSurfs(1).ViewFactor + srdSurfsProperty_east.SurroundingSurfs(2).ViewFactor; EXPECT_DOUBLE_EQ(0.3, srdSurfacesViewFactorSum_result2); // calculate surrounding surface radiation coeffient - surf_tempExtK = state->dataHeatBalSurf->SurfOutsideTempHist(1)(surfNum) + Constant::KelvinConv; + surf_tempExtK = state->dataHeatBalSurf->SurfOutsideTempHist(1)(surfNum) + Constant::Kelvin; auto &east_wall_const = state->dataConstruction->Construct(surface_east_wall.Construction); auto *east_wall_mat = dynamic_cast(state->dataMaterial->Material(east_wall_const.LayerPoint(1))); Real64 surf_absExt_east_wall = east_wall_mat->AbsorpThermal; // LW emitance of the exterior surface // calculate surrounding surfaces radiation exchange coefficient - Real64 east_wall_srdSurfsTK = surface_east_wall.SrdSurfTemp + Constant::KelvinConv; + Real64 east_wall_srdSurfsTK = surface_east_wall.SrdSurfTemp + Constant::Kelvin; EXPECT_NEAR(15.34, surface_east_wall.SrdSurfTemp, 1.0e-02); EXPECT_NEAR(0.7, surf_absExt_east_wall, 1.0e-06); Real64 HRadSrdSurf_result2 = diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index 70f7df1c095..976c45c7fd7 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -5516,8 +5516,8 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatingsTest) GetCurveInput(*state); Fans::GetFanInput(*state); GetDXCoils(*state); - int dXCoilIndex = UtilityRoutines::FindItemInList("CCOOLING DX TWO SPEED", state->dataDXCoils->DXCoil); - int fanIndex = UtilityRoutines::FindItemInList("FAN VARIABLE VOLUME", state->dataFans->Fan, &Fans::FanEquipConditions::FanName); + int dXCoilIndex = Util::FindItemInList("CCOOLING DX TWO SPEED", state->dataDXCoils->DXCoil); + int fanIndex = Util::FindItemInList("FAN VARIABLE VOLUME", state->dataFans->Fan, &Fans::FanEquipConditions::FanName); auto &coolcoilTwoSpeed = state->dataDXCoils->DXCoil(dXCoilIndex); auto &supplyFan = state->dataFans->Fan(fanIndex); coolcoilTwoSpeed.SupplyFanIndex = fanIndex; @@ -5754,8 +5754,8 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatings_Curve_Fix_Test) GetCurveInput(*state); Fans::GetFanInput(*state); GetDXCoils(*state); - int dXCoilIndex = UtilityRoutines::FindItemInList("CCOOLING DX TWO SPEED", state->dataDXCoils->DXCoil); - int fanIndex = UtilityRoutines::FindItemInList("FAN VARIABLE VOLUME", state->dataFans->Fan, &Fans::FanEquipConditions::FanName); + int dXCoilIndex = Util::FindItemInList("CCOOLING DX TWO SPEED", state->dataDXCoils->DXCoil); + int fanIndex = Util::FindItemInList("FAN VARIABLE VOLUME", state->dataFans->Fan, &Fans::FanEquipConditions::FanName); auto &coolcoilTwoSpeed = state->dataDXCoils->DXCoil(dXCoilIndex); auto &supplyFan = state->dataFans->Fan(fanIndex); coolcoilTwoSpeed.SupplyFanIndex = fanIndex; diff --git a/tst/EnergyPlus/unit/DataHeatBalance.unit.cc b/tst/EnergyPlus/unit/DataHeatBalance.unit.cc index 5dc8f4f0946..8738e9d9444 100644 --- a/tst/EnergyPlus/unit/DataHeatBalance.unit.cc +++ b/tst/EnergyPlus/unit/DataHeatBalance.unit.cc @@ -852,7 +852,7 @@ TEST_F(EnergyPlusFixture, DataHeatBalance_CheckConstructLayers) EXPECT_EQ(state->dataConstruction->Construct(4).LayerPoint(2), 5); // air gap EXPECT_EQ(state->dataConstruction->Construct(4).LayerPoint(3), 4); // glass, inner layer - int windowSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL001:WIN001", state->dataSurface->Surface); + int windowSurfNum = Util::FindItemInList("ZN001:WALL001:WIN001", state->dataSurface->Surface); EXPECT_FALSE(state->dataSurface->SurfWinHasShadeOrBlindLayer(windowSurfNum)); // the window construction has no blind // check if the construction has a blind material layer diff --git a/tst/EnergyPlus/unit/DataSizing.unit.cc b/tst/EnergyPlus/unit/DataSizing.unit.cc index 05ebeda038b..a5a593602e7 100644 --- a/tst/EnergyPlus/unit/DataSizing.unit.cc +++ b/tst/EnergyPlus/unit/DataSizing.unit.cc @@ -367,7 +367,7 @@ TEST_F(EnergyPlusFixture, OARequirements_calcDesignSpecificationOutdoorAir) compare_err_stream(""); std::string thisOAReqName = "DSOA ZONE 1 SPACES"; - int oaNum = UtilityRoutines::FindItemInList(thisOAReqName, state->dataSize->OARequirements); + int oaNum = Util::FindItemInList(thisOAReqName, state->dataSize->OARequirements); EXPECT_TRUE(oaNum > 0); EXPECT_EQ(4, state->dataSize->OARequirements(oaNum).dsoaIndexes.size()); @@ -375,26 +375,26 @@ TEST_F(EnergyPlusFixture, OARequirements_calcDesignSpecificationOutdoorAir) state->dataHeatBal->spaceIntGain.allocate(state->dataGlobal->numSpaces); state->dataHeatBal->ZoneIntGain.allocate(state->dataGlobal->NumOfZones); std::string thisSpaceName = "SPACE 1A"; - int spaceNum = UtilityRoutines::FindItemInList(thisSpaceName, state->dataHeatBal->space); + int spaceNum = Util::FindItemInList(thisSpaceName, state->dataHeatBal->space); state->dataHeatBal->space(spaceNum).FloorArea = 100.0; state->dataHeatBal->space(spaceNum).TotOccupants = 10; state->dataHeatBal->spaceIntGain(spaceNum).NOFOCC = 1; state->dataHeatBal->space(spaceNum).maxOccupants = 12; thisSpaceName = "SPACE 1B"; - spaceNum = UtilityRoutines::FindItemInList(thisSpaceName, state->dataHeatBal->space); + spaceNum = Util::FindItemInList(thisSpaceName, state->dataHeatBal->space); state->dataHeatBal->space(spaceNum).FloorArea = 100.0; thisSpaceName = "SPACE 1C"; - spaceNum = UtilityRoutines::FindItemInList(thisSpaceName, state->dataHeatBal->space); + spaceNum = Util::FindItemInList(thisSpaceName, state->dataHeatBal->space); state->dataHeatBal->space(spaceNum).FloorArea = 100.0; thisSpaceName = "SPACE 1D"; - spaceNum = UtilityRoutines::FindItemInList(thisSpaceName, state->dataHeatBal->space); + spaceNum = Util::FindItemInList(thisSpaceName, state->dataHeatBal->space); state->dataHeatBal->space(spaceNum).FloorArea = 100.0; std::string thisZoneName = "ZONE 2"; - zoneNum = UtilityRoutines::FindItemInList(thisZoneName, state->dataHeatBal->Zone); + zoneNum = Util::FindItemInList(thisZoneName, state->dataHeatBal->Zone); state->dataHeatBal->Zone(zoneNum).FloorArea = 400.0; state->dataHeatBal->Zone(zoneNum).TotOccupants = 10; state->dataHeatBal->ZoneIntGain(zoneNum).NOFOCC = 1; @@ -404,20 +404,20 @@ TEST_F(EnergyPlusFixture, OARequirements_calcDesignSpecificationOutdoorAir) bool UseMinOASchFlag = false; thisZoneName = "ZONE 1"; - zoneNum = UtilityRoutines::FindItemInList(thisZoneName, state->dataHeatBal->Zone); + zoneNum = Util::FindItemInList(thisZoneName, state->dataHeatBal->Zone); state->dataHeatBal->Zone(zoneNum).FloorArea = 400.0; thisOAReqName = "DSOA ZONE 1 SPACES"; - oaNum = UtilityRoutines::FindItemInList(thisOAReqName, state->dataSize->OARequirements); + oaNum = Util::FindItemInList(thisOAReqName, state->dataSize->OARequirements); Real64 zone1OA = DataSizing::calcDesignSpecificationOutdoorAir(*state, oaNum, zoneNum, UseOccSchFlag, UseMinOASchFlag); // 0.0125/person * 10.0 + 0.001/area * 100.0 + 1.0/zone + 0.1ACH * 300.0 / 3600.0; Real64 expectedOA = 0.0125 * 10.0 + 0.001 * 100.0 + 1.0 + 0.1 * 300.0 / 3600.0; EXPECT_EQ(expectedOA, zone1OA); thisZoneName = "ZONE 2"; - zoneNum = UtilityRoutines::FindItemInList(thisZoneName, state->dataHeatBal->Zone); + zoneNum = Util::FindItemInList(thisZoneName, state->dataHeatBal->Zone); state->dataHeatBal->Zone(zoneNum).FloorArea = 400.0; thisOAReqName = "DSOA SUM"; - oaNum = UtilityRoutines::FindItemInList(thisOAReqName, state->dataSize->OARequirements); + oaNum = Util::FindItemInList(thisOAReqName, state->dataSize->OARequirements); Real64 zone2OA = DataSizing::calcDesignSpecificationOutdoorAir(*state, oaNum, zoneNum, UseOccSchFlag, UseMinOASchFlag); EXPECT_EQ(expectedOA, zone2OA); } diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index c8ee3076b3e..1768a1c8674 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -1417,7 +1417,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_DayltgInteriorIllum_LuminanceShadin EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); - int ZoneNum = UtilityRoutines::FindItemInList("EAST ZONE", state->dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList("EAST ZONE", state->dataHeatBal->Zone); InternalHeatGains::GetInternalHeatGainsInput(*state); state->dataInternalHeatGains->GetInternalHeatGainsInputFlag = false; Dayltg::GetInputDayliteRefPt(*state, foundErrors); @@ -1747,7 +1747,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_DayltgInteriorIllum_Test) EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); - int ZoneNum = UtilityRoutines::FindItemInList("EAST ZONE", state->dataHeatBal->Zone); + int ZoneNum = Util::FindItemInList("EAST ZONE", state->dataHeatBal->Zone); InternalHeatGains::GetInternalHeatGainsInput(*state); state->dataInternalHeatGains->GetInternalHeatGainsInputFlag = false; Dayltg::GetInputDayliteRefPt(*state, foundErrors); @@ -1793,7 +1793,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_DayltgInteriorIllum_Test) int DayltgExtWin = 1; int Shaded = 2; int Unshaded = 1; - int IWin = UtilityRoutines::FindItemInList("ZN001:WALL001:WIN001", state->dataSurface->Surface); + int IWin = Util::FindItemInList("ZN001:WALL001:WIN001", state->dataSurface->Surface); EXPECT_GT(IWin, 0); // Set un-shaded surface illuminance factor to 1.0 for RefPt1, 0.1 for RefPt2 @@ -3671,8 +3671,8 @@ TEST_F(EnergyPlusFixture, DaylightingManager_DayltgIlluminanceMap) state->dataGlobal->CurrentTime = 12.0; state->dataHeatBalMgr->CountWarmupDayPoints = 0; state->dataGlobal->EndDayFlag = false; - state->dataWeatherManager->Envrn = 1; - WeatherManager::ManageWeather(*state); + state->dataWeather->Envrn = 1; + Weather::ManageWeather(*state); HeatBalanceManager::ManageHeatBalance(*state); EXPECT_NEAR(16051, state->dataDaylightingData->IllumMapCalc(1).DaylIllumAtMapPt(5), 1); EXPECT_NEAR(203, state->dataDaylightingData->IllumMapCalc(1).DaylIllumAtMapPt(10), 1); diff --git a/tst/EnergyPlus/unit/DemandResponse.unit.cc b/tst/EnergyPlus/unit/DemandResponse.unit.cc index cf3bebe3cac..e1bae6e3d2c 100644 --- a/tst/EnergyPlus/unit/DemandResponse.unit.cc +++ b/tst/EnergyPlus/unit/DemandResponse.unit.cc @@ -166,7 +166,7 @@ TEST_F(EnergyPlusFixture, DemandManagerAssignmentListGetInputTest) int dMgrIndex = 0; auto &DemandMgr(state->dataDemandManager->DemandMgr); // check lights demand manager name - dMgrIndex = UtilityRoutines::FindItemInList("EXT LIGHTS MANAGER", DemandMgr); + dMgrIndex = Util::FindItemInList("EXT LIGHTS MANAGER", DemandMgr); auto &lightsDmndMgr = state->dataDemandManager->DemandMgr(dMgrIndex); EXPECT_EQ("EXT LIGHTS MANAGER", lightsDmndMgr.Name); // test expected fatal error due to wrong demand manager objet name diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index b2d415bb963..1f477530de2 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -918,9 +918,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) state->dataEMSMgr->FinishProcessingUserInput = false; ReturnValue = RuntimeLanguageProcessor::EvaluateExpression( *state, - state->dataRuntimeLang->ErlStack(UtilityRoutines::FindItemInList("SETNODESETPOINTTEST", state->dataRuntimeLang->ErlStack)) - .Instruction(1) - .Argument2, + state->dataRuntimeLang->ErlStack(Util::FindItemInList("SETNODESETPOINTTEST", state->dataRuntimeLang->ErlStack)).Instruction(1).Argument2, seriousErrorFound); // we just check the logic and don't throw the fatal errors. EXPECT_TRUE(seriousErrorFound); @@ -930,9 +928,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) seriousErrorFound = false; ReturnValue = RuntimeLanguageProcessor::EvaluateExpression( *state, - state->dataRuntimeLang->ErlStack(UtilityRoutines::FindItemInList("SETNODESETPOINTTEST", state->dataRuntimeLang->ErlStack)) - .Instruction(1) - .Argument2, + state->dataRuntimeLang->ErlStack(Util::FindItemInList("SETNODESETPOINTTEST", state->dataRuntimeLang->ErlStack)).Instruction(1).Argument2, seriousErrorFound); EXPECT_FALSE(seriousErrorFound); } @@ -1751,12 +1747,12 @@ TEST_F(EnergyPlusFixture, EMS_WeatherDataActuators) state->dataGlobal->BeginSimFlag = true; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->LocationGathered = false; + state->dataWeather->LocationGathered = false; EMSManager::CheckIfAnyEMS(*state); bool available = false; bool errorsFound = false; - WeatherManager::GetNextEnvironment(*state, available, errorsFound); + Weather::GetNextEnvironment(*state, available, errorsFound); ASSERT_FALSE(errorsFound); state->dataEMSMgr->FinishProcessingUserInput = true; @@ -1767,7 +1763,7 @@ TEST_F(EnergyPlusFixture, EMS_WeatherDataActuators) state->dataGlobal->DayOfSim = 1; state->dataGlobal->BeginEnvrnFlag = true; state->dataGlobal->BeginDayFlag = true; - WeatherManager::ManageWeather(*state); + Weather::ManageWeather(*state); EXPECT_NEAR(state->dataEnvrn->OutDryBulbTemp, 50.0, 0.000001); EXPECT_NEAR(state->dataEnvrn->OutDewPointTemp, 25.0, 0.000001); @@ -1782,7 +1778,7 @@ TEST_F(EnergyPlusFixture, EMS_WeatherDataActuators) state->dataGlobal->DayOfSim = 1; state->dataGlobal->BeginEnvrnFlag = false; state->dataGlobal->BeginDayFlag = false; - WeatherManager::ManageWeather(*state); + Weather::ManageWeather(*state); EXPECT_NEAR(state->dataEnvrn->OutDryBulbTemp, 50.0, 0.000001); EXPECT_NEAR(state->dataEnvrn->OutDewPointTemp, 25.0, 0.000001); @@ -1879,12 +1875,12 @@ TEST_F(EnergyPlusFixture, EMS_TodayTomorrowFunctions) state->dataGlobal->BeginSimFlag = true; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->LocationGathered = false; + state->dataWeather->LocationGathered = false; EMSManager::CheckIfAnyEMS(*state); bool available = false; bool errorsFound = false; - WeatherManager::GetNextEnvironment(*state, available, errorsFound); + Weather::GetNextEnvironment(*state, available, errorsFound); ASSERT_FALSE(errorsFound); state->dataEMSMgr->FinishProcessingUserInput = true; @@ -1895,7 +1891,7 @@ TEST_F(EnergyPlusFixture, EMS_TodayTomorrowFunctions) state->dataGlobal->DayOfSim = 1; state->dataGlobal->BeginEnvrnFlag = true; state->dataGlobal->BeginDayFlag = true; - WeatherManager::ManageWeather(*state); + Weather::ManageWeather(*state); // Note that operands for these functions are Hour (0:23) then Timestep // In the EMS code above, they are all using Hour = 5 and Timestep=3 @@ -1905,125 +1901,133 @@ TEST_F(EnergyPlusFixture, EMS_TodayTomorrowFunctions) int internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayRain", 1); ASSERT_GT(internalVarNum, 0); bool rainTrueFalse = (state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number > 0.0); - EXPECT_EQ(state->dataWeatherManager->TodayIsRain(3, 5 + 1), rainTrueFalse); + EXPECT_EQ(state->dataWeather->wvarsHrTsToday(3, 5 + 1).IsRain, rainTrueFalse); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodaySnow", 1); ASSERT_GT(internalVarNum, 0); bool snowTrueFalse = (state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number > 0.0); - EXPECT_EQ(state->dataWeatherManager->TodayIsRain(3, 5 + 1), snowTrueFalse); + EXPECT_EQ(state->dataWeather->wvarsHrTsToday(3, 5 + 1).IsSnow, snowTrueFalse); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayDryBulb", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayOutDryBulbTemp(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsToday(3, 5 + 1).OutDryBulbTemp, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayDewPoint", 1); ASSERT_GT(internalVarNum, 0); EXPECT_NEAR( - state->dataWeatherManager->TodayOutDewPointTemp(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + state->dataWeather->wvarsHrTsToday(3, 5 + 1).OutDewPointTemp, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayBaroPress", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayOutBaroPress(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsToday(3, 5 + 1).OutBaroPress, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayRelHum", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayOutRelHum(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsToday(3, 5 + 1).OutRelHum, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayWindSpd", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayWindSpeed(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsToday(3, 5 + 1).WindSpeed, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayWindDirect", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayWindDir(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsToday(3, 5 + 1).WindDir, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodaySkyT", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodaySkyTemp(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsToday(3, 5 + 1).SkyTemp, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayHorIR", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayHorizIRSky(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsToday(3, 5 + 1).HorizIRSky, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayBeamSol", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayBeamSolarRad(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsToday(3, 5 + 1).BeamSolarRad, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayDifSol", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayDifSolarRad(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsToday(3, 5 + 1).DifSolarRad, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayAlb", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayAlbedo(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsToday(3, 5 + 1).Albedo, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TodayPrecip", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TodayLiquidPrecip(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsToday(3, 5 + 1).LiquidPrecip, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); // TodayIsRain and TodayIsSnow are logicals, but the ems functions returns 0 or 1 internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowRain", 1); ASSERT_GT(internalVarNum, 0); rainTrueFalse = (state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number > 0.0); - EXPECT_EQ(state->dataWeatherManager->TomorrowIsRain(3, 5 + 1), rainTrueFalse); + EXPECT_EQ(state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).IsRain, rainTrueFalse); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowSnow", 1); ASSERT_GT(internalVarNum, 0); snowTrueFalse = (state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number > 0.0); - EXPECT_EQ(state->dataWeatherManager->TomorrowIsRain(3, 5 + 1), snowTrueFalse); + EXPECT_EQ(state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).IsSnow, snowTrueFalse); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowDryBulb", 1); ASSERT_GT(internalVarNum, 0); EXPECT_NEAR( - state->dataWeatherManager->TomorrowOutDryBulbTemp(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).OutDryBulbTemp, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowDewPoint", 1); ASSERT_GT(internalVarNum, 0); EXPECT_NEAR( - state->dataWeatherManager->TomorrowOutDewPointTemp(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).OutDewPointTemp, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowBaroPress", 1); ASSERT_GT(internalVarNum, 0); EXPECT_NEAR( - state->dataWeatherManager->TomorrowOutBaroPress(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).OutBaroPress, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowRelHum", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutRelHum(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).OutRelHum, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowWindSpd", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindSpeed(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).WindSpeed, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowWindDirect", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindDir(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).WindDir, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowSkyT", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TomorrowSkyTemp(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).SkyTemp, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowHorIR", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TomorrowHorizIRSky(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).HorizIRSky, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowBeamSol", 1); ASSERT_GT(internalVarNum, 0); EXPECT_NEAR( - state->dataWeatherManager->TomorrowBeamSolarRad(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).BeamSolarRad, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowDifSol", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TomorrowDifSolarRad(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR( + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).DifSolarRad, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowAlb", 1); ASSERT_GT(internalVarNum, 0); - EXPECT_NEAR(state->dataWeatherManager->TomorrowAlbedo(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).Albedo, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "TomorrowPrecip", 1); ASSERT_GT(internalVarNum, 0); EXPECT_NEAR( - state->dataWeatherManager->TomorrowLiquidPrecip(3, 5 + 1), state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); + state->dataWeather->wvarsHrTsTomorrow(3, 5 + 1).LiquidPrecip, state->dataRuntimeLang->ErlVariable(internalVarNum).Value.Number, 0.000001); } TEST_F(EnergyPlusFixture, EMS_ViewFactorToGround) @@ -2204,8 +2208,8 @@ TEST_F(EnergyPlusFixture, EMS_ViewFactorToGround) SimulationManager::ManageSimulation(*state); - int winSurfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); - int wallSurfNum = UtilityRoutines::FindItemInList("WALL", state->dataSurface->Surface); + int winSurfNum = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int wallSurfNum = Util::FindItemInList("WALL", state->dataSurface->Surface); bool anyRan; // Test 1 - Set day of year to 121 diff --git a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc index 23f4c31af37..b2644824466 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(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("January"))); - EXPECT_EQ(1, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("February"))); - EXPECT_EQ(2, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("March"))); - EXPECT_EQ(3, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("April"))); - EXPECT_EQ(4, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("May"))); - EXPECT_EQ(5, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("June"))); - EXPECT_EQ(6, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("July"))); - EXPECT_EQ(7, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("August"))); - EXPECT_EQ(8, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("September"))); - EXPECT_EQ(9, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("October"))); - EXPECT_EQ(10, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("November"))); - EXPECT_EQ(11, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("December"))); - EXPECT_EQ(-1, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("Hexember"))); + 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"))); } TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ExpressAsCashFlows) diff --git a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc index 083861b6892..f64ed8998a4 100644 --- a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc +++ b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc @@ -1078,7 +1078,7 @@ TEST_F(EnergyPlusFixture, Battery_LiIonNmc_Constructor) ASSERT_TRUE(process_idf(idf_objects)); ElectricStorage battery1{*state, "Battery1"}; - ASSERT_TRUE(UtilityRoutines::SameString(battery1.name(), "Battery1")); + ASSERT_TRUE(Util::SameString(battery1.name(), "Battery1")); ASSERT_THROW(ElectricStorage battery2(*state, "Battery2"), EnergyPlus::FatalError); std::string const error_string = delimited_string( diff --git a/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc b/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc index 27d583af9cc..f818009c8ff 100644 --- a/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc +++ b/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc @@ -85,7 +85,7 @@ TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModelTest) thisModel->developMesh(); // Setting weather data manually here - thisModel->weatherDataArray.dimension(state->dataWeatherManager->NumDaysInYear); + thisModel->weatherDataArray.dimension(state->dataWeather->NumDaysInYear); Real64 drybulb_minTemp = 5; Real64 drybulb_amp = 10; @@ -94,11 +94,11 @@ TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModelTest) Real64 solar_min = 100; Real64 solar_amp = 100; - for (int day = 1; day <= state->dataWeatherManager->NumDaysInYear; ++day) { + for (int day = 1; day <= state->dataWeather->NumDaysInYear; ++day) { auto &tdwd = thisModel->weatherDataArray(day); // "This day weather data" - Real64 theta = 2 * Constant::Pi * day / state->dataWeatherManager->NumDaysInYear; - Real64 omega = 2 * Constant::Pi * 130 / state->dataWeatherManager->NumDaysInYear; // Shifts min to around the end of Jan + Real64 theta = 2 * Constant::Pi * day / state->dataWeather->NumDaysInYear; + Real64 omega = 2 * Constant::Pi * 130 / state->dataWeather->NumDaysInYear; // Shifts min to around the end of Jan tdwd.dryBulbTemp = drybulb_amp * std::sin(theta - omega) + (drybulb_minTemp + drybulb_amp); tdwd.relativeHumidity = relHum_const; @@ -174,9 +174,9 @@ TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModel_GetWeather_NoWeather) TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModel_GetWeather_Weather) { - // I have to actually specify the RunPerod and SizingPeriods because in getWeatherData calls state->dataWeatherManager->GetNextEnvironment + // I have to actually specify the RunPerod and SizingPeriods because in getWeatherData calls state->dataWeather->GetNextEnvironment // I cannot hard set WeatherManager's GetBranchInputOneTimeFlag (in anonymous namespace) to false, - // so it'll end up calling >state->dataWeatherManager->ReadUserWeatherInput which calls the inputProcessor to set the NumOfEnvrn in particular. + // so it'll end up calling >state->dataWeather->ReadUserWeatherInput which calls the inputProcessor to set the NumOfEnvrn in particular. std::string const idf_objects = delimited_string({ "Timestep,4;" @@ -271,7 +271,7 @@ TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModel_GetWeather_Weather) ASSERT_TRUE(process_idf(idf_objects)); // Set an actual weather file to Chicago EPW - state->dataWeatherManager->WeatherFileExists = true; + state->dataWeather->WeatherFileExists = true; state->files.inputWeatherFilePath.filePath = fs::path(configured_source_directory()) / "weather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"; // Read the project data, such as Timestep @@ -286,9 +286,9 @@ TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModel_GetWeather_Weather) SimulationManager::SetupSimulation(*state, ErrorsFound); ASSERT_FALSE(ErrorsFound); - EXPECT_EQ(state->dataWeatherManager->NumOfEnvrn, 3); + EXPECT_EQ(state->dataWeather->NumOfEnvrn, 3); EXPECT_EQ(state->dataEnvrn->TotDesDays, 2); - EXPECT_EQ(state->dataWeatherManager->TotRunPers, 1); + EXPECT_EQ(state->dataWeather->TotRunPers, 1); std::shared_ptr thisModel(new EnergyPlus::FiniteDiffGroundTempsModel()); @@ -305,9 +305,9 @@ TEST_F(EnergyPlusFixture, FiniteDiffGroundTempModel_GetWeather_Weather) thisModel->getWeatherData(*state); // It should have reverted the added period - EXPECT_EQ(state->dataWeatherManager->NumOfEnvrn, 3); + EXPECT_EQ(state->dataWeather->NumOfEnvrn, 3); EXPECT_EQ(state->dataEnvrn->TotDesDays, 2); - EXPECT_EQ(state->dataWeatherManager->TotRunPers, 1); + EXPECT_EQ(state->dataWeather->TotRunPers, 1); // And should have populated a 365-day array of averages EXPECT_EQ(365u, thisModel->weatherDataArray.size()); diff --git a/tst/EnergyPlus/unit/General.unit.cc b/tst/EnergyPlus/unit/General.unit.cc index 2647365c951..9751ba815ab 100644 --- a/tst/EnergyPlus/unit/General.unit.cc +++ b/tst/EnergyPlus/unit/General.unit.cc @@ -415,19 +415,19 @@ TEST_F(EnergyPlusFixture, General_BetweenDateHoursLeftInclusive) int currentMonth = 5; int currentDay = 13; int currentHour = 8; - int currentDate = WeatherManager::computeJulianDate(currentYear, currentMonth, currentDay); + int currentDate = Weather::computeJulianDate(currentYear, currentMonth, currentDay); // neither end inclusive int startYear = 2018; int startMonth = 3; int startDay = 13; int startHour = 8; - int startDate = WeatherManager::computeJulianDate(startYear, startMonth, startDay); + int startDate = Weather::computeJulianDate(startYear, startMonth, startDay); int endYear = 2018; int endMonth = 5; int endDay = 13; int endHour = 9; - int endDate = WeatherManager::computeJulianDate(endYear, endMonth, endDay); + int endDate = Weather::computeJulianDate(endYear, endMonth, endDay); EXPECT_TRUE(BetweenDateHoursLeftInclusive(currentDate, currentHour, startDate, startHour, endDate, endHour)); // right inclusive @@ -435,12 +435,12 @@ TEST_F(EnergyPlusFixture, General_BetweenDateHoursLeftInclusive) startMonth = 3; startDay = 13; startHour = 8; - startDate = WeatherManager::computeJulianDate(startYear, startMonth, startDay); + startDate = Weather::computeJulianDate(startYear, startMonth, startDay); endYear = 2018; endMonth = 5; endDay = 13; endHour = 8; - endDate = WeatherManager::computeJulianDate(endYear, endMonth, endDay); + endDate = Weather::computeJulianDate(endYear, endMonth, endDay); EXPECT_TRUE(BetweenDateHoursLeftInclusive(currentDate, currentHour, startDate, startHour, endDate, endHour)); // not in the range @@ -448,12 +448,12 @@ TEST_F(EnergyPlusFixture, General_BetweenDateHoursLeftInclusive) startMonth = 6; startDay = 13; startHour = 8; - startDate = WeatherManager::computeJulianDate(startYear, startMonth, startDay); + startDate = Weather::computeJulianDate(startYear, startMonth, startDay); endYear = 2018; endMonth = 8; endDay = 13; endHour = 8; - endDate = WeatherManager::computeJulianDate(endYear, endMonth, endDay); + endDate = Weather::computeJulianDate(endYear, endMonth, endDay); EXPECT_FALSE(BetweenDateHoursLeftInclusive(currentDate, currentHour, startDate, startHour, endDate, endHour)); // left inclusive @@ -461,12 +461,12 @@ TEST_F(EnergyPlusFixture, General_BetweenDateHoursLeftInclusive) startMonth = 5; startDay = 13; startHour = 8; - startDate = WeatherManager::computeJulianDate(startYear, startMonth, startDay); + startDate = Weather::computeJulianDate(startYear, startMonth, startDay); endYear = 2018; endMonth = 7; endDay = 15; endHour = 2; - endDate = WeatherManager::computeJulianDate(endYear, endMonth, endDay); + endDate = Weather::computeJulianDate(endYear, endMonth, endDay); EXPECT_TRUE(BetweenDateHoursLeftInclusive(currentDate, currentHour, startDate, startHour, endDate, endHour)); // different year @@ -474,12 +474,12 @@ TEST_F(EnergyPlusFixture, General_BetweenDateHoursLeftInclusive) startMonth = 5; startDay = 13; startHour = 8; - startDate = WeatherManager::computeJulianDate(startYear, startMonth, startDay); + startDate = Weather::computeJulianDate(startYear, startMonth, startDay); endYear = 2019; endMonth = 2; endDay = 15; endHour = 2; - endDate = WeatherManager::computeJulianDate(endYear, endMonth, endDay); + endDate = Weather::computeJulianDate(endYear, endMonth, endDay); EXPECT_TRUE(BetweenDateHoursLeftInclusive(currentDate, currentHour, startDate, startHour, endDate, endHour)); // different year flipping the start and end @@ -487,38 +487,38 @@ TEST_F(EnergyPlusFixture, General_BetweenDateHoursLeftInclusive) startMonth = 2; startDay = 15; startHour = 2; - startDate = WeatherManager::computeJulianDate(startYear, startMonth, startDay); + startDate = Weather::computeJulianDate(startYear, startMonth, startDay); endYear = 2017; endMonth = 5; endDay = 13; endHour = 8; - endDate = WeatherManager::computeJulianDate(endYear, endMonth, endDay); + endDate = Weather::computeJulianDate(endYear, endMonth, endDay); EXPECT_TRUE(BetweenDateHoursLeftInclusive(currentDate, currentHour, startDate, startHour, endDate, endHour)); } TEST_F(EnergyPlusFixture, General_isReportPeriodBeginning) { - state->dataWeatherManager->TotReportPers = 1; - state->dataWeatherManager->ReportPeriodInput.allocate(state->dataWeatherManager->TotReportPers); + state->dataWeather->TotReportPers = 1; + state->dataWeather->ReportPeriodInput.allocate(state->dataWeather->TotReportPers); int periodIdx = 1; - state->dataWeatherManager->ReportPeriodInput(periodIdx).startYear = 0; - state->dataWeatherManager->ReportPeriodInput(periodIdx).startMonth = 1; - state->dataWeatherManager->ReportPeriodInput(periodIdx).startDay = 1; - state->dataWeatherManager->ReportPeriodInput(periodIdx).startHour = 8; - state->dataWeatherManager->ReportPeriodInput(periodIdx).startJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ReportPeriodInput(periodIdx).startYear, - state->dataWeatherManager->ReportPeriodInput(periodIdx).startMonth, - state->dataWeatherManager->ReportPeriodInput(periodIdx).startDay); - state->dataWeatherManager->ReportPeriodInput(periodIdx).endYear = 0; - state->dataWeatherManager->ReportPeriodInput(periodIdx).endMonth = 1; - state->dataWeatherManager->ReportPeriodInput(periodIdx).endDay = 3; - state->dataWeatherManager->ReportPeriodInput(periodIdx).endHour = 18; - state->dataWeatherManager->ReportPeriodInput(periodIdx).endJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ReportPeriodInput(periodIdx).endYear, - state->dataWeatherManager->ReportPeriodInput(periodIdx).endMonth, - state->dataWeatherManager->ReportPeriodInput(periodIdx).endDay); + state->dataWeather->ReportPeriodInput(periodIdx).startYear = 0; + state->dataWeather->ReportPeriodInput(periodIdx).startMonth = 1; + state->dataWeather->ReportPeriodInput(periodIdx).startDay = 1; + state->dataWeather->ReportPeriodInput(periodIdx).startHour = 8; + state->dataWeather->ReportPeriodInput(periodIdx).startJulianDate = + Weather::computeJulianDate(state->dataWeather->ReportPeriodInput(periodIdx).startYear, + state->dataWeather->ReportPeriodInput(periodIdx).startMonth, + state->dataWeather->ReportPeriodInput(periodIdx).startDay); + state->dataWeather->ReportPeriodInput(periodIdx).endYear = 0; + state->dataWeather->ReportPeriodInput(periodIdx).endMonth = 1; + state->dataWeather->ReportPeriodInput(periodIdx).endDay = 3; + state->dataWeather->ReportPeriodInput(periodIdx).endHour = 18; + state->dataWeather->ReportPeriodInput(periodIdx).endJulianDate = + Weather::computeJulianDate(state->dataWeather->ReportPeriodInput(periodIdx).endYear, + state->dataWeather->ReportPeriodInput(periodIdx).endMonth, + state->dataWeather->ReportPeriodInput(periodIdx).endDay); state->dataEnvrn->Year = 0; state->dataEnvrn->Month = 1; state->dataEnvrn->DayOfMonth = 1; @@ -547,45 +547,45 @@ TEST_F(EnergyPlusFixture, General_isReportPeriodBeginning) TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) { - state->dataWeatherManager->TotThermalReportPers = 2; - state->dataWeatherManager->ThermalReportPeriodInput.allocate(state->dataWeatherManager->TotThermalReportPers); + state->dataWeather->TotThermalReportPers = 2; + state->dataWeather->ThermalReportPeriodInput.allocate(state->dataWeather->TotThermalReportPers); // non-overlapping periods: 1/1 8:00:00 -- 1/10 18:00, 2/1 8:00 -- 3/10 18:00 - state->dataWeatherManager->ThermalReportPeriodInput(1).startYear = 0; - state->dataWeatherManager->ThermalReportPeriodInput(1).startMonth = 1; - state->dataWeatherManager->ThermalReportPeriodInput(1).startDay = 1; - state->dataWeatherManager->ThermalReportPeriodInput(1).startHour = 8; - state->dataWeatherManager->ThermalReportPeriodInput(1).startJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ThermalReportPeriodInput(1).startYear, - state->dataWeatherManager->ThermalReportPeriodInput(1).startMonth, - state->dataWeatherManager->ThermalReportPeriodInput(1).startDay); - state->dataWeatherManager->ThermalReportPeriodInput(1).endYear = 0; - state->dataWeatherManager->ThermalReportPeriodInput(1).endMonth = 1; - state->dataWeatherManager->ThermalReportPeriodInput(1).endDay = 10; - state->dataWeatherManager->ThermalReportPeriodInput(1).endHour = 18; - state->dataWeatherManager->ThermalReportPeriodInput(1).endJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ThermalReportPeriodInput(1).endYear, - state->dataWeatherManager->ThermalReportPeriodInput(1).endMonth, - state->dataWeatherManager->ThermalReportPeriodInput(1).endDay); - state->dataWeatherManager->ThermalReportPeriodInput(2).startYear = 0; - state->dataWeatherManager->ThermalReportPeriodInput(2).startMonth = 2; - state->dataWeatherManager->ThermalReportPeriodInput(2).startDay = 1; - state->dataWeatherManager->ThermalReportPeriodInput(2).startHour = 8; - state->dataWeatherManager->ThermalReportPeriodInput(2).startJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ThermalReportPeriodInput(2).startYear, - state->dataWeatherManager->ThermalReportPeriodInput(2).startMonth, - state->dataWeatherManager->ThermalReportPeriodInput(2).startDay); - state->dataWeatherManager->ThermalReportPeriodInput(2).endYear = 0; - state->dataWeatherManager->ThermalReportPeriodInput(2).endMonth = 3; - state->dataWeatherManager->ThermalReportPeriodInput(2).endDay = 10; - state->dataWeatherManager->ThermalReportPeriodInput(2).endHour = 18; - state->dataWeatherManager->ThermalReportPeriodInput(2).endJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ThermalReportPeriodInput(2).endYear, - state->dataWeatherManager->ThermalReportPeriodInput(2).endMonth, - state->dataWeatherManager->ThermalReportPeriodInput(2).endDay); + state->dataWeather->ThermalReportPeriodInput(1).startYear = 0; + state->dataWeather->ThermalReportPeriodInput(1).startMonth = 1; + state->dataWeather->ThermalReportPeriodInput(1).startDay = 1; + state->dataWeather->ThermalReportPeriodInput(1).startHour = 8; + state->dataWeather->ThermalReportPeriodInput(1).startJulianDate = + Weather::computeJulianDate(state->dataWeather->ThermalReportPeriodInput(1).startYear, + state->dataWeather->ThermalReportPeriodInput(1).startMonth, + state->dataWeather->ThermalReportPeriodInput(1).startDay); + state->dataWeather->ThermalReportPeriodInput(1).endYear = 0; + state->dataWeather->ThermalReportPeriodInput(1).endMonth = 1; + state->dataWeather->ThermalReportPeriodInput(1).endDay = 10; + state->dataWeather->ThermalReportPeriodInput(1).endHour = 18; + state->dataWeather->ThermalReportPeriodInput(1).endJulianDate = + Weather::computeJulianDate(state->dataWeather->ThermalReportPeriodInput(1).endYear, + state->dataWeather->ThermalReportPeriodInput(1).endMonth, + state->dataWeather->ThermalReportPeriodInput(1).endDay); + state->dataWeather->ThermalReportPeriodInput(2).startYear = 0; + state->dataWeather->ThermalReportPeriodInput(2).startMonth = 2; + state->dataWeather->ThermalReportPeriodInput(2).startDay = 1; + state->dataWeather->ThermalReportPeriodInput(2).startHour = 8; + state->dataWeather->ThermalReportPeriodInput(2).startJulianDate = + Weather::computeJulianDate(state->dataWeather->ThermalReportPeriodInput(2).startYear, + state->dataWeather->ThermalReportPeriodInput(2).startMonth, + state->dataWeather->ThermalReportPeriodInput(2).startDay); + state->dataWeather->ThermalReportPeriodInput(2).endYear = 0; + state->dataWeather->ThermalReportPeriodInput(2).endMonth = 3; + state->dataWeather->ThermalReportPeriodInput(2).endDay = 10; + state->dataWeather->ThermalReportPeriodInput(2).endHour = 18; + state->dataWeather->ThermalReportPeriodInput(2).endJulianDate = + Weather::computeJulianDate(state->dataWeather->ThermalReportPeriodInput(2).endYear, + state->dataWeather->ThermalReportPeriodInput(2).endMonth, + state->dataWeather->ThermalReportPeriodInput(2).endDay); Array1D_bool reportPeriodFlags; - reportPeriodFlags.allocate(state->dataWeatherManager->TotThermalReportPers); + reportPeriodFlags.allocate(state->dataWeather->TotThermalReportPers); // before the start of first period state->dataEnvrn->Year = 0; @@ -593,8 +593,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 1; state->dataGlobal->HourOfDay = 5; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_FALSE(reportPeriodFlags(1)); EXPECT_FALSE(reportPeriodFlags(2)); @@ -604,8 +603,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 8; state->dataGlobal->HourOfDay = 6; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_TRUE(reportPeriodFlags(1)); EXPECT_FALSE(reportPeriodFlags(2)); @@ -615,8 +613,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 15; state->dataGlobal->HourOfDay = 21; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_FALSE(reportPeriodFlags(1)); EXPECT_FALSE(reportPeriodFlags(2)); @@ -626,8 +623,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 1; state->dataGlobal->HourOfDay = 11; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_FALSE(reportPeriodFlags(1)); EXPECT_TRUE(reportPeriodFlags(2)); @@ -637,20 +633,19 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 1; state->dataGlobal->HourOfDay = 11; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_FALSE(reportPeriodFlags(1)); EXPECT_FALSE(reportPeriodFlags(2)); // overlapping periods: 1/1 8:00:00 -- 2/10 18:00, 2/1 8:00 -- 3/10 18:00 - state->dataWeatherManager->ThermalReportPeriodInput(1).endYear = 0; - state->dataWeatherManager->ThermalReportPeriodInput(1).endMonth = 2; - state->dataWeatherManager->ThermalReportPeriodInput(1).endDay = 10; - state->dataWeatherManager->ThermalReportPeriodInput(1).endHour = 18; - state->dataWeatherManager->ThermalReportPeriodInput(1).endJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ThermalReportPeriodInput(1).endYear, - state->dataWeatherManager->ThermalReportPeriodInput(1).endMonth, - state->dataWeatherManager->ThermalReportPeriodInput(1).endDay); + state->dataWeather->ThermalReportPeriodInput(1).endYear = 0; + state->dataWeather->ThermalReportPeriodInput(1).endMonth = 2; + state->dataWeather->ThermalReportPeriodInput(1).endDay = 10; + state->dataWeather->ThermalReportPeriodInput(1).endHour = 18; + state->dataWeather->ThermalReportPeriodInput(1).endJulianDate = + Weather::computeJulianDate(state->dataWeather->ThermalReportPeriodInput(1).endYear, + state->dataWeather->ThermalReportPeriodInput(1).endMonth, + state->dataWeather->ThermalReportPeriodInput(1).endDay); // before the start of first period state->dataEnvrn->Year = 0; @@ -658,8 +653,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 1; state->dataGlobal->HourOfDay = 5; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_FALSE(reportPeriodFlags(1)); EXPECT_FALSE(reportPeriodFlags(2)); @@ -669,8 +663,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 8; state->dataGlobal->HourOfDay = 6; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_TRUE(reportPeriodFlags(1)); EXPECT_FALSE(reportPeriodFlags(2)); @@ -680,8 +673,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 5; state->dataGlobal->HourOfDay = 21; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_TRUE(reportPeriodFlags(1)); EXPECT_TRUE(reportPeriodFlags(2)); @@ -691,8 +683,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 1; state->dataGlobal->HourOfDay = 11; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_FALSE(reportPeriodFlags(1)); EXPECT_TRUE(reportPeriodFlags(2)); @@ -702,8 +693,7 @@ TEST_F(EnergyPlusFixture, General_findReportPeriodIdx) state->dataEnvrn->DayOfMonth = 1; state->dataGlobal->HourOfDay = 11; reportPeriodFlags = false; - findReportPeriodIdx( - *state, state->dataWeatherManager->ThermalReportPeriodInput, state->dataWeatherManager->TotThermalReportPers, reportPeriodFlags); + findReportPeriodIdx(*state, state->dataWeather->ThermalReportPeriodInput, state->dataWeather->TotThermalReportPers, reportPeriodFlags); EXPECT_FALSE(reportPeriodFlags(1)); EXPECT_FALSE(reportPeriodFlags(2)); } diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index 196eb196669..28d52fffba3 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -1741,7 +1741,7 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateOneZone) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); TestAirPathIntegrity(*state, ErrorsFound); // Needed to initialize return node connections to airloops and inlet nodes SimulationManager::SetupSimulation(*state, ErrorsFound); state->dataGlobal->KickOffSimulation = false; @@ -3320,7 +3320,7 @@ TEST_F(EnergyPlusFixture, Beam_fatalWhenSysSizingOff) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); ASSERT_ANY_THROW(SimulationManager::SetupSimulation(*state, ErrorsFound)); } @@ -4817,7 +4817,7 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateHighOA) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); TestAirPathIntegrity(*state, ErrorsFound); // Needed to initialize return node connections to airloops and inlet nodes SimulationManager::SetupSimulation(*state, ErrorsFound); state->dataGlobal->KickOffSimulation = false; diff --git a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc index c1df18d47ce..6a603565676 100644 --- a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc +++ b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc @@ -531,8 +531,8 @@ TEST_F(EnergyPlusFixture, HXAssistCCUnitarySystem_VStest1) // coil system delta T > 0, coil system inlet node = 8, outlet node = 4 int coilSystemInletNode = thisSys->CoolCoilInletNodeNum; int coilSystemOutletNode = thisSys->CoolCoilOutletNodeNum; - int coolCoilInletHXSupplyOutlet = UtilityRoutines::FindItemInList("HEAT RECOVERY SUPPLY OUTLET", state->dataLoopNodes->NodeID); - int coolCoilOutletHXExhaustInlet = UtilityRoutines::FindItemInList("HEAT RECOVERY EXHUAST INLET NODE", state->dataLoopNodes->NodeID); + int coolCoilInletHXSupplyOutlet = Util::FindItemInList("HEAT RECOVERY SUPPLY OUTLET", state->dataLoopNodes->NodeID); + int coolCoilOutletHXExhaustInlet = Util::FindItemInList("HEAT RECOVERY EXHUAST INLET NODE", state->dataLoopNodes->NodeID); EXPECT_LT(state->dataLoopNodes->Node(coilSystemOutletNode).Temp, state->dataLoopNodes->Node(coilSystemInletNode).Temp); // coil delta T > 0, cooling coil inlet node = 6, cooling coil outlet node = 7 EXPECT_LT(state->dataLoopNodes->Node(coolCoilOutletHXExhaustInlet).Temp, state->dataLoopNodes->Node(coolCoilInletHXSupplyOutlet).Temp); diff --git a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc index dd7470268fa..94887fb46c8 100644 --- a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc @@ -2207,13 +2207,13 @@ TEST_F(EnergyPlusFixture, HVACMSHP_UnitarySystemElectricityRateTest) state->dataEnvrn->OutBaroPress = 101325.0; // set zone air conditions auto &zoneAirNode = - state->dataLoopNodes->Node(UtilityRoutines::FindItemInList("Z401 AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); + state->dataLoopNodes->Node(Util::FindItemInList("Z401 AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); zoneAirNode.Temp = 21.1; zoneAirNode.HumRat = 0.0035; zoneAirNode.Enthalpy = Psychrometrics::PsyHFnTdbW(zoneAirNode.Temp, zoneAirNode.HumRat); // set maixed air node conditions - auto &mixedAirNode = state->dataLoopNodes->Node( - UtilityRoutines::FindItemInList("AC-24 SF INLET AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); + auto &mixedAirNode = + state->dataLoopNodes->Node(Util::FindItemInList("AC-24 SF INLET AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); mixedAirNode.Temp = 10.0; mixedAirNode.HumRat = 0.005; mixedAirNode.Enthalpy = Psychrometrics::PsyHFnTdbW(mixedAirNode.Temp, mixedAirNode.HumRat); diff --git a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc index 845bc5ac46a..1c61b976cd9 100644 --- a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc @@ -67,7 +67,6 @@ using namespace EnergyPlus; using namespace DataPlant; using namespace DataSizing; using namespace OutputReportPredefined; -using namespace WeatherManager; using namespace DataLoopNode; using namespace OutputProcessor; using namespace DataHVACGlobals; @@ -80,13 +79,13 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture EnergyPlusFixture::SetUp(); // Sets up the base fixture first. // setup weather manager state needed - state->dataWeatherManager->NumOfEnvrn = 2; - state->dataWeatherManager->Environment.allocate(state->dataWeatherManager->NumOfEnvrn); - state->dataWeatherManager->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(1).DesignDayNum = 1; + state->dataWeather->NumOfEnvrn = 2; + state->dataWeather->Environment.allocate(state->dataWeather->NumOfEnvrn); + state->dataWeather->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(1).DesignDayNum = 1; - state->dataWeatherManager->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(2).DesignDayNum = 2; + state->dataWeather->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(2).DesignDayNum = 2; // setup plant sizing data structure state->dataSize->NumPltSizInput = 1; @@ -122,7 +121,7 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture SetupTimePointers(*state, OutputProcessor::SOVTimeStepType::HVAC, state->dataHVACGlobal->TimeStepSys); state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->TimeStepFraction = 1.0 / double(state->dataGlobal->NumOfTimeStepInHour); + state->dataWeather->TimeStepFraction = 1.0 / double(state->dataGlobal->NumOfTimeStepInHour); state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).TimeStep = &state->dataGlobal->TimeStepZone; state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0; // init @@ -143,23 +142,23 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) // calls code related to coincident plant sizing with HVAC sizing simulation // this test runs 3 system timesteps for each zone timestep - state->dataWeatherManager->Environment.deallocate(); + state->dataWeather->Environment.deallocate(); // setup weather manager state needed - state->dataWeatherManager->NumOfEnvrn = 4; - state->dataWeatherManager->Environment.allocate(state->dataWeatherManager->NumOfEnvrn); - state->dataWeatherManager->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(1).DesignDayNum = 1; + state->dataWeather->NumOfEnvrn = 4; + state->dataWeather->Environment.allocate(state->dataWeather->NumOfEnvrn); + state->dataWeather->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(1).DesignDayNum = 1; - state->dataWeatherManager->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(2).DesignDayNum = 2; + state->dataWeather->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(2).DesignDayNum = 2; - state->dataWeatherManager->Environment(3).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; - state->dataWeatherManager->Environment(3).DesignDayNum = 0; - state->dataWeatherManager->Environment(3).TotalDays = 4; + state->dataWeather->Environment(3).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; + state->dataWeather->Environment(3).DesignDayNum = 0; + state->dataWeather->Environment(3).TotalDays = 4; - state->dataWeatherManager->Environment(4).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; - state->dataWeatherManager->Environment(4).DesignDayNum = 0; - state->dataWeatherManager->Environment(4).TotalDays = 4; + state->dataWeather->Environment(4).KindOfEnvrn = Constant::KindOfSim::RunPeriodDesign; + state->dataWeather->Environment(4).DesignDayNum = 0; + state->dataWeather->Environment(4).TotalDays = 4; HVACSizingSimulationManager testSizeSimManagerObj; @@ -169,9 +168,9 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) testSizeSimManagerObj.SetupSizingAnalyses(*state); - EXPECT_EQ(4, state->dataWeatherManager->NumOfEnvrn); - AddDesignSetToEnvironmentStruct(*state, 1); - EXPECT_EQ(8, state->dataWeatherManager->NumOfEnvrn); + EXPECT_EQ(4, state->dataWeather->NumOfEnvrn); + Weather::AddDesignSetToEnvironmentStruct(*state, 1); + EXPECT_EQ(8, state->dataWeather->NumOfEnvrn); // now fill with three system timesteps for each zone timestep state->dataGlobal->TimeStepZone = 15.0 / 60.0; @@ -182,8 +181,8 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) // first HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 5; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 1; + state->dataWeather->Envrn = 5; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 1; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... @@ -208,9 +207,9 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) // second HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 6; + state->dataWeather->Envrn = 6; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 2; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0.0; @@ -235,7 +234,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) // first HVAC Sizing Simulation WeatherFileDays emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeRunPeriodDesign; state->dataGlobal->DayOfSim = 0; - state->dataWeatherManager->Envrn = 7; + state->dataWeather->Envrn = 7; state->dataGlobal->NumOfDayInEnvrn = 4; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); while (state->dataGlobal->DayOfSim < state->dataGlobal->NumOfDayInEnvrn) { @@ -264,7 +263,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) // second HVAC Sizing Simulation WEatherFileDAys emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeRunPeriodDesign; state->dataGlobal->DayOfSim = 0; - state->dataWeatherManager->Envrn = 8; + state->dataWeather->Envrn = 8; state->dataGlobal->NumOfDayInEnvrn = 4; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); while (state->dataGlobal->DayOfSim < state->dataGlobal->NumOfDayInEnvrn) { @@ -358,13 +357,13 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) .ztStepObj[96] .runningAvgDataValue); - // first timestep of third sizing state->dataWeatherManager->Environment WeatherFileDays + // first timestep of third sizing state->dataWeather->Environment WeatherFileDays EXPECT_DOUBLE_EQ(0.1, testSizeSimManagerObj.sizingLogger.logObjs[testSizeSimManagerObj.plantCoincAnalyObjs[0].supplyInletNodeFlow_LogIndex] .ztStepObj[192] .runningAvgDataValue); - // first timestep of fourth sizing state->dataWeatherManager->Environment WeatherFileDays + // first timestep of fourth sizing state->dataWeather->Environment WeatherFileDays EXPECT_DOUBLE_EQ(0.1, testSizeSimManagerObj.sizingLogger.logObjs[testSizeSimManagerObj.plantCoincAnalyObjs[0].supplyInletNodeFlow_LogIndex] .ztStepObj[576] @@ -385,10 +384,10 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) testSizeSimManagerObj.SetupSizingAnalyses(*state); - EXPECT_EQ(2, state->dataWeatherManager->NumOfEnvrn); - AddDesignSetToEnvironmentStruct(*state, 1); + EXPECT_EQ(2, state->dataWeather->NumOfEnvrn); + Weather::AddDesignSetToEnvironmentStruct(*state, 1); - EXPECT_EQ(4, state->dataWeatherManager->NumOfEnvrn); + EXPECT_EQ(4, state->dataWeather->NumOfEnvrn); // now fill with three system timesteps for each zone timestep state->dataGlobal->TimeStepZone = 15.0 / 60.0; @@ -399,8 +398,8 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) // first HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 3; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 1; + state->dataWeather->Envrn = 3; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 1; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0.0; @@ -424,8 +423,8 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) // second HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 4; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 2; + state->dataWeather->Envrn = 4; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0.0; @@ -533,9 +532,9 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) testSizeSimManagerObj.SetupSizingAnalyses(*state); - EXPECT_EQ(2, state->dataWeatherManager->NumOfEnvrn); - AddDesignSetToEnvironmentStruct(*state, 1); - EXPECT_EQ(4, state->dataWeatherManager->NumOfEnvrn); + EXPECT_EQ(2, state->dataWeather->NumOfEnvrn); + Weather::AddDesignSetToEnvironmentStruct(*state, 1); + EXPECT_EQ(4, state->dataWeather->NumOfEnvrn); // now fill with one system timesteps for each zone timestep state->dataGlobal->TimeStepZone = 15.0 / 60.0; @@ -546,8 +545,8 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) // first HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 3; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 1; + state->dataWeather->Envrn = 3; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 1; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0.0; @@ -573,8 +572,8 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) // second HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 4; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 2; + state->dataWeather->Envrn = 4; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0.0; @@ -622,9 +621,9 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) testSizeSimManagerObj.SetupSizingAnalyses(*state); - EXPECT_EQ(2, state->dataWeatherManager->NumOfEnvrn); - AddDesignSetToEnvironmentStruct(*state, 1); - EXPECT_EQ(4, state->dataWeatherManager->NumOfEnvrn); + EXPECT_EQ(2, state->dataWeather->NumOfEnvrn); + Weather::AddDesignSetToEnvironmentStruct(*state, 1); + EXPECT_EQ(4, state->dataWeather->NumOfEnvrn); // now fill with one system timesteps for each zone timestep state->dataGlobal->TimeStepZone = 15.0 / 60.0; @@ -635,8 +634,8 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) // first HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 3; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 1; + state->dataWeather->Envrn = 3; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 1; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0.0; @@ -666,8 +665,8 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) // second HVAC Sizing Simulation DD emulation state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; - state->dataWeatherManager->Envrn = 4; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 2; + state->dataWeather->Envrn = 4; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(*state); for (state->dataGlobal->HourOfDay = 1; state->dataGlobal->HourOfDay <= 24; ++state->dataGlobal->HourOfDay) { // Begin hour loop ... state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::Zone).CurMinute = 0.0; diff --git a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc index 1ced5e6289d..7f3ef4dc76b 100644 --- a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc +++ b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc @@ -1696,7 +1696,7 @@ TEST_F(EnergyPlusFixture, UnitaryBypassVAV_ParentElectricityRateTest) auto &BypassVAV = state->dataHVACUnitaryBypassVAV->CBVAV(1); // set zone air conditions auto &zoneAirNode = - state->dataLoopNodes->Node(UtilityRoutines::FindItemInList("ZONE 1 NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); + state->dataLoopNodes->Node(Util::FindItemInList("ZONE 1 NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); zoneAirNode.Temp = 20.0; zoneAirNode.HumRat = 0.005; zoneAirNode.Enthalpy = Psychrometrics::PsyHFnTdbW(zoneAirNode.Temp, zoneAirNode.HumRat); @@ -1706,8 +1706,8 @@ TEST_F(EnergyPlusFixture, UnitaryBypassVAV_ParentElectricityRateTest) airInNode.HumRat = 0.005; airInNode.Enthalpy = Psychrometrics::PsyHFnTdbW(airInNode.Temp, airInNode.HumRat); // set outside air inlet node - auto &oaMixerAirInletNode = state->dataLoopNodes->Node( - UtilityRoutines::FindItemInList("OUTSIDE AIR INLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); + auto &oaMixerAirInletNode = + state->dataLoopNodes->Node(Util::FindItemInList("OUTSIDE AIR INLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); // auto &oaMixerAirInletNode = state->dataLoopNodes->Node(state->dataMixedAir->OAMixer(1).InletNode); oaMixerAirInletNode.Temp = state->dataEnvrn->OutDryBulbTemp; oaMixerAirInletNode.HumRat = state->dataEnvrn->OutHumRat; diff --git a/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc index 3ef0a3e3ebd..931f2a4753c 100644 --- a/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc @@ -401,11 +401,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceAirManager_GetInfiltrationAndVentilation) Real64 constexpr Zone2FloorArea = 1000.0; // Zone and space nums - int const zone1 = UtilityRoutines::FindItemInList("ZONE 1", state->dataHeatBal->Zone); - int const zone2 = UtilityRoutines::FindItemInList("ZONE 2", state->dataHeatBal->Zone); - int const space1a = UtilityRoutines::FindItemInList("SPACE 1A", state->dataHeatBal->space); - int const space1b = UtilityRoutines::FindItemInList("SPACE 1B", state->dataHeatBal->space); - int const spaceZone2 = UtilityRoutines::FindItemInList("ZONE 2", state->dataHeatBal->space); + int const zone1 = Util::FindItemInList("ZONE 1", state->dataHeatBal->Zone); + int const zone2 = Util::FindItemInList("ZONE 2", state->dataHeatBal->Zone); + int const space1a = Util::FindItemInList("SPACE 1A", state->dataHeatBal->space); + int const space1b = Util::FindItemInList("SPACE 1B", state->dataHeatBal->space); + int const spaceZone2 = Util::FindItemInList("ZONE 2", state->dataHeatBal->space); int zoneNum = zone1; EXPECT_EQ("ZONE 1", state->dataHeatBal->Zone(zoneNum).Name); @@ -501,9 +501,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(UtilityRoutines::SameString(infilNames[itemNum], thisInfiltration.Name)); + EXPECT_TRUE(Util::SameString(infilNames[itemNum], thisInfiltration.Name)); EXPECT_EQ(thisInfiltration.DesignLevel, flows[itemNum]); - EXPECT_TRUE(UtilityRoutines::SameString(ventNames[itemNum], thisVentilation.Name)); + EXPECT_TRUE(Util::SameString(ventNames[itemNum], thisVentilation.Name)); EXPECT_EQ(thisVentilation.DesignLevel, flows[itemNum]); EXPECT_EQ(thisInfiltration.ZonePtr, zoneNums[itemNum]); EXPECT_EQ(thisVentilation.ZonePtr, zoneNums[itemNum]); @@ -788,11 +788,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceAirManager_GetMixingAndCrossMixing) Real64 constexpr Zone2FloorArea = 1000.0; // Zone and space nums - int const zone1 = UtilityRoutines::FindItemInList("ZONE 1", state->dataHeatBal->Zone); - int const zone2 = UtilityRoutines::FindItemInList("ZONE 2", state->dataHeatBal->Zone); - int const space1a = UtilityRoutines::FindItemInList("SPACE 1A", state->dataHeatBal->space); - int const space1b = UtilityRoutines::FindItemInList("SPACE 1B", state->dataHeatBal->space); - int const spaceZone2 = UtilityRoutines::FindItemInList("ZONE 2", state->dataHeatBal->space); + int const zone1 = Util::FindItemInList("ZONE 1", state->dataHeatBal->Zone); + int const zone2 = Util::FindItemInList("ZONE 2", state->dataHeatBal->Zone); + int const space1a = Util::FindItemInList("SPACE 1A", state->dataHeatBal->space); + int const space1b = Util::FindItemInList("SPACE 1B", state->dataHeatBal->space); + int const spaceZone2 = Util::FindItemInList("ZONE 2", state->dataHeatBal->space); int zoneNum = zone1; EXPECT_EQ("ZONE 1", state->dataHeatBal->Zone(zoneNum).Name); @@ -867,9 +867,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(UtilityRoutines::SameString(mixNames[itemNum], thisMixing.Name)); + EXPECT_TRUE(Util::SameString(mixNames[itemNum], thisMixing.Name)); EXPECT_EQ(thisMixing.DesignLevel, flows[itemNum]); - EXPECT_TRUE(UtilityRoutines::SameString(crossMixNames[itemNum], thisCrossMixing.Name)); + EXPECT_TRUE(Util::SameString(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 49733bb43c3..6f4f3341249 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -506,17 +506,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); @@ -608,17 +608,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest2) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); @@ -707,17 +707,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest3) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); @@ -809,17 +809,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest4) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + Util::FindItemInList(Util::makeUPPER("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); diff --git a/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc index e9acfb57713..fd17bc16cc3 100644 --- a/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc @@ -208,7 +208,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult1 = kv1.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult1, zoneAssumedTemperature1 + Constant::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult1, zoneAssumedTemperature1 + Constant::Kelvin, 0.001); // Test using default Initial Indoor Temperature with Cooling/Heating Setpoints of 24C/20C @@ -223,7 +223,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult2 = kv2.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult2, heatingSetpoint2 + Constant::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult2, heatingSetpoint2 + Constant::Kelvin, 0.001); // Test using default Initial Indoor Temperature with Cooling/Heating Setpoints of 100C/-100C @@ -241,7 +241,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult3 = kv3.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult3, heatingSetpoint3 + Constant::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult3, heatingSetpoint3 + Constant::Kelvin, 0.001); // Test Initial Indoor Temperature input of 15C with Cooling/Heating Setpoints of 100C/-100C @@ -258,7 +258,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs) Real64 expectedResult4 = kv4.instance.bcs->slabConvectiveTemp; - EXPECT_NEAR(expectedResult4, zoneAssumedTemperature4 + Constant::KelvinConv, 0.001); + EXPECT_NEAR(expectedResult4, zoneAssumedTemperature4 + Constant::Kelvin, 0.001); } TEST_F(EnergyPlusFixture, HeatBalanceKiva_setupKivaInstances_ThermalComfort) @@ -718,14 +718,14 @@ TEST_F(EnergyPlusFixture, OpaqueSkyCover_InterpretWeatherMissingOpaqueSkyCover) // SUBROUTINE LOCAL VARIABLE DECLARATIONS: state->files.inputWeatherFilePath.filePath = configured_source_directory() / "tst/EnergyPlus/unit/Resources/HeatBalanceKivaManagerOSkyTest.epw"; - state->dataWeatherManager->Missing.OpaqSkyCvr = 5; + state->dataWeather->wvarsMissing.OpaqueSkyCover = 5; HeatBalanceKivaManager::KivaManager km; km.readWeatherData(*state); Real64 TDewK = 264.25; Real64 expected_OSky = 5; - Real64 expected_ESky = (0.787 + 0.764 * std::log(TDewK / Constant::KelvinConv)) * + Real64 expected_ESky = (0.787 + 0.764 * std::log(TDewK / Constant::Kelvin)) * (1.0 + 0.0224 * expected_OSky - 0.0035 * pow_2(expected_OSky) + 0.00028 * pow_3(expected_OSky)); EXPECT_NEAR(expected_ESky, km.kivaWeather.skyEmissivity[0], 0.01); diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 41f13b20112..cd6928b6846 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -1580,19 +1580,19 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_EMSConstructionTest) // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(*state); state->dataGlobal->DayOfSim = 2; // avoid array bounds problem in RecKeepHeatBalance - state->dataWeatherManager->Envrn = 1; + state->dataWeather->Envrn = 1; // Test 1 - Set time of day to morning - should use high transmittance window state->dataGlobal->TimeStep = 1; state->dataGlobal->HourOfDay = 11; state->dataGlobal->CurrentTime = 11.0; - WeatherManager::SetCurrentWeather(*state); + Weather::SetCurrentWeather(*state); HeatBalanceManager::ManageHeatBalance(*state); // For now, must call this twice in order to hit the BeginTimeStepBeforePredictor EMS calling point HeatBalanceManager::ManageHeatBalance(*state); // Find the fenestration surface - int winSurfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); - int win1ConstNum = UtilityRoutines::FindItemInList("WINDOWCONSTRUCTION1", state->dataConstruction->Construct); + int winSurfNum = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int win1ConstNum = Util::FindItemInList("WINDOWCONSTRUCTION1", state->dataConstruction->Construct); EXPECT_EQ(state->dataSurface->Surface(winSurfNum).Construction, win1ConstNum); Real64 transSol = state->dataSurface->SurfWinSysSolTransmittance(winSurfNum); EXPECT_GT(transSol, 0.8); @@ -1603,11 +1603,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_EMSConstructionTest) state->dataGlobal->TimeStep = 1; state->dataGlobal->HourOfDay = 14; state->dataGlobal->CurrentTime = 14.0; - WeatherManager::SetCurrentWeather(*state); + Weather::SetCurrentWeather(*state); HeatBalanceManager::ManageHeatBalance(*state); // For now, must call this twice in order to hit the BeginTimeStepBeforePredictor EMS calling point HeatBalanceManager::ManageHeatBalance(*state); - int win2ConstNum = UtilityRoutines::FindItemInList("WINDOWCONSTRUCTION2", state->dataConstruction->Construct); + int win2ConstNum = Util::FindItemInList("WINDOWCONSTRUCTION2", state->dataConstruction->Construct); EXPECT_EQ(state->dataSurface->Surface(winSurfNum).Construction, win2ConstNum); transSol = state->dataSurface->SurfWinSysSolTransmittance(winSurfNum); EXPECT_LT(transSol, 0.2); @@ -1814,8 +1814,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData) EXPECT_EQ(state->dataHeatBal->TotConstructs, 2); - int constrNum = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Grouped Air Boundary"), state->dataConstruction->Construct); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataConstruction->Construct(constrNum).Name, "Grouped Air Boundary")); + int constrNum = Util::FindItemInList(Util::makeUPPER("Grouped Air Boundary"), state->dataConstruction->Construct); + EXPECT_TRUE(Util::SameString(state->dataConstruction->Construct(constrNum).Name, "Grouped Air Boundary")); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundary); EXPECT_FALSE(state->dataConstruction->Construct(constrNum).IsUsedCTF); EXPECT_FALSE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundaryMixing); @@ -1824,9 +1824,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData) EXPECT_EQ(state->dataConstruction->Construct(constrNum).AirBoundaryMixingSched, 0); EXPECT_EQ(state->dataHeatBal->NominalRforNominalUCalculation(constrNum), 0.0); - constrNum = - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Air Boundary with Good Mixing Schedule"), state->dataConstruction->Construct); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataConstruction->Construct(constrNum).Name, "Air Boundary with Good Mixing Schedule")); + constrNum = Util::FindItemInList(Util::makeUPPER("Air Boundary with Good Mixing Schedule"), state->dataConstruction->Construct); + EXPECT_TRUE(Util::SameString(state->dataConstruction->Construct(constrNum).Name, "Air Boundary with Good Mixing Schedule")); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundary); EXPECT_FALSE(state->dataConstruction->Construct(constrNum).IsUsedCTF); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundaryMixing); @@ -1875,9 +1874,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData2) EXPECT_EQ(state->dataHeatBal->TotConstructs, 1); - int constrNum = - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Air Boundary with Bad Mixing Schedule"), state->dataConstruction->Construct); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataConstruction->Construct(constrNum).Name, "Air Boundary with Bad Mixing Schedule")); + int constrNum = Util::FindItemInList(Util::makeUPPER("Air Boundary with Bad Mixing Schedule"), state->dataConstruction->Construct); + EXPECT_TRUE(Util::SameString(state->dataConstruction->Construct(constrNum).Name, "Air Boundary with Bad Mixing Schedule")); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundary); EXPECT_FALSE(state->dataConstruction->Construct(constrNum).IsUsedCTF); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundaryMixing); @@ -2176,7 +2174,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_EMSConstructionSwitchTest) SimulationManager::ManageSimulation(*state); - int surfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); EXPECT_EQ(state->dataSurface->Surface(surfNum).Construction, state->dataSurface->SurfEMSConstructionOverrideValue(surfNum)); EXPECT_TRUE(state->dataSurface->SurfEMSConstructionOverrideON(surfNum)); } diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 49be281b3fd..9fc4785c0f5 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -1280,7 +1280,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI ScheduleManager::ProcessScheduleInput(*state); // read schedules state->files.inputWeatherFilePath.filePath = configured_source_directory() / "tst/EnergyPlus/unit/Resources/HeatBalanceKivaManagerOSkyTest.epw"; - state->dataWeatherManager->WeatherFileExists = true; + state->dataWeather->WeatherFileExists = true; HeatBalanceManager::GetHeatBalanceInput(*state); state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0; @@ -2501,21 +2501,19 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) EXPECT_DOUBLE_EQ(0.25, state->dataSurface->Surface(3).ViewFactorSkyIR); EXPECT_DOUBLE_EQ(0.25, state->dataSurface->Surface(3).ViewFactorGroundIR); // Test if sky and grd view factor and temperature correctly overwritten - EXPECT_DOUBLE_EQ( - (Constant::StefanBoltzmann * 0.9 * 0.3 * (pow_4(20.0 + Constant::KelvinConv) - pow_4(15.0 + Constant::KelvinConv)) / (20.0 - 15.0)), - state->dataHeatBalSurf->SurfHSkyExt(1)); - EXPECT_DOUBLE_EQ( - (Constant::StefanBoltzmann * 0.9 * 0.1 * (pow_4(20.0 + Constant::KelvinConv) - pow_4(22.0 + Constant::KelvinConv)) / (20.0 - 22.0)), - state->dataHeatBalSurf->SurfHGrdExt(1)); + EXPECT_DOUBLE_EQ((Constant::StefanBoltzmann * 0.9 * 0.3 * (pow_4(20.0 + Constant::Kelvin) - pow_4(15.0 + Constant::Kelvin)) / (20.0 - 15.0)), + state->dataHeatBalSurf->SurfHSkyExt(1)); + EXPECT_DOUBLE_EQ((Constant::StefanBoltzmann * 0.9 * 0.1 * (pow_4(20.0 + Constant::Kelvin) - pow_4(22.0 + Constant::Kelvin)) / (20.0 - 22.0)), + state->dataHeatBalSurf->SurfHGrdExt(1)); // Test if LWR from surrounding surfaces correctly calculated - EXPECT_DOUBLE_EQ(Constant::StefanBoltzmann * 0.9 * 0.6 * (pow_4(25.0 + Constant::KelvinConv) - pow_4(20.0 + Constant::KelvinConv)), + EXPECT_DOUBLE_EQ(Constant::StefanBoltzmann * 0.9 * 0.6 * (pow_4(25.0 + Constant::Kelvin) - pow_4(20.0 + Constant::Kelvin)), state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs(1)); EXPECT_DOUBLE_EQ(Constant::StefanBoltzmann * 0.9 * - (0.3 * (pow_4(25.0 + Constant::KelvinConv) - pow_4(20.0 + Constant::KelvinConv)) + - 0.3 * (pow_4(25.0 + Constant::KelvinConv) - pow_4(20.0 + Constant::KelvinConv))), + (0.3 * (pow_4(25.0 + Constant::Kelvin) - pow_4(20.0 + Constant::Kelvin)) + + 0.3 * (pow_4(25.0 + Constant::Kelvin) - pow_4(20.0 + Constant::Kelvin))), state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs(2)); - EXPECT_DOUBLE_EQ(Constant::StefanBoltzmann * 0.9 * 0.5 * (pow_4(25.0 + Constant::KelvinConv) - pow_4(20.0 + Constant::KelvinConv)), + EXPECT_DOUBLE_EQ(Constant::StefanBoltzmann * 0.9 * 0.5 * (pow_4(25.0 + Constant::Kelvin) - pow_4(20.0 + Constant::Kelvin)), state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs(3)); EXPECT_DOUBLE_EQ(0.0, state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs(4)); } @@ -3728,15 +3726,15 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestThermalResilienceReportR ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - state->dataWeatherManager->TotReportPers = 2; + state->dataWeather->TotReportPers = 2; - WeatherManager::GetReportPeriodData(*state, state->dataWeatherManager->TotReportPers, ErrorsFound); - state->dataWeatherManager->TotThermalReportPers = 0; - state->dataWeatherManager->TotCO2ReportPers = 0; - state->dataWeatherManager->TotVisualReportPers = 0; - WeatherManager::GroupReportPeriodByType(*state, state->dataWeatherManager->TotReportPers); + Weather::GetReportPeriodData(*state, state->dataWeather->TotReportPers, ErrorsFound); + state->dataWeather->TotThermalReportPers = 0; + state->dataWeather->TotCO2ReportPers = 0; + state->dataWeather->TotVisualReportPers = 0; + Weather::GroupReportPeriodByType(*state, state->dataWeather->TotReportPers); - EXPECT_EQ(state->dataWeatherManager->TotThermalReportPers, 2); + EXPECT_EQ(state->dataWeather->TotThermalReportPers, 2); state->dataGlobal->NumOfZones = 1; state->dataGlobal->KindOfSim = Constant::KindOfSim::RunPeriodWeather; @@ -3760,28 +3758,22 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestThermalResilienceReportR state->dataHeatBalFanSys->ZoneThermostatSetPointLo.dimension(state->dataGlobal->NumOfZones, 22.0); state->dataHeatBalFanSys->ZoneThermostatSetPointHi.dimension(state->dataGlobal->NumOfZones, 28.0); - state->dataHeatBalFanSys->ZoneHeatIndexHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneHumidexHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneHeatIndexOccuHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneHeatIndexHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneHumidexHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneHeatIndexOccuHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); state->dataHeatBalFanSys->ZoneHeatIndexOccupiedHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneHumidexOccuHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneHumidexOccupiedHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneColdHourOfSafetyBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneHeatHourOfSafetyBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); + state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneHumidexOccuHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneHumidexOccupiedHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneColdHourOfSafetyBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneHeatHourOfSafetyBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); state->dataHeatBalFanSys->ZoneDiscomfortWtExceedOccuHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); + state->dataWeather->TotThermalReportPers); state->dataHeatBalFanSys->ZoneDiscomfortWtExceedOccupiedHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, - state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->CrossedColdThreshRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->CrossedHeatThreshRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); + state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->CrossedColdThreshRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->CrossedHeatThreshRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); state->dataHeatBalFanSys->CrossedColdThreshRepPeriod = false; state->dataHeatBalFanSys->CrossedHeatThreshRepPeriod = false; state->dataHeatBalFanSys->ZoneThermostatSetPointLo.dimension(state->dataGlobal->NumOfZones, 22.0); @@ -3801,12 +3793,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestThermalResilienceReportR state->dataScheduleMgr->Schedule.allocate(1); state->dataThermalComforts->ThermalComfortData.allocate(state->dataHeatBal->TotPeople); - state->dataHeatBalFanSys->ZoneLowSETHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->ZoneHighSETHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->lowSETLongestHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->highSETLongestHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->lowSETLongestStartRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); - state->dataHeatBalFanSys->highSETLongestStartRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneLowSETHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->ZoneHighSETHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->lowSETLongestHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->highSETLongestHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->lowSETLongestStartRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); + state->dataHeatBalFanSys->highSETLongestStartRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotThermalReportPers); state->dataThermalComforts->ThermalComfortData(1).PierceSET = 31; state->dataScheduleMgr->Schedule(1).CurrentValue = 0; @@ -4222,19 +4214,19 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestCO2ResilienceReportRepPe ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - state->dataWeatherManager->TotReportPers = 2; + state->dataWeather->TotReportPers = 2; - WeatherManager::GetReportPeriodData(*state, state->dataWeatherManager->TotReportPers, ErrorsFound); - state->dataWeatherManager->TotThermalReportPers = 0; - state->dataWeatherManager->TotCO2ReportPers = 0; - state->dataWeatherManager->TotVisualReportPers = 0; - WeatherManager::GroupReportPeriodByType(*state, state->dataWeatherManager->TotReportPers); + Weather::GetReportPeriodData(*state, state->dataWeather->TotReportPers, ErrorsFound); + state->dataWeather->TotThermalReportPers = 0; + state->dataWeather->TotCO2ReportPers = 0; + state->dataWeather->TotVisualReportPers = 0; + Weather::GroupReportPeriodByType(*state, state->dataWeather->TotReportPers); - EXPECT_EQ(state->dataWeatherManager->TotCO2ReportPers, 2); + EXPECT_EQ(state->dataWeather->TotCO2ReportPers, 2); - state->dataHeatBalFanSys->ZoneCO2LevelHourBinsRepPeriod.allocate(1, state->dataWeatherManager->TotCO2ReportPers); - state->dataHeatBalFanSys->ZoneCO2LevelOccuHourBinsRepPeriod.allocate(1, state->dataWeatherManager->TotCO2ReportPers); - state->dataHeatBalFanSys->ZoneCO2LevelOccupiedHourBinsRepPeriod.allocate(1, state->dataWeatherManager->TotCO2ReportPers); + state->dataHeatBalFanSys->ZoneCO2LevelHourBinsRepPeriod.allocate(1, state->dataWeather->TotCO2ReportPers); + state->dataHeatBalFanSys->ZoneCO2LevelOccuHourBinsRepPeriod.allocate(1, state->dataWeather->TotCO2ReportPers); + state->dataHeatBalFanSys->ZoneCO2LevelOccupiedHourBinsRepPeriod.allocate(1, state->dataWeather->TotCO2ReportPers); state->dataGlobal->NumOfZones = 1; state->dataGlobal->KindOfSim = Constant::KindOfSim::RunPeriodWeather; @@ -4257,7 +4249,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestCO2ResilienceReportRepPe int NoBins = 3; - for (int i = 1; i <= state->dataWeatherManager->TotCO2ReportPers; i++) { + for (int i = 1; i <= state->dataWeather->TotCO2ReportPers; i++) { state->dataHeatBalFanSys->ZoneCO2LevelHourBinsRepPeriod(1, i).assign(NoBins, 0.0); state->dataHeatBalFanSys->ZoneCO2LevelOccuHourBinsRepPeriod(1, i).assign(NoBins, 0.0); state->dataHeatBalFanSys->ZoneCO2LevelOccupiedHourBinsRepPeriod(1, i).assign(NoBins, 0.0); @@ -4376,19 +4368,19 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestVisualResilienceReportRe ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - state->dataWeatherManager->TotReportPers = 2; + state->dataWeather->TotReportPers = 2; - WeatherManager::GetReportPeriodData(*state, state->dataWeatherManager->TotReportPers, ErrorsFound); - state->dataWeatherManager->TotThermalReportPers = 0; - state->dataWeatherManager->TotCO2ReportPers = 0; - state->dataWeatherManager->TotVisualReportPers = 0; - WeatherManager::GroupReportPeriodByType(*state, state->dataWeatherManager->TotReportPers); + Weather::GetReportPeriodData(*state, state->dataWeather->TotReportPers, ErrorsFound); + state->dataWeather->TotThermalReportPers = 0; + state->dataWeather->TotCO2ReportPers = 0; + state->dataWeather->TotVisualReportPers = 0; + Weather::GroupReportPeriodByType(*state, state->dataWeather->TotReportPers); - EXPECT_EQ(state->dataWeatherManager->TotVisualReportPers, 2); + EXPECT_EQ(state->dataWeather->TotVisualReportPers, 2); - state->dataHeatBalFanSys->ZoneLightingLevelHourBinsRepPeriod.allocate(1, state->dataWeatherManager->TotVisualReportPers); - state->dataHeatBalFanSys->ZoneLightingLevelOccuHourBinsRepPeriod.allocate(1, state->dataWeatherManager->TotVisualReportPers); - state->dataHeatBalFanSys->ZoneLightingLevelOccupiedHourBinsRepPeriod.allocate(1, state->dataWeatherManager->TotVisualReportPers); + state->dataHeatBalFanSys->ZoneLightingLevelHourBinsRepPeriod.allocate(1, state->dataWeather->TotVisualReportPers); + state->dataHeatBalFanSys->ZoneLightingLevelOccuHourBinsRepPeriod.allocate(1, state->dataWeather->TotVisualReportPers); + state->dataHeatBalFanSys->ZoneLightingLevelOccupiedHourBinsRepPeriod.allocate(1, state->dataWeather->TotVisualReportPers); state->dataGlobal->NumOfZones = 1; state->dataGlobal->KindOfSim = Constant::KindOfSim::RunPeriodWeather; @@ -4425,7 +4417,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestVisualResilienceReportRe int NoBins = 4; - for (int i = 1; i <= state->dataWeatherManager->TotVisualReportPers; i++) { + for (int i = 1; i <= state->dataWeather->TotVisualReportPers; i++) { state->dataHeatBalFanSys->ZoneLightingLevelHourBinsRepPeriod(1, i).assign(NoBins, 0.0); state->dataHeatBalFanSys->ZoneLightingLevelOccuHourBinsRepPeriod(1, i).assign(NoBins, 0.0); state->dataHeatBalFanSys->ZoneLightingLevelOccupiedHourBinsRepPeriod(1, i).assign(NoBins, 0.0); @@ -7122,11 +7114,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySurfToGndLWR state->dataSurface->SurfTAirRef(3) = DataSurfaces::RefAirTemp::ZoneSupplyAirTemp; // default surface view factors - int SurfNum = UtilityRoutines::FindItemInList("LIVING:NORTH", state->dataSurface->Surface); + int SurfNum = Util::FindItemInList("LIVING:NORTH", state->dataSurface->Surface); auto &Surface_Living_North = state->dataSurface->Surface(SurfNum); - SurfNum = UtilityRoutines::FindItemInList("LIVING:EAST", state->dataSurface->Surface); + SurfNum = Util::FindItemInList("LIVING:EAST", state->dataSurface->Surface); auto &Surface_Living_East = state->dataSurface->Surface(SurfNum); - SurfNum = UtilityRoutines::FindItemInList("LIVING:SOUTH", state->dataSurface->Surface); + SurfNum = Util::FindItemInList("LIVING:SOUTH", state->dataSurface->Surface); auto &Surface_Living_South = state->dataSurface->Surface(SurfNum); // check exterior default surfaces sky and ground view factors @@ -7169,8 +7161,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySurfToGndLWR Real64 result_LWRExchangeCoeff_surf2 = 0.0; Real64 result_LWRExchangeCoeff_surf3 = 0.0; // set exterior surface and ground surface temperatures - Real64 surf_TK = 20.0 + Constant::KelvinConv; - Real64 grnd_TK = 22.0 + Constant::KelvinConv; + Real64 surf_TK = 20.0 + Constant::Kelvin; + Real64 grnd_TK = 22.0 + Constant::Kelvin; // calculate LWR exchange coefficent from exterior surface to ground result_LWRExchangeCoeff_surf1 = Constant::StefanBoltzmann * 0.9 * 0.5 * (pow_4(surf_TK) - pow_4(grnd_TK)) / (surf_TK - grnd_TK); result_LWRExchangeCoeff_surf2 = Constant::StefanBoltzmann * 0.9 * 0.2 * (pow_4(surf_TK) - pow_4(grnd_TK)) / (surf_TK - grnd_TK); @@ -7402,12 +7394,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestGroundSurfsAverageTemp) EXPECT_FALSE(ErrorsFound); EXPECT_TRUE(state->dataGlobal->AnyLocalEnvironmentsInModel); // test surface property object inputs - int SrdSurfsNum = UtilityRoutines::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); + int SrdSurfsNum = Util::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(SrdSurfsNum).SurroundingSurfsPtr); - int GndSurfsNum = UtilityRoutines::FindItemInList("GNDSURFS:FENESSURFACE", state->dataSurface->GroundSurfsProperty); + int GndSurfsNum = Util::FindItemInList("GNDSURFS:FENESSURFACE", state->dataSurface->GroundSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(GndSurfsNum).GroundSurfsPtr); // set local derived data vars - int SurfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int SurfNum = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); SrdSurfsNum = state->dataSurface->Surface(SurfNum).SurfSurroundingSurfacesNum; auto &SrdSurfsProperty = state->dataSurface->SurroundingSurfsProperty(SrdSurfsNum); GndSurfsNum = state->dataSurface->Surface(SurfNum).SurfPropertyGndSurfIndex; @@ -7438,7 +7430,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestGroundSurfsAverageTemp) // test 1: surface viewing grass, parking and lake areas // calculate ground surfaces average temperature GetGroundSurfacesTemperatureAverage(*state); - Real64 dTK = Constant::KelvinConv; + Real64 dTK = Constant::Kelvin; Real64 results_gndSurfsAvgTemp = 0.0; results_gndSurfsAvgTemp = root_4((0.2 * pow_4(25.0 + dTK) + 0.1 * pow_4(28.0 + dTK) + 0.1 * pow_4(22.0 + dTK)) / (0.2 + 0.1 + 0.1)) - dTK; // check ground surfaces average temperature @@ -7723,12 +7715,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestGroundSurfsAverageRefl) EXPECT_FALSE(ErrorsFound); EXPECT_TRUE(state->dataGlobal->AnyLocalEnvironmentsInModel); // test surface property object inputs - int SrdSurfsNum = UtilityRoutines::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); + int SrdSurfsNum = Util::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(SrdSurfsNum).SurroundingSurfsPtr); - int GndSurfsNum = UtilityRoutines::FindItemInList("GNDSURFS:FENESSURFACE", state->dataSurface->GroundSurfsProperty); + int GndSurfsNum = Util::FindItemInList("GNDSURFS:FENESSURFACE", state->dataSurface->GroundSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(GndSurfsNum).GroundSurfsPtr); // set local derived data vars - int SurfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int SurfNum = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); SrdSurfsNum = state->dataSurface->Surface(SurfNum).SurfSurroundingSurfacesNum; auto &SrdSurfsProperty = state->dataSurface->SurroundingSurfsProperty(SrdSurfsNum); GndSurfsNum = state->dataSurface->Surface(SurfNum).SurfPropertyGndSurfIndex; @@ -8368,11 +8360,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyViewFactorsR state->dataSurface->SurfTAirRef(3) = DataSurfaces::RefAirTemp::ZoneSupplyAirTemp; // check default surface view factors - int SurfNum = UtilityRoutines::FindItemInList("LIVING:NORTH", state->dataSurface->Surface); + int SurfNum = Util::FindItemInList("LIVING:NORTH", state->dataSurface->Surface); auto &Surface_Living_North = state->dataSurface->Surface(SurfNum); - SurfNum = UtilityRoutines::FindItemInList("LIVING:EAST", state->dataSurface->Surface); + SurfNum = Util::FindItemInList("LIVING:EAST", state->dataSurface->Surface); auto &Surface_Living_East = state->dataSurface->Surface(SurfNum); - SurfNum = UtilityRoutines::FindItemInList("LIVING:SOUTH", state->dataSurface->Surface); + SurfNum = Util::FindItemInList("LIVING:SOUTH", state->dataSurface->Surface); auto &Surface_Living_South = state->dataSurface->Surface(SurfNum); // check exterior default surfaces sky and ground view factors EXPECT_DOUBLE_EQ(0.5, Surface_Living_North.ViewFactorSkyIR); @@ -8383,17 +8375,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyViewFactorsR EXPECT_DOUBLE_EQ(0.5, Surface_Living_South.ViewFactorGroundIR); // set local derived data vars - SurfNum = UtilityRoutines::FindItemInList("LIVING:NORTH", state->dataSurface->Surface); + SurfNum = Util::FindItemInList("LIVING:NORTH", state->dataSurface->Surface); int SrdSurfsNum = state->dataSurface->Surface(SurfNum).SurfSurroundingSurfacesNum; auto &SrdSurfsProperty_1 = state->dataSurface->SurroundingSurfsProperty(SrdSurfsNum); int GndSurfsNum = state->dataSurface->Surface(SurfNum).SurfPropertyGndSurfIndex; auto &GndSurfsProperty_1 = state->dataSurface->GroundSurfsProperty(GndSurfsNum); - SurfNum = UtilityRoutines::FindItemInList("LIVING:EAST", state->dataSurface->Surface); + SurfNum = Util::FindItemInList("LIVING:EAST", state->dataSurface->Surface); SrdSurfsNum = state->dataSurface->Surface(SurfNum).SurfSurroundingSurfacesNum; auto &SrdSurfsProperty_2 = state->dataSurface->SurroundingSurfsProperty(SrdSurfsNum); GndSurfsNum = state->dataSurface->Surface(SurfNum).SurfPropertyGndSurfIndex; auto &GndSurfsProperty_2 = state->dataSurface->GroundSurfsProperty(GndSurfsNum); - SurfNum = UtilityRoutines::FindItemInList("LIVING:SOUTH", state->dataSurface->Surface); + SurfNum = Util::FindItemInList("LIVING:SOUTH", state->dataSurface->Surface); SrdSurfsNum = state->dataSurface->Surface(SurfNum).SurfSurroundingSurfacesNum; auto &SrdSurfsProperty_3 = state->dataSurface->SurroundingSurfsProperty(SrdSurfsNum); GndSurfsNum = state->dataSurface->Surface(SurfNum).SurfPropertyGndSurfIndex; @@ -8906,10 +8898,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_SurroundingSurfacesTempTest) EXPECT_FALSE(ErrorsFound); EXPECT_TRUE(state->dataGlobal->AnyLocalEnvironmentsInModel); // test surface property object inputs - int srdSurfsPropNum = UtilityRoutines::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); + int srdSurfsPropNum = Util::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(srdSurfsPropNum).SurroundingSurfsPtr); // set local derived data vars - int surfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); auto &surface = state->dataSurface->Surface(surfNum); int srdSurfsNum = state->dataSurface->Surface(surfNum).SurfSurroundingSurfacesNum; auto &srdSurfsProperty = state->dataSurface->SurroundingSurfsProperty(srdSurfsNum); @@ -8920,10 +8912,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_SurroundingSurfacesTempTest) Real64 SrdSurfaceTemp = 0.0; Real64 SrdSurfaceTempSum = 0.0; for (auto &surdSurfs : srdSurfsProperty.SurroundingSurfs) { - SrdSurfaceTemp = ScheduleManager::GetCurrentScheduleValue(*state, surdSurfs.TempSchNum) + Constant::KelvinConv; + SrdSurfaceTemp = ScheduleManager::GetCurrentScheduleValue(*state, surdSurfs.TempSchNum) + Constant::Kelvin; SrdSurfaceTempSum += surdSurfs.ViewFactor * pow_4(SrdSurfaceTemp); } - Real64 srdSurfacesTemp_result = root_4(SrdSurfaceTempSum / surface.ViewFactorSrdSurfs) - Constant::KelvinConv; + Real64 srdSurfacesTemp_result = root_4(SrdSurfaceTempSum / surface.ViewFactorSrdSurfs) - Constant::Kelvin; // check average temperature of surrounding surfaces EXPECT_DOUBLE_EQ(srdSurfacesTemp_result, surface.SrdSurfTemp); } diff --git a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc index 4e822aa924e..54850af17bd 100644 --- a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc +++ b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc @@ -755,7 +755,7 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); state->dataGlobal->KickOffSimulation = false; @@ -765,7 +765,7 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) while (Available) { - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); + Weather::GetNextEnvironment(*state, Available, ErrorsFound); if (!Available) break; if (ErrorsFound) break; @@ -816,7 +816,7 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) } } - WeatherManager::ManageWeather(*state); + Weather::ManageWeather(*state); HeatBalanceManager::ManageHeatBalance(*state); @@ -1534,7 +1534,7 @@ TEST_F(EnergyPlusFixture, WWHP_AutosizeTest1) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); state->dataGlobal->KickOffSimulation = false; diff --git a/tst/EnergyPlus/unit/InputProcessor.unit.cc b/tst/EnergyPlus/unit/InputProcessor.unit.cc index 16543805765..6c3420ab478 100644 --- a/tst/EnergyPlus/unit/InputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/InputProcessor.unit.cc @@ -4449,7 +4449,7 @@ TEST_F(InputProcessorFixture, epJSONgetObjectItem_minfields) // User inputs from above // Note even though choice keys are case-sensitive during epJSON processing, getObjectItem pushes Alphas to UPPERcase - EXPECT_EQ(state->dataIPShortCut->cAlphaArgs(1), UtilityRoutines::makeUPPER(name2)); // Material Name field is NOT tagged with /retaincase + EXPECT_EQ(state->dataIPShortCut->cAlphaArgs(1), Util::makeUPPER(name2)); // Material Name field is NOT tagged with /retaincase EXPECT_EQ(state->dataIPShortCut->cAlphaArgs(2), "MEDIUMROUGH"); EXPECT_NEAR(state->dataIPShortCut->rNumericArgs(1), 2.0, 0.0001); EXPECT_NEAR(state->dataIPShortCut->rNumericArgs(3), 0.5, 0.0001); @@ -4632,10 +4632,10 @@ TEST_F(InputProcessorFixture, epJSONgetFieldValue_fromIDF) EXPECT_EQ(numericFieldValue, -99999); // Check an alpha field alphaFieldValue = ip->getAlphaFieldValue(fields, objectSchemaProps, "on_cycle_parasitic_fuel_type"); - EXPECT_TRUE(UtilityRoutines::SameString(alphaFieldValue, "Electricity")); + EXPECT_TRUE(Util::SameString(alphaFieldValue, "Electricity")); // Check a defaulted alpha field alphaFieldValue = ip->getAlphaFieldValue(fields, objectSchemaProps, "heater_control_type"); - EXPECT_TRUE(UtilityRoutines::SameString(alphaFieldValue, "Cycle")); + EXPECT_TRUE(Util::SameString(alphaFieldValue, "Cycle")); } } } @@ -4683,11 +4683,11 @@ TEST_F(InputProcessorFixture, epJSONgetFieldValue_extensiblesFromIDF) auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); + std::string const &thisObjectName = Util::makeUPPER(instance.key()); EXPECT_EQ(thisObjectName, "SPACE EQUIPMENT"); // Fields before extensibles alphaFieldValue = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "load_distribution_scheme"); - EXPECT_TRUE(UtilityRoutines::SameString(alphaFieldValue, "UniformPLR")); + EXPECT_TRUE(Util::SameString(alphaFieldValue, "UniformPLR")); // Extensibles @@ -4726,25 +4726,25 @@ TEST_F(InputProcessorFixture, epJSONgetFieldValue_extensiblesFromIDF) } EXPECT_EQ(counter, 3); } - EXPECT_TRUE(UtilityRoutines::SameString(equipmentNames[0], "Baseboard Heat")); - EXPECT_TRUE(UtilityRoutines::SameString(equipmentTypes[0], "ZoneHVAC:Baseboard:RadiantConvective:Electric")); - EXPECT_TRUE(UtilityRoutines::SameString(coolFracSchedNames[0], "")); - EXPECT_TRUE(UtilityRoutines::SameString(heatFracSchedNames[0], "")); + 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_EQ(coolSeqNums[0], 0); EXPECT_EQ(heatSeqNums[0], 3); - EXPECT_TRUE(UtilityRoutines::SameString(equipmentNames[1], "Air Terminal ADU")); - EXPECT_TRUE(UtilityRoutines::SameString(equipmentTypes[1], "ZoneHVAC:AirDistributionUnit")); - EXPECT_TRUE(UtilityRoutines::SameString(coolFracSchedNames[1], "ADU Cooling Fraction Schedule")); - EXPECT_TRUE(UtilityRoutines::SameString(heatFracSchedNames[1], "ADU Heating Fraction Schedule")); + EXPECT_TRUE(Util::SameString(equipmentNames[1], "Air Terminal ADU")); + EXPECT_TRUE(Util::SameString(equipmentTypes[1], "ZoneHVAC:AirDistributionUnit")); + EXPECT_TRUE(Util::SameString(coolFracSchedNames[1], "ADU Cooling Fraction Schedule")); + EXPECT_TRUE(Util::SameString(heatFracSchedNames[1], "ADU Heating Fraction Schedule")); // Note the input values above are 1.9 and 2.1, the should round to the nearest integer EXPECT_EQ(coolSeqNums[1], 2); EXPECT_EQ(heatSeqNums[1], 2); - EXPECT_TRUE(UtilityRoutines::SameString(equipmentNames[2], "Exhaust Fan")); - EXPECT_TRUE(UtilityRoutines::SameString(equipmentTypes[2], "Fan:ZoneExhaust")); - EXPECT_TRUE(UtilityRoutines::SameString(coolFracSchedNames[2], "")); - EXPECT_TRUE(UtilityRoutines::SameString(heatFracSchedNames[2], "")); + 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_EQ(coolSeqNums[2], 1); EXPECT_EQ(heatSeqNums[2], 1); } diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index 5486a53c5ce..b9e75a9ede4 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -3367,10 +3367,9 @@ TEST_F(LowTempRadiantSystemTest, calculateRunningMeanAverageTemperatureTest) state->dataLowTempRadSys->CflowRadiantSysDesign.allocate(1); auto &thisRadSysDesign(state->dataLowTempRadSys->CflowRadiantSysDesign(1)); state->dataGlobal->NumOfTimeStepInHour = 1; - state->dataWeatherManager->TodayOutDryBulbTemp.allocate(state->dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); - state->dataWeatherManager->TodayOutDryBulbTemp = 0.0; + state->dataWeather->wvarsHrTsToday.allocate(state->dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); for (int hourNumber = 1; hourNumber <= Constant::HoursInDay; ++hourNumber) { - state->dataWeatherManager->TodayOutDryBulbTemp(state->dataGlobal->NumOfTimeStepInHour, hourNumber) = double(hourNumber); + state->dataWeather->wvarsHrTsToday(state->dataGlobal->NumOfTimeStepInHour, hourNumber).OutDryBulbTemp = double(hourNumber); } // Test 1: First day of the simulation and it's in warmup-->everything set to the same temperature diff --git a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc index b77d605f323..6a0aa175832 100644 --- a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc +++ b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc @@ -121,7 +121,7 @@ TEST_F(EnergyPlusFixture, CheckEMPDCalc) state->dataConstruction->Construct.allocate(1); Construction::ConstructionProps &construction = state->dataConstruction->Construct(1); construction.TotLayers = 1; - construction.LayerPoint(construction.TotLayers) = UtilityRoutines::FindItemInPtrList("CONCRETE", state->dataMaterial->Material); + construction.LayerPoint(construction.TotLayers) = Util::FindItemInPtrList("CONCRETE", state->dataMaterial->Material); // Initialize and get inputs MoistureBalanceEMPDManager::InitMoistureBalanceEMPD(*state); @@ -241,7 +241,7 @@ TEST_F(EnergyPlusFixture, EMPDRcoating) state->dataConstruction->Construct.allocate(1); Construction::ConstructionProps &construction = state->dataConstruction->Construct(1); construction.TotLayers = 1; - construction.LayerPoint(construction.TotLayers) = UtilityRoutines::FindItemInPtrList("CONCRETE", state->dataMaterial->Material); + construction.LayerPoint(construction.TotLayers) = Util::FindItemInPtrList("CONCRETE", state->dataMaterial->Material); // Initialize and get inputs MoistureBalanceEMPDManager::InitMoistureBalanceEMPD(*state); @@ -327,7 +327,7 @@ TEST_F(EnergyPlusFixture, CheckEMPDCalc_Slope) state->dataConstruction->Construct.allocate(constNum); Construction::ConstructionProps &construction = state->dataConstruction->Construct(constNum); construction.TotLayers = constNum; - construction.LayerPoint(construction.TotLayers) = UtilityRoutines::FindItemInPtrList("WOOD", state->dataMaterial->Material); + construction.LayerPoint(construction.TotLayers) = Util::FindItemInPtrList("WOOD", state->dataMaterial->Material); // Initialize and get inputs MoistureBalanceEMPDManager::InitMoistureBalanceEMPD(*state); @@ -357,7 +357,7 @@ TEST_F(EnergyPlusFixture, CheckEMPDCalc_Slope) // Calculate RH for use in material property calculations. Real64 RV_Deep_Old = state->dataMstBalEMPD->RVdeepOld(surfNum); Real64 RVaver = state->dataMstBalEMPD->RVSurfLayerOld(surfNum); - Real64 RHaver = RVaver * 461.52 * (Taver + Constant::KelvinConv) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); + Real64 RHaver = RVaver * 461.52 * (Taver + Constant::Kelvin) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); Real64 dU_dRH = material->MoistACoeff * material->MoistBCoeff * pow(RHaver, material->MoistBCoeff - 1) + material->MoistCCoeff * material->MoistDCoeff * pow(RHaver, material->MoistDCoeff - 1); diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 8c75f5f5e3e..dda76502357 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -70,7 +70,6 @@ #include using namespace EnergyPlus::PurchasedAirManager; -using namespace EnergyPlus::WeatherManager; using namespace EnergyPlus::OutputProcessor; namespace EnergyPlus { @@ -3719,13 +3718,13 @@ namespace OutputProcessor { EXPECT_EQ(1, state->dataOutputProcessor->EndUseCategory(2).NumSubcategories); EXPECT_EQ("General", state->dataOutputProcessor->EndUseCategory(2).SubcategoryName(1)); - found = UtilityRoutines::FindItem("Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("Cooling", state->dataOutputProcessor->EnergyMeters(found).EndUse); EXPECT_EQ("", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); - found = UtilityRoutines::FindItem("General:Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("General:Cooling:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("Cooling", state->dataOutputProcessor->EnergyMeters(found).EndUse); @@ -3736,16 +3735,16 @@ namespace OutputProcessor { EXPECT_EQ(1, state->dataOutputProcessor->EndUseCategory(3).NumSubcategories); // lighting end use EXPECT_EQ("RailroadCrossing", state->dataOutputProcessor->EndUseCategory(3).SubcategoryName(1)); - found = UtilityRoutines::FindItem("InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("InteriorLights", state->dataOutputProcessor->EnergyMeters(found).EndUse); EXPECT_EQ("", state->dataOutputProcessor->EnergyMeters(found).EndUseSub); - found = UtilityRoutines::FindItem("General:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("General:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_EQ(0, found); // should not find this - found = UtilityRoutines::FindItem("RailroadCrossing:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("RailroadCrossing:InteriorLights:Electricity", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("Electricity", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("InteriorLights", state->dataOutputProcessor->EnergyMeters(found).EndUse); @@ -3753,7 +3752,7 @@ namespace OutputProcessor { // fuel oil CO2 emissions // testing a non-ABUPS end use with no sub end use specified - found = UtilityRoutines::FindItem("FuelOilNo2Emissions:CO2", state->dataOutputProcessor->EnergyMeters); + found = Util::FindItem("FuelOilNo2Emissions:CO2", state->dataOutputProcessor->EnergyMeters); EXPECT_NE(0, found); EXPECT_EQ("CO2", state->dataOutputProcessor->EnergyMeters(found).ResourceType); EXPECT_EQ("FuelOilNo2Emissions", state->dataOutputProcessor->EnergyMeters(found).EndUse); @@ -4449,7 +4448,7 @@ namespace OutputProcessor { } } - if (state->dataEnvrn->DayOfMonth == state->dataWeatherManager->EndDayOfMonth(state->dataEnvrn->Month)) { + if (state->dataEnvrn->DayOfMonth == state->dataWeather->EndDayOfMonth(state->dataEnvrn->Month)) { state->dataEnvrn->EndMonthFlag = true; } @@ -4737,7 +4736,7 @@ namespace OutputProcessor { } } - if (state->dataEnvrn->DayOfMonth == state->dataWeatherManager->EndDayOfMonth(state->dataEnvrn->Month)) { + if (state->dataEnvrn->DayOfMonth == state->dataWeather->EndDayOfMonth(state->dataEnvrn->Month)) { state->dataEnvrn->EndMonthFlag = true; } @@ -5050,7 +5049,7 @@ namespace OutputProcessor { } } - if (state->dataEnvrn->DayOfMonth == state->dataWeatherManager->EndDayOfMonth(state->dataEnvrn->Month)) { + if (state->dataEnvrn->DayOfMonth == state->dataWeather->EndDayOfMonth(state->dataEnvrn->Month)) { state->dataEnvrn->EndMonthFlag = true; } @@ -5307,7 +5306,7 @@ namespace OutputProcessor { } } - if (state->dataEnvrn->DayOfMonth == state->dataWeatherManager->EndDayOfMonth(state->dataEnvrn->Month)) { + if (state->dataEnvrn->DayOfMonth == state->dataWeather->EndDayOfMonth(state->dataEnvrn->Month)) { state->dataEnvrn->EndMonthFlag = true; } @@ -5394,7 +5393,7 @@ namespace OutputProcessor { } } - if (state->dataEnvrn->DayOfMonth == state->dataWeatherManager->EndDayOfMonth(state->dataEnvrn->Month)) { + if (state->dataEnvrn->DayOfMonth == state->dataWeather->EndDayOfMonth(state->dataEnvrn->Month)) { state->dataEnvrn->EndMonthFlag = true; } @@ -5478,7 +5477,7 @@ namespace OutputProcessor { } } - if (state->dataEnvrn->DayOfMonth == state->dataWeatherManager->EndDayOfMonth(state->dataEnvrn->Month)) { + if (state->dataEnvrn->DayOfMonth == state->dataWeather->EndDayOfMonth(state->dataEnvrn->Month)) { state->dataEnvrn->EndMonthFlag = true; } diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 2ccb6068393..ebf06b032c7 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -6593,9 +6593,9 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_CollectPeakZoneConditions_test state->dataHeatBal->Zone(1).ListMultiplier = 1; state->dataHeatBal->Zone(1).FloorArea = 12.; - state->dataWeatherManager->DesDayInput.allocate(1); - state->dataWeatherManager->DesDayInput(1).Month = 5; - state->dataWeatherManager->DesDayInput(1).DayOfMonth = 21; + state->dataWeather->DesDayInput.allocate(1); + state->dataWeather->DesDayInput(1).Month = 5; + state->dataWeather->DesDayInput(1).DayOfMonth = 21; state->dataGlobal->NumOfTimeStepInHour = 4; state->dataGlobal->MinutesPerTimeStep = 15; @@ -7082,11 +7082,11 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo int numDesDays = 2; state->dataEnvrn->TotDesDays = numDesDays; state->dataEnvrn->TotRunDesPersDays = 0; - state->dataWeatherManager->DesDayInput.allocate(2); - state->dataWeatherManager->DesDayInput(1).Month = 7; - state->dataWeatherManager->DesDayInput(1).DayOfMonth = 21; - state->dataWeatherManager->DesDayInput(2).Month = 1; - state->dataWeatherManager->DesDayInput(2).DayOfMonth = 21; + state->dataWeather->DesDayInput.allocate(2); + state->dataWeather->DesDayInput(1).Month = 7; + state->dataWeather->DesDayInput(1).DayOfMonth = 21; + state->dataWeather->DesDayInput(2).Month = 1; + state->dataWeather->DesDayInput(2).DayOfMonth = 21; state->dataGlobal->NumOfTimeStepInHour = 4; state->dataGlobal->MinutesPerTimeStep = 15; @@ -9967,8 +9967,8 @@ 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 UtilityRoutines::SameString("Standard62.1Summary", rN.name); }); + auto it = + std::find_if(reportNameArray.begin(), reportNameArray.end(), [](const auto &rN) { return Util::SameString("Standard62.1Summary", rN.name); }); EXPECT_FALSE(it != reportNameArray.end()); // Not found GetInputOutputTableSummaryReports(*state); @@ -10001,10 +10001,10 @@ 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 UtilityRoutines::SameString("Standard62.1Summary", rN.name); }); + auto it = + std::find_if(reportNameArray.begin(), reportNameArray.end(), [](const auto &rN) { return Util::SameString("Standard62.1Summary", rN.name); }); EXPECT_TRUE(it != reportNameArray.end()); - // EXPECT_TRUE(UtilityRoutines::FindItem("Standard62.1Summary", state->dataOutRptPredefined->reportName)); + // EXPECT_TRUE(Util::FindItem("Standard62.1Summary", state->dataOutRptPredefined->reportName)); GetInputOutputTableSummaryReports(*state); @@ -10250,15 +10250,15 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_WriteSETHoursTableReportingPer columnHead(5) = "Start Time of the Longest SET ≤ 12.2°C Duration for Occupied Period "; Real64 degreeHourConversion = 1.8; - state->dataWeatherManager->TotReportPers = 2; + state->dataWeather->TotReportPers = 2; - state->dataHeatBalFanSys->ZoneLowSETHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotReportPers); - for (int i = 1; i <= state->dataWeatherManager->TotReportPers; i++) { + state->dataHeatBalFanSys->ZoneLowSETHoursRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotReportPers); + for (int i = 1; i <= state->dataWeather->TotReportPers; i++) { state->dataHeatBalFanSys->ZoneLowSETHoursRepPeriod(1, i).assign(5, 0.0); } int encodedMonDayHrMin; - for (int k = 1; k <= state->dataWeatherManager->TotReportPers; k++) { + for (int k = 1; k <= state->dataWeather->TotReportPers; k++) { for (int i = 0; i < 4; i++) { state->dataHeatBalFanSys->ZoneLowSETHoursRepPeriod(1, k)[i] = float(k) * std::pow(-1.0, float(i)) * std::pow(float(i), 2.0); } @@ -10334,14 +10334,14 @@ TEST_F(EnergyPlusFixture, OutputReportTabularTest_UnmetDegreeHourRepPeriodUnitCo std::string tableName = "Unmet Degree-Hours"; Real64 degreeHourConversion = 1.8; - state->dataWeatherManager->TotReportPers = 2; + state->dataWeather->TotReportPers = 2; - state->dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeatherManager->TotReportPers); - for (int i = 1; i <= state->dataWeatherManager->TotReportPers; i++) { + state->dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod.allocate(state->dataGlobal->NumOfZones, state->dataWeather->TotReportPers); + for (int i = 1; i <= state->dataWeather->TotReportPers; i++) { state->dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod(1, i).assign(columnNumUnmetDegHr, 0.0); } // state->dataHeatBal->Resilience(1).ZoneUnmetDegreeHourBins: [0, -1, 4, -9, 16, -25] - for (int k = 1; k <= state->dataWeatherManager->TotReportPers; k++) { + for (int k = 1; k <= state->dataWeather->TotReportPers; k++) { for (int i = 0; i < 6; i++) { state->dataHeatBalFanSys->ZoneUnmetDegreeHourBinsRepPeriod(1, k)[i] = float(k) * std::pow(-1.0, float(i)) * std::pow(float(i), 2.0); } diff --git a/tst/EnergyPlus/unit/PVWatts.unit.cc b/tst/EnergyPlus/unit/PVWatts.unit.cc index 5d7446fc7e3..13ecf320fcd 100644 --- a/tst/EnergyPlus/unit/PVWatts.unit.cc +++ b/tst/EnergyPlus/unit/PVWatts.unit.cc @@ -187,14 +187,14 @@ TEST_F(EnergyPlusFixture, PVWattsGenerator_Calc) state->dataGlobal->BeginTimeStepFlag = true; state->dataGlobal->MinutesPerTimeStep = 60; state->dataGlobal->NumOfTimeStepInHour = 1; - WeatherManager::AllocateWeatherData(*state); // gets us the albedo array initialized + Weather::AllocateWeatherData(*state); // gets us the albedo array initialized state->dataEnvrn->Year = 1986; state->dataEnvrn->Month = 6; state->dataEnvrn->DayOfMonth = 15; state->dataGlobal->HourOfDay = 8; // 8th hour of day, 7-8am - state->dataWeatherManager->WeatherFileLatitude = 33.45; - state->dataWeatherManager->WeatherFileLongitude = -111.98; - state->dataWeatherManager->WeatherFileTimeZone = -7; + state->dataWeather->WeatherFileLatitude = 33.45; + state->dataWeather->WeatherFileLongitude = -111.98; + state->dataWeather->WeatherFileTimeZone = -7; state->dataEnvrn->BeamSolarRad = 728; state->dataEnvrn->DifSolarRad = 70; state->dataEnvrn->WindSpeed = 3.1; diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index 4d1e2287c7b..728f88256ce 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -4298,9 +4298,9 @@ TEST_F(EnergyPlusFixture, PTAC_ZoneEquipment_NodeInputTest) thisSys.getUnitarySystemInput(*state, "SPACE1-1 PTAC", isZoneEquipment, 0); state->dataUnitarySystems->getInputOnceFlag = false; - int zoneSupplyInlet = UtilityRoutines::FindItemInList("SPACE1-1 SUPPLY INLET", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); - int zoneExhaustNode = UtilityRoutines::FindItemInList("SPACE1-1 HP INLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); - int zoneNum = UtilityRoutines::FindItemInList("SPACE1-1", state->dataHeatBal->Zone); + int zoneSupplyInlet = Util::FindItemInList("SPACE1-1 SUPPLY INLET", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneExhaustNode = Util::FindItemInList("SPACE1-1 HP INLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneNum = Util::FindItemInList("SPACE1-1", state->dataHeatBal->Zone); // Test 1 - PTAC Inlet node is zone exhaust node ASSERT_EQ(1, state->dataUnitarySystems->numUnitarySystems); @@ -4322,8 +4322,7 @@ TEST_F(EnergyPlusFixture, PTAC_ZoneEquipment_NodeInputTest) thisSys.processInputSpec(*state, thisSys.input_specs, sysNum, errorsFound, isZoneEquipment, zoneOAUnit); ASSERT_TRUE(compare_err_stream("")); ASSERT_FALSE(errorsFound); - int plenumInducedNode = - UtilityRoutines::FindItemInList("PLENUM INDUCED AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int plenumInducedNode = Util::FindItemInList("PLENUM INDUCED AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); EXPECT_EQ(plenumInducedNode, thisSys.AirInNode); EXPECT_EQ(zoneSupplyInlet, thisSys.AirOutNode); EXPECT_EQ(zoneSupplyInlet, thisSys.m_ZoneInletNode); @@ -4353,7 +4352,7 @@ TEST_F(EnergyPlusFixture, PTAC_ZoneEquipment_NodeInputTest) ASSERT_TRUE(compare_err_stream(error_string, true)); ASSERT_TRUE(errorsFound); - int someOtherNode = UtilityRoutines::FindItemInList("SOME OTHER NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int someOtherNode = Util::FindItemInList("SOME OTHER NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); EXPECT_EQ(someOtherNode, thisSys.AirInNode); EXPECT_EQ(zoneSupplyInlet, thisSys.AirOutNode); EXPECT_EQ(zoneSupplyInlet, thisSys.m_ZoneInletNode); @@ -4567,10 +4566,8 @@ TEST_F(EnergyPlusFixture, ZonePTHP_ElectricityRateTest) state->dataUnitarySystems->getInputOnceFlag = false; EXPECT_FALSE(errorsFound); - int zoneSupplyInlet = - UtilityRoutines::FindItemInList("THERMAL ZONE ONE INLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); - int zoneExhaustNode = - UtilityRoutines::FindItemInList("THERMAL ZONE ONE EXHAUST NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneSupplyInlet = Util::FindItemInList("THERMAL ZONE ONE INLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneExhaustNode = Util::FindItemInList("THERMAL ZONE ONE EXHAUST NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); // test PTHP node connections ASSERT_EQ(1, state->dataUnitarySystems->numUnitarySystems); EXPECT_EQ("ZoneHVAC:PackagedTerminalHeatPump", thisSys.UnitType); @@ -4586,20 +4583,20 @@ TEST_F(EnergyPlusFixture, ZonePTHP_ElectricityRateTest) state->dataEnvrn->StdRhoAir = 1.20; // set zone air conditions - auto &zoneAirNode = state->dataLoopNodes->Node( - UtilityRoutines::FindItemInList("THERMAL ZONE ONE AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); + auto &zoneAirNode = + state->dataLoopNodes->Node(Util::FindItemInList("THERMAL ZONE ONE AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); zoneAirNode.Temp = 20.0; zoneAirNode.HumRat = 0.003; zoneAirNode.Enthalpy = Psychrometrics::PsyHFnTdbW(zoneAirNode.Temp, zoneAirNode.HumRat); // set mixed air conditions auto &mixedAirNode = state->dataLoopNodes->Node( - UtilityRoutines::FindItemInList("PTHP THERMAL ZONE ONE MIXED AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); + Util::FindItemInList("PTHP THERMAL ZONE ONE MIXED AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); mixedAirNode.Temp = 10.0; mixedAirNode.HumRat = 0.003; mixedAirNode.Enthalpy = Psychrometrics::PsyHFnTdbW(mixedAirNode.Temp, mixedAirNode.HumRat); // set zone exhaust node auto &zoneExhNode = state->dataLoopNodes->Node( - UtilityRoutines::FindItemInList("THERMAL ZONE ONE EXHAUST NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); + Util::FindItemInList("THERMAL ZONE ONE EXHAUST NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); zoneExhNode.Temp = 20.0; zoneExhNode.HumRat = 0.003; zoneExhNode.Enthalpy = Psychrometrics::PsyHFnTdbW(zoneExhNode.Temp, zoneExhNode.HumRat); diff --git a/tst/EnergyPlus/unit/PhotovoltaicThermalCollectors.unit.cc b/tst/EnergyPlus/unit/PhotovoltaicThermalCollectors.unit.cc index bc39f4ff53a..c512c3f389e 100644 --- a/tst/EnergyPlus/unit/PhotovoltaicThermalCollectors.unit.cc +++ b/tst/EnergyPlus/unit/PhotovoltaicThermalCollectors.unit.cc @@ -267,14 +267,14 @@ TEST_F(EnergyPlusFixture, BIPVT_calculateBIPVTMaxHeatGain) Real64 tCollector = 0.0; // Set up conditions - int InletNode = UtilityRoutines::FindItemInList("ZN_1_FLR_1_SEC_1:SYS_OAINLET NODE", - state->dataLoopNodes->NodeID, - state->dataLoopNodes->NumOfNodes); // HVAC node associated with inlet of BIPVT - state->dataLoopNodes->Node(InletNode).HumRat = 0.001; // inlet air humidity ratio (kgda/kg) - state->dataEnvrn->OutHumRat = 0.001; // ambient humidity ratio (kg/kg) - state->dataEnvrn->SkyTemp = 0.0; // sky temperature (DegC) - state->dataEnvrn->WindSpeed = 5.0; // wind speed (m/s) - state->dataEnvrn->WindDir = 0.0; // wind direction (deg) + int InletNode = Util::FindItemInList("ZN_1_FLR_1_SEC_1:SYS_OAINLET NODE", + state->dataLoopNodes->NodeID, + state->dataLoopNodes->NumOfNodes); // HVAC node associated with inlet of BIPVT + state->dataLoopNodes->Node(InletNode).HumRat = 0.001; // inlet air humidity ratio (kgda/kg) + state->dataEnvrn->OutHumRat = 0.001; // ambient humidity ratio (kg/kg) + state->dataEnvrn->SkyTemp = 0.0; // sky temperature (DegC) + state->dataEnvrn->WindSpeed = 5.0; // wind speed (m/s) + state->dataEnvrn->WindDir = 0.0; // wind direction (deg) state->dataPhotovoltaic->PVarray(thisBIPVT.PVnum).TRNSYSPVcalc.ArrayEfficiency = 0.5; state->dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(thisBIPVT.SurfNum) = 0.0; // Exterior ground diffuse solar incident on surface (W/m2) state->dataHeatBal->SurfCosIncidenceAngle(thisBIPVT.SurfNum) = 0.5; // Cosine of beam solar incidence angle diff --git a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc index 90f14478f2c..3bf16823afe 100644 --- a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc +++ b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc @@ -1077,7 +1077,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileHi) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); state->dataGlobal->KickOffSimulation = false; @@ -1087,7 +1087,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileHi) while (Available) { - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); + Weather::GetNextEnvironment(*state, Available, ErrorsFound); if (!Available) break; if (ErrorsFound) break; @@ -1138,7 +1138,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileHi) } } - WeatherManager::ManageWeather(*state); + Weather::ManageWeather(*state); HeatBalanceManager::ManageHeatBalance(*state); @@ -2169,7 +2169,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileLo) state->dataGlobal->DoingSizing = false; state->dataGlobal->KickOffSimulation = true; - WeatherManager::ResetEnvironmentCounter(*state); + Weather::ResetEnvironmentCounter(*state); SimulationManager::SetupSimulation(*state, ErrorsFound); state->dataGlobal->KickOffSimulation = false; @@ -2179,7 +2179,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileLo) while (Available) { - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); + Weather::GetNextEnvironment(*state, Available, ErrorsFound); if (!Available) break; if (ErrorsFound) break; @@ -2230,7 +2230,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileLo) } } - WeatherManager::ManageWeather(*state); + Weather::ManageWeather(*state); HeatBalanceManager::ManageHeatBalance(*state); diff --git a/tst/EnergyPlus/unit/RunPeriod.unit.cc b/tst/EnergyPlus/unit/RunPeriod.unit.cc index cebb02f902d..765a916f467 100644 --- a/tst/EnergyPlus/unit/RunPeriod.unit.cc +++ b/tst/EnergyPlus/unit/RunPeriod.unit.cc @@ -65,12 +65,11 @@ #include using namespace EnergyPlus; -using namespace EnergyPlus::WeatherManager; using namespace EnergyPlus::ScheduleManager; TEST_F(EnergyPlusFixture, RunPeriod_Defaults) { - RunPeriodData runperiod; + Weather::RunPeriodData runperiod; EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Sunday, runperiod.startWeekDay)); EXPECT_EQ(1, runperiod.startMonth); @@ -199,48 +198,48 @@ TEST_F(EnergyPlusFixture, RunPeriod_YearTests) ASSERT_TRUE(process_idf(idf_objects)); bool errors_in_input(false); int totalrps(7); - WeatherManager::GetRunPeriodData(*state, totalrps, errors_in_input); + Weather::GetRunPeriodData(*state, totalrps, errors_in_input); EXPECT_FALSE(errors_in_input); - EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Monday, state->dataWeatherManager->RunPeriodInput[0].startWeekDay)); - EXPECT_EQ(2016, state->dataWeatherManager->RunPeriodInput[0].startYear); - EXPECT_EQ(2457448, state->dataWeatherManager->RunPeriodInput[0].startJulianDate); - EXPECT_EQ(2457451, state->dataWeatherManager->RunPeriodInput[0].endJulianDate); - - EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Wednesday, state->dataWeatherManager->RunPeriodInput[1].startWeekDay)); - EXPECT_EQ(2012, state->dataWeatherManager->RunPeriodInput[1].startYear); - EXPECT_EQ(2455987, state->dataWeatherManager->RunPeriodInput[1].startJulianDate); - EXPECT_EQ(2455990, state->dataWeatherManager->RunPeriodInput[1].endJulianDate); - - EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Thursday, state->dataWeatherManager->RunPeriodInput[2].startWeekDay)); - EXPECT_EQ(2015, state->dataWeatherManager->RunPeriodInput[2].startYear); - EXPECT_EQ(2457024, state->dataWeatherManager->RunPeriodInput[2].startJulianDate); - EXPECT_EQ(2457388, state->dataWeatherManager->RunPeriodInput[2].endJulianDate); - - EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Sunday, state->dataWeatherManager->RunPeriodInput[3].startWeekDay)); - EXPECT_EQ(2017, state->dataWeatherManager->RunPeriodInput[3].startYear); - EXPECT_EQ(2457755, state->dataWeatherManager->RunPeriodInput[3].startJulianDate); - EXPECT_EQ(2458119, state->dataWeatherManager->RunPeriodInput[3].endJulianDate); + EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Monday, state->dataWeather->RunPeriodInput[0].startWeekDay)); + EXPECT_EQ(2016, state->dataWeather->RunPeriodInput[0].startYear); + EXPECT_EQ(2457448, state->dataWeather->RunPeriodInput[0].startJulianDate); + EXPECT_EQ(2457451, state->dataWeather->RunPeriodInput[0].endJulianDate); + + EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Wednesday, state->dataWeather->RunPeriodInput[1].startWeekDay)); + EXPECT_EQ(2012, state->dataWeather->RunPeriodInput[1].startYear); + EXPECT_EQ(2455987, state->dataWeather->RunPeriodInput[1].startJulianDate); + EXPECT_EQ(2455990, state->dataWeather->RunPeriodInput[1].endJulianDate); + + EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Thursday, state->dataWeather->RunPeriodInput[2].startWeekDay)); + EXPECT_EQ(2015, state->dataWeather->RunPeriodInput[2].startYear); + EXPECT_EQ(2457024, state->dataWeather->RunPeriodInput[2].startJulianDate); + EXPECT_EQ(2457388, state->dataWeather->RunPeriodInput[2].endJulianDate); + + EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Sunday, state->dataWeather->RunPeriodInput[3].startWeekDay)); + EXPECT_EQ(2017, state->dataWeather->RunPeriodInput[3].startYear); + EXPECT_EQ(2457755, state->dataWeather->RunPeriodInput[3].startJulianDate); + EXPECT_EQ(2458119, state->dataWeather->RunPeriodInput[3].endJulianDate); // This is the default, check that it works properly std::array startDays{{1, 4, 4, 7, 2, 5, 7, 3, 6, 1, 4, 6}}; for (size_t i = 0; i < 12; ++i) { - EXPECT_EQ(startDays[i], state->dataWeatherManager->RunPeriodInput[3].monWeekDay[i]); + EXPECT_EQ(startDays[i], state->dataWeather->RunPeriodInput[3].monWeekDay[i]); } - EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Wednesday, state->dataWeatherManager->RunPeriodInput[4].startWeekDay)); - EXPECT_EQ(2010, state->dataWeatherManager->RunPeriodInput[4].startYear); - EXPECT_EQ(2455427, state->dataWeatherManager->RunPeriodInput[4].startJulianDate); - EXPECT_EQ(2455562, state->dataWeatherManager->RunPeriodInput[4].endJulianDate); + EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Wednesday, state->dataWeather->RunPeriodInput[4].startWeekDay)); + EXPECT_EQ(2010, state->dataWeather->RunPeriodInput[4].startYear); + EXPECT_EQ(2455427, state->dataWeather->RunPeriodInput[4].startJulianDate); + EXPECT_EQ(2455562, state->dataWeather->RunPeriodInput[4].endJulianDate); - EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Saturday, state->dataWeatherManager->RunPeriodInput[5].startWeekDay)); - EXPECT_EQ(1992, state->dataWeatherManager->RunPeriodInput[5].startYear); - EXPECT_EQ(2448682, state->dataWeatherManager->RunPeriodInput[5].startJulianDate); - EXPECT_EQ(2448988, state->dataWeatherManager->RunPeriodInput[5].endJulianDate); + EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Saturday, state->dataWeather->RunPeriodInput[5].startWeekDay)); + EXPECT_EQ(1992, state->dataWeather->RunPeriodInput[5].startYear); + EXPECT_EQ(2448682, state->dataWeather->RunPeriodInput[5].startJulianDate); + EXPECT_EQ(2448988, state->dataWeather->RunPeriodInput[5].endJulianDate); - EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Friday, state->dataWeatherManager->RunPeriodInput[6].startWeekDay)); - EXPECT_EQ(2016, state->dataWeatherManager->RunPeriodInput[6].startYear); - EXPECT_EQ(2457389, state->dataWeatherManager->RunPeriodInput[6].startJulianDate); - EXPECT_EQ(2458940, state->dataWeatherManager->RunPeriodInput[6].endJulianDate); + EXPECT_TRUE(compare_enums(ScheduleManager::DayType::Friday, state->dataWeather->RunPeriodInput[6].startWeekDay)); + EXPECT_EQ(2016, state->dataWeather->RunPeriodInput[6].startYear); + EXPECT_EQ(2457389, state->dataWeather->RunPeriodInput[6].startJulianDate); + EXPECT_EQ(2458940, state->dataWeather->RunPeriodInput[6].endJulianDate); } TEST_F(EnergyPlusFixture, RunPeriod_EndYearOnly) @@ -268,7 +267,7 @@ TEST_F(EnergyPlusFixture, RunPeriod_EndYearOnly) ASSERT_TRUE(process_idf(idf_objects)); bool errors_in_input(false); int totalrps(1); - WeatherManager::GetRunPeriodData(*state, totalrps, errors_in_input); + Weather::GetRunPeriodData(*state, totalrps, errors_in_input); EXPECT_TRUE(errors_in_input); } @@ -334,7 +333,7 @@ TEST_F(EnergyPlusFixture, RunPeriod_NameOfPeriodInWarning) ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; int totalrps(1); - WeatherManager::GetRunPeriodData(*state, totalrps, ErrorsFound); + Weather::GetRunPeriodData(*state, totalrps, ErrorsFound); // This should just issue a warning EXPECT_FALSE(ErrorsFound); @@ -368,7 +367,7 @@ TEST_F(EnergyPlusFixture, RunPeriod_NameOfPeriodInWarning) ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; int totalrps(1); - WeatherManager::GetRunPeriodData(*state, totalrps, ErrorsFound); + Weather::GetRunPeriodData(*state, totalrps, ErrorsFound); // This should issue a severe EXPECT_TRUE(ErrorsFound); @@ -402,7 +401,7 @@ TEST_F(EnergyPlusFixture, SizingPeriod_WeatherFile) ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - WeatherManager::GetRunPeriodDesignData(*state, ErrorsFound); + Weather::GetRunPeriodDesignData(*state, ErrorsFound); // This should just issue a severe EXPECT_TRUE(ErrorsFound); @@ -437,21 +436,21 @@ TEST_F(EnergyPlusFixture, RunPeriod_BadLeapDayFlagLogic) ASSERT_TRUE(process_idf(idf_objects)); bool errors_in_input(false); int totalrps(1); - WeatherManager::GetRunPeriodData(*state, totalrps, errors_in_input); + Weather::GetRunPeriodData(*state, totalrps, errors_in_input); EXPECT_FALSE(errors_in_input); - state->dataWeatherManager->Environment.allocate(1); + state->dataWeather->Environment.allocate(1); // These may already be set, but do it anyway state->dataEnvrn->TotDesDays = 0; - state->dataWeatherManager->TotRunPers = 1; - state->dataWeatherManager->TotRunDesPers = 0; + state->dataWeather->TotRunPers = 1; + state->dataWeather->TotRunDesPers = 0; - state->dataWeatherManager->WFAllowsLeapYears = true; // This was hitting a bad bit of logic - WeatherManager::SetupEnvironmentTypes(*state); + state->dataWeather->WFAllowsLeapYears = true; // This was hitting a bad bit of logic + Weather::SetupEnvironmentTypes(*state); - EXPECT_FALSE(state->dataWeatherManager->Environment[0].IsLeapYear); - EXPECT_EQ(365, state->dataWeatherManager->Environment[0].TotalDays); + EXPECT_FALSE(state->dataWeather->Environment[0].IsLeapYear); + EXPECT_EQ(365, state->dataWeather->Environment[0].TotalDays); - state->dataWeatherManager->Environment.deallocate(); + state->dataWeather->Environment.deallocate(); } diff --git a/tst/EnergyPlus/unit/ScheduleManager.unit.cc b/tst/EnergyPlus/unit/ScheduleManager.unit.cc index 0ecf609fd2c..87a34bfc37c 100644 --- a/tst/EnergyPlus/unit/ScheduleManager.unit.cc +++ b/tst/EnergyPlus/unit/ScheduleManager.unit.cc @@ -973,8 +973,8 @@ TEST_F(EnergyPlusFixture, Schedule_GetCurrentScheduleValue_DST_RampUp_Leap) // # 'FOR' => Number of additional day schedules // So we use 366 Week Schedules, all with one day (LeapYear) state->dataEnvrn->CurrentYearIsLeapYear = true; - state->dataWeatherManager->WFAllowsLeapYears = true; - state->dataWeatherManager->LeapYearAdd = 1; + state->dataWeather->WFAllowsLeapYears = true; + state->dataWeather->LeapYearAdd = 1; int nDays = 366; state->dataGlobal->NumOfTimeStepInHour = 4; @@ -1156,8 +1156,8 @@ TEST_F(EnergyPlusFixture, Schedule_GetCurrentScheduleValue_DST_RampUp_NoLeap) // # 'FOR' => Number of additional day schedules // So we use 366 Week Schedules, all with one day (LeapYear) state->dataEnvrn->CurrentYearIsLeapYear = false; - state->dataWeatherManager->WFAllowsLeapYears = false; - state->dataWeatherManager->LeapYearAdd = 0; + state->dataWeather->WFAllowsLeapYears = false; + state->dataWeather->LeapYearAdd = 0; // ScheduleManager always assume LeapYear really. int nDays = 365; diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 2f7aa36dcde..8a23c1700c9 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -1241,8 +1241,8 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1); state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).TotalOutputRequired = 10000.0; - int ZoneNodeNum = UtilityRoutines::FindItemInList("SPACE1-1 NODE", state->dataLoopNodes->NodeID); - int InletNodeNum = UtilityRoutines::FindItemInList("SPACE1-1 IN NODE", state->dataLoopNodes->NodeID); + int ZoneNodeNum = Util::FindItemInList("SPACE1-1 NODE", state->dataLoopNodes->NodeID); + int InletNodeNum = Util::FindItemInList("SPACE1-1 IN NODE", state->dataLoopNodes->NodeID); EXPECT_EQ(state->dataLoopNodes->NodeID(InletNodeNum), "SPACE1-1 IN NODE"); EXPECT_EQ(state->dataLoopNodes->NodeID(ZoneNodeNum), "SPACE1-1 NODE"); @@ -1254,7 +1254,7 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) SetPointManager::SimSetPointManagers(*state); SetPointManager::UpdateSetPointManagers(*state); - int OutletNodeNum = UtilityRoutines::FindItemInList("VAV SYS 1 OUTLET NODE", state->dataLoopNodes->NodeID); + int OutletNodeNum = Util::FindItemInList("VAV SYS 1 OUTLET NODE", state->dataLoopNodes->NodeID); EXPECT_EQ(state->dataLoopNodes->NodeID(OutletNodeNum), "VAV SYS 1 OUTLET NODE"); EXPECT_DOUBLE_EQ(16.0, state->dataSetPointManager->WarmestSetPtMgr(1).SetPt); // no cooling load, sets to maximum limit value @@ -1265,7 +1265,7 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) ZoneSetPointTemp = state->dataLoopNodes->Node(ZoneNodeNum).Temp + state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).TotalOutputRequired / (CpAir * state->dataLoopNodes->Node(InletNodeNum).MassFlowRateMax); // check the value of ZoneSetPointTemp matches to the value calculated by ColdestSetPtMgr - int HCOutletNodeNum = UtilityRoutines::FindItemInList("HCOIL OUTLET NODE", state->dataLoopNodes->NodeID); + int HCOutletNodeNum = Util::FindItemInList("HCOIL OUTLET NODE", state->dataLoopNodes->NodeID); EXPECT_EQ(state->dataLoopNodes->NodeID(HCOutletNodeNum), "HCOIL OUTLET NODE"); EXPECT_DOUBLE_EQ(ZoneSetPointTemp, state->dataSetPointManager->ColdestSetPtMgr(1).SetPt); // 29.74 deg C EXPECT_DOUBLE_EQ(ZoneSetPointTemp, state->dataLoopNodes->Node(HCOutletNodeNum).TempSetPoint); // 29.74 deg C @@ -1546,13 +1546,13 @@ TEST_F(EnergyPlusFixture, SingZoneCoolHeatSetPtMgrSetPtTest) state->dataZoneEquip->ZoneEquipConfig(1).InletNodeAirLoopNum.allocate(1); state->dataZoneEquip->ZoneEquipConfig(1).AirDistUnitCool.allocate(1); state->dataZoneEquip->ZoneEquipConfig(1).AirDistUnitHeat.allocate(1); - int zoneNodeNum = UtilityRoutines::FindItemInList("ZSF1 NODE", state->dataLoopNodes->NodeID); + int zoneNodeNum = Util::FindItemInList("ZSF1 NODE", state->dataLoopNodes->NodeID); state->dataZoneEquip->ZoneEquipConfig(1).ZoneNode = zoneNodeNum; - int inletNodeNum = UtilityRoutines::FindItemInList("ZSF1 INLET NODE", state->dataLoopNodes->NodeID); + int inletNodeNum = Util::FindItemInList("ZSF1 INLET NODE", state->dataLoopNodes->NodeID); state->dataZoneEquip->ZoneEquipConfig(1).InletNode(1) = inletNodeNum; state->dataZoneEquip->ZoneEquipConfig(1).InletNodeAirLoopNum(1) = 1; - int coolSPNodeNum = UtilityRoutines::FindItemInList("ZONE EQUIPMENT 1 INLET NODE", state->dataLoopNodes->NodeID); - int heatSPNodeNum = UtilityRoutines::FindItemInList("AIR LOOP 1 OUTLET NODE", state->dataLoopNodes->NodeID); + int coolSPNodeNum = Util::FindItemInList("ZONE EQUIPMENT 1 INLET NODE", state->dataLoopNodes->NodeID); + int heatSPNodeNum = Util::FindItemInList("AIR LOOP 1 OUTLET NODE", state->dataLoopNodes->NodeID); auto &zoneNode(state->dataLoopNodes->Node(zoneNodeNum)); auto &inletNode(state->dataLoopNodes->Node(inletNodeNum)); diff --git a/tst/EnergyPlus/unit/SimAirServingZones.unit.cc b/tst/EnergyPlus/unit/SimAirServingZones.unit.cc index 38bc912964e..220ffe9a957 100644 --- a/tst/EnergyPlus/unit/SimAirServingZones.unit.cc +++ b/tst/EnergyPlus/unit/SimAirServingZones.unit.cc @@ -2419,9 +2419,9 @@ TEST_F(EnergyPlusFixture, DISABLED_AirLoop_ReturnFan_MinFlow) SimulationManager::ManageSimulation(*state); // run the design days int returnFanNode = - UtilityRoutines::FindItemInList("VSD RETURN FAN OUTLET TO MIXING BOX NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + Util::FindItemInList("VSD RETURN FAN OUTLET TO MIXING BOX NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); EXPECT_GT(returnFanNode, 0); - int supplyOutletNode = UtilityRoutines::FindItemInList("SUPPLY SIDE OUTLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int supplyOutletNode = Util::FindItemInList("SUPPLY SIDE OUTLET NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); EXPECT_GT(returnFanNode, 0); EXPECT_GT(supplyOutletNode, 0); diff --git a/tst/EnergyPlus/unit/SimulationManager.unit.cc b/tst/EnergyPlus/unit/SimulationManager.unit.cc index e76fe8fd381..afc395145bb 100644 --- a/tst/EnergyPlus/unit/SimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/SimulationManager.unit.cc @@ -135,13 +135,13 @@ TEST_F(EnergyPlusFixture, Simulationmanager_writeIntialPerfLogValues) fs::remove(state->dataStrGlobals->outputPerfLogFilePath); // make sure the static variables are cleared - UtilityRoutines::appendPerfLog(*state, "RESET", "RESET"); + Util::appendPerfLog(*state, "RESET", "RESET"); // call the function to test SimulationManager::writeIntialPerfLogValues(*state, "MODE193"); // force the file to be written - UtilityRoutines::appendPerfLog(*state, "lastHeader", "lastValue", true); + Util::appendPerfLog(*state, "lastHeader", "lastValue", true); std::ifstream perfLogFile; std::stringstream perfLogStrSteam; diff --git a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc index 8ab793cb997..a249811cac4 100644 --- a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc +++ b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc @@ -87,27 +87,27 @@ class SizingAnalysisObjectsTest : public EnergyPlusFixture state->dataGlobal->TimeStepZone = 0.25; // setup weather manager state needed - state->dataWeatherManager->NumOfEnvrn = 2; - state->dataWeatherManager->Environment.allocate(state->dataWeatherManager->NumOfEnvrn); - state->dataWeatherManager->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(1).DesignDayNum = 1; + state->dataWeather->NumOfEnvrn = 2; + state->dataWeather->Environment.allocate(state->dataWeather->NumOfEnvrn); + state->dataWeather->Environment(1).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(1).DesignDayNum = 1; - state->dataWeatherManager->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; - state->dataWeatherManager->Environment(2).DesignDayNum = 2; + state->dataWeather->Environment(2).KindOfEnvrn = Constant::KindOfSim::DesignDay; + state->dataWeather->Environment(2).DesignDayNum = 2; averagingWindow = 1; logIndex = sizingLoggerFrameObj.SetupVariableSizingLog(*state, LogVal, averagingWindow); - state->dataWeatherManager->NumOfEnvrn = 4; - state->dataWeatherManager->Environment.redimension(state->dataWeatherManager->NumOfEnvrn); + state->dataWeather->NumOfEnvrn = 4; + state->dataWeather->Environment.redimension(state->dataWeather->NumOfEnvrn); - state->dataWeatherManager->Environment(3).KindOfEnvrn = Constant::KindOfSim::HVACSizeDesignDay; - state->dataWeatherManager->Environment(3).DesignDayNum = 1; - state->dataWeatherManager->Environment(3).SeedEnvrnNum = 1; + state->dataWeather->Environment(3).KindOfEnvrn = Constant::KindOfSim::HVACSizeDesignDay; + state->dataWeather->Environment(3).DesignDayNum = 1; + state->dataWeather->Environment(3).SeedEnvrnNum = 1; - state->dataWeatherManager->Environment(4).KindOfEnvrn = Constant::KindOfSim::HVACSizeDesignDay; - state->dataWeatherManager->Environment(4).DesignDayNum = 2; - state->dataWeatherManager->Environment(4).SeedEnvrnNum = 2; + state->dataWeather->Environment(4).KindOfEnvrn = Constant::KindOfSim::HVACSizeDesignDay; + state->dataWeather->Environment(4).DesignDayNum = 2; + state->dataWeather->Environment(4).SeedEnvrnNum = 2; OutputProcessor::SetupTimePointers(*state, OutputProcessor::SOVTimeStepType::Zone, state->dataGlobal->TimeStepZone); OutputProcessor::SetupTimePointers(*state, OutputProcessor::SOVTimeStepType::HVAC, state->dataHVACGlobal->TimeStepSys); @@ -152,8 +152,8 @@ TEST_F(SizingAnalysisObjectsTest, testZoneUpdateInLoggerFramework) state->dataGlobal->KindOfSim = Constant::KindOfSim::HVACSizeDesignDay; state->dataGlobal->DayOfSim = 1; state->dataGlobal->HourOfDay = 1; - state->dataWeatherManager->Envrn = 3; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 1; + state->dataWeather->Envrn = 3; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 1; sizingLoggerFrameObj.SetupSizingLogsNewEnvironment(*state); state->dataGlobal->TimeStep = 1; @@ -173,8 +173,8 @@ TEST_F(SizingAnalysisObjectsTest, testZoneUpdateInLoggerFramework) // first step of second design day state->dataGlobal->HourOfDay = 1; state->dataGlobal->TimeStep = 1; - state->dataWeatherManager->Envrn = 4; - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).DesignDayNum = 2; + state->dataWeather->Envrn = 4; + state->dataWeather->Environment(state->dataWeather->Envrn).DesignDayNum = 2; sizingLoggerFrameObj.SetupSizingLogsNewEnvironment(*state); LogVal = midLogVal; sizingLoggerFrameObj.UpdateSizingLogValuesZoneStep(*state); diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 8d9634acf9c..4ac5fbcc7fd 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -687,7 +687,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_FigureSolarBeamAtTimestep) state->dataBSDFWindow->SUNCOSTS(4, 9)(3) = 0.1; FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); - int windowSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + int windowSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); EXPECT_NEAR(0.6504, state->dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(4, 9, windowSurfNum), 0.0001); EXPECT_NEAR(0.9152, state->dataSolarShading->SurfDifShdgRatioHorizHRTS(4, 9, windowSurfNum), 0.0001); } @@ -1098,11 +1098,11 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) EXPECT_FALSE(state->dataSolarShading->SUNCOS(3) < DataEnvironment::SunIsUpValue); - int surfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); EXPECT_DOUBLE_EQ(1, state->dataHeatBal->SurfSunlitFrac(9, 4, surfNum)); - surfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); EXPECT_DOUBLE_EQ(1, state->dataHeatBal->SurfSunlitFrac(9, 4, surfNum)); - surfNum = UtilityRoutines::FindItemInList("ZN001:ROOF", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZN001:ROOF", state->dataSurface->Surface); EXPECT_DOUBLE_EQ(0.5432, state->dataHeatBal->SurfSunlitFrac(9, 4, surfNum)); } @@ -1877,7 +1877,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonClippingDirect) state->dataSolarShading->CalcSkyDifShading = false; FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); - int surfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); EXPECT_NEAR(0.6504, state->dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(4, 9, surfNum), 0.0001); EXPECT_NEAR(0.9152, state->dataSolarShading->SurfDifShdgRatioHorizHRTS(4, 9, surfNum), 0.0001); @@ -3156,7 +3156,7 @@ TEST_F(EnergyPlusFixture, SolarShading_TestSurfsPropertyViewFactor) SolarShading::InitSolarCalculations(*state); SolarShading::SkyDifSolarShading(*state); - int windowSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + int windowSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); auto &win_Surface = state->dataSurface->Surface(windowSurfNum); // check exterior default surfaces sky and ground view factors EXPECT_DOUBLE_EQ(0.5, win_Surface.ViewFactorSkyIR); @@ -4173,10 +4173,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap) SurfaceGeometry::GetGeometryParameters(*state, FoundError); EXPECT_FALSE(FoundError); - WeatherManager::GetLocationInfo(*state, FoundError); + Weather::GetLocationInfo(*state, FoundError); EXPECT_FALSE(FoundError); - WeatherManager::CheckLocationValidity(*state); + Weather::CheckLocationValidity(*state); state->dataSurfaceGeometry->CosZoneRelNorth.allocate(1); state->dataSurfaceGeometry->SinZoneRelNorth.allocate(1); @@ -4220,10 +4220,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap) SolarShading::PerformSolarCalculations(*state); // Get surface nums - int winSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); - int wallSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); - int overhangSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:SHADE001", state->dataSurface->Surface); - int treeSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:TREE", state->dataSurface->Surface); + int winSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + int wallSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); + int overhangSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:SHADE001", state->dataSurface->Surface); + int treeSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:TREE", state->dataSurface->Surface); // Get shading surface schedule indexes int overhangSchedNum = state->dataSurface->Surface(overhangSurfNum).SchedShadowSurfIndex; @@ -4602,10 +4602,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap2) SurfaceGeometry::GetGeometryParameters(*state, FoundError); EXPECT_FALSE(FoundError); - WeatherManager::GetLocationInfo(*state, FoundError); + Weather::GetLocationInfo(*state, FoundError); EXPECT_FALSE(FoundError); - WeatherManager::CheckLocationValidity(*state); + Weather::CheckLocationValidity(*state); state->dataSurfaceGeometry->CosZoneRelNorth.allocate(1); state->dataSurfaceGeometry->SinZoneRelNorth.allocate(1); @@ -4649,10 +4649,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap2) SolarShading::PerformSolarCalculations(*state); // Get surface nums - int winSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); - int wallSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); - int shade1SurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:SHADE1", state->dataSurface->Surface); - int shade2SurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:SHADE2", state->dataSurface->Surface); + int winSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + int wallSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); + int shade1SurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:SHADE1", state->dataSurface->Surface); + int shade2SurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:SHADE2", state->dataSurface->Surface); // Get shading surface schedule indexes int shade1SchedNum = state->dataSurface->Surface(shade1SurfNum).SchedShadowSurfIndex; @@ -4963,10 +4963,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap3) SurfaceGeometry::GetGeometryParameters(*state, FoundError); EXPECT_FALSE(FoundError); - WeatherManager::GetLocationInfo(*state, FoundError); + Weather::GetLocationInfo(*state, FoundError); EXPECT_FALSE(FoundError); - WeatherManager::CheckLocationValidity(*state); + Weather::CheckLocationValidity(*state); state->dataSurfaceGeometry->CosZoneRelNorth.allocate(1); state->dataSurfaceGeometry->SinZoneRelNorth.allocate(1); @@ -5010,8 +5010,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap3) SolarShading::PerformSolarCalculations(*state); // Get surface nums - int winSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); - int wallSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); + int winSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + int wallSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); // Use the base transmittance schedules (no EMS override) // shade1 transmittance = 0.5, shade2 transmittance = 0.8 diff --git a/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc b/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc index 84444ab0099..bae931172a8 100644 --- a/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc +++ b/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc @@ -93,7 +93,7 @@ TEST_F(EnergyPlusFixture, SortAndStringUtilitiesTest_findItemInSortedListUndersc iListOfObjects.allocate(NumObjectDefs); SetupAndSort(ListOfObjects, iListOfObjects); // list is resorted - auto index = UtilityRoutines::FindItemInSortedList("SYSTEM NODE TEMPERATURE", ListOfObjects, NumObjectDefs); + auto index = Util::FindItemInSortedList("SYSTEM NODE TEMPERATURE", ListOfObjects, NumObjectDefs); EXPECT_EQ(3, index); } diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 33000f0e0e2..4c10d01f90a 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -517,31 +517,31 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SurfaceShape) // enum surfaceShape:Triangle = 1 // "Surface 1 - Triangle" - int surfNum = UtilityRoutines::FindItemInList("SURFACE 1 - TRIANGLE", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("SURFACE 1 - TRIANGLE", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_TRUE(compare_enums(SurfaceShape::Triangle, state->dataSurface->Surface(surfNum).Shape)); // enum surfaceShape:Quadrilateral = 2 // "Surface 2 - Quadrilateral" - surfNum = UtilityRoutines::FindItemInList("SURFACE 2 - QUADRILATERAL", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 2 - QUADRILATERAL", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_TRUE(compare_enums(SurfaceShape::Quadrilateral, state->dataSurface->Surface(surfNum).Shape)); // enum surfaceShape:Rectangle = 3 // "Surface 3 - Rectangle" - surfNum = UtilityRoutines::FindItemInList("SURFACE 3 - RECTANGLE", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 3 - RECTANGLE", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_TRUE(compare_enums(SurfaceShape::Rectangle, state->dataSurface->Surface(surfNum).Shape)); // enum surfaceShape:RectangularDoorWindow = 4 // "Surface 4 - RectangularDoorWindow" - surfNum = UtilityRoutines::FindItemInList("SURFACE 4 - RECTANGULARDOORWINDOW", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 4 - RECTANGULARDOORWINDOW", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_TRUE(compare_enums(SurfaceShape::RectangularDoorWindow, state->dataSurface->Surface(surfNum).Shape)); // enum surfaceShape:RectangularOverhang = 5 // "Surface 5 - RectangularOverhang" - surfNum = UtilityRoutines::FindItemInList("SURFACE 5 - RECTANGULAROVERHANG", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 5 - RECTANGULAROVERHANG", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_FALSE(compare_enums(SurfaceShape::RectangularOverhang, state->dataSurface->Surface(surfNum).Shape, @@ -549,7 +549,7 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SurfaceShape) // enum surfaceShape:RectangularLeftFin = 6 // "Surface 6 - RectangularLeftFin" - surfNum = UtilityRoutines::FindItemInList("SURFACE 6 - RECTANGULARLEFTFIN Left", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 6 - RECTANGULARLEFTFIN Left", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_FALSE(compare_enums(SurfaceShape::RectangularLeftFin, state->dataSurface->Surface(surfNum).Shape, @@ -557,7 +557,7 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SurfaceShape) // enum surfaceShape:RectangularRightFin = 7 // "Surface 7 - RectangularRightFin" - surfNum = UtilityRoutines::FindItemInList("SURFACE 7 - RECTANGULARRIGHTFIN Right", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 7 - RECTANGULARRIGHTFIN Right", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_FALSE(compare_enums(SurfaceShape::RectangularRightFin, state->dataSurface->Surface(surfNum).Shape, @@ -565,19 +565,19 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SurfaceShape) // enum surfaceShape:TriangularWindow = 8 // "Surface 8 - TriangularWindow" - surfNum = UtilityRoutines::FindItemInList("SURFACE 8 - TRIANGULARWINDOW", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 8 - TRIANGULARWINDOW", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_TRUE(compare_enums(SurfaceShape::TriangularWindow, state->dataSurface->Surface(surfNum).Shape)); // enum surfaceShape:TriangularDoor = 9 // "Surface 9 - TriangularDoor" - surfNum = UtilityRoutines::FindItemInList("SURFACE 9 - TRIANGULARDOOR", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 9 - TRIANGULARDOOR", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_TRUE(compare_enums(SurfaceShape::TriangularDoor, state->dataSurface->Surface(surfNum).Shape)); // enum surfaceShape:Polygonal = 10 // "Surface 10 - Polygonal" - surfNum = UtilityRoutines::FindItemInList("SURFACE 10 - POLYGONAL", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE 10 - POLYGONAL", state->dataSurface->Surface); ProcessSurfaceVertices(*state, surfNum, ErrorsFound); EXPECT_TRUE(compare_enums(SurfaceShape::Polygonal, state->dataSurface->Surface(surfNum).Shape)); } @@ -971,19 +971,19 @@ TEST_F(EnergyPlusFixture, MakeEquivalentRectangle) // For each surface Run the test then Check the result // (1) rectangle window - int surfNum = UtilityRoutines::FindItemInList("SURFACE-1-RECTANGLE", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("SURFACE-1-RECTANGLE", state->dataSurface->Surface); MakeEquivalentRectangle(*state, surfNum, ErrorsFound); EXPECT_FALSE(ErrorsFound); // expect no errors EXPECT_NEAR(7.60, state->dataSurface->Surface(surfNum).Width, 0.01); EXPECT_NEAR(1.20, state->dataSurface->Surface(surfNum).Height, 0.01); // (2) trapzoid window - surfNum = UtilityRoutines::FindItemInList("SURFACE-2-TRAPZOID", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE-2-TRAPZOID", state->dataSurface->Surface); MakeEquivalentRectangle(*state, surfNum, ErrorsFound); EXPECT_FALSE(ErrorsFound); // expect no errors EXPECT_NEAR(7.80, state->dataSurface->Surface(surfNum).Width, 0.01); EXPECT_NEAR(1.17, state->dataSurface->Surface(surfNum).Height, 0.01); // (3) parallelogram window - surfNum = UtilityRoutines::FindItemInList("SURFACE-3-PARALLELOGRAM", state->dataSurface->Surface); + surfNum = Util::FindItemInList("SURFACE-3-PARALLELOGRAM", state->dataSurface->Surface); MakeEquivalentRectangle(*state, surfNum, ErrorsFound); EXPECT_FALSE(ErrorsFound); // expect no errors EXPECT_NEAR(8.08, state->dataSurface->Surface(surfNum).Width, 0.01); @@ -4126,19 +4126,19 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_HeatTransferAlgorithmTest) GetSurfaceData(*state, ErrorsFound); // setup zone geometry and get zone data EXPECT_FALSE(ErrorsFound); // expect no errors - int surfNum = UtilityRoutines::FindItemInList("DATATELCOM_CEILING_1_0_0", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("DATATELCOM_CEILING_1_0_0", state->dataSurface->Surface); EXPECT_TRUE(compare_enums(DataSurfaces::HeatTransferModel::CondFD, state->dataSurface->Surface(surfNum).HeatTransferAlgorithm)); EXPECT_TRUE(state->dataHeatBal->AnyCondFD); - surfNum = UtilityRoutines::FindItemInList("ZONE1_FLOOR_4_0_10000", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZONE1_FLOOR_4_0_10000", state->dataSurface->Surface); EXPECT_TRUE(compare_enums(DataSurfaces::HeatTransferModel::CondFD, state->dataSurface->Surface(surfNum).HeatTransferAlgorithm)); EXPECT_TRUE(state->dataHeatBal->AnyEMPD); // input as EMPD but then later overriden to CondFD - see error message below - surfNum = UtilityRoutines::FindItemInList("ZONE1_FLOOR_4_0_20000", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZONE1_FLOOR_4_0_20000", state->dataSurface->Surface); EXPECT_TRUE(compare_enums(DataSurfaces::HeatTransferModel::HAMT, state->dataSurface->Surface(surfNum).HeatTransferAlgorithm)); EXPECT_TRUE(state->dataHeatBal->AnyHAMT); - surfNum = UtilityRoutines::FindItemInList("ZONE1_FLOOR_4_0_30000", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZONE1_FLOOR_4_0_30000", state->dataSurface->Surface); EXPECT_TRUE(compare_enums(DataSurfaces::HeatTransferModel::CTF, state->dataSurface->Surface(surfNum).HeatTransferAlgorithm)); EXPECT_TRUE(state->dataHeatBal->AnyCTF); @@ -4164,11 +4164,11 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_HeatTransferAlgorithmTest) EXPECT_EQ(state->dataSurface->AllHTSurfaceList.size(), 4u); EXPECT_EQ(state->dataSurface->AllIZSurfaceList.size(), 2u); - int zoneNum = UtilityRoutines::FindItemInList("DATATELCOM", state->dataHeatBal->Zone); + int zoneNum = Util::FindItemInList("DATATELCOM", state->dataHeatBal->Zone); EXPECT_EQ(state->dataHeatBal->Zone(zoneNum).ZoneHTSurfaceList.size(), 2u); EXPECT_EQ(state->dataHeatBal->Zone(zoneNum).ZoneIZSurfaceList.size(), 2u); - zoneNum = UtilityRoutines::FindItemInList("ZONE1", state->dataHeatBal->Zone); + zoneNum = Util::FindItemInList("ZONE1", state->dataHeatBal->Zone); EXPECT_EQ(state->dataHeatBal->Zone(zoneNum).ZoneHTSurfaceList.size(), 4u); EXPECT_EQ(state->dataHeatBal->Zone(zoneNum).ZoneIZSurfaceList.size(), 2u); } @@ -5390,23 +5390,23 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresNoAirBoundari EXPECT_FALSE(ErrorsFound); // expect no errors EXPECT_EQ(state->dataViewFactor->NumOfRadiantEnclosures, 3); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(3).Name, "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(3).spaceNames[0], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(3).Name, "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(3).spaceNames[0], "Space 3")); EXPECT_EQ(state->dataHeatBal->space(1).radiantEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).radiantEnclosureNum, 2); EXPECT_EQ(state->dataHeatBal->space(3).radiantEnclosureNum, 3); EXPECT_EQ(state->dataViewFactor->NumOfSolarEnclosures, 3); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(3).Name, "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(3).spaceNames[0], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(3).Name, "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(3).spaceNames[0], "Space 3")); EXPECT_EQ(state->dataHeatBal->space(1).solarEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).solarEnclosureNum, 2); EXPECT_EQ(state->dataHeatBal->space(3).solarEnclosureNum, 3); @@ -5593,19 +5593,19 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda EXPECT_FALSE(ErrorsFound); // expect no errors EXPECT_EQ(state->dataViewFactor->NumOfRadiantEnclosures, 1); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[2], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[2], "Space 3")); EXPECT_EQ(state->dataHeatBal->space(1).radiantEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).radiantEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(3).radiantEnclosureNum, 1); EXPECT_EQ(state->dataViewFactor->NumOfSolarEnclosures, 1); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[2], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[2], "Space 3")); EXPECT_EQ(state->dataHeatBal->space(1).solarEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).solarEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(3).solarEnclosureNum, 1); @@ -5805,33 +5805,33 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda // For this test case, Zones 1 and 3 share radiant and solar enclosures EXPECT_EQ(state->dataViewFactor->NumOfRadiantEnclosures, 2); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 2")); EXPECT_EQ(state->dataHeatBal->space(1).radiantEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).radiantEnclosureNum, 2); EXPECT_EQ(state->dataHeatBal->space(3).radiantEnclosureNum, 1); EXPECT_EQ(state->dataViewFactor->NumOfSolarEnclosures, 2); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 2")); EXPECT_EQ(state->dataHeatBal->space(1).solarEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).solarEnclosureNum, 2); EXPECT_EQ(state->dataHeatBal->space(3).solarEnclosureNum, 1); // Check surface order - int Zone1Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone1-Surface1"), state->dataSurface->Surface); - int Zone1Surface2 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone1-Surface2"), state->dataSurface->Surface); - int Zone2Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone2-Surface1"), state->dataSurface->Surface); - int Zone3Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone3-Surface1"), state->dataSurface->Surface); - int Zone1Floor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone1-Floor"), state->dataSurface->Surface); - int Zone2Floor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone2-Floor"), state->dataSurface->Surface); - int Zone3Floor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone3-Floor"), state->dataSurface->Surface); + int Zone1Surface1 = Util::FindItemInList(Util::makeUPPER("Zone1-Surface1"), state->dataSurface->Surface); + int Zone1Surface2 = Util::FindItemInList(Util::makeUPPER("Zone1-Surface2"), state->dataSurface->Surface); + int Zone2Surface1 = Util::FindItemInList(Util::makeUPPER("Zone2-Surface1"), state->dataSurface->Surface); + int Zone3Surface1 = Util::FindItemInList(Util::makeUPPER("Zone3-Surface1"), state->dataSurface->Surface); + int Zone1Floor = Util::FindItemInList(Util::makeUPPER("Zone1-Floor"), state->dataSurface->Surface); + int Zone2Floor = Util::FindItemInList(Util::makeUPPER("Zone2-Floor"), state->dataSurface->Surface); + int Zone3Floor = Util::FindItemInList(Util::makeUPPER("Zone3-Floor"), state->dataSurface->Surface); EXPECT_EQ(state->dataHeatBal->Zone(1).AllSurfaceFirst, Zone1Surface2); // air boundary surface EXPECT_EQ(state->dataHeatBal->Zone(1).AllSurfaceFirst + 1, Zone1Surface1); // air boundary surface @@ -6258,12 +6258,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda // This should trigger the enclosure merging and all five zones should share a radiant and solar enclosure EXPECT_EQ(state->dataViewFactor->NumOfRadiantEnclosures, 1); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[2], "Space 5")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[3], "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[4], "Space 4")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[2], "Space 5")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[3], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[4], "Space 4")); EXPECT_EQ(state->dataHeatBal->space(1).radiantEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).radiantEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(3).radiantEnclosureNum, 1); @@ -6271,12 +6271,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda EXPECT_EQ(state->dataHeatBal->space(5).radiantEnclosureNum, 1); EXPECT_EQ(state->dataViewFactor->NumOfSolarEnclosures, 1); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[2], "Space 5")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[3], "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[4], "Space 4")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[2], "Space 5")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[3], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[4], "Space 4")); EXPECT_EQ(state->dataHeatBal->space(1).solarEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(2).solarEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(3).solarEnclosureNum, 1); @@ -6806,38 +6806,38 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda // That proved difficult to reproduce, however the root cause of the crash is space enclosure nums that are not consistent // with the enclosures that hold them. This test demostrates that failure. EXPECT_EQ(state->dataViewFactor->NumOfRadiantEnclosures, 3); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 5")); - - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Radiant Enclosure 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 6")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[1], "Space 7")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[2], "Space 10")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[3], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[4], "Space 4")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[5], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[6], "Space 9")); - - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(3).Name, "Zone 8")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(3).spaceNames[0], "Space 8")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 5")); + + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Radiant Enclosure 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 6")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[1], "Space 7")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[2], "Space 10")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[3], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[4], "Space 4")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[5], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[6], "Space 9")); + + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(3).Name, "Zone 8")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(3).spaceNames[0], "Space 8")); EXPECT_EQ(state->dataViewFactor->NumOfSolarEnclosures, 3); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 3")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 5")); - - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Solar Enclosure 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 6")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[1], "Space 7")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[2], "Space 10")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[3], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[4], "Space 4")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[5], "Space 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[6], "Space 9")); - - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(3).Name, "Zone 8")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(3).spaceNames[0], "Space 8")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 5")); + + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Solar Enclosure 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 6")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[1], "Space 7")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[2], "Space 10")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[3], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[4], "Space 4")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[5], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[6], "Space 9")); + + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(3).Name, "Zone 8")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(3).spaceNames[0], "Space 8")); // Loop through all spaces on all enclosures and check that space radiantEnlosureNum matches the enclosure number // Before the fix, Space 3 and Space 5 have incorrect radiantEnclosureNum = 2 (should be 1) @@ -7097,24 +7097,24 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda EXPECT_FALSE(ErrorsFound); // expect no errors EXPECT_EQ(state->dataViewFactor->NumOfRadiantEnclosures, 2); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).Name, "Radiant Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(1).spaceNames[1], "Space 3")); EXPECT_EQ(state->dataHeatBal->space(1).radiantEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(3).radiantEnclosureNum, 1); Real64 enclArea = state->dataHeatBal->space(1).FloorArea + state->dataHeatBal->space(3).FloorArea; EXPECT_EQ(state->dataViewFactor->EnclRadInfo(1).FloorArea, enclArea); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Zone 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).Name, "Zone 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclRadInfo(2).spaceNames[0], "Space 2")); EXPECT_EQ(state->dataHeatBal->space(2).radiantEnclosureNum, 2); enclArea = state->dataHeatBal->space(2).FloorArea; EXPECT_EQ(state->dataViewFactor->EnclRadInfo(2).FloorArea, enclArea); EXPECT_EQ(state->dataViewFactor->NumOfSolarEnclosures, 2); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 3")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).Name, "Solar Enclosure 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[0], "Space 1")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(1).spaceNames[1], "Space 3")); EXPECT_EQ(state->dataHeatBal->space(1).solarEnclosureNum, 1); EXPECT_EQ(state->dataHeatBal->space(3).solarEnclosureNum, 1); enclArea = state->dataHeatBal->space(1).FloorArea + state->dataHeatBal->space(3).FloorArea; @@ -7123,8 +7123,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda Real64 enclTotSurfArea = state->dataHeatBal->space(1).totalSurfArea + state->dataHeatBal->space(3).totalSurfArea; EXPECT_EQ(state->dataViewFactor->EnclSolInfo(1).TotalSurfArea, enclTotSurfArea); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Zone 2")); - EXPECT_TRUE(UtilityRoutines::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).Name, "Zone 2")); + EXPECT_TRUE(Util::SameString(state->dataViewFactor->EnclSolInfo(2).spaceNames[0], "Space 2")); EXPECT_EQ(state->dataHeatBal->space(2).solarEnclosureNum, 2); enclArea = state->dataHeatBal->space(2).FloorArea; EXPECT_EQ(state->dataViewFactor->EnclSolInfo(2).FloorArea, enclArea); @@ -8799,18 +8799,14 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) // Simulation Order (1-based): // SHADING SURFACES: - int siteShadeShadeFlatShadeSurface = - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); - int mirSiteShadeFlatShadeSurface = - UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::makeUPPER("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); - int buildingShadeTiltedShadeSurface = - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); + int siteShadeShadeFlatShadeSurface = Util::FindItemInList(Util::makeUPPER("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); + int mirSiteShadeFlatShadeSurface = Util::FindItemInList("Mir-" + Util::makeUPPER("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); + int buildingShadeTiltedShadeSurface = Util::FindItemInList(Util::makeUPPER("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); int mirBuildingShadeTiltedShadeSurface = - UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::makeUPPER("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); - int zoneShadeLivingSouthShade001 = - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); + Util::FindItemInList("Mir-" + Util::makeUPPER("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); + int zoneShadeLivingSouthShade001 = Util::FindItemInList(Util::makeUPPER("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); int mirZoneShadeLivingSouthShade001 = - UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::makeUPPER("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); + Util::FindItemInList("Mir-" + Util::makeUPPER("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); EXPECT_EQ(siteShadeShadeFlatShadeSurface, 1); EXPECT_EQ(mirSiteShadeFlatShadeSurface, 2); EXPECT_EQ(buildingShadeTiltedShadeSurface, 3); @@ -8819,20 +8815,19 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(mirZoneShadeLivingSouthShade001, 6); // LIVING ZONE: - int wallLivingNorth = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:North"), state->dataSurface->Surface); - int wallLivingEast = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:East"), state->dataSurface->Surface); - int wallLivingSouth = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:South"), state->dataSurface->Surface); - int wallLivingWest = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:West"), state->dataSurface->Surface); - int wallLivingInterior = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:Interior"), state->dataSurface->Surface); - int floorLivingFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:Floor"), state->dataSurface->Surface); - int ceilingLivingCeiling = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:Ceiling"), state->dataSurface->Surface); - int doorWestDoor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestDoor"), state->dataSurface->Surface); - int windowTubularDaylightingDiffuser1 = - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("TubularDaylightingDiffuser1"), state->dataSurface->Surface); - int windowNorthWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthWindow"), state->dataSurface->Surface); - int windowEastWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EastWindow"), state->dataSurface->Surface); - int windowSouthWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("SouthWindow"), state->dataSurface->Surface); - int windowWestWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestWindow"), state->dataSurface->Surface); + int wallLivingNorth = Util::FindItemInList(Util::makeUPPER("Living:North"), state->dataSurface->Surface); + int wallLivingEast = Util::FindItemInList(Util::makeUPPER("Living:East"), state->dataSurface->Surface); + int wallLivingSouth = Util::FindItemInList(Util::makeUPPER("Living:South"), state->dataSurface->Surface); + int wallLivingWest = Util::FindItemInList(Util::makeUPPER("Living:West"), state->dataSurface->Surface); + int wallLivingInterior = Util::FindItemInList(Util::makeUPPER("Living:Interior"), state->dataSurface->Surface); + int floorLivingFloor = Util::FindItemInList(Util::makeUPPER("Living:Floor"), state->dataSurface->Surface); + int ceilingLivingCeiling = Util::FindItemInList(Util::makeUPPER("Living:Ceiling"), state->dataSurface->Surface); + int doorWestDoor = Util::FindItemInList(Util::makeUPPER("WestDoor"), state->dataSurface->Surface); + int windowTubularDaylightingDiffuser1 = Util::FindItemInList(Util::makeUPPER("TubularDaylightingDiffuser1"), state->dataSurface->Surface); + int windowNorthWindow = Util::FindItemInList(Util::makeUPPER("NorthWindow"), state->dataSurface->Surface); + int windowEastWindow = Util::FindItemInList(Util::makeUPPER("EastWindow"), state->dataSurface->Surface); + int windowSouthWindow = Util::FindItemInList(Util::makeUPPER("SouthWindow"), state->dataSurface->Surface); + int windowWestWindow = Util::FindItemInList(Util::makeUPPER("WestWindow"), state->dataSurface->Surface); EXPECT_EQ(wallLivingNorth, 7); EXPECT_EQ(wallLivingEast, 8); @@ -8855,13 +8850,13 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceLast, 19); // GARAGE ZONE: - int wallGarageInterior = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:Interior"), state->dataSurface->Surface); - int wallGarageEast = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:EastWall"), state->dataSurface->Surface); - int wallGarageWest = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:WestWall"), state->dataSurface->Surface); - int wallGarageFrontDoor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:FrontDoor"), state->dataSurface->Surface); - int floorGarageFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:Floor"), state->dataSurface->Surface); - int ceilingGarageInterior = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:Ceiling"), state->dataSurface->Surface); - int intmassEVChargingStation = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EVChargingStation"), state->dataSurface->Surface); + int wallGarageInterior = Util::FindItemInList(Util::makeUPPER("Garage:Interior"), state->dataSurface->Surface); + int wallGarageEast = Util::FindItemInList(Util::makeUPPER("Garage:EastWall"), state->dataSurface->Surface); + int wallGarageWest = Util::FindItemInList(Util::makeUPPER("Garage:WestWall"), state->dataSurface->Surface); + int wallGarageFrontDoor = Util::FindItemInList(Util::makeUPPER("Garage:FrontDoor"), state->dataSurface->Surface); + int floorGarageFloor = Util::FindItemInList(Util::makeUPPER("Garage:Floor"), state->dataSurface->Surface); + int ceilingGarageInterior = Util::FindItemInList(Util::makeUPPER("Garage:Ceiling"), state->dataSurface->Surface); + int intmassEVChargingStation = Util::FindItemInList(Util::makeUPPER("EVChargingStation"), state->dataSurface->Surface); EXPECT_EQ(wallGarageInterior, 20); EXPECT_EQ(wallGarageEast, 21); @@ -8878,21 +8873,20 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(state->dataHeatBal->space(2).WindowSurfaceLast, -1); // ATTIC ZONE: - int wallEastGable = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EastGable"), state->dataSurface->Surface); - int wallWestGable = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestGable"), state->dataSurface->Surface); - int wallNorthGable = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthGable"), state->dataSurface->Surface); - int floorAtticLivingFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Attic:LivingFloor"), state->dataSurface->Surface); - int floorAtticGarageFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Attic:GarageFloor"), state->dataSurface->Surface); - int roofNorthRoof1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof1"), state->dataSurface->Surface); - int roofSouthRoof = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("SouthRoof"), state->dataSurface->Surface); - int roofNorthRoof2 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof2"), state->dataSurface->Surface); - int roofNorthRoof3 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof3"), state->dataSurface->Surface); - int roofNorthRoof4 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof4"), state->dataSurface->Surface); - int roofEastRoof = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EastRoof"), state->dataSurface->Surface); - int roofWestRoof = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestRoof"), state->dataSurface->Surface); - int nonwindowTubularDaylightingDome1 = - UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("TubularDaylightingDome1"), state->dataSurface->Surface); - int windowAtticSkylight = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("AtticSkylight"), state->dataSurface->Surface); + int wallEastGable = Util::FindItemInList(Util::makeUPPER("EastGable"), state->dataSurface->Surface); + int wallWestGable = Util::FindItemInList(Util::makeUPPER("WestGable"), state->dataSurface->Surface); + int wallNorthGable = Util::FindItemInList(Util::makeUPPER("NorthGable"), state->dataSurface->Surface); + int floorAtticLivingFloor = Util::FindItemInList(Util::makeUPPER("Attic:LivingFloor"), state->dataSurface->Surface); + int floorAtticGarageFloor = Util::FindItemInList(Util::makeUPPER("Attic:GarageFloor"), state->dataSurface->Surface); + int roofNorthRoof1 = Util::FindItemInList(Util::makeUPPER("NorthRoof1"), state->dataSurface->Surface); + int roofSouthRoof = Util::FindItemInList(Util::makeUPPER("SouthRoof"), state->dataSurface->Surface); + int roofNorthRoof2 = Util::FindItemInList(Util::makeUPPER("NorthRoof2"), state->dataSurface->Surface); + int roofNorthRoof3 = Util::FindItemInList(Util::makeUPPER("NorthRoof3"), state->dataSurface->Surface); + int roofNorthRoof4 = Util::FindItemInList(Util::makeUPPER("NorthRoof4"), state->dataSurface->Surface); + int roofEastRoof = Util::FindItemInList(Util::makeUPPER("EastRoof"), state->dataSurface->Surface); + int roofWestRoof = Util::FindItemInList(Util::makeUPPER("WestRoof"), state->dataSurface->Surface); + int nonwindowTubularDaylightingDome1 = Util::FindItemInList(Util::makeUPPER("TubularDaylightingDome1"), state->dataSurface->Surface); + int windowAtticSkylight = Util::FindItemInList(Util::makeUPPER("AtticSkylight"), state->dataSurface->Surface); EXPECT_EQ(wallEastGable, 27); EXPECT_EQ(wallWestGable, 28); @@ -10201,12 +10195,12 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_GetSurfaceGroundSurfsTest) EXPECT_FALSE(ErrorsFound); EXPECT_TRUE(state->dataGlobal->AnyLocalEnvironmentsInModel); // test surface property object inputs - int SrdSurfsNum = UtilityRoutines::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); + int SrdSurfsNum = Util::FindItemInList("SRDSURFS:FENESSURFACE", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(SrdSurfsNum).SurroundingSurfsPtr); - int GndSurfsNum = UtilityRoutines::FindItemInList("GNDSURFS:FENESSURFACE", state->dataSurface->GroundSurfsProperty); + int GndSurfsNum = Util::FindItemInList("GNDSURFS:FENESSURFACE", state->dataSurface->GroundSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(GndSurfsNum).GroundSurfsPtr); // set local derived data vars - int SurfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int SurfNum = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); SrdSurfsNum = state->dataSurface->Surface(SurfNum).SurfSurroundingSurfacesNum; auto &SrdSurfsProperty = state->dataSurface->SurroundingSurfsProperty(SrdSurfsNum); GndSurfsNum = state->dataSurface->Surface(SurfNum).SurfPropertyGndSurfIndex; @@ -11382,7 +11376,7 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_ShadingSurfaceScheduleChecks) static constexpr std::array isTransparent{false, true, false, false, false, true, false, false}; for (int surf = 0; surf < 8; ++surf) { - int surfNum = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER(surfacenames[surf]), state->dataSurface->Surface); + int surfNum = Util::FindItemInList(Util::makeUPPER(surfacenames[surf]), state->dataSurface->Surface); EXPECT_EQ(state->dataSurface->Surface(surfNum).IsTransparent, isTransparent[surf]); } EXPECT_TRUE(state->dataSolarShading->anyScheduledShadingSurface); @@ -11874,9 +11868,9 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_SurroundingSurfacesViewFactorTest) int srdSurfsNum = 0; int srdSurfsPropNum = 0; // test 1: exterior north wall - srdSurfsPropNum = UtilityRoutines::FindItemInList("SRDSURFS:NORTH-WALL", state->dataSurface->SurroundingSurfsProperty); + srdSurfsPropNum = Util::FindItemInList("SRDSURFS:NORTH-WALL", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(1, state->dataSurface->SurfLocalEnvironment(srdSurfsPropNum).SurroundingSurfsPtr); - surfNum = UtilityRoutines::FindItemInList("NORTH-WALL", state->dataSurface->Surface); + surfNum = Util::FindItemInList("NORTH-WALL", state->dataSurface->Surface); auto &surface_north_wall = state->dataSurface->Surface(surfNum); srdSurfsNum = state->dataSurface->Surface(surfNum).SurfSurroundingSurfacesNum; auto &srdSurfsProperty_north = state->dataSurface->SurroundingSurfsProperty(srdSurfsNum); @@ -11902,9 +11896,9 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_SurroundingSurfacesViewFactorTest) EXPECT_DOUBLE_EQ(1.0, surface_north_wall.ViewFactorSrdSurfs + surface_north_wall.ViewFactorSkyIR + surface_north_wall.ViewFactorGroundIR); // test 2: exterior east wall - srdSurfsPropNum = UtilityRoutines::FindItemInList("SRDSURFS:EAST-WALL", state->dataSurface->SurroundingSurfsProperty); + srdSurfsPropNum = Util::FindItemInList("SRDSURFS:EAST-WALL", state->dataSurface->SurroundingSurfsProperty); EXPECT_EQ(2, state->dataSurface->SurfLocalEnvironment(srdSurfsPropNum).SurroundingSurfsPtr); - surfNum = UtilityRoutines::FindItemInList("EAST-WALL", state->dataSurface->Surface); + surfNum = Util::FindItemInList("EAST-WALL", state->dataSurface->Surface); auto &surface_east_wall = state->dataSurface->Surface(surfNum); srdSurfsNum = state->dataSurface->Surface(surfNum).SurfSurroundingSurfacesNum; auto &srdSurfsProperty_east = state->dataSurface->SurroundingSurfsProperty(srdSurfsNum); diff --git a/tst/EnergyPlus/unit/SystemReports.unit.cc b/tst/EnergyPlus/unit/SystemReports.unit.cc index 2c061664661..86731c0d40e 100644 --- a/tst/EnergyPlus/unit/SystemReports.unit.cc +++ b/tst/EnergyPlus/unit/SystemReports.unit.cc @@ -111,7 +111,7 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).EndUse_CompMode = SystemReports::EndUseType::CoolingOnly; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).CurMeterReading = 100.0; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).ResourceType = - static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("NaturalGas"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER("NaturalGas"))); state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).Name = "Main Gas Heating Coil"; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).TypeOf = "COIL:HEATING:DESUPERHEATER"; @@ -122,7 +122,7 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).EndUse_CompMode = SystemReports::EndUseType::CoolingOnly; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).CurMeterReading = 100.0; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).ResourceType = - static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("NaturalGas"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER("NaturalGas"))); state->dataLoopNodes->Node(1).MassFlowRate = 1.0; state->dataLoopNodes->Node(2).MassFlowRate = 1.0; @@ -160,9 +160,9 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) state->dataSysRpts->SysLoadRepVars(1).TotNaturalGas = 0; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).ResourceType = - static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("Propane"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER("Propane"))); state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).ResourceType = - static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("Propane"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, Util::makeUPPER("Propane"))); // Calculate SysHumidPropane ("Air System Humidifier Propane Energy" Output Variable) CalcSystemEnergyUse(*state, diff --git a/tst/EnergyPlus/unit/ThermalChimney.unit.cc b/tst/EnergyPlus/unit/ThermalChimney.unit.cc index ddbecabb69c..2b83d9c640e 100644 --- a/tst/EnergyPlus/unit/ThermalChimney.unit.cc +++ b/tst/EnergyPlus/unit/ThermalChimney.unit.cc @@ -1144,13 +1144,13 @@ TEST_F(EnergyPlusFixture, ThermalChimney_EMSAirflow_Test) state->dataHeatBalSurf->SurfHConvInt.allocate(state->dataSurface->TotSurfaces); state->dataHeatBalSurf->SurfHConvInt = 0.1; state->dataHeatBalSurf->SurfTempIn = 25.00; - int surfNum = UtilityRoutines::FindItemInList("ZN002:WALL001", state->dataSurface->Surface); + int surfNum = Util::FindItemInList("ZN002:WALL001", state->dataSurface->Surface); state->dataHeatBalSurf->SurfTempIn(surfNum) = 25.92; - surfNum = UtilityRoutines::FindItemInList("ZN002:WALL001:WIN001", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZN002:WALL001:WIN001", state->dataSurface->Surface); state->dataHeatBalSurf->SurfTempIn(surfNum) = 25.92; - surfNum = UtilityRoutines::FindItemInList("ZN002:WALL004", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZN002:WALL004", state->dataSurface->Surface); state->dataHeatBalSurf->SurfTempIn(surfNum) = 26.99; - surfNum = UtilityRoutines::FindItemInList("ZN004:WALL001:WIN001", state->dataSurface->Surface); + surfNum = Util::FindItemInList("ZN004:WALL001:WIN001", state->dataSurface->Surface); state->dataHeatBalSurf->SurfTempIn(surfNum) = 22.99; state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); for (auto &thisZoneHB : state->dataZoneTempPredictorCorrector->zoneHeatBalance) { diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 7e0bff099b5..b3db270b8ac 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -4372,17 +4372,14 @@ SetpointManager:Scheduled, sensOut, latOut); - int unitarySystemAirInletNodeIndex = UtilityRoutines::FindItemInList("ZONE EXHAUST NODE", state->dataLoopNodes->NodeID); // was Node 1 - int coolingCoilAirInletNodeIndex = - UtilityRoutines::FindItemInList("WATER COOLING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 3 - int coolingCoilAirOutletNodeIndex = - UtilityRoutines::FindItemInList("WATER HEATING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 6 - int heatingCoilAirOutletNodeIndex = - UtilityRoutines::FindItemInList("WATER HEATING COIL AIR OUTLET NODE", state->dataLoopNodes->NodeID); // was Node 7 - int suppHeatingAirOutletNodeIndex = UtilityRoutines::FindItemInList("ZONE 2 INLET NODE", state->dataLoopNodes->NodeID); // was Node 2 - int coolingCoilWaterInletNodeIndex = UtilityRoutines::FindItemInList("CHWINLETNODE", state->dataLoopNodes->NodeID); // was Node 10 - int heatingCoilWaterInletNodeIndex = UtilityRoutines::FindItemInList("HWINLETNODE", state->dataLoopNodes->NodeID); // was Node 4 - int suppHeatingCoilWaterInletNodeIndex = UtilityRoutines::FindItemInList("SUPPHWINLETNODE", state->dataLoopNodes->NodeID); // was Node 8 + int unitarySystemAirInletNodeIndex = Util::FindItemInList("ZONE EXHAUST NODE", state->dataLoopNodes->NodeID); // was Node 1 + int coolingCoilAirInletNodeIndex = Util::FindItemInList("WATER COOLING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 3 + int coolingCoilAirOutletNodeIndex = Util::FindItemInList("WATER HEATING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 6 + int heatingCoilAirOutletNodeIndex = Util::FindItemInList("WATER HEATING COIL AIR OUTLET NODE", state->dataLoopNodes->NodeID); // was Node 7 + int suppHeatingAirOutletNodeIndex = Util::FindItemInList("ZONE 2 INLET NODE", state->dataLoopNodes->NodeID); // was Node 2 + int coolingCoilWaterInletNodeIndex = Util::FindItemInList("CHWINLETNODE", state->dataLoopNodes->NodeID); // was Node 10 + int heatingCoilWaterInletNodeIndex = Util::FindItemInList("HWINLETNODE", state->dataLoopNodes->NodeID); // was Node 4 + int suppHeatingCoilWaterInletNodeIndex = Util::FindItemInList("SUPPHWINLETNODE", state->dataLoopNodes->NodeID); // was Node 8 // set up node conditions to test UnitarySystem set point based control // Unitary system air inlet node = 1 @@ -4705,14 +4702,11 @@ SetpointManager:Scheduled, thisSys->getUnitarySystemInputData(*state, compName, zoneEquipment, 0, ErrorsFound); // get UnitarySystem input from object above EXPECT_FALSE(ErrorsFound); // expect no errors - auto unitarySystemAirInletNodeIndex = - UtilityRoutines::FindItemInList("WATER COOLING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 1 - auto coolingCoilAirInletNodeIndex = - UtilityRoutines::FindItemInList("WATER COOLING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 3 - auto coolingCoilAirOutletNodeIndex = - UtilityRoutines::FindItemInList("WATER COOLING COIL AIR OUTLET NODE", state->dataLoopNodes->NodeID); // was Node 6 - auto coolingCoilWaterInletNodeIndex = UtilityRoutines::FindItemInList("CHWINLETNODE", state->dataLoopNodes->NodeID); // was Node 10 - auto coolingCoilWaterOutletNodeIndex = UtilityRoutines::FindItemInList("CHWOUTLETNODE", state->dataLoopNodes->NodeID); // was Node 10 + auto unitarySystemAirInletNodeIndex = Util::FindItemInList("WATER COOLING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 1 + auto coolingCoilAirInletNodeIndex = Util::FindItemInList("WATER COOLING COIL AIR INLET NODE", state->dataLoopNodes->NodeID); // was Node 3 + auto coolingCoilAirOutletNodeIndex = Util::FindItemInList("WATER COOLING COIL AIR OUTLET NODE", state->dataLoopNodes->NodeID); // was Node 6 + auto coolingCoilWaterInletNodeIndex = Util::FindItemInList("CHWINLETNODE", state->dataLoopNodes->NodeID); // was Node 10 + auto coolingCoilWaterOutletNodeIndex = Util::FindItemInList("CHWOUTLETNODE", state->dataLoopNodes->NodeID); // was Node 10 state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = "WATER COOLING COIL"; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = @@ -14260,16 +14254,16 @@ 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_TRUE(compare_enums(UnitarySys::UnitarySysCtrlType::Load, thisSys->m_ControlType)); // checks control type - EXPECT_TRUE(compare_enums(UnitarySys::DehumCtrlType::None, thisSys->m_DehumidControlType_Num)); // checks Dehumidification Control type - EXPECT_EQ(UtilityRoutines::FindItemInList("EAST ZONE", state->dataHeatBal->Zone), thisSys->ControlZoneNum); // checks zone ID - EXPECT_EQ(ScheduleManager::ScheduleAlwaysOn, thisSys->m_SysAvailSchedPtr); // checks availability schedule name - 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(DataHVACGlobals::FanType_SimpleOnOff, thisSys->m_FanType_Num); // checks fan object type "FAN:ONOFF" - EXPECT_EQ("SUPPLY FAN", thisSys->m_FanName); // checks fan object name - EXPECT_TRUE(compare_enums(UnitarySys::FanPlace::DrawThru, thisSys->m_FanPlace)); // checks fan placement, "DrawThrough" + EXPECT_EQ("UNITARY SYSTEM MODEL", thisSys->Name); // checks object name + EXPECT_TRUE(compare_enums(UnitarySys::UnitarySysCtrlType::Load, thisSys->m_ControlType)); // checks control type + EXPECT_TRUE(compare_enums(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 + EXPECT_EQ(ScheduleManager::ScheduleAlwaysOn, thisSys->m_SysAvailSchedPtr); // checks availability schedule name + 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(DataHVACGlobals::FanType_SimpleOnOff, thisSys->m_FanType_Num); // checks fan object type "FAN:ONOFF" + EXPECT_EQ("SUPPLY FAN", thisSys->m_FanName); // checks fan object name + EXPECT_TRUE(compare_enums(UnitarySys::FanPlace::DrawThru, thisSys->m_FanPlace)); // checks fan placement, "DrawThrough" EXPECT_EQ(0, thisSys->m_FanOpModeSchedPtr); // 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 diff --git a/tst/EnergyPlus/unit/UtilityRoutines.unit.cc b/tst/EnergyPlus/unit/UtilityRoutines.unit.cc index 8313d35d8e3..ec10bd5ca6e 100644 --- a/tst/EnergyPlus/unit/UtilityRoutines.unit.cc +++ b/tst/EnergyPlus/unit/UtilityRoutines.unit.cc @@ -147,12 +147,12 @@ TEST_F(EnergyPlusFixture, UtilityRoutines_appendPerfLog1) fs::remove(state->dataStrGlobals->outputPerfLogFilePath); // make sure the static variables are cleared - UtilityRoutines::appendPerfLog(*state, "RESET", "RESET"); + Util::appendPerfLog(*state, "RESET", "RESET"); // add headers and values - UtilityRoutines::appendPerfLog(*state, "header1", "value1-1"); - UtilityRoutines::appendPerfLog(*state, "header2", "value1-2"); - UtilityRoutines::appendPerfLog(*state, "header3", "value1-3", true); + Util::appendPerfLog(*state, "header1", "value1-1"); + Util::appendPerfLog(*state, "header2", "value1-2"); + Util::appendPerfLog(*state, "header3", "value1-3", true); std::ifstream perfLogFile; std::stringstream perfLogStrSteam; @@ -174,7 +174,7 @@ TEST_F(EnergyPlusFixture, UtilityRoutines_appendPerfLog1) TEST_F(EnergyPlusFixture, UtilityRoutines_appendPerfLog2) { // make sure the static variables are cleared - UtilityRoutines::appendPerfLog(*state, "RESET", "RESET"); + Util::appendPerfLog(*state, "RESET", "RESET"); state->dataStrGlobals->outputPerfLogFilePath = "eplusout_2_perflog.csv"; @@ -186,9 +186,9 @@ TEST_F(EnergyPlusFixture, UtilityRoutines_appendPerfLog2) initPerfLogFile.close(); // without deleting file add headers and values again - UtilityRoutines::appendPerfLog(*state, "ignored1", "value2-1"); - UtilityRoutines::appendPerfLog(*state, "ignored2", "value2-2"); - UtilityRoutines::appendPerfLog(*state, "ignored3", "value2-3", true); + Util::appendPerfLog(*state, "ignored1", "value2-1"); + Util::appendPerfLog(*state, "ignored2", "value2-2"); + Util::appendPerfLog(*state, "ignored3", "value2-3", true); std::ifstream perfLogFile; std::stringstream perfLogStrSteam; @@ -214,50 +214,50 @@ TEST_F(EnergyPlusFixture, UtilityRoutines_ProcessNumber) std::string goodString{"3.14159"}; double expectedVal{3.14159}; bool expectedError{false}; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); EXPECT_FALSE(expectedError); goodString = "3.14159+E0"; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); EXPECT_FALSE(expectedError); goodString = "3.14159+e0"; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); EXPECT_FALSE(expectedError); goodString = "3.14159+D0"; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); EXPECT_FALSE(expectedError); goodString = "3.14159+d0"; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(goodString, expectedError), expectedVal, 1E-5); EXPECT_FALSE(expectedError); // invalid strings std::string badString{"É.14159"}; expectedVal = 0.0; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(badString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(badString, expectedError), expectedVal, 1E-5); EXPECT_TRUE(expectedError); badString = "3.14159É0"; expectedVal = 0.0; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(badString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(badString, expectedError), expectedVal, 1E-5); EXPECT_TRUE(expectedError); badString = "3.14159 0"; expectedVal = 0.0; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(badString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(badString, expectedError), expectedVal, 1E-5); EXPECT_TRUE(expectedError); // invalid argument badString = "E3.14159"; expectedVal = 0.0; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(badString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(badString, expectedError), expectedVal, 1E-5); EXPECT_TRUE(expectedError); // out of range badString = "1E5000"; expectedVal = 0.0; - EXPECT_NEAR(UtilityRoutines::ProcessNumber(badString, expectedError), expectedVal, 1E-5); + EXPECT_NEAR(Util::ProcessNumber(badString, expectedError), expectedVal, 1E-5); EXPECT_TRUE(expectedError); } diff --git a/tst/EnergyPlus/unit/WaterManager.unit.cc b/tst/EnergyPlus/unit/WaterManager.unit.cc index f60e763f4ac..0db1b4c42f0 100644 --- a/tst/EnergyPlus/unit/WaterManager.unit.cc +++ b/tst/EnergyPlus/unit/WaterManager.unit.cc @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -311,3 +312,67 @@ TEST_F(EnergyPlusFixture, WaterManager_Fill) WaterManager::UpdateWaterManager(*state); } + +TEST_F(EnergyPlusFixture, WaterManager_MainsWater_Meter_Test) +{ + // Test for #10235: A mainswater meter with a blank Water Quality Subcategory + // should add a "General" mainswater meter + std::string const idf_objects = delimited_string({ + + "WaterUse:Storage,", + " Cooling Tower Water Storage Tank, !- Name", + " , !- Water Quality Subcategory", + " 3, !- Maximum Capacity {m3}", + " 0.25, !- Initial Volume {m3}", + " 0.003, !- Design In Flow Rate {m3/s}", + " , !- Design Out Flow Rate {m3/s}", + " , !- Overflow Destination", + " GroundwaterWell, !- Type of Supply Controlled by Float Valve", + " 0.20, !- Float Valve On Capacity {m3}", + " 3, !- Float Valve Off Capacity {m3}", + " 0.10, !- Backup Mains Capacity {m3}", + " , !- Other Tank Name", + " ScheduledTemperature, !- Water Thermal Mode", + " Always 18, !- Water Temperature Schedule Name", + " , !- Ambient Temperature Indicator", + " , !- Ambient Temperature Schedule Name", + " , !- Zone Name", + " , !- Tank Surface Area {m2}", + " , !- Tank U Value {W/m2-K}", + " ; !- Tank Outside Surface Material Name", + + "WaterUse:Well,", + " Cooling Tower Transfer Pumps, !- Name", + " Cooling Tower Water Storage Tank, !- Storage Tank Name", + " , !- Pump Depth {m}", + " 0.003, !- Pump Rated Flow Rate {m3/s}", + " , !- Pump Rated Head {Pa}", + " 1500, !- Pump Rated Power Consumption {W}", + " , !- Pump Efficiency", + " , !- Well Recovery Rate {m3/s}", + " , !- Nominal Well Storage Volume {m3}", + " , !- Water Table Depth Mode", + " , !- Water Table Depth {m}", + " ; !- Water Table Depth Schedule Name", + + "Schedule:Constant,", + " Always 18, !- Name", + " , !- Schedule Type Limits Name", + " 18.0; !- Hourly Value", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + WaterManager::GetWaterManagerInput(*state); + state->dataWaterManager->GetInputFlag = false; + + EXPECT_EQ(state->dataWaterData->WaterStorage.size(), 1u); + + EXPECT_EQ(state->dataOutputProcessor->EnergyMeters.size(), 11u); + + EXPECT_EQ(state->dataOutputProcessor->EnergyMeters(4).Name, "General:WaterSystems:MainsWater"); + EXPECT_EQ(state->dataOutputProcessor->EnergyMeters(4).ResourceType, "MainsWater"); + EXPECT_EQ(state->dataOutputProcessor->EnergyMeters(4).EndUse, "WaterSystems"); + EXPECT_EQ(state->dataOutputProcessor->EnergyMeters(4).EndUseSub, "General"); + EXPECT_EQ(state->dataOutputProcessor->EnergyMeters(4).Group, ""); +} diff --git a/tst/EnergyPlus/unit/WeatherManager.unit.cc b/tst/EnergyPlus/unit/WeatherManager.unit.cc index 585dfdfbaca..f2033bdbef5 100644 --- a/tst/EnergyPlus/unit/WeatherManager.unit.cc +++ b/tst/EnergyPlus/unit/WeatherManager.unit.cc @@ -77,7 +77,6 @@ #include using namespace EnergyPlus; -using namespace EnergyPlus::WeatherManager; using namespace EnergyPlus::ScheduleManager; TEST_F(EnergyPlusFixture, SkyTempTest) @@ -160,11 +159,11 @@ TEST_F(EnergyPlusFixture, SkyTempTest) TEST_F(EnergyPlusFixture, SkyEmissivityTest) { // setup environment state - state->dataWeatherManager->Environment.allocate(4); - state->dataWeatherManager->Environment(1).SkyTempModel = SkyTempCalcType::ClarkAllenModel; - state->dataWeatherManager->Environment(2).SkyTempModel = SkyTempCalcType::BruntModel; - state->dataWeatherManager->Environment(3).SkyTempModel = SkyTempCalcType::IdsoModel; - state->dataWeatherManager->Environment(4).SkyTempModel = SkyTempCalcType::BerdahlMartinModel; + state->dataWeather->Environment.allocate(4); + state->dataWeather->Environment(1).skyTempModel = Weather::SkyTempModel::ClarkAllen; + state->dataWeather->Environment(2).skyTempModel = Weather::SkyTempModel::Brunt; + state->dataWeather->Environment(3).skyTempModel = Weather::SkyTempModel::Idso; + state->dataWeather->Environment(4).skyTempModel = Weather::SkyTempModel::BerdahlMartin; // init local variables Real64 OpaqueSkyCover(0.0); @@ -172,41 +171,33 @@ TEST_F(EnergyPlusFixture, SkyEmissivityTest) Real64 DewPoint(16.7); Real64 RelHum(0.6); - EXPECT_NEAR( - 0.832, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(1).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); - EXPECT_NEAR( - 0.862, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(2).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); - EXPECT_NEAR( - 0.867, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(3).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); - EXPECT_NEAR( - 0.862, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(4).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.832, CalcSkyEmissivity(*state, state->dataWeather->Environment(1).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.862, CalcSkyEmissivity(*state, state->dataWeather->Environment(2).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.867, CalcSkyEmissivity(*state, state->dataWeather->Environment(3).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.862, CalcSkyEmissivity(*state, state->dataWeather->Environment(4).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); DryBulb = 5.0; DewPoint = -2.13; - EXPECT_NEAR( - 0.781, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(1).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); - EXPECT_NEAR( - 0.746, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(2).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); - EXPECT_NEAR( - 0.760, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(3).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); - EXPECT_NEAR( - 0.747, CalcSkyEmissivity(*state, state->dataWeatherManager->Environment(4).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.781, CalcSkyEmissivity(*state, state->dataWeather->Environment(1).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.746, CalcSkyEmissivity(*state, state->dataWeather->Environment(2).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.760, CalcSkyEmissivity(*state, state->dataWeather->Environment(3).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); + EXPECT_NEAR(0.747, CalcSkyEmissivity(*state, state->dataWeather->Environment(4).skyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum), 0.001); } TEST_F(EnergyPlusFixture, WaterMainsCorrelationTest) { - state->dataWeatherManager->WaterMainsTempsMethod = WeatherManager::WaterMainsTempCalcMethod::Correlation; - state->dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp = 9.69; - state->dataWeatherManager->WaterMainsTempsMaxDiffAirTemp = 28.1; + state->dataWeather->WaterMainsTempsMethod = Weather::WaterMainsTempCalcMethod::Correlation; + state->dataWeather->WaterMainsTempsAnnualAvgAirTemp = 9.69; + state->dataWeather->WaterMainsTempsMaxDiffAirTemp = 28.1; state->dataEnvrn->DayOfYear = 50; state->dataEnvrn->Latitude = 40.0; - CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 6.6667, 0.0001); state->dataEnvrn->Latitude = -40.0; - CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 19.3799, 0.0001); } @@ -215,11 +206,11 @@ TEST_F(EnergyPlusFixture, JGDate_Test) // used http://aa.usno.navy.mil/data/docs/JulianDate.php // int julianDate; - GregorianDate gregorianDate(2016, 5, 25); // when test was made + Weather::GregorianDate gregorianDate = {2016, 5, 25}; // when test was made julianDate = computeJulianDate(gregorianDate); EXPECT_EQ(2457534, julianDate); - gregorianDate = computeGregorianDate(julianDate); + gregorianDate = Weather::computeGregorianDate(julianDate); EXPECT_EQ(2016, gregorianDate.year); EXPECT_EQ(5, gregorianDate.month); EXPECT_EQ(25, gregorianDate.day); @@ -227,7 +218,7 @@ TEST_F(EnergyPlusFixture, JGDate_Test) gregorianDate.year--; // a year before julianDate = computeJulianDate(gregorianDate); EXPECT_EQ(2457168, julianDate); - gregorianDate = computeGregorianDate(julianDate); + gregorianDate = Weather::computeGregorianDate(julianDate); EXPECT_EQ(2015, gregorianDate.year); EXPECT_EQ(5, gregorianDate.month); EXPECT_EQ(25, gregorianDate.day); @@ -235,7 +226,7 @@ TEST_F(EnergyPlusFixture, JGDate_Test) gregorianDate = {1966, 7, 16}; // a fine date in history julianDate = computeJulianDate(gregorianDate); EXPECT_EQ(2439323, julianDate); - gregorianDate = computeGregorianDate(julianDate); + gregorianDate = Weather::computeGregorianDate(julianDate); EXPECT_EQ(1966, gregorianDate.year); EXPECT_EQ(7, gregorianDate.month); EXPECT_EQ(16, gregorianDate.day); @@ -243,7 +234,7 @@ TEST_F(EnergyPlusFixture, JGDate_Test) gregorianDate = {2000, 12, 31}; // complex leap year julianDate = computeJulianDate(gregorianDate); EXPECT_EQ(2451910, julianDate); - gregorianDate = computeGregorianDate(julianDate); + gregorianDate = Weather::computeGregorianDate(julianDate); EXPECT_EQ(2000, gregorianDate.year); EXPECT_EQ(12, gregorianDate.month); EXPECT_EQ(31, gregorianDate.day); @@ -252,70 +243,70 @@ TEST_F(EnergyPlusFixture, JGDate_Test) TEST_F(EnergyPlusFixture, interpolateWindDirectionTest) { // simple test in each quadrant - EXPECT_EQ(interpolateWindDirection(0, 90, 0.5), 45.); - EXPECT_EQ(interpolateWindDirection(10, 80, 0.5), 45.); - EXPECT_EQ(interpolateWindDirection(20, 80, 0.7), 62.); - EXPECT_EQ(interpolateWindDirection(20, 80, 0.3), 38.); - - EXPECT_EQ(interpolateWindDirection(90, 180, 0.5), 135.); - EXPECT_EQ(interpolateWindDirection(100, 170, 0.5), 135.); - EXPECT_EQ(interpolateWindDirection(110, 170, 0.7), 152.); - EXPECT_EQ(interpolateWindDirection(110, 170, 0.3), 128.); - - EXPECT_EQ(interpolateWindDirection(180, 270, 0.5), 225.); - EXPECT_EQ(interpolateWindDirection(190, 260, 0.5), 225.); - EXPECT_EQ(interpolateWindDirection(200, 260, 0.7), 242.); - EXPECT_EQ(interpolateWindDirection(200, 260, 0.3), 218.); - - EXPECT_EQ(interpolateWindDirection(270, 360, 0.5), 315.); - EXPECT_EQ(interpolateWindDirection(280, 350, 0.5), 315.); - EXPECT_EQ(interpolateWindDirection(290, 350, 0.7), 332.); - EXPECT_EQ(interpolateWindDirection(290, 350, 0.3), 308.); + EXPECT_EQ(Weather::interpolateWindDirection(0, 90, 0.5), 45.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 80, 0.5), 45.); + EXPECT_EQ(Weather::interpolateWindDirection(20, 80, 0.7), 62.); + EXPECT_EQ(Weather::interpolateWindDirection(20, 80, 0.3), 38.); + + EXPECT_EQ(Weather::interpolateWindDirection(90, 180, 0.5), 135.); + EXPECT_EQ(Weather::interpolateWindDirection(100, 170, 0.5), 135.); + EXPECT_EQ(Weather::interpolateWindDirection(110, 170, 0.7), 152.); + EXPECT_EQ(Weather::interpolateWindDirection(110, 170, 0.3), 128.); + + EXPECT_EQ(Weather::interpolateWindDirection(180, 270, 0.5), 225.); + EXPECT_EQ(Weather::interpolateWindDirection(190, 260, 0.5), 225.); + EXPECT_EQ(Weather::interpolateWindDirection(200, 260, 0.7), 242.); + EXPECT_EQ(Weather::interpolateWindDirection(200, 260, 0.3), 218.); + + EXPECT_EQ(Weather::interpolateWindDirection(270, 360, 0.5), 315.); + EXPECT_EQ(Weather::interpolateWindDirection(280, 350, 0.5), 315.); + EXPECT_EQ(Weather::interpolateWindDirection(290, 350, 0.7), 332.); + EXPECT_EQ(Weather::interpolateWindDirection(290, 350, 0.3), 308.); // tests across 180 degree angle - EXPECT_EQ(interpolateWindDirection(170, 190, 0.7), 184.); - EXPECT_EQ(interpolateWindDirection(170, 190, 0.3), 176.); - EXPECT_EQ(interpolateWindDirection(100, 260, 0.7), 212.); - EXPECT_EQ(interpolateWindDirection(100, 260, 0.3), 148.); + EXPECT_EQ(Weather::interpolateWindDirection(170, 190, 0.7), 184.); + EXPECT_EQ(Weather::interpolateWindDirection(170, 190, 0.3), 176.); + EXPECT_EQ(Weather::interpolateWindDirection(100, 260, 0.7), 212.); + EXPECT_EQ(Weather::interpolateWindDirection(100, 260, 0.3), 148.); // tests across 0 degree angle (which was issue #5682) - EXPECT_EQ(interpolateWindDirection(350, 10, 0.7), 4.); - EXPECT_EQ(interpolateWindDirection(350, 10, 0.3), 356.); - EXPECT_EQ(interpolateWindDirection(300, 80, 0.7), 38.); - EXPECT_EQ(interpolateWindDirection(300, 80, 0.3), 342.); - - EXPECT_EQ(interpolateWindDirection(350, 10, 0.5), 0.); - EXPECT_EQ(interpolateWindDirection(340, 10, 0.5), 355.); - EXPECT_EQ(interpolateWindDirection(280, 10, 0.5), 325.); - EXPECT_EQ(interpolateWindDirection(260, 10, 0.5), 315.); - EXPECT_EQ(interpolateWindDirection(200, 10, 0.7), 319.); - EXPECT_EQ(interpolateWindDirection(200, 10, 0.3), 251.); - EXPECT_EQ(interpolateWindDirection(350, 160, 0.7), 109.); - EXPECT_EQ(interpolateWindDirection(350, 160, 0.3), 41.); + EXPECT_EQ(Weather::interpolateWindDirection(350, 10, 0.7), 4.); + EXPECT_EQ(Weather::interpolateWindDirection(350, 10, 0.3), 356.); + EXPECT_EQ(Weather::interpolateWindDirection(300, 80, 0.7), 38.); + EXPECT_EQ(Weather::interpolateWindDirection(300, 80, 0.3), 342.); + + EXPECT_EQ(Weather::interpolateWindDirection(350, 10, 0.5), 0.); + EXPECT_EQ(Weather::interpolateWindDirection(340, 10, 0.5), 355.); + EXPECT_EQ(Weather::interpolateWindDirection(280, 10, 0.5), 325.); + EXPECT_EQ(Weather::interpolateWindDirection(260, 10, 0.5), 315.); + EXPECT_EQ(Weather::interpolateWindDirection(200, 10, 0.7), 319.); + EXPECT_EQ(Weather::interpolateWindDirection(200, 10, 0.3), 251.); + EXPECT_EQ(Weather::interpolateWindDirection(350, 160, 0.7), 109.); + EXPECT_EQ(Weather::interpolateWindDirection(350, 160, 0.3), 41.); // tests for new failures - EXPECT_EQ(interpolateWindDirection(70, 30, 0.25), 60.); + EXPECT_EQ(Weather::interpolateWindDirection(70, 30, 0.25), 60.); // tests across 180 degree angle (reversed) - EXPECT_EQ(interpolateWindDirection(190, 170, 0.3), 184.); - EXPECT_EQ(interpolateWindDirection(190, 170, 0.7), 176.); - EXPECT_EQ(interpolateWindDirection(260, 100, 0.3), 212.); - EXPECT_EQ(interpolateWindDirection(260, 100, 0.7), 148.); + EXPECT_EQ(Weather::interpolateWindDirection(190, 170, 0.3), 184.); + EXPECT_EQ(Weather::interpolateWindDirection(190, 170, 0.7), 176.); + EXPECT_EQ(Weather::interpolateWindDirection(260, 100, 0.3), 212.); + EXPECT_EQ(Weather::interpolateWindDirection(260, 100, 0.7), 148.); // tests across 0 degree angle (reversed) - EXPECT_EQ(interpolateWindDirection(10, 350, 0.3), 4.); - EXPECT_EQ(interpolateWindDirection(10, 350, 0.7), 356.); - EXPECT_EQ(interpolateWindDirection(80, 300, 0.3), 38.); - EXPECT_EQ(interpolateWindDirection(80, 300, 0.7), 342.); - - EXPECT_EQ(interpolateWindDirection(10, 350, 0.5), 0.); - EXPECT_EQ(interpolateWindDirection(10, 340, 0.5), 355.); - EXPECT_EQ(interpolateWindDirection(10, 280, 0.5), 325.); - EXPECT_EQ(interpolateWindDirection(10, 260, 0.5), 315.); - EXPECT_EQ(interpolateWindDirection(10, 200, 0.3), 319.); - EXPECT_EQ(interpolateWindDirection(10, 200, 0.7), 251.); - EXPECT_EQ(interpolateWindDirection(160, 350, 0.3), 109.); - EXPECT_EQ(interpolateWindDirection(160, 350, 0.7), 41.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 350, 0.3), 4.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 350, 0.7), 356.); + EXPECT_EQ(Weather::interpolateWindDirection(80, 300, 0.3), 38.); + EXPECT_EQ(Weather::interpolateWindDirection(80, 300, 0.7), 342.); + + EXPECT_EQ(Weather::interpolateWindDirection(10, 350, 0.5), 0.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 340, 0.5), 355.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 280, 0.5), 325.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 260, 0.5), 315.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 200, 0.3), 319.); + EXPECT_EQ(Weather::interpolateWindDirection(10, 200, 0.7), 251.); + EXPECT_EQ(Weather::interpolateWindDirection(160, 350, 0.3), 109.); + EXPECT_EQ(Weather::interpolateWindDirection(160, 350, 0.7), 41.); } TEST_F(EnergyPlusFixture, UnderwaterBoundaryConditionFullyPopulated) @@ -335,13 +326,13 @@ TEST_F(EnergyPlusFixture, UnderwaterBoundaryConditionFullyPopulated) EXPECT_EQ(state->dataSurface->TotOSCM, 1); // then process the input for this underwater surface - bool shouldBeTrue = WeatherManager::CheckIfAnyUnderwaterBoundaries(*state); + bool shouldBeTrue = Weather::CheckIfAnyUnderwaterBoundaries(*state); EXPECT_TRUE(shouldBeTrue); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].Name, "UNDERWATERSURFACENAME"); - EXPECT_NEAR(state->dataWeatherManager->underwaterBoundaries[0].distanceFromLeadingEdge, 31.4159, 0.0001); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].OSCMIndex, 1); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].WaterTempScheduleIndex, 1); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].VelocityScheduleIndex, 2); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].Name, "UNDERWATERSURFACENAME"); + EXPECT_NEAR(state->dataWeather->underwaterBoundaries[0].distanceFromLeadingEdge, 31.4159, 0.0001); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].OSCMIndex, 1); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].WaterTempScheduleIndex, 1); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].VelocityScheduleIndex, 2); } TEST_F(EnergyPlusFixture, UnderwaterBoundaryConditionMissingVelocityOK) @@ -359,22 +350,22 @@ TEST_F(EnergyPlusFixture, UnderwaterBoundaryConditionMissingVelocityOK) EXPECT_EQ(state->dataSurface->TotOSCM, 1); // then process the input for this underwater surface - bool shouldBeTrue = WeatherManager::CheckIfAnyUnderwaterBoundaries(*state); + bool shouldBeTrue = Weather::CheckIfAnyUnderwaterBoundaries(*state); EXPECT_TRUE(shouldBeTrue); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].Name, "UNDERWATERSURFACENAME"); - EXPECT_NEAR(state->dataWeatherManager->underwaterBoundaries[0].distanceFromLeadingEdge, 31.4159, 0.0001); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].OSCMIndex, 1); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].WaterTempScheduleIndex, 1); - EXPECT_EQ(state->dataWeatherManager->underwaterBoundaries[0].VelocityScheduleIndex, 0); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].Name, "UNDERWATERSURFACENAME"); + EXPECT_NEAR(state->dataWeather->underwaterBoundaries[0].distanceFromLeadingEdge, 31.4159, 0.0001); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].OSCMIndex, 1); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].WaterTempScheduleIndex, 1); + EXPECT_EQ(state->dataWeather->underwaterBoundaries[0].VelocityScheduleIndex, 0); } TEST_F(EnergyPlusFixture, UnderwaterBoundaryConditionConvectionCoefficients) { - EXPECT_NEAR(2483.702, WeatherManager::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 30.0), 0.01); - EXPECT_NEAR(2162.188, WeatherManager::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 60.0), 0.01); - EXPECT_NEAR(1993.771, WeatherManager::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 90.0), 0.01); - EXPECT_NEAR(1882.294, WeatherManager::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 120.0), 0.01); - EXPECT_NEAR(1800.136, WeatherManager::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 150.0), 0.01); + EXPECT_NEAR(2483.702, Weather::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 30.0), 0.01); + EXPECT_NEAR(2162.188, Weather::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 60.0), 0.01); + EXPECT_NEAR(1993.771, Weather::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 90.0), 0.01); + EXPECT_NEAR(1882.294, Weather::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 120.0), 0.01); + EXPECT_NEAR(1800.136, Weather::calculateWaterBoundaryConvectionCoefficient(30.0, 3.0, 150.0), 0.01); } TEST_F(EnergyPlusFixture, WaterMainsCorrelationFromWeatherFileTest) @@ -391,28 +382,27 @@ TEST_F(EnergyPlusFixture, WaterMainsCorrelationFromWeatherFileTest) ASSERT_TRUE(process_idf(idf_objects)); bool foundErrors(false); - WeatherManager::GetWaterMainsTemperatures(*state, foundErrors); + Weather::GetWaterMainsTemperatures(*state, foundErrors); EXPECT_FALSE(foundErrors); // expect no errors - EXPECT_TRUE( - compare_enums(state->dataWeatherManager->WaterMainsTempsMethod, WeatherManager::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); + EXPECT_TRUE(compare_enums(state->dataWeather->WaterMainsTempsMethod, Weather::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); // for calculation method CorrelationFromWeatherFile these parameters are ignored - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 0.0); - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsAnnualAvgAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsMaxDiffAirTemp, 0.0); // set water mains parameters for CorrelationFromWeatherFile method - state->dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp = 9.99; - state->dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff = 28.78; - state->dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed = true; + state->dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp = 9.99; + state->dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff = 28.78; + state->dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed = true; state->dataEnvrn->Latitude = 42.00; // CHICAGO_IL_USA_WMO_725300 // January 15th water mains temperature test state->dataEnvrn->DayOfYear = 15; // January 15th - WeatherManager::CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 7.5145, 0.0001); // July 15th water mains temperature test state->dataEnvrn->DayOfYear = 196; // July 15th - WeatherManager::CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 19.0452, 0.0001); } @@ -432,26 +422,25 @@ TEST_F(EnergyPlusFixture, WaterMainsCorrelationFromWeatherFileTest_Actual) ASSERT_TRUE(process_idf(idf_objects)); bool foundErrors(false); - WeatherManager::GetWaterMainsTemperatures(*state, foundErrors); + Weather::GetWaterMainsTemperatures(*state, foundErrors); EXPECT_FALSE(foundErrors); // expect no errors - EXPECT_TRUE( - compare_enums(state->dataWeatherManager->WaterMainsTempsMethod, WeatherManager::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); + EXPECT_TRUE(compare_enums(state->dataWeather->WaterMainsTempsMethod, Weather::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); // for calculation method CorrelationFromWeatherFile these parameters are ignored - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 0.0); - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsAnnualAvgAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsMaxDiffAirTemp, 0.0); - EXPECT_TRUE(state->dataWeatherManager->WaterMainsParameterReport); + EXPECT_TRUE(state->dataWeather->WaterMainsParameterReport); // CalcAnnualAndMonthlyDryBulbTemp was the one that was faulty - state->dataWeatherManager->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(*state); + state->dataWeather->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(*state); - EXPECT_TRUE(state->dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed); - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp, 7.31, 0.01); - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, 27.94, 0.01); + EXPECT_TRUE(state->dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp, 7.31, 0.01); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, 27.94, 0.01); // January 15th water mains temperature test state->dataEnvrn->DayOfYear = 15; // January 15th - WeatherManager::CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 5.8439, 0.0001); } @@ -474,44 +463,43 @@ TEST_F(EnergyPlusFixture, WaterMainsCorrelationFromStatFileTest) ASSERT_TRUE(process_idf(idf_objects)); bool foundErrors(false); - WeatherManager::GetWaterMainsTemperatures(*state, foundErrors); + Weather::GetWaterMainsTemperatures(*state, foundErrors); EXPECT_FALSE(foundErrors); // expect no errors - EXPECT_TRUE( - compare_enums(state->dataWeatherManager->WaterMainsTempsMethod, WeatherManager::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); + EXPECT_TRUE(compare_enums(state->dataWeather->WaterMainsTempsMethod, Weather::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); // for calculation method CorrelationFromWeatherFile these parameters are ignored - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 0.0); - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsAnnualAvgAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsMaxDiffAirTemp, 0.0); Array1D MonthlyDryBulbTempFromStatFile(12, {-4.60, -2.50, 3.80, 10.00, 15.30, 21.10, 24.10, 21.80, 18.10, 11.00, 4.70, -3.70}); - state->dataWeatherManager->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp = MonthlyDryBulbTempFromStatFile; + state->dataWeather->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp = MonthlyDryBulbTempFromStatFile; // calc water mains parameters for CorrelationFromWeatherFile method for (int i = 1; i <= 12; ++i) { AnnualDailyAverageDryBulbTempSum += - state->dataWeatherManager->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp(i) * state->dataWeatherManager->EndDayOfMonth(i); - MonthlyDailyDryBulbMin = min(MonthlyDailyDryBulbMin, state->dataWeatherManager->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp(i)); - MonthlyDailyDryBulbMax = max(MonthlyDailyDryBulbMax, state->dataWeatherManager->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp(i)); - AnnualNumberOfDays += state->dataWeatherManager->EndDayOfMonth(i); + state->dataWeather->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp(i) * state->dataWeather->EndDayOfMonth(i); + MonthlyDailyDryBulbMin = min(MonthlyDailyDryBulbMin, state->dataWeather->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp(i)); + MonthlyDailyDryBulbMax = max(MonthlyDailyDryBulbMax, state->dataWeather->OADryBulbAverage.MonthlyDailyAverageDryBulbTemp(i)); + AnnualNumberOfDays += state->dataWeather->EndDayOfMonth(i); } - state->dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp = AnnualDailyAverageDryBulbTempSum / AnnualNumberOfDays; - state->dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff = MonthlyDailyDryBulbMax - MonthlyDailyDryBulbMin; + state->dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp = AnnualDailyAverageDryBulbTempSum / AnnualNumberOfDays; + state->dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff = MonthlyDailyDryBulbMax - MonthlyDailyDryBulbMin; // check results - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp, 9.9882, 0.0001); - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, 28.7000, 0.0001); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp, 9.9882, 0.0001); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, 28.7000, 0.0001); // test water mains temperature - // WeatherManager::WaterMainsTempsMethod = WeatherManager::CorrelationFromWeatherFileMethod; - state->dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed = true; + // Weather::WaterMainsTempsMethod = Weather::CorrelationFromWeatherFileMethod; + state->dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed = true; state->dataEnvrn->Latitude = 42.00; // CHICAGO_IL_USA_WMO_725300 // January 21st water mains temperature test state->dataEnvrn->DayOfYear = 21; // January 21st - WeatherManager::CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 7.23463, 0.00001); // July 21st water mains temperature test state->dataEnvrn->DayOfYear = 202; // July 21st - WeatherManager::CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 19.33812, 0.00001); } @@ -529,18 +517,17 @@ TEST_F(EnergyPlusFixture, WaterMainsCorrelationFromStatFileTest_Actual) ASSERT_TRUE(process_idf(idf_objects)); bool foundErrors(false); - WeatherManager::GetWaterMainsTemperatures(*state, foundErrors); + Weather::GetWaterMainsTemperatures(*state, foundErrors); EXPECT_FALSE(foundErrors); // expect no errors - EXPECT_TRUE( - compare_enums(state->dataWeatherManager->WaterMainsTempsMethod, WeatherManager::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); + EXPECT_TRUE(compare_enums(state->dataWeather->WaterMainsTempsMethod, Weather::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); // for calculation method CorrelationFromWeatherFile these parameters are ignored - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 0.0); - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsAnnualAvgAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsMaxDiffAirTemp, 0.0); - EXPECT_TRUE(state->dataWeatherManager->WaterMainsParameterReport); + EXPECT_TRUE(state->dataWeather->WaterMainsParameterReport); // CalcAnnualAndMonthlyDryBulbTemp was the one that was faulty - state->dataWeatherManager->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(*state); + state->dataWeather->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(*state); std::array nDaysInMonth{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; std::array monthlyDryBulbTemps{-4.6, -2.5, 3.8, 10.0, 15.3, 21.1, 24.1, 21.8, 18.1, 11.0, 4.7, -3.7}; @@ -551,15 +538,15 @@ TEST_F(EnergyPlusFixture, WaterMainsCorrelationFromStatFileTest_Actual) const auto [min, max] = std::minmax_element(std::begin(monthlyDryBulbTemps), std::end(monthlyDryBulbTemps)); double monthlyAvgOADryBulbTempMaxDiff = (*max) - (*min); - EXPECT_TRUE(state->dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed); - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp, 9.988219178082193, 0.01); - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, 28.7, 0.01); - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp, annualAvgOADryBulbTemp, 0.01); - EXPECT_NEAR(state->dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, monthlyAvgOADryBulbTempMaxDiff, 0.01); + EXPECT_TRUE(state->dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp, 9.988219178082193, 0.01); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, 28.7, 0.01); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp, annualAvgOADryBulbTemp, 0.01); + EXPECT_NEAR(state->dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff, monthlyAvgOADryBulbTempMaxDiff, 0.01); // January 15th water mains temperature test state->dataEnvrn->DayOfYear = 15; // January 15th - WeatherManager::CalcWaterMainsTemp(*state); + Weather::CalcWaterMainsTemp(*state); EXPECT_NEAR(state->dataEnvrn->WaterMainsTemp, 7.5295, 0.0001); } @@ -576,19 +563,18 @@ TEST_F(EnergyPlusFixture, WaterMainsCorrelationFromStatFileTest_ActualBroken) ASSERT_TRUE(process_idf(idf_objects)); bool foundErrors(false); - WeatherManager::GetWaterMainsTemperatures(*state, foundErrors); + Weather::GetWaterMainsTemperatures(*state, foundErrors); EXPECT_FALSE(foundErrors); // expect no errors - EXPECT_TRUE( - compare_enums(state->dataWeatherManager->WaterMainsTempsMethod, WeatherManager::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); + EXPECT_TRUE(compare_enums(state->dataWeather->WaterMainsTempsMethod, Weather::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); // for calculation method CorrelationFromWeatherFile these parameters are ignored - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 0.0); - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsAnnualAvgAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsMaxDiffAirTemp, 0.0); - EXPECT_TRUE(state->dataWeatherManager->WaterMainsParameterReport); + EXPECT_TRUE(state->dataWeather->WaterMainsParameterReport); // CalcAnnualAndMonthlyDryBulbTemp was the one that was faulty - state->dataWeatherManager->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(*state); - EXPECT_FALSE(state->dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed); + state->dataWeather->OADryBulbAverage.CalcAnnualAndMonthlyDryBulbTemp(*state); + EXPECT_FALSE(state->dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed); std::string const error_string = delimited_string({ " ** Severe ** CalcAnnualAndMonthlyDryBulbTemp: Stat file '" + state->files.inStatFilePath.filePath.string() + "' does not have Monthly Statistics for Dry Bulb " @@ -613,21 +599,20 @@ TEST_F(EnergyPlusFixture, WaterMainsOutputReports_CorrelationFromWeatherFileTest ASSERT_TRUE(process_idf(idf_objects)); bool foundErrors(false); - WeatherManager::GetWaterMainsTemperatures(*state, foundErrors); + Weather::GetWaterMainsTemperatures(*state, foundErrors); EXPECT_FALSE(foundErrors); // expect no errors - EXPECT_TRUE( - compare_enums(state->dataWeatherManager->WaterMainsTempsMethod, WeatherManager::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); + EXPECT_TRUE(compare_enums(state->dataWeather->WaterMainsTempsMethod, Weather::WaterMainsTempCalcMethod::CorrelationFromWeatherFile)); // for calculation method CorrelationFromWeatherFile these two parameters are ignored - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsAnnualAvgAirTemp, 0.0); - EXPECT_EQ(state->dataWeatherManager->WaterMainsTempsMaxDiffAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsAnnualAvgAirTemp, 0.0); + EXPECT_EQ(state->dataWeather->WaterMainsTempsMaxDiffAirTemp, 0.0); // set water mains temp parameters for CorrelationFromWeatherFile method - state->dataWeatherManager->OADryBulbAverage.AnnualAvgOADryBulbTemp = 9.99; - state->dataWeatherManager->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff = 28.78; - state->dataWeatherManager->OADryBulbAverage.OADryBulbWeatherDataProcessed = true; + state->dataWeather->OADryBulbAverage.AnnualAvgOADryBulbTemp = 9.99; + state->dataWeather->OADryBulbAverage.MonthlyAvgOADryBulbTempMaxDiff = 28.78; + state->dataWeather->OADryBulbAverage.OADryBulbWeatherDataProcessed = true; // report water mains parameters to eio file - WeatherManager::ReportWaterMainsTempParameters(*state); + Weather::ReportWaterMainsTempParameters(*state); std::string const eiooutput = delimited_string({"! ," "Calculation Method{}," @@ -704,11 +689,11 @@ TEST_F(EnergyPlusFixture, ASHRAE_Tau2017ModelTest) bool ErrorsFound(false); state->dataEnvrn->TotDesDays = 2; // setup environment state - state->dataWeatherManager->Environment.allocate(state->dataEnvrn->TotDesDays); - state->dataWeatherManager->DesignDay.allocate(state->dataEnvrn->TotDesDays); - state->dataWeatherManager->Environment(1).DesignDayNum = 1; - state->dataWeatherManager->Environment(2).DesignDayNum = 2; - GetDesignDayData(*state, state->dataEnvrn->TotDesDays, ErrorsFound); + state->dataWeather->Environment.allocate(state->dataEnvrn->TotDesDays); + state->dataWeather->DesignDay.allocate(state->dataEnvrn->TotDesDays); + state->dataWeather->Environment(1).DesignDayNum = 1; + state->dataWeather->Environment(2).DesignDayNum = 2; + Weather::GetDesignDayData(*state, state->dataEnvrn->TotDesDays, ErrorsFound); ASSERT_FALSE(ErrorsFound); // init local variables @@ -720,21 +705,21 @@ TEST_F(EnergyPlusFixture, ASHRAE_Tau2017ModelTest) // EnvrnNum = 1 uses Tau values of January int EnvrnNum = 1; Real64 CosZenith = 1.0; // assumed zero zenith angle - Real64 TauB = state->dataWeatherManager->DesDayInput(EnvrnNum).TauB; - Real64 TauD = state->dataWeatherManager->DesDayInput(EnvrnNum).TauD; + Real64 TauB = state->dataWeather->DesDayInput(EnvrnNum).TauB; + Real64 TauD = state->dataWeather->DesDayInput(EnvrnNum).TauD; // check tau values - EXPECT_TRUE(compare_enums(DesignDaySolarModel::ASHRAE_Tau2017, state->dataWeatherManager->DesDayInput(EnvrnNum).SolarModel)); + EXPECT_TRUE(compare_enums(Weather::DesDaySolarModel::ASHRAE_Tau2017, state->dataWeather->DesDayInput(EnvrnNum).solarModel)); EXPECT_EQ(0.325, TauB); EXPECT_EQ(2.461, TauD); // calc expected values for environment 1 Real64 AB = 1.454 - 0.406 * TauB - 0.268 * TauD + 0.021 * TauB * TauD; Real64 AD = 0.507 + 0.205 * TauB - 0.080 * TauD - 0.190 * TauB * TauD; - Real64 M = AirMass(CosZenith); + Real64 M = Weather::AirMass(CosZenith); Real64 expectedIDirN = ETR * std::exp(-TauB * std::pow(M, AB)); Real64 expectedIDifH = ETR * std::exp(-TauD * std::pow(M, AD)); Real64 expectedIGlbH = expectedIDirN * CosZenith + expectedIDifH; // calc TauModel - ASHRAETauModel(*state, state->dataWeatherManager->DesDayInput(EnvrnNum).SolarModel, ETR, CosZenith, TauB, TauD, BeamRad, DiffRad, GloHorzRad); + ASHRAETauModel(*state, state->dataWeather->DesDayInput(EnvrnNum).solarModel, ETR, CosZenith, TauB, TauD, BeamRad, DiffRad, GloHorzRad); // check the coefficients are correctly applied EXPECT_EQ(expectedIDirN, BeamRad); EXPECT_EQ(expectedIDifH, DiffRad); @@ -743,15 +728,15 @@ TEST_F(EnergyPlusFixture, ASHRAE_Tau2017ModelTest) // EnvrnNum = 2 uses Tau values of July EnvrnNum = 2; CosZenith = 1.0; // assumed zero zenith angle - TauB = state->dataWeatherManager->DesDayInput(EnvrnNum).TauB; - TauD = state->dataWeatherManager->DesDayInput(EnvrnNum).TauD; + TauB = state->dataWeather->DesDayInput(EnvrnNum).TauB; + TauD = state->dataWeather->DesDayInput(EnvrnNum).TauD; // check tau values EXPECT_EQ(0.556, TauB); EXPECT_EQ(1.779, TauD); // calc expected values for environment 2 AB = 1.454 - 0.406 * TauB - 0.268 * TauD + 0.021 * TauB * TauD; AD = 0.507 + 0.205 * TauB - 0.080 * TauD - 0.190 * TauB * TauD; - M = AirMass(CosZenith); + M = Weather::AirMass(CosZenith); expectedIDirN = ETR * std::exp(-TauB * std::pow(M, AB)); expectedIDifH = ETR * std::exp(-TauD * std::pow(M, AD)); expectedIGlbH = expectedIDirN * CosZenith + expectedIDifH; @@ -760,7 +745,7 @@ TEST_F(EnergyPlusFixture, ASHRAE_Tau2017ModelTest) DiffRad = 0.0; GloHorzRad = 0.0; // calc TauModel - ASHRAETauModel(*state, state->dataWeatherManager->DesDayInput(EnvrnNum).SolarModel, ETR, CosZenith, TauB, TauD, BeamRad, DiffRad, GloHorzRad); + ASHRAETauModel(*state, state->dataWeather->DesDayInput(EnvrnNum).solarModel, ETR, CosZenith, TauB, TauD, BeamRad, DiffRad, GloHorzRad); // check the coefficients are correctly applied EXPECT_EQ(expectedIDirN, BeamRad); EXPECT_EQ(expectedIDifH, DiffRad); @@ -806,11 +791,11 @@ TEST_F(EnergyPlusFixture, WeatherManager_NoLocation) state->dataGlobal->BeginSimFlag = false; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->LocationGathered = false; + state->dataWeather->LocationGathered = false; bool Available{false}; bool ErrorsFound{false}; - ASSERT_THROW(WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound), std::runtime_error); + ASSERT_THROW(Weather::GetNextEnvironment(*state, Available, ErrorsFound), std::runtime_error); ASSERT_TRUE(ErrorsFound); std::string const error_string = delimited_string({ @@ -825,8 +810,8 @@ TEST_F(EnergyPlusFixture, WeatherManager_NoLocation) }); EXPECT_TRUE(compare_err_stream(error_string, true)); - EXPECT_EQ(1, state->dataWeatherManager->NumOfEnvrn); - EXPECT_TRUE(compare_enums(state->dataWeatherManager->Environment(1).KindOfEnvrn, Constant::KindOfSim::DesignDay)); + EXPECT_EQ(1, state->dataWeather->NumOfEnvrn); + EXPECT_TRUE(compare_enums(state->dataWeather->Environment(1).KindOfEnvrn, Constant::KindOfSim::DesignDay)); } // Test for https://github.com/NREL/EnergyPlus/issues/7550 @@ -883,32 +868,32 @@ TEST_F(SQLiteFixture, DesignDay_EnthalphyAtMaxDB) bool ErrorsFound(false); state->dataEnvrn->TotDesDays = 1; // setup environment state - state->dataWeatherManager->Environment.allocate(state->dataEnvrn->TotDesDays); - state->dataWeatherManager->DesignDay.allocate(state->dataEnvrn->TotDesDays); + state->dataWeather->Environment.allocate(state->dataEnvrn->TotDesDays); + state->dataWeather->DesignDay.allocate(state->dataEnvrn->TotDesDays); - state->dataWeatherManager->Environment(1).DesignDayNum = 1; - state->dataWeatherManager->Environment(1).WP_Type1 = 0; + state->dataWeather->Environment(1).DesignDayNum = 1; + state->dataWeather->Environment(1).WP_Type1 = 0; state->dataGlobal->MinutesPerTimeStep = 60; state->dataGlobal->NumOfTimeStepInHour = 1; state->dataGlobal->BeginSimFlag = true; state->dataReportFlag->DoWeatherInitReporting = true; - WeatherManager::SetupInterpolationValues(*state); - WeatherManager::AllocateWeatherData(*state); + Weather::SetupInterpolationValues(*state); + Weather::AllocateWeatherData(*state); - WeatherManager::GetDesignDayData(*state, state->dataEnvrn->TotDesDays, ErrorsFound); + Weather::GetDesignDayData(*state, state->dataEnvrn->TotDesDays, ErrorsFound); ASSERT_FALSE(ErrorsFound); - WeatherManager::SetUpDesignDay(*state, 1); - EXPECT_TRUE(compare_enums(state->dataWeatherManager->DesDayInput(1).HumIndType, DDHumIndType::Enthalpy)); - EXPECT_EQ(state->dataWeatherManager->DesDayInput(1).HumIndValue, 90500.0); + Weather::SetUpDesignDay(*state, 1); + EXPECT_TRUE(compare_enums(state->dataWeather->DesDayInput(1).HumIndType, Weather::DesDayHumIndType::Enthalpy)); + EXPECT_EQ(state->dataWeather->DesDayInput(1).HumIndValue, 90500.0); unsigned n_RH_not100 = 0; for (int Hour = 1; Hour <= 24; ++Hour) { for (int TS = 1; TS <= state->dataGlobal->NumOfTimeStepInHour; ++TS) { - EXPECT_GE(state->dataWeatherManager->TomorrowOutRelHum(TS, Hour), 0.); - EXPECT_LE(state->dataWeatherManager->TomorrowOutRelHum(TS, Hour), 100.); - if (state->dataWeatherManager->TomorrowOutRelHum(TS, Hour) < 100.) { + EXPECT_GE(state->dataWeather->wvarsHrTsTomorrow(TS, Hour).OutRelHum, 0.); + EXPECT_LE(state->dataWeather->wvarsHrTsTomorrow(TS, Hour).OutRelHum, 100.); + if (state->dataWeather->wvarsHrTsTomorrow(TS, Hour).OutRelHum < 100.) { ++n_RH_not100; } } @@ -1052,42 +1037,42 @@ TEST_F(EnergyPlusFixture, IRHoriz_InterpretWeatherZeroIRHoriz) std::string ErrOut; for (auto WeatherDataLine : Lines) { - WeatherManager::InterpretWeatherDataLine(*state, - WeatherDataLine, - ErrorFound, - WYear, - WMonth, - WDay, - WHour, - WMinute, - DryBulb, - DewPoint, - RelHum, - AtmPress, - ETHoriz, - ETDirect, - IRHoriz, - GLBHoriz, - DirectRad, - DiffuseRad, - GLBHorizIllum, - DirectNrmIllum, - DiffuseHorizIllum, - ZenLum, - WindDir, - WindSpeed, - TotalSkyCover, - OpaqueSkyCover, - Visibility, - CeilHeight, - PresWeathObs, - PresWeathConds, - PrecipWater, - AerosolOptDepth, - SnowDepth, - DaysSinceLastSnow, - Albedo, - LiquidPrecip); + Weather::InterpretWeatherDataLine(*state, + WeatherDataLine, + ErrorFound, + WYear, + WMonth, + WDay, + WHour, + WMinute, + DryBulb, + DewPoint, + RelHum, + AtmPress, + ETHoriz, + ETDirect, + IRHoriz, + GLBHoriz, + DirectRad, + DiffuseRad, + GLBHorizIllum, + DirectNrmIllum, + DiffuseHorizIllum, + ZenLum, + WindDir, + WindSpeed, + TotalSkyCover, + OpaqueSkyCover, + Visibility, + CeilHeight, + PresWeathObs, + PresWeathConds, + PrecipWater, + AerosolOptDepth, + SnowDepth, + DaysSinceLastSnow, + Albedo, + LiquidPrecip); EXPECT_EQ(IRHoriz, 0.0); } @@ -1161,25 +1146,25 @@ TEST_F(EnergyPlusFixture, IRHoriz_InterpretWeatherCalculateMissingIRHoriz) state->dataEnvrn->TotDesDays = 2; // setup environment state - state->dataWeatherManager->Environment.allocate(state->dataEnvrn->TotDesDays); - state->dataWeatherManager->DesignDay.allocate(state->dataEnvrn->TotDesDays); - state->dataWeatherManager->Environment(1).DesignDayNum = 1; - state->dataWeatherManager->Environment(2).DesignDayNum = 2; - GetDesignDayData(*state, state->dataEnvrn->TotDesDays, ErrorsFound); + state->dataWeather->Environment.allocate(state->dataEnvrn->TotDesDays); + state->dataWeather->DesignDay.allocate(state->dataEnvrn->TotDesDays); + state->dataWeather->Environment(1).DesignDayNum = 1; + state->dataWeather->Environment(2).DesignDayNum = 2; + Weather::GetDesignDayData(*state, state->dataEnvrn->TotDesDays, ErrorsFound); ASSERT_FALSE(ErrorsFound); - state->dataWeatherManager->Envrn = 1; + state->dataWeather->Envrn = 1; state->dataGlobal->NumOfTimeStepInHour = 1; - state->dataWeatherManager->Environment.allocate(1); - state->dataWeatherManager->Environment(1).SkyTempModel = SkyTempCalcType::ClarkAllenModel; + state->dataWeather->Environment.allocate(1); + state->dataWeather->Environment(1).skyTempModel = Weather::SkyTempModel::ClarkAllen; - AllocateWeatherData(*state); - OpenWeatherFile(*state, ErrorsFound); - ReadWeatherForDay(*state, 0, 1, false); + Weather::AllocateWeatherData(*state); + Weather::OpenWeatherFile(*state, ErrorsFound); + Weather::ReadWeatherForDay(*state, 0, 1, false); Real64 expected_IRHorizSky = 345.73838855245953; - EXPECT_NEAR(state->dataWeatherManager->TomorrowHorizIRSky(1, 1), expected_IRHorizSky, 0.001); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).HorizIRSky, expected_IRHorizSky, 0.001); } // Test for Issue 7957: add new sky cover weather output values; @@ -1233,7 +1218,7 @@ TEST_F(EnergyPlusFixture, Add_and_InterpolateWeatherInputOutputTest) bool ErrorsFound(false); ErrorsFound = false; - state->dataWeatherManager->WeatherFileExists = true; + state->dataWeather->WeatherFileExists = true; state->files.inputWeatherFilePath.filePath = configured_source_directory() / "weather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"; state->dataGlobal->BeginSimFlag = true; @@ -1243,7 +1228,7 @@ TEST_F(EnergyPlusFixture, Add_and_InterpolateWeatherInputOutputTest) Available = true; state->dataGlobal->BeginSimFlag = true; - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); + Weather::GetNextEnvironment(*state, Available, ErrorsFound); // Test get output variables for Total Sky Cover and Opaque Sky Cover EXPECT_EQ("Site Outdoor Air Drybulb Temperature", state->dataOutputProcessor->RVariableTypes(1).VarNameOnly); @@ -1260,23 +1245,23 @@ TEST_F(EnergyPlusFixture, Add_and_InterpolateWeatherInputOutputTest) EXPECT_EQ(9, state->dataOutputProcessor->RVariableTypes(3).ReportID); EXPECT_EQ(10, state->dataOutputProcessor->RVariableTypes(4).ReportID); - state->dataWeatherManager->Envrn = 1; + state->dataWeather->Envrn = 1; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->Environment.allocate(1); - state->dataWeatherManager->Environment(1).SkyTempModel = SkyTempCalcType::ClarkAllenModel; - state->dataWeatherManager->Environment(1).StartMonth = 1; - state->dataWeatherManager->Environment(1).StartDay = 1; + state->dataWeather->Environment.allocate(1); + state->dataWeather->Environment(1).skyTempModel = Weather::SkyTempModel::ClarkAllen; + state->dataWeather->Environment(1).StartMonth = 1; + state->dataWeather->Environment(1).StartDay = 1; - state->dataWeatherManager->Environment(1).UseWeatherFileHorizontalIR = false; + state->dataWeather->Environment(1).UseWeatherFileHorizontalIR = false; - AllocateWeatherData(*state); - OpenWeatherFile(*state, ErrorsFound); - ReadWeatherForDay(*state, 1, 1, true); + Weather::AllocateWeatherData(*state); + Weather::OpenWeatherFile(*state, ErrorsFound); + Weather::ReadWeatherForDay(*state, 1, 1, true); // Test the feature of interpolating some weather inputs to calc sky temp Real64 expected_SkyTemp = -22.8763495; - EXPECT_NEAR(state->dataWeatherManager->TomorrowSkyTemp(2, 2), expected_SkyTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 2).SkyTemp, expected_SkyTemp, 1e-6); } // Test for fixing the first sub-hour weather data interpolation @@ -1332,7 +1317,7 @@ TEST_F(EnergyPlusFixture, Fix_first_hour_weather_data_interpolation_OutputTest) bool ErrorsFound(false); ErrorsFound = false; - state->dataWeatherManager->WeatherFileExists = true; + state->dataWeather->WeatherFileExists = true; state->files.inputWeatherFilePath.filePath = configured_source_directory() / "weather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"; state->dataGlobal->BeginSimFlag = true; @@ -1344,75 +1329,75 @@ TEST_F(EnergyPlusFixture, Fix_first_hour_weather_data_interpolation_OutputTest) state->dataGlobal->BeginSimFlag = true; // The added first hour processing will be called here: - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); + Weather::GetNextEnvironment(*state, Available, ErrorsFound); state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->Environment(1).SkyTempModel = SkyTempCalcType::ClarkAllenModel; - state->dataWeatherManager->Environment(1).StartMonth = 1; - state->dataWeatherManager->Environment(1).StartDay = 1; + state->dataWeather->Environment(1).skyTempModel = Weather::SkyTempModel::ClarkAllen; + state->dataWeather->Environment(1).StartMonth = 1; + state->dataWeather->Environment(1).StartDay = 1; - state->dataWeatherManager->Environment(1).UseWeatherFileHorizontalIR = false; + state->dataWeather->Environment(1).UseWeatherFileHorizontalIR = false; - AllocateWeatherData(*state); - OpenWeatherFile(*state, ErrorsFound); - ReadWeatherForDay(*state, 1, 1, true); + Weather::AllocateWeatherData(*state); + Weather::OpenWeatherFile(*state, ErrorsFound); + Weather::ReadWeatherForDay(*state, 1, 1, true); // Test interpolating values of some weather data during the first hour Real64 expected_DryBulbTemp = -12.2; - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDryBulbTemp(4, 1), expected_DryBulbTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).OutDryBulbTemp, expected_DryBulbTemp, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDryBulbTemp(1, 1), expected_DryBulbTemp, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDryBulbTemp(2, 1), expected_DryBulbTemp, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDryBulbTemp(3, 1), expected_DryBulbTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).OutDryBulbTemp, expected_DryBulbTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).OutDryBulbTemp, expected_DryBulbTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).OutDryBulbTemp, expected_DryBulbTemp, 1e-6); Real64 expected_DewPointTemp = -16.1; - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDewPointTemp(4, 1), expected_DewPointTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).OutDewPointTemp, expected_DewPointTemp, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDewPointTemp(1, 1), expected_DewPointTemp, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDewPointTemp(2, 1), expected_DewPointTemp, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutDewPointTemp(3, 1), expected_DewPointTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).OutDewPointTemp, expected_DewPointTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).OutDewPointTemp, expected_DewPointTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).OutDewPointTemp, expected_DewPointTemp, 1e-6); Real64 expected_BaroPress = 99500; - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutBaroPress(4, 1), expected_BaroPress, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).OutBaroPress, expected_BaroPress, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutBaroPress(1, 1), expected_BaroPress, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutBaroPress(2, 1), expected_BaroPress, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutBaroPress(3, 1), expected_BaroPress, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).OutBaroPress, expected_BaroPress, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).OutBaroPress, expected_BaroPress, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).OutBaroPress, expected_BaroPress, 1e-6); Real64 expected_RelHum = 73; - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutRelHum(4, 1), expected_RelHum, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).OutRelHum, expected_RelHum, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutRelHum(1, 1), expected_RelHum, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutRelHum(2, 1), expected_RelHum, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOutRelHum(3, 1), expected_RelHum, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).OutRelHum, expected_RelHum, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).OutRelHum, expected_RelHum, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).OutRelHum, expected_RelHum, 1e-6); Real64 expected_WindSpeed = 2.6; - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindSpeed(4, 1), expected_WindSpeed, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).WindSpeed, expected_WindSpeed, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindSpeed(1, 1), expected_WindSpeed, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindSpeed(2, 1), expected_WindSpeed, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindSpeed(3, 1), expected_WindSpeed, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).WindSpeed, expected_WindSpeed, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).WindSpeed, expected_WindSpeed, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).WindSpeed, expected_WindSpeed, 1e-6); Real64 expected_WindDir = 270; - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindDir(4, 1), expected_WindDir, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).WindDir, expected_WindDir, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindDir(1, 1), expected_WindDir, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindDir(2, 1), expected_WindDir, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowWindDir(3, 1), expected_WindDir, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).WindDir, expected_WindDir, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).WindDir, expected_WindDir, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).WindDir, expected_WindDir, 1e-6); Real64 expected_TotalSkyCover = 9; - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(4, 1), expected_TotalSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).TotalSkyCover, expected_TotalSkyCover, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(1, 1), expected_TotalSkyCover, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(2, 1), expected_TotalSkyCover, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(3, 1), expected_TotalSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).TotalSkyCover, expected_TotalSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).TotalSkyCover, expected_TotalSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).TotalSkyCover, expected_TotalSkyCover, 1e-6); Real64 expected_OpaqueSkyCover = 9; - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(4, 1), expected_OpaqueSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 1).OpaqueSkyCover, expected_OpaqueSkyCover, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(1, 1), expected_OpaqueSkyCover, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(2, 1), expected_OpaqueSkyCover, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(3, 1), expected_OpaqueSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 1).OpaqueSkyCover, expected_OpaqueSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).OpaqueSkyCover, expected_OpaqueSkyCover, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 1).OpaqueSkyCover, expected_OpaqueSkyCover, 1e-6); } // Test for Issue 8760: fix opaque sky cover weather values; @@ -1460,7 +1445,7 @@ TEST_F(EnergyPlusFixture, Fix_OpaqueSkyCover_Test) bool ErrorsFound(false); ErrorsFound = false; - state->dataWeatherManager->WeatherFileExists = true; + state->dataWeather->WeatherFileExists = true; state->files.inputWeatherFilePath.filePath = configured_source_directory() / "weather/USA_IL_University.of.Illinois-Willard.AP.725315_TMY3.epw"; state->dataGlobal->BeginSimFlag = true; SimulationManager::GetProjectData(*state); @@ -1469,7 +1454,7 @@ TEST_F(EnergyPlusFixture, Fix_OpaqueSkyCover_Test) Available = true; state->dataGlobal->BeginSimFlag = true; - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); + Weather::GetNextEnvironment(*state, Available, ErrorsFound); // Test get output variables for Total Sky Cover and Opaque Sky Cover EXPECT_EQ("Site Total Sky Cover", state->dataOutputProcessor->RVariableTypes(1).VarNameOnly); @@ -1480,48 +1465,48 @@ TEST_F(EnergyPlusFixture, Fix_OpaqueSkyCover_Test) EXPECT_EQ(7, state->dataOutputProcessor->RVariableTypes(1).ReportID); EXPECT_EQ(8, state->dataOutputProcessor->RVariableTypes(2).ReportID); - state->dataWeatherManager->Envrn = 1; + state->dataWeather->Envrn = 1; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->Environment.allocate(1); - state->dataWeatherManager->Environment(1).SkyTempModel = SkyTempCalcType::ClarkAllenModel; - state->dataWeatherManager->Environment(1).StartMonth = 1; - state->dataWeatherManager->Environment(1).StartDay = 1; + state->dataWeather->Environment.allocate(1); + state->dataWeather->Environment(1).skyTempModel = Weather::SkyTempModel::ClarkAllen; + state->dataWeather->Environment(1).StartMonth = 1; + state->dataWeather->Environment(1).StartDay = 1; - state->dataWeatherManager->Environment(1).UseWeatherFileHorizontalIR = false; + state->dataWeather->Environment(1).UseWeatherFileHorizontalIR = false; - AllocateWeatherData(*state); - OpenWeatherFile(*state, ErrorsFound); - ReadWeatherForDay(*state, 1, 1, true); + Weather::AllocateWeatherData(*state); + Weather::OpenWeatherFile(*state, ErrorsFound); + Weather::ReadWeatherForDay(*state, 1, 1, true); // Test additional set of weather data on sky temp calc Real64 expected_SkyTemp = -1.7901122977770569; - EXPECT_NEAR(state->dataWeatherManager->TomorrowSkyTemp(2, 1), expected_SkyTemp, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 1).SkyTemp, expected_SkyTemp, 1e-6); // Test Total Sky Cover and Opaque Sky Cover Real64 expected_TSC = 9; Real64 expected_OSC = 8; - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(4, 3), expected_TSC, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(4, 3), expected_OSC, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(3, 3), 9.25, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(3, 3), 8.25, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(2, 3), 9.5, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(2, 3), 8.5, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(1, 3), 9.75, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(1, 3), 8.75, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 3).TotalSkyCover, expected_TSC, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 3).OpaqueSkyCover, expected_OSC, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 3).TotalSkyCover, 9.25, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 3).OpaqueSkyCover, 8.25, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 3).TotalSkyCover, 9.5, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 3).OpaqueSkyCover, 8.5, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 3).TotalSkyCover, 9.75, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 3).OpaqueSkyCover, 8.75, 1e-6); expected_TSC = 8; expected_OSC = 8; - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(4, 4), expected_TSC, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(4, 4), expected_OSC, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(3, 4), 8.25, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(3, 4), 8.00, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(2, 4), 8.50, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(2, 4), 8.00, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(1, 4), 8.75, 1e-6); - EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(1, 4), 8.00, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 4).TotalSkyCover, expected_TSC, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(4, 4).OpaqueSkyCover, expected_OSC, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 4).TotalSkyCover, 8.25, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(3, 4).OpaqueSkyCover, 8.00, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 4).TotalSkyCover, 8.50, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(2, 4).OpaqueSkyCover, 8.00, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 4).TotalSkyCover, 8.75, 1e-6); + EXPECT_NEAR(state->dataWeather->wvarsHrTsTomorrow(1, 4).OpaqueSkyCover, 8.00, 1e-6); } TEST_F(EnergyPlusFixture, WeatherManager_SetRainFlag) @@ -1599,7 +1584,7 @@ TEST_F(EnergyPlusFixture, WeatherManager_SetRainFlag) SimulationManager::ManageSimulation(*state); WaterManager::GetWaterManagerInput(*state); state->dataGlobal->DayOfSim = 2; // avoid array bounds problem in RecKeepHeatBalance - state->dataWeatherManager->Envrn = 1; + state->dataWeather->Envrn = 1; state->dataGlobal->NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 15; // must initialize this to get schedules initialized state->dataGlobal->TimeStepZone = 0.25; @@ -1618,31 +1603,31 @@ TEST_F(EnergyPlusFixture, WeatherManager_SetRainFlag) state->dataEnvrn->DSTIndicator = 0; // DST IS OFF ScheduleManager::UpdateScheduleValues(*state); - state->dataWeatherManager->Interpolation.allocate(state->dataGlobal->NumOfTimeStepInHour); - state->dataWeatherManager->Interpolation = 0; + state->dataWeather->Interpolation.allocate(state->dataGlobal->NumOfTimeStepInHour); + state->dataWeather->Interpolation = 0; // setting up end ------------------------------------------------------------------------------ // Need to instantiate some stuff to avoid a crash - // WeatherManager::ReadUserWeatherInput(*state); + // Weather::ReadUserWeatherInput(*state); - state->dataWeatherManager->TodayIsRain.allocate(state->dataGlobal->NumOfTimeStepInHour, 24); - state->dataWeatherManager->TodayIsRain(1, 24) = false; + state->dataWeather->wvarsHrTsToday.allocate(state->dataGlobal->NumOfTimeStepInHour, Constant::HoursInDay); + state->dataWeather->wvarsHrTsToday(1, 24).IsRain = false; state->dataEnvrn->RunPeriodEnvironment = true; - WeatherManager::SetCurrentWeather(*state); + Weather::SetCurrentWeather(*state); // when TodayIsRain is false, IsRain is still true as site:precipitation has non-zero rain fall ASSERT_TRUE(state->dataEnvrn->IsRain); state->dataWaterData->RainFall.ModeID = DataWater::RainfallMode::EPWPrecipitation; - state->dataWeatherManager->TodayIsRain(1, 24) = false; + state->dataWeather->wvarsHrTsToday(1, 24).IsRain = false; state->dataEnvrn->RunPeriodEnvironment = true; - WeatherManager::SetCurrentWeather(*state); + Weather::SetCurrentWeather(*state); ASSERT_FALSE(state->dataEnvrn->IsRain); // site:precipitation overwritten of rain flag does not take effect during sizing period state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->TodayIsRain(1, 24) = false; + state->dataWeather->wvarsHrTsToday(1, 24).IsRain = false; state->dataEnvrn->RunPeriodEnvironment = false; - WeatherManager::SetCurrentWeather(*state); + Weather::SetCurrentWeather(*state); ASSERT_FALSE(state->dataEnvrn->IsRain); } @@ -1663,76 +1648,72 @@ TEST_F(EnergyPlusFixture, WeatherManager_GetReportPeriodData) ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - state->dataWeatherManager->TotReportPers = 1; - - GetReportPeriodData(*state, state->dataWeatherManager->TotReportPers, ErrorsFound); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).startYear, 0); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).startMonth, 1); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).startDay, 1); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).startHour, 8); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).endYear, 0); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).endMonth, 1); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).endDay, 3); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(1).endHour, 18); + state->dataWeather->TotReportPers = 1; + + Weather::GetReportPeriodData(*state, state->dataWeather->TotReportPers, ErrorsFound); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).startYear, 0); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).startMonth, 1); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).startDay, 1); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).startHour, 8); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).endYear, 0); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).endMonth, 1); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).endDay, 3); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(1).endHour, 18); } TEST_F(EnergyPlusFixture, WeatherManager_CopyReportPeriodObject) { int nReportPeriod = 2; - state->dataWeatherManager->ReportPeriodInput.allocate(nReportPeriod); - - state->dataWeatherManager->ReportPeriodInput(1).title = "test period 1"; - state->dataWeatherManager->ReportPeriodInput(1).reportName = "empty report 1"; - state->dataWeatherManager->ReportPeriodInput(1).startYear = 0; - state->dataWeatherManager->ReportPeriodInput(1).startMonth = 3; - state->dataWeatherManager->ReportPeriodInput(1).startDay = 5; - state->dataWeatherManager->ReportPeriodInput(1).startHour = 8; - state->dataWeatherManager->ReportPeriodInput(1).startJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ReportPeriodInput(1).startYear, - state->dataWeatherManager->ReportPeriodInput(1).startMonth, - state->dataWeatherManager->ReportPeriodInput(1).startDay); - state->dataWeatherManager->ReportPeriodInput(1).endYear = 0; - state->dataWeatherManager->ReportPeriodInput(1).endMonth = 3; - state->dataWeatherManager->ReportPeriodInput(1).endDay = 10; - state->dataWeatherManager->ReportPeriodInput(1).endHour = 8; - state->dataWeatherManager->ReportPeriodInput(1).endJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ReportPeriodInput(1).endYear, - state->dataWeatherManager->ReportPeriodInput(1).endMonth, - state->dataWeatherManager->ReportPeriodInput(1).endDay); - - state->dataWeatherManager->ReportPeriodInput(2).title = "test period 2"; - state->dataWeatherManager->ReportPeriodInput(2).reportName = "empty report 2"; - state->dataWeatherManager->ReportPeriodInput(2).startYear = 0; - state->dataWeatherManager->ReportPeriodInput(2).startMonth = 6; - state->dataWeatherManager->ReportPeriodInput(2).startDay = 6; - state->dataWeatherManager->ReportPeriodInput(2).startHour = 8; - state->dataWeatherManager->ReportPeriodInput(2).startJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ReportPeriodInput(2).startYear, - state->dataWeatherManager->ReportPeriodInput(2).startMonth, - state->dataWeatherManager->ReportPeriodInput(2).startDay); - state->dataWeatherManager->ReportPeriodInput(2).endYear = 0; - state->dataWeatherManager->ReportPeriodInput(2).endMonth = 7; - state->dataWeatherManager->ReportPeriodInput(2).endDay = 7; - state->dataWeatherManager->ReportPeriodInput(2).endHour = 8; - state->dataWeatherManager->ReportPeriodInput(2).endJulianDate = - WeatherManager::computeJulianDate(state->dataWeatherManager->ReportPeriodInput(2).endYear, - state->dataWeatherManager->ReportPeriodInput(2).endMonth, - state->dataWeatherManager->ReportPeriodInput(2).endDay); - - CopyReportPeriodObject(state->dataWeatherManager->ReportPeriodInput, 1, state->dataWeatherManager->ReportPeriodInput, 2); - - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).title, state->dataWeatherManager->ReportPeriodInput(1).title); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).reportName, state->dataWeatherManager->ReportPeriodInput(1).reportName); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).startYear, state->dataWeatherManager->ReportPeriodInput(1).startYear); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).startMonth, state->dataWeatherManager->ReportPeriodInput(1).startMonth); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).startDay, state->dataWeatherManager->ReportPeriodInput(1).startDay); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).startHour, state->dataWeatherManager->ReportPeriodInput(1).startHour); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).startJulianDate, state->dataWeatherManager->ReportPeriodInput(1).startJulianDate); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).endYear, state->dataWeatherManager->ReportPeriodInput(1).endYear); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).endMonth, state->dataWeatherManager->ReportPeriodInput(1).endMonth); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).endDay, state->dataWeatherManager->ReportPeriodInput(1).endDay); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).endHour, state->dataWeatherManager->ReportPeriodInput(1).endHour); - EXPECT_EQ(state->dataWeatherManager->ReportPeriodInput(2).endJulianDate, state->dataWeatherManager->ReportPeriodInput(1).endJulianDate); + state->dataWeather->ReportPeriodInput.allocate(nReportPeriod); + + state->dataWeather->ReportPeriodInput(1).title = "test period 1"; + state->dataWeather->ReportPeriodInput(1).reportName = "empty report 1"; + state->dataWeather->ReportPeriodInput(1).startYear = 0; + state->dataWeather->ReportPeriodInput(1).startMonth = 3; + state->dataWeather->ReportPeriodInput(1).startDay = 5; + state->dataWeather->ReportPeriodInput(1).startHour = 8; + state->dataWeather->ReportPeriodInput(1).startJulianDate = Weather::computeJulianDate(state->dataWeather->ReportPeriodInput(1).startYear, + state->dataWeather->ReportPeriodInput(1).startMonth, + state->dataWeather->ReportPeriodInput(1).startDay); + state->dataWeather->ReportPeriodInput(1).endYear = 0; + state->dataWeather->ReportPeriodInput(1).endMonth = 3; + state->dataWeather->ReportPeriodInput(1).endDay = 10; + state->dataWeather->ReportPeriodInput(1).endHour = 8; + state->dataWeather->ReportPeriodInput(1).endJulianDate = Weather::computeJulianDate(state->dataWeather->ReportPeriodInput(1).endYear, + state->dataWeather->ReportPeriodInput(1).endMonth, + state->dataWeather->ReportPeriodInput(1).endDay); + + state->dataWeather->ReportPeriodInput(2).title = "test period 2"; + state->dataWeather->ReportPeriodInput(2).reportName = "empty report 2"; + state->dataWeather->ReportPeriodInput(2).startYear = 0; + state->dataWeather->ReportPeriodInput(2).startMonth = 6; + state->dataWeather->ReportPeriodInput(2).startDay = 6; + state->dataWeather->ReportPeriodInput(2).startHour = 8; + state->dataWeather->ReportPeriodInput(2).startJulianDate = Weather::computeJulianDate(state->dataWeather->ReportPeriodInput(2).startYear, + state->dataWeather->ReportPeriodInput(2).startMonth, + state->dataWeather->ReportPeriodInput(2).startDay); + state->dataWeather->ReportPeriodInput(2).endYear = 0; + state->dataWeather->ReportPeriodInput(2).endMonth = 7; + state->dataWeather->ReportPeriodInput(2).endDay = 7; + state->dataWeather->ReportPeriodInput(2).endHour = 8; + state->dataWeather->ReportPeriodInput(2).endJulianDate = Weather::computeJulianDate(state->dataWeather->ReportPeriodInput(2).endYear, + state->dataWeather->ReportPeriodInput(2).endMonth, + state->dataWeather->ReportPeriodInput(2).endDay); + + state->dataWeather->ReportPeriodInput(2) = state->dataWeather->ReportPeriodInput(1); + + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).title, state->dataWeather->ReportPeriodInput(1).title); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).reportName, state->dataWeather->ReportPeriodInput(1).reportName); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).startYear, state->dataWeather->ReportPeriodInput(1).startYear); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).startMonth, state->dataWeather->ReportPeriodInput(1).startMonth); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).startDay, state->dataWeather->ReportPeriodInput(1).startDay); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).startHour, state->dataWeather->ReportPeriodInput(1).startHour); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).startJulianDate, state->dataWeather->ReportPeriodInput(1).startJulianDate); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).endYear, state->dataWeather->ReportPeriodInput(1).endYear); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).endMonth, state->dataWeather->ReportPeriodInput(1).endMonth); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).endDay, state->dataWeather->ReportPeriodInput(1).endDay); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).endHour, state->dataWeather->ReportPeriodInput(1).endHour); + EXPECT_EQ(state->dataWeather->ReportPeriodInput(2).endJulianDate, state->dataWeather->ReportPeriodInput(1).endJulianDate); } TEST_F(EnergyPlusFixture, WeatherManager_GroupReportPeriodByType) @@ -1775,44 +1756,44 @@ TEST_F(EnergyPlusFixture, WeatherManager_GroupReportPeriodByType) ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - state->dataWeatherManager->TotReportPers = 3; - GetReportPeriodData(*state, state->dataWeatherManager->TotReportPers, ErrorsFound); - - state->dataWeatherManager->TotThermalReportPers = 0; - state->dataWeatherManager->TotCO2ReportPers = 0; - state->dataWeatherManager->TotVisualReportPers = 0; - GroupReportPeriodByType(*state, state->dataWeatherManager->TotReportPers); - - EXPECT_EQ(state->dataWeatherManager->TotThermalReportPers, 2); - EXPECT_EQ(state->dataWeatherManager->TotCO2ReportPers, 1); - EXPECT_EQ(state->dataWeatherManager->TotVisualReportPers, 0); - - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).startYear, 0); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).startMonth, 1); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).startDay, 1); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).startHour, 8); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).endYear, 0); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).endMonth, 1); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).endDay, 3); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(1).endHour, 18); - - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).startYear, 0); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).startMonth, 7); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).startDay, 1); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).startHour, 9); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).endYear, 0); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).endMonth, 8); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).endDay, 5); - EXPECT_EQ(state->dataWeatherManager->ThermalReportPeriodInput(2).endHour, 10); - - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).startYear, 0); - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).startMonth, 2); - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).startDay, 1); - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).startHour, 8); - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).endYear, 0); - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).endMonth, 2); - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).endDay, 5); - EXPECT_EQ(state->dataWeatherManager->CO2ReportPeriodInput(1).endHour, 18); + state->dataWeather->TotReportPers = 3; + Weather::GetReportPeriodData(*state, state->dataWeather->TotReportPers, ErrorsFound); + + state->dataWeather->TotThermalReportPers = 0; + state->dataWeather->TotCO2ReportPers = 0; + state->dataWeather->TotVisualReportPers = 0; + Weather::GroupReportPeriodByType(*state, state->dataWeather->TotReportPers); + + EXPECT_EQ(state->dataWeather->TotThermalReportPers, 2); + EXPECT_EQ(state->dataWeather->TotCO2ReportPers, 1); + EXPECT_EQ(state->dataWeather->TotVisualReportPers, 0); + + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).startYear, 0); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).startMonth, 1); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).startDay, 1); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).startHour, 8); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).endYear, 0); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).endMonth, 1); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).endDay, 3); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(1).endHour, 18); + + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).startYear, 0); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).startMonth, 7); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).startDay, 1); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).startHour, 9); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).endYear, 0); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).endMonth, 8); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).endDay, 5); + EXPECT_EQ(state->dataWeather->ThermalReportPeriodInput(2).endHour, 10); + + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).startYear, 0); + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).startMonth, 2); + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).startDay, 1); + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).startHour, 8); + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).endYear, 0); + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).endMonth, 2); + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).endDay, 5); + EXPECT_EQ(state->dataWeather->CO2ReportPeriodInput(1).endHour, 18); } TEST_F(EnergyPlusFixture, WeatherRunPeriod_WeatherFile_OK) @@ -1855,21 +1836,21 @@ TEST_F(EnergyPlusFixture, WeatherRunPeriod_WeatherFile_OK) ASSERT_TRUE(process_idf(idf_objects)); // We do have an EPW - state->dataWeatherManager->WeatherFileExists = true; + state->dataWeather->WeatherFileExists = true; state->files.inputWeatherFilePath.filePath = configured_source_directory() / "weather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"; state->dataGlobal->BeginSimFlag = false; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->LocationGathered = false; + state->dataWeather->LocationGathered = false; state->dataGlobal->DoWeathSim = true; bool Available{false}; bool ErrorsFound{false}; - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); // Does not throw + Weather::GetNextEnvironment(*state, Available, ErrorsFound); // Does not throw EXPECT_TRUE(compare_err_stream("", true)); - EXPECT_EQ(1, state->dataWeatherManager->NumOfEnvrn); - EXPECT_TRUE(compare_enums(state->dataWeatherManager->Environment(1).KindOfEnvrn, Constant::KindOfSim::RunPeriodWeather)); + EXPECT_EQ(1, state->dataWeather->NumOfEnvrn); + EXPECT_TRUE(compare_enums(state->dataWeather->Environment(1).KindOfEnvrn, Constant::KindOfSim::RunPeriodWeather)); } TEST_F(EnergyPlusFixture, WeatherRunPeriod_WeatherFile_Missing) @@ -1912,17 +1893,17 @@ TEST_F(EnergyPlusFixture, WeatherRunPeriod_WeatherFile_Missing) ASSERT_TRUE(process_idf(idf_objects)); // We don't have an EPW - state->dataWeatherManager->WeatherFileExists = false; + state->dataWeather->WeatherFileExists = false; state->files.inputWeatherFilePath.filePath = "doesntnotexist.epw"; state->dataGlobal->BeginSimFlag = false; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->LocationGathered = false; + state->dataWeather->LocationGathered = false; state->dataGlobal->DoWeathSim = true; bool Available{false}; bool ErrorsFound{false}; - ASSERT_THROW(WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound), std::runtime_error); + ASSERT_THROW(Weather::GetNextEnvironment(*state, Available, ErrorsFound), std::runtime_error); std::string const error_string = delimited_string({ " ** Severe ** GetNextEnvironment: Weather Environment(s) requested, but no weather file found", @@ -1933,8 +1914,8 @@ TEST_F(EnergyPlusFixture, WeatherRunPeriod_WeatherFile_Missing) }); EXPECT_TRUE(compare_err_stream(error_string, true)); - EXPECT_EQ(1, state->dataWeatherManager->NumOfEnvrn); - EXPECT_TRUE(compare_enums(state->dataWeatherManager->Environment(1).KindOfEnvrn, Constant::KindOfSim::RunPeriodWeather)); + EXPECT_EQ(1, state->dataWeather->NumOfEnvrn); + EXPECT_TRUE(compare_enums(state->dataWeather->Environment(1).KindOfEnvrn, Constant::KindOfSim::RunPeriodWeather)); } TEST_F(EnergyPlusFixture, epwHeaderTest) @@ -1942,128 +1923,128 @@ TEST_F(EnergyPlusFixture, epwHeaderTest) // Test for #9743 bool errorsFound = false; std::string location = "LOCATION,NADI,-,FJI,IWEC Data,916800,-17.75,177.45,12.0,18.0"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::Location, location, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::Location, location, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); - EXPECT_EQ(state->dataWeatherManager->EPWHeaderTitle, "NADI - FJI IWEC Data WMO#=916800"); - EXPECT_EQ(state->dataWeatherManager->WeatherFileLatitude, -17.75); - EXPECT_EQ(state->dataWeatherManager->WeatherFileLongitude, 177.45); - EXPECT_EQ(state->dataWeatherManager->WeatherFileTimeZone, 12.0); - EXPECT_EQ(state->dataWeatherManager->WeatherFileElevation, 18.0); + EXPECT_EQ(state->dataWeather->EPWHeaderTitle, "NADI - FJI IWEC Data WMO#=916800"); + EXPECT_EQ(state->dataWeather->WeatherFileLatitude, -17.75); + EXPECT_EQ(state->dataWeather->WeatherFileLongitude, 177.45); + EXPECT_EQ(state->dataWeather->WeatherFileTimeZone, 12.0); + EXPECT_EQ(state->dataWeather->WeatherFileElevation, 18.0); std::string designConditions = "DESIGN CONDITIONS,1,Climate Design Data 2009 ASHRAE " "Handbook,,Heating,7,16.3,17.3,12.5,9,21.2,13.4,9.6,21.2,9,25.8,8.2,25.8,2,120,Cooling,1,7.5,32.3,25.3,31.9,25.3," "31.2,25.2,26.9,30.5,26.5,30.1,26.2,29.7,5.2,300,26,21.4,28.8,25.6,20.8,28.5,25.2,20.3,28.2,84.8,30.6,83.2,30.3," "81.9,29.8,21,Extremes,8.4,7.4,6.6,30.4,14.3,34.6,1,1.7,13.5,35.8,12.9,36.9,12.4,37.8,11.6,39.1"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::DesignConditions, designConditions, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::DesignConditions, designConditions, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); // Design Conditions are skipped - nothing to check std::string typicalExtreme = "TYPICAL/EXTREME PERIODS,3,No Dry Season - Week Near Average Annual,Typical,4/16,4/22,No Dry Season " "- Week Near Annual Max,Extreme,2/ 5,2/11,No Dry Season - Week Near Annual Min,Extreme,July 16,Jul 22"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::TypicalExtremePeriods, typicalExtreme, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::TypicalExtremePeriods, typicalExtreme, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); - EXPECT_EQ(state->dataWeatherManager->NumEPWTypExtSets, 3); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(1).Title, "No Dry Season - Week Near Average Annual"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(1).ShortTitle, "NoDrySeason"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(1).TEType, "Typical"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(1).StartMonth, 4); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(1).StartDay, 16); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(1).EndMonth, 4); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(1).EndDay, 22); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(2).Title, "No Dry Season - Week Near Annual Max"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(2).ShortTitle, "NoDrySeasonMax"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(2).TEType, "Extreme"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(2).StartMonth, 2); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(2).StartDay, 5); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(2).EndMonth, 2); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(2).EndDay, 11); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(3).Title, "No Dry Season - Week Near Annual Min"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(3).ShortTitle, "NoDrySeasonMin"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(3).TEType, "Extreme"); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(3).StartMonth, 7); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(3).StartDay, 16); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(3).EndMonth, 7); - EXPECT_EQ(state->dataWeatherManager->TypicalExtremePeriods(3).EndDay, 22); + EXPECT_EQ(state->dataWeather->NumEPWTypExtSets, 3); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(1).Title, "No Dry Season - Week Near Average Annual"); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(1).ShortTitle, "NoDrySeason"); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(1).TEType, "Typical"); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(1).StartMonth, 4); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(1).StartDay, 16); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(1).EndMonth, 4); + 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(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(state->dataWeather->TypicalExtremePeriods(3).StartMonth, 7); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).StartDay, 16); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).EndMonth, 7); + EXPECT_EQ(state->dataWeather->TypicalExtremePeriods(3).EndDay, 22); std::string groundTemps = "GROUND " "TEMPERATURES,3,.5,,,,26.85,26.98,26.68,26.23,25.09,24.22,23.64,23.49,23.82,24.51,25.43,26.27,2,,,,26.27,26.54,26.46,26.22,25.45,24.76,24.22," "23.94,24.02,24.42,25.06,25.72,4,,,,25.79,26.07,26.12,26.03,25.58,25.12,24.70,24.41,24.35,24.53,24.91,25.36"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::GroundTemperatures, groundTemps, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::GroundTemperatures, groundTemps, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); // apparently only the first set of ground temps are used - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(1), 26.85); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(2), 26.98); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(3), 26.68); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(4), 26.23); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(5), 25.09); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(6), 24.22); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(7), 23.64); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(8), 23.49); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(9), 23.82); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(10), 24.51); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(11), 25.43); - EXPECT_EQ(state->dataWeatherManager->GroundTempsFCFromEPWHeader(12), 26.27); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(1), 26.85); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(2), 26.98); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(3), 26.68); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(4), 26.23); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(5), 25.09); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(6), 24.22); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(7), 23.64); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(8), 23.49); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(9), 23.82); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(10), 24.51); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(11), 25.43); + EXPECT_EQ(state->dataWeather->GroundTempsFCFromEPWHeader(12), 26.27); std::string holidaysDST = "HOLIDAYS/DAYLIGHT SAVINGS,No,0,0,0"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::HolidaysDST, holidaysDST, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::HolidaysDST, holidaysDST, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); - EXPECT_FALSE(state->dataWeatherManager->WFAllowsLeapYears); - EXPECT_FALSE(state->dataWeatherManager->EPWDaylightSaving); - EXPECT_EQ(state->dataWeatherManager->NumSpecialDays, 0); + EXPECT_FALSE(state->dataWeather->WFAllowsLeapYears); + EXPECT_FALSE(state->dataWeather->EPWDaylightSaving); + EXPECT_EQ(state->dataWeather->NumSpecialDays, 0); holidaysDST = "HOLIDAYS/DAYLIGHT SAVINGS,Yes,1st Monday in May,7/31,0"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::HolidaysDST, holidaysDST, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::HolidaysDST, holidaysDST, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); - EXPECT_TRUE(state->dataWeatherManager->WFAllowsLeapYears); - EXPECT_TRUE(state->dataWeatherManager->EPWDaylightSaving); - EXPECT_TRUE(compare_enums(state->dataWeatherManager->EPWDST.StDateType, WeatherManager::DateType::NthDayInMonth)); - EXPECT_EQ(state->dataWeatherManager->EPWDST.StMon, 5); - EXPECT_EQ(state->dataWeatherManager->EPWDST.StDay, 1); - EXPECT_EQ(state->dataWeatherManager->EPWDST.StWeekDay, 2); - EXPECT_TRUE(compare_enums(state->dataWeatherManager->EPWDST.EnDateType, WeatherManager::DateType::MonthDay)); - EXPECT_EQ(state->dataWeatherManager->EPWDST.EnMon, 7); - EXPECT_EQ(state->dataWeatherManager->EPWDST.EnDay, 31); - EXPECT_EQ(state->dataWeatherManager->EPWDST.EnWeekDay, 2); + EXPECT_TRUE(state->dataWeather->WFAllowsLeapYears); + EXPECT_TRUE(state->dataWeather->EPWDaylightSaving); + EXPECT_TRUE(compare_enums(state->dataWeather->EPWDST.StDateType, Weather::DateType::NthDayInMonth)); + EXPECT_EQ(state->dataWeather->EPWDST.StMon, 5); + EXPECT_EQ(state->dataWeather->EPWDST.StDay, 1); + EXPECT_EQ(state->dataWeather->EPWDST.StWeekDay, 2); + EXPECT_TRUE(compare_enums(state->dataWeather->EPWDST.EnDateType, Weather::DateType::MonthDay)); + EXPECT_EQ(state->dataWeather->EPWDST.EnMon, 7); + EXPECT_EQ(state->dataWeather->EPWDST.EnDay, 31); + EXPECT_EQ(state->dataWeather->EPWDST.EnWeekDay, 2); std::string comments1 = "COMMENTS 1,IWEC- WMO#916800 - South-west Pacific -- Original Source Data (c) 2001 ASHRAE Inc.,"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::Comments1, comments1, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::Comments1, comments1, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); // Comments are skipped - nothing to check std::string comments2 = "COMMENTS 2, -- Ground temps produced with a standard soil diffusivity of 2.3225760E-03 {m**2/day}"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::Comments2, comments2, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::Comments2, comments2, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); // Comments are skipped - nothing to check std::string dataPeriods = "DATA PERIODS,2,10,Data1,Sunday, 1/ 1/1989,12/31/1990,Data2,Friday, FEBRUARY 1,Mar 15"; - WeatherManager::ProcessEPWHeader(*state, WeatherManager::EpwHeaderType::DataPeriods, dataPeriods, errorsFound); + Weather::ProcessEPWHeader(*state, Weather::EpwHeaderType::DataPeriods, dataPeriods, errorsFound); EXPECT_FALSE(errorsFound); EXPECT_FALSE(has_err_output()); - EXPECT_EQ(state->dataWeatherManager->NumDataPeriods, 2); - EXPECT_EQ(state->dataWeatherManager->NumIntervalsPerHour, 10); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(1).StMon, 1); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(1).StDay, 1); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(1).StYear, 1989); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(1).EnMon, 12); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(1).EnDay, 31); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(1).EnYear, 1990); - EXPECT_TRUE(state->dataWeatherManager->DataPeriods(1).HasYearData); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(2).StMon, 2); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(2).StDay, 1); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(2).StYear, 0); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(2).EnMon, 3); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(2).EnDay, 15); - EXPECT_EQ(state->dataWeatherManager->DataPeriods(2).EnYear, 0); - EXPECT_FALSE(state->dataWeatherManager->DataPeriods(2).HasYearData); + EXPECT_EQ(state->dataWeather->NumDataPeriods, 2); + EXPECT_EQ(state->dataWeather->NumIntervalsPerHour, 10); + EXPECT_EQ(state->dataWeather->DataPeriods(1).StMon, 1); + EXPECT_EQ(state->dataWeather->DataPeriods(1).StDay, 1); + EXPECT_EQ(state->dataWeather->DataPeriods(1).StYear, 1989); + EXPECT_EQ(state->dataWeather->DataPeriods(1).EnMon, 12); + EXPECT_EQ(state->dataWeather->DataPeriods(1).EnDay, 31); + EXPECT_EQ(state->dataWeather->DataPeriods(1).EnYear, 1990); + EXPECT_TRUE(state->dataWeather->DataPeriods(1).HasYearData); + EXPECT_EQ(state->dataWeather->DataPeriods(2).StMon, 2); + EXPECT_EQ(state->dataWeather->DataPeriods(2).StDay, 1); + EXPECT_EQ(state->dataWeather->DataPeriods(2).StYear, 0); + EXPECT_EQ(state->dataWeather->DataPeriods(2).EnMon, 3); + EXPECT_EQ(state->dataWeather->DataPeriods(2).EnDay, 15); + EXPECT_EQ(state->dataWeather->DataPeriods(2).EnYear, 0); + EXPECT_FALSE(state->dataWeather->DataPeriods(2).HasYearData); } TEST_F(EnergyPlusFixture, DisplayWeatherMissingDataWarnings_TMYx) @@ -2112,46 +2093,46 @@ TEST_F(EnergyPlusFixture, DisplayWeatherMissingDataWarnings_TMYx) "2018,1,5,15,0,?9?9?9?9E0?9?9?9?9?9?9?9?9?9?9?9?9?9*9?9?9?9,16.60,13.50,82,100997,588,1415,369,195,14,189,22230,1274,22230," "10584,320,10.00,9,9,777.7,1050,0,909999999,37,0.0840,0,88,0.200,0.0,0.0"; - WeatherManager::InterpretWeatherDataLine(*state, - WeatherDataLine, - ErrorFound, - WYear, - WMonth, - WDay, - WHour, - WMinute, - DryBulb, - DewPoint, - RelHum, - AtmPress, - ETHoriz, - ETDirect, - IRHoriz, - GLBHoriz, - DirectRad, - DiffuseRad, - GLBHorizIllum, - DirectNrmIllum, - DiffuseHorizIllum, - ZenLum, - WindDir, - WindSpeed, - TotalSkyCover, - OpaqueSkyCover, - Visibility, - CeilHeight, - PresWeathObs, - PresWeathConds, - PrecipWater, - AerosolOptDepth, - SnowDepth, - DaysSinceLastSnow, - Albedo, - LiquidPrecip); + Weather::InterpretWeatherDataLine(*state, + WeatherDataLine, + ErrorFound, + WYear, + WMonth, + WDay, + WHour, + WMinute, + DryBulb, + DewPoint, + RelHum, + AtmPress, + ETHoriz, + ETDirect, + IRHoriz, + GLBHoriz, + DirectRad, + DiffuseRad, + GLBHorizIllum, + DirectNrmIllum, + DiffuseHorizIllum, + ZenLum, + WindDir, + WindSpeed, + TotalSkyCover, + OpaqueSkyCover, + Visibility, + CeilHeight, + PresWeathObs, + PresWeathConds, + PrecipWater, + AerosolOptDepth, + SnowDepth, + DaysSinceLastSnow, + Albedo, + LiquidPrecip); EXPECT_FALSE(ErrorFound); EXPECT_EQ(0, PresWeathObs); - EXPECT_EQ(0, state->dataWeatherManager->Missed.WeathCodes); + EXPECT_EQ(0, state->dataWeather->wvarsMissedCounts.WeathCodes); EXPECT_EQ(9, PresWeathConds(1)); EXPECT_EQ(0, PresWeathConds(2)); EXPECT_EQ(9, PresWeathConds(3)); @@ -2236,46 +2217,46 @@ TEST_F(EnergyPlusFixture, DisplayWeatherMissingDataWarnings_TMYx) std::string WeatherDataLine = "1984,1,5,15,60,A7A7E8E8*0G9G9G9I9I9I9I9A7A7A7A7A7A7*0E8*0*0,14.4,2.2,44,103200,586,1415,307,357,581,115,37300," "54200,16400,2230,240,3.1,1,0,20.0,22000,9,999999999,0,0.1570,0,88,0.000,0.0,0.0"; - WeatherManager::InterpretWeatherDataLine(*state, - WeatherDataLine, - ErrorFound, - WYear, - WMonth, - WDay, - WHour, - WMinute, - DryBulb, - DewPoint, - RelHum, - AtmPress, - ETHoriz, - ETDirect, - IRHoriz, - GLBHoriz, - DirectRad, - DiffuseRad, - GLBHorizIllum, - DirectNrmIllum, - DiffuseHorizIllum, - ZenLum, - WindDir, - WindSpeed, - TotalSkyCover, - OpaqueSkyCover, - Visibility, - CeilHeight, - PresWeathObs, - PresWeathConds, - PrecipWater, - AerosolOptDepth, - SnowDepth, - DaysSinceLastSnow, - Albedo, - LiquidPrecip); + Weather::InterpretWeatherDataLine(*state, + WeatherDataLine, + ErrorFound, + WYear, + WMonth, + WDay, + WHour, + WMinute, + DryBulb, + DewPoint, + RelHum, + AtmPress, + ETHoriz, + ETDirect, + IRHoriz, + GLBHoriz, + DirectRad, + DiffuseRad, + GLBHorizIllum, + DirectNrmIllum, + DiffuseHorizIllum, + ZenLum, + WindDir, + WindSpeed, + TotalSkyCover, + OpaqueSkyCover, + Visibility, + CeilHeight, + PresWeathObs, + PresWeathConds, + PrecipWater, + AerosolOptDepth, + SnowDepth, + DaysSinceLastSnow, + Albedo, + LiquidPrecip); EXPECT_FALSE(ErrorFound); EXPECT_EQ(9, PresWeathObs); - EXPECT_EQ(0, state->dataWeatherManager->Missed.WeathCodes); + EXPECT_EQ(0, state->dataWeather->wvarsMissedCounts.WeathCodes); EXPECT_EQ(9, PresWeathConds(1)); EXPECT_EQ(9, PresWeathConds(2)); EXPECT_EQ(9, PresWeathConds(3)); @@ -2361,46 +2342,46 @@ TEST_F(EnergyPlusFixture, DisplayWeatherMissingDataWarnings_TMYx) "2018,1,5,15,0,?9?9?9?9E0?9?9?9?9?9?9?9?9?9?9?9?9?9*9?9?9?9,16.60,13.50,82,100997,588,1415,369,195,14,189,22230,1274,22230," "10584,320,10.00,9,9,777.7,1050,0,909999999,37,0.0840"; - WeatherManager::InterpretWeatherDataLine(*state, - WeatherDataLine, - ErrorFound, - WYear, - WMonth, - WDay, - WHour, - WMinute, - DryBulb, - DewPoint, - RelHum, - AtmPress, - ETHoriz, - ETDirect, - IRHoriz, - GLBHoriz, - DirectRad, - DiffuseRad, - GLBHorizIllum, - DirectNrmIllum, - DiffuseHorizIllum, - ZenLum, - WindDir, - WindSpeed, - TotalSkyCover, - OpaqueSkyCover, - Visibility, - CeilHeight, - PresWeathObs, - PresWeathConds, - PrecipWater, - AerosolOptDepth, - SnowDepth, - DaysSinceLastSnow, - Albedo, - LiquidPrecip); + Weather::InterpretWeatherDataLine(*state, + WeatherDataLine, + ErrorFound, + WYear, + WMonth, + WDay, + WHour, + WMinute, + DryBulb, + DewPoint, + RelHum, + AtmPress, + ETHoriz, + ETDirect, + IRHoriz, + GLBHoriz, + DirectRad, + DiffuseRad, + GLBHorizIllum, + DirectNrmIllum, + DiffuseHorizIllum, + ZenLum, + WindDir, + WindSpeed, + TotalSkyCover, + OpaqueSkyCover, + Visibility, + CeilHeight, + PresWeathObs, + PresWeathConds, + PrecipWater, + AerosolOptDepth, + SnowDepth, + DaysSinceLastSnow, + Albedo, + LiquidPrecip); EXPECT_FALSE(ErrorFound); EXPECT_EQ(0, PresWeathObs); - EXPECT_EQ(0, state->dataWeatherManager->Missed.WeathCodes); + EXPECT_EQ(0, state->dataWeather->wvarsMissedCounts.WeathCodes); EXPECT_EQ(9, PresWeathConds(1)); EXPECT_EQ(0, PresWeathConds(2)); EXPECT_EQ(9, PresWeathConds(3)); @@ -2489,23 +2470,23 @@ TEST_F(EnergyPlusFixture, EPW_no_eol_at_end_of_file) ASSERT_TRUE(process_idf(idf_objects)); // We do have an EPW - state->dataWeatherManager->WeatherFileExists = true; + state->dataWeather->WeatherFileExists = true; // This is USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw, and did `truncate -s -1 chicago_no_eol_at_end_of_file.epw` state->files.inputWeatherFilePath.filePath = configured_source_directory() / "tst/EnergyPlus/unit/Resources/chicago_no_eol_at_end_of_file.epw"; state->dataGlobal->BeginSimFlag = false; state->dataGlobal->NumOfTimeStepInHour = 4; - state->dataWeatherManager->LocationGathered = false; + state->dataWeather->LocationGathered = false; state->dataGlobal->DoWeathSim = true; bool Available = false; bool ErrorsFound = false; - WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); // Does not throw + Weather::GetNextEnvironment(*state, Available, ErrorsFound); // Does not throw ASSERT_FALSE(ErrorsFound); EXPECT_TRUE(compare_err_stream("", true)); - EXPECT_EQ(1, state->dataWeatherManager->NumOfEnvrn); - EXPECT_TRUE(compare_enums(state->dataWeatherManager->Environment(1).KindOfEnvrn, Constant::KindOfSim::RunPeriodWeather)); + EXPECT_EQ(1, state->dataWeather->NumOfEnvrn); + EXPECT_TRUE(compare_enums(state->dataWeather->Environment(1).KindOfEnvrn, Constant::KindOfSim::RunPeriodWeather)); - EXPECT_NO_THROW(ReadWeatherForDay(*state, 1, 1, true)); + EXPECT_NO_THROW(Weather::ReadWeatherForDay(*state, 1, 1, true)); EXPECT_TRUE(compare_err_stream("", true)); } diff --git a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc index 1c33871bf1b..82b1d1129b6 100644 --- a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc +++ b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc @@ -535,7 +535,7 @@ TEST_F(EnergyPlusFixture, WindowEquivalentLayer_VBMaximizeBeamSolar) state->dataGlobal->TimeStep = 1; state->dataGlobal->HourOfDay = 12; state->dataGlobal->CurrentTime = 12.0; - WeatherManager::DetermineSunUpDown(*state, state->dataEnvrn->SOLCOS); + Weather::DetermineSunUpDown(*state, state->dataEnvrn->SOLCOS); // get window surface index for (int iSurf = 1; iSurf <= state->dataSurface->TotSurfaces; iSurf++) { if (state->dataSurface->SurfWinWindowModelType(iSurf) == DataSurfaces::WindowModel::EQL) { @@ -897,7 +897,7 @@ TEST_F(EnergyPlusFixture, WindowEquivalentLayer_VBBlockBeamSolar) state->dataGlobal->TimeStep = 1; state->dataGlobal->HourOfDay = 12; state->dataGlobal->CurrentTime = 12.0; - WeatherManager::DetermineSunUpDown(*state, state->dataEnvrn->SOLCOS); + Weather::DetermineSunUpDown(*state, state->dataEnvrn->SOLCOS); // get equivalent layer window surface index for (int iSurf = 1; iSurf <= state->dataSurface->TotSurfaces; iSurf++) { if (state->dataSurface->SurfWinWindowModelType(iSurf) == DataSurfaces::WindowModel::EQL) { diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 4b0e00a6786..1c6e3962024 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -244,7 +244,7 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) state->dataSurface->SurfOutDryBulbTemp(winNum) = T_out; state->dataHeatBal->SurfTempEffBulkAir(winNum) = T_in; - state->dataSurface->SurfWinIRfromParentZone(winNum) = Constant::StefanBoltzmann * std::pow(T_in + Constant::KelvinConv, 4); + state->dataSurface->SurfWinIRfromParentZone(winNum) = Constant::StefanBoltzmann * std::pow(T_in + Constant::Kelvin, 4); state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(1); state->dataZoneTempPredictorCorrector->zoneHeatBalance(1).MAT = T_in; state->dataZoneTempPredictorCorrector->zoneHeatBalance(1).airHumRatAvg = 0.01; @@ -506,9 +506,9 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataHeatBalSurf->SurfTempInTmp.allocate(3); state->dataHeatBalSurf->SurfHAirExt.allocate(3); - int surfNum1 = UtilityRoutines::FindItemInList("WALL", state->dataSurface->Surface); - int surfNum2 = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); - int surfNum3 = UtilityRoutines::FindItemInList("FLOOR", state->dataSurface->Surface); + int surfNum1 = Util::FindItemInList("WALL", state->dataSurface->Surface); + int surfNum2 = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int surfNum3 = Util::FindItemInList("FLOOR", state->dataSurface->Surface); state->dataSurface->Surface(surfNum1).HeatTransSurf = true; state->dataSurface->Surface(surfNum2).HeatTransSurf = true; @@ -2772,9 +2772,9 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataLoopNodes->Node.allocate(4); - int surfNum1 = UtilityRoutines::FindItemInList("WALL", state->dataSurface->Surface); - int surfNum2 = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); - int surfNum3 = UtilityRoutines::FindItemInList("FLOOR", state->dataSurface->Surface); + int surfNum1 = Util::FindItemInList("WALL", state->dataSurface->Surface); + int surfNum2 = Util::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); + int surfNum3 = Util::FindItemInList("FLOOR", state->dataSurface->Surface); state->dataSurface->Surface(surfNum1).HeatTransSurf = true; state->dataSurface->Surface(surfNum2).HeatTransSurf = true; @@ -2845,7 +2845,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) HeatBalanceSurfaceManager::ReportSurfaceHeatBalance(*state); // Test if LWR from surrounding surfaces correctly calculated - EXPECT_DOUBLE_EQ(Constant::StefanBoltzmann * 0.84 * 0.6 * (pow_4(25.0 + Constant::KelvinConv) - pow_4(state->dataWindowManager->thetas[0])), + EXPECT_DOUBLE_EQ(Constant::StefanBoltzmann * 0.84 * 0.6 * (pow_4(25.0 + Constant::Kelvin) - pow_4(state->dataWindowManager->thetas[0])), state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs(surfNum2)); EXPECT_NEAR(-24.9342, state->dataHeatBalSurf->SurfQHeatEmiReport(surfNum2), 3); } @@ -7700,7 +7700,7 @@ TEST_F(EnergyPlusFixture, CFS_InteriorSolarDistribution_Test) int winNum = i; state->dataSurface->SurfOutDryBulbTemp(winNum) = T_out; state->dataHeatBal->SurfTempEffBulkAir(winNum) = T_in; - state->dataSurface->SurfWinIRfromParentZone(winNum) = Constant::StefanBoltzmann * std::pow(T_in + Constant::KelvinConv, 4); + state->dataSurface->SurfWinIRfromParentZone(winNum) = Constant::StefanBoltzmann * std::pow(T_in + Constant::Kelvin, 4); } } state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(1); diff --git a/tst/EnergyPlus/unit/WindowManagerExteriorThermal.unit.cc b/tst/EnergyPlus/unit/WindowManagerExteriorThermal.unit.cc index 9253b50d6ee..6c1b007f87c 100644 --- a/tst/EnergyPlus/unit/WindowManagerExteriorThermal.unit.cc +++ b/tst/EnergyPlus/unit/WindowManagerExteriorThermal.unit.cc @@ -739,9 +739,9 @@ TEST_F(EnergyPlusFixture, test_GetWindowAssemblyNfrcForReport_withIDF) double shgcRep{0.}; double vtRep{0.}; - int windowSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); + int windowSurfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); EXPECT_TRUE(windowSurfNum > 0); - int constructNum = UtilityRoutines::FindItemInList("DOUBLE PANE HW WINDOW", state->dataConstruction->Construct); + int constructNum = Util::FindItemInList("DOUBLE PANE HW WINDOW", state->dataConstruction->Construct); EXPECT_TRUE(constructNum > 0); GetWindowAssemblyNfrcForReport( diff --git a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc index 5ccb98ef78c..07cc75e3601 100644 --- a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc +++ b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc @@ -1347,7 +1347,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeUniformPLR) state->dataZoneEquip->ZoneEquipList(1).EquipIndex(1) = 1; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(2) = 2; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(3) = 3; - int zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); int coolingPriority = 0; int heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); @@ -1355,7 +1355,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeUniformPLR) EXPECT_EQ(heatingPriority, 1); // DataHVACGlobals::MinAirLoopIterationsAfterFirst should equal 2 for UniformPLR EXPECT_EQ(state->dataHVACGlobal->MinAirLoopIterationsAfterFirst, 2); - zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); coolingPriority = 0; heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); @@ -1569,7 +1569,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeSequentialUniformPLR) state->dataZoneEquip->ZoneEquipList(1).EquipIndex(1) = 1; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(2) = 2; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(3) = 3; - int zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); int coolingPriority = 0; int heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); @@ -1577,7 +1577,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeSequentialUniformPLR) EXPECT_EQ(heatingPriority, 1); // DataHVACGlobals::MinAirLoopIterationsAfterFirst should equal equipmnum+1 for SequentialUniformPLR EXPECT_EQ(state->dataHVACGlobal->MinAirLoopIterationsAfterFirst, 2); - zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); coolingPriority = 0; heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); @@ -1888,7 +1888,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeSequentialLoad_MixedEqu state->dataZoneEquip->ZoneEquipList(1).EquipIndex(2) = 1; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(3) = 2; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(4) = 2; - int zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); int coolingPriority = 0; int heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); @@ -1896,7 +1896,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeSequentialLoad_MixedEqu EXPECT_EQ(heatingPriority, 1); // DataHVACGlobals::MinAirLoopIterationsAfterFirst should equal the highest air terminal equipment num for sequential loading EXPECT_EQ(state->dataHVACGlobal->MinAirLoopIterationsAfterFirst, 1); - zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); coolingPriority = 0; heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); @@ -2119,7 +2119,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeSequentialLoad_MixedEqu state->dataZoneEquip->ZoneEquipList(1).EquipIndex(2) = 1; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(3) = 2; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(4) = 2; - int zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + int zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 1", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); int coolingPriority = 0; int heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); @@ -2127,7 +2127,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_DistributeSequentialLoad_MixedEqu EXPECT_EQ(heatingPriority, 1); // DataHVACGlobals::MinAirLoopIterationsAfterFirst should equal the highest air terminal equipment num for sequential loading EXPECT_EQ(state->dataHVACGlobal->MinAirLoopIterationsAfterFirst, 1); - zoneInlet = UtilityRoutines::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); + zoneInlet = Util::FindItemInList("ZONE EQUIP INLET 3", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes); coolingPriority = 0; heatingPriority = 0; state->dataZoneEquip->ZoneEquipList(1).getPrioritiesForInletNode(*state, zoneInlet, coolingPriority, heatingPriority); diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index 49c2b47d7b1..d67b0a175cb 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -807,13 +807,13 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_AdaptiveThermostat) int constexpr CEN15251_CENTRAL(5); state->dataEnvrn->DayOfYear = 1; - state->dataWeatherManager->Envrn = 1; - state->dataWeatherManager->Environment.allocate(1); - state->dataWeatherManager->DesDayInput.allocate(1); - state->dataWeatherManager->Environment(state->dataWeatherManager->Envrn).KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; - state->dataWeatherManager->DesDayInput(state->dataWeatherManager->Envrn).DayType = summerDesignDayTypeIndex; - state->dataWeatherManager->DesDayInput(state->dataWeatherManager->Envrn).MaxDryBulb = 30.0; - state->dataWeatherManager->DesDayInput(state->dataWeatherManager->Envrn).DailyDBRange = 10.0; + state->dataWeather->Envrn = 1; + state->dataWeather->Environment.allocate(1); + state->dataWeather->DesDayInput.allocate(1); + state->dataWeather->Environment(state->dataWeather->Envrn).KindOfEnvrn = Constant::KindOfSim::RunPeriodWeather; + state->dataWeather->DesDayInput(state->dataWeather->Envrn).DayType = summerDesignDayTypeIndex; + state->dataWeather->DesDayInput(state->dataWeather->Envrn).MaxDryBulb = 30.0; + state->dataWeather->DesDayInput(state->dataWeather->Envrn).DailyDBRange = 10.0; Real64 ZoneAirSetPoint = 0.0; bool ErrorsFound(false); // If errors detected in input