diff --git a/doc/module-developer/src/hvac-network/interfacing-with-plant.tex b/doc/module-developer/src/hvac-network/interfacing-with-plant.tex index 248d370e5f9..1d6a8481c83 100644 --- a/doc/module-developer/src/hvac-network/interfacing-with-plant.tex +++ b/doc/module-developer/src/hvac-network/interfacing-with-plant.tex @@ -107,9 +107,9 @@ \subsection{Central Routine Modifications}\label{central-routine-modifications} a.~~~~Parameter NumSimPlantEquipTypes. Increment up to include new component. -b.~~~Array SimPlantEquipTypes.~ Add array element with new object's class name in upper case. +b.~~~Array PlantEquipTypeNamesUC.~ Add array element with new object's class name in upper case. -c.~~~~Array ccSimPlantEquipTypes.Add array element with new object's class name in camel case. +c.~~~~Array PlantEquipTypeNames.Add array element with new object's class name in camel case. d.~~~Array ValidLoopEquipTypes.~ Add array element with classification for what type of loop this component is intended for, primarily with respect to the type of loop it is intended to meet loads. diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 4766d9a9bae..8c742fad446 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -503,7 +503,7 @@ namespace AirLoopHVACDOAS { } PlantUtilities::ScanPlantLoopsForObject(state, CompName, - DataPlant::TypeOf_CoilWaterCooling, + DataPlant::PlantEquipmentType::CoilWaterCooling, thisDOAS.CWLoopNum, thisDOAS.CWLoopSide, thisDOAS.CWBranchNum, @@ -536,7 +536,7 @@ namespace AirLoopHVACDOAS { } PlantUtilities::ScanPlantLoopsForObject(state, CompName, - DataPlant::TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, thisDOAS.HWLoopNum, thisDOAS.HWLoopSide, thisDOAS.HWBranchNum, @@ -576,7 +576,7 @@ namespace AirLoopHVACDOAS { } PlantUtilities::ScanPlantLoopsForObject(state, CompName, - DataPlant::TypeOf_CoilWaterDetailedFlatCooling, + DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling, thisDOAS.CWLoopNum, thisDOAS.CWLoopSide, thisDOAS.CWBranchNum, diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index d7d605af64a..d1cfaf64d8a 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -92,7 +92,6 @@ namespace BaseboardRadiator { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using DataPlant::TypeOf_Baseboard_Conv_Water; // Use statements for access to subroutines in other modules using namespace ScheduleManager; @@ -322,7 +321,7 @@ namespace BaseboardRadiator { ++BaseboardNum; baseboard->Baseboard(BaseboardNum).EquipID = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard - baseboard->Baseboard(BaseboardNum).EquipType = TypeOf_Baseboard_Conv_Water; + baseboard->Baseboard(BaseboardNum).EquipType = DataPlant::PlantEquipmentType::Baseboard_Conv_Water; baseboard->Baseboard(BaseboardNum).Schedule = state.dataIPShortCut->cAlphaArgs(2); if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { baseboard->Baseboard(BaseboardNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; diff --git a/src/EnergyPlus/BaseboardRadiator.hh b/src/EnergyPlus/BaseboardRadiator.hh index dc5a1471c3b..e583ed8dc92 100644 --- a/src/EnergyPlus/BaseboardRadiator.hh +++ b/src/EnergyPlus/BaseboardRadiator.hh @@ -55,6 +55,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -69,7 +70,7 @@ namespace BaseboardRadiator { std::string EquipID; std::string Schedule; int SchedPtr; - int EquipType; + DataPlant::PlantEquipmentType EquipType; int ZonePtr; int WaterInletNode; int WaterOutletNode; @@ -110,12 +111,12 @@ namespace BaseboardRadiator { // Default Constructor BaseboardParams() - : SchedPtr(0), EquipType(0), ZonePtr(0), WaterInletNode(0), WaterOutletNode(0), ControlCompTypeNum(0), CompErrIndex(0), UA(0.0), - WaterMassFlowRate(0.0), WaterVolFlowRateMax(0.0), WaterMassFlowRateMax(0.0), Offset(0.0), AirMassFlowRate(0.0), DesAirMassFlowRate(0.0), - WaterInletTemp(0.0), WaterOutletTemp(0.0), WaterInletEnthalpy(0.0), WaterOutletEnthalpy(0.0), AirInletTemp(0.0), AirInletHumRat(0.0), - AirOutletTemp(0.0), Power(0.0), Energy(0.0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), BBLoadReSimIndex(0), - BBMassFlowReSimIndex(0), BBInletTempFlowReSimIndex(0), HeatingCapMethod(0), ScaledHeatingCapacity(0.0), MySizeFlag(true), - CheckEquipName(true), SetLoopIndexFlag(true), MyEnvrnFlag(true) + : SchedPtr(0), EquipType(DataPlant::PlantEquipmentType::Invalid), ZonePtr(0), WaterInletNode(0), WaterOutletNode(0), + ControlCompTypeNum(0), CompErrIndex(0), UA(0.0), WaterMassFlowRate(0.0), WaterVolFlowRateMax(0.0), WaterMassFlowRateMax(0.0), + Offset(0.0), AirMassFlowRate(0.0), DesAirMassFlowRate(0.0), WaterInletTemp(0.0), WaterOutletTemp(0.0), WaterInletEnthalpy(0.0), + WaterOutletEnthalpy(0.0), AirInletTemp(0.0), AirInletHumRat(0.0), AirOutletTemp(0.0), Power(0.0), Energy(0.0), LoopNum(0), + LoopSideNum(0), BranchNum(0), CompNum(0), BBLoadReSimIndex(0), BBMassFlowReSimIndex(0), BBInletTempFlowReSimIndex(0), + HeatingCapMethod(0), ScaledHeatingCapacity(0.0), MySizeFlag(true), CheckEquipName(true), SetLoopIndexFlag(true), MyEnvrnFlag(true) { } }; diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index 2de50096e9a..9c2e1ed8367 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -315,7 +315,7 @@ namespace BoilerSteam { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Boiler_Steam, + DataPlant::PlantEquipmentType::Boiler_Steam, this->LoopNum, this->LoopSideNum, this->BranchNum, @@ -429,15 +429,18 @@ namespace BoilerSteam { // fix for clumsy old input that worked because loop setpoint was spread. // could be removed with transition, testing , model change, period of being obsolete. int BoilerOutletNode = this->BoilerOutletNodeNum; - { - auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - state.dataLoopNodes->Node(BoilerOutletNode).TempSetPoint = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - state.dataLoopNodes->Node(BoilerOutletNode).TempSetPointLo = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; - } + switch (state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme) { + + case (DataPlant::LoopDemandCalcScheme::SingleSetPoint): + state.dataLoopNodes->Node(BoilerOutletNode).TempSetPoint = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; + break; + case (DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand): + state.dataLoopNodes->Node(BoilerOutletNode).TempSetPointLo = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; + break; + default: + break; } } } @@ -641,9 +644,9 @@ namespace BoilerSteam { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPointLo; } } @@ -683,15 +686,15 @@ namespace BoilerSteam { state, fluidNameSteam, state.dataLoopNodes->Node(this->BoilerInletNodeNum).Temp, 0.0, this->FluidIndex, RoutineName); if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == - DataPlant::iFlowLock::Unlocked) { // TODO: Components shouldn't check FlowLock + DataPlant::FlowLock::Unlocked) { // TODO: Components shouldn't check FlowLock // Calculate the flow for the boiler { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPoint - state.dataLoopNodes->Node(this->BoilerInletNodeNum).Temp; - } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand + } else { // DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand BoilerDeltaTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPointLo - state.dataLoopNodes->Node(this->BoilerInletNodeNum).Temp; } @@ -720,10 +723,10 @@ namespace BoilerSteam { // Assume that it can meet the setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPoint - state.dataLoopNodes->Node(this->BoilerInletNodeNum).Temp; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { BoilerDeltaTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPointLo - state.dataLoopNodes->Node(this->BoilerInletNodeNum).Temp; } @@ -732,9 +735,9 @@ namespace BoilerSteam { if (BoilerDeltaTemp < 0.0) { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPointLo; } } @@ -749,9 +752,9 @@ namespace BoilerSteam { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPointLo; } } @@ -772,9 +775,9 @@ namespace BoilerSteam { // Reset later , here just for calculating latent heat { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPointLo; } } diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index 5b53b6ab986..60775c96839 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -207,7 +207,7 @@ void GetBoilerInput(EnergyPlusData &state) state.dataIPShortCut->cCurrentModuleObject + " Name"); auto &thisBoiler = state.dataBoilers->Boiler(BoilerNum); thisBoiler.Name = state.dataIPShortCut->cAlphaArgs(1); - thisBoiler.TypeNum = DataPlant::TypeOf_Boiler_Simple; + thisBoiler.Type = DataPlant::PlantEquipmentType::Boiler_Simple; // Validate fuel type input bool FuelTypeError(false); @@ -474,7 +474,7 @@ void BoilerSpecs::oneTimeInit(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Boiler_Simple, + DataPlant::PlantEquipmentType::Boiler_Simple, this->LoopNum, this->LoopSideNum, this->BranchNum, @@ -585,10 +585,10 @@ void BoilerSpecs::InitBoiler(EnergyPlusData &state) // number of the current boi if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) && this->ModulatedFlowSetToLoop) { // fix for clumsy old input that worked because loop setpoint was spread. // could be removed with transition, testing , model change, period of being obsolete. - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; - } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand + } else { // DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand state.dataLoopNodes->Node(this->BoilerOutletNodeNum).TempSetPointLo = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; } @@ -833,7 +833,7 @@ void BoilerSpecs::CalcBoilerModel(EnergyPlusData &state, // Initialize the delta temperature to zero Real64 BoilerDeltaTemp; // C - boiler inlet to outlet temperature difference, set in all necessary code paths so no initialization required - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { // Either set the flow to the Constant value or calculate the flow for the variable volume if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Then find the flow rate and outlet temp @@ -852,9 +852,9 @@ void BoilerSpecs::CalcBoilerModel(EnergyPlusData &state, // Calculate the Delta Temp from the inlet temp to the boiler outlet setpoint // Then find the flow rate and outlet temp - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = state.dataLoopNodes->Node(BoilerOutletNode).TempSetPoint - state.dataLoopNodes->Node(BoilerInletNode).Temp; - } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand + } else { // DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand BoilerDeltaTemp = state.dataLoopNodes->Node(BoilerOutletNode).TempSetPointLo - state.dataLoopNodes->Node(BoilerInletNode).Temp; } diff --git a/src/EnergyPlus/Boilers.hh b/src/EnergyPlus/Boilers.hh index 301dfc19271..2186fc750f0 100644 --- a/src/EnergyPlus/Boilers.hh +++ b/src/EnergyPlus/Boilers.hh @@ -80,7 +80,7 @@ namespace Boilers { // Members std::string Name; // user identifier DataGlobalConstants::ResourceType FuelType; // resource type assignment - int TypeNum; // plant loop type identifier + DataPlant::PlantEquipmentType Type; // plant loop type identifier int LoopNum; // plant loop connection int LoopSideNum; // plant loop side connection int BranchNum; // plant loop branch connection @@ -139,16 +139,16 @@ namespace Boilers { // Default Constructor BoilerSpecs() - : FuelType(DataGlobalConstants::ResourceType::None), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false), - ON(false), NomCap(0.0), NomCapWasAutoSized(false), NomEffic(0.0), TempDesBoilerOut(0.0), FlowMode(DataPlant::FlowMode::Unassigned), - ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), VolFlowRate(0.0), VolFlowRateWasAutoSized(false), DesMassFlowRate(0.0), - MassFlowRate(0.0), SizFac(0.0), BoilerInletNodeNum(0), BoilerOutletNodeNum(0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), - OptPartLoadRat(0.0), OperPartLoadRat(0.0), CurveTempMode(TempMode::NOTSET), EfficiencyCurvePtr(0), TempUpLimitBoilerOut(0.0), - ParasiticElecLoad(0.0), EffCurveOutputError(0), EffCurveOutputIndex(0), CalculatedEffError(0), CalculatedEffIndex(0), - IsThisSized(false), FaultyBoilerFoulingFlag(false), FaultyBoilerFoulingIndex(0), FaultyBoilerFoulingFactor(1.0), MyEnvrnFlag(true), - MyFlag(true), FuelUsed(0.0), ParasiticElecPower(0.0), BoilerLoad(0.0), BoilerMassFlowRate(0.0), BoilerOutletTemp(0.0), BoilerPLR(0.0), - BoilerEff(0.0), BoilerEnergy(0.0), FuelConsumed(0.0), BoilerInletTemp(0.0), ParasiticElecConsumption(0.0), - BoilerFuelTypeForOutputVariable("") + : FuelType(DataGlobalConstants::ResourceType::None), Type(DataPlant::PlantEquipmentType::Invalid), LoopNum(0), LoopSideNum(0), + BranchNum(0), CompNum(0), Available(false), ON(false), NomCap(0.0), NomCapWasAutoSized(false), NomEffic(0.0), TempDesBoilerOut(0.0), + FlowMode(DataPlant::FlowMode::Unassigned), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), VolFlowRate(0.0), + VolFlowRateWasAutoSized(false), DesMassFlowRate(0.0), MassFlowRate(0.0), SizFac(0.0), BoilerInletNodeNum(0), BoilerOutletNodeNum(0), + MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), OperPartLoadRat(0.0), CurveTempMode(TempMode::NOTSET), + EfficiencyCurvePtr(0), TempUpLimitBoilerOut(0.0), ParasiticElecLoad(0.0), EffCurveOutputError(0), EffCurveOutputIndex(0), + CalculatedEffError(0), CalculatedEffIndex(0), IsThisSized(false), FaultyBoilerFoulingFlag(false), FaultyBoilerFoulingIndex(0), + FaultyBoilerFoulingFactor(1.0), MyEnvrnFlag(true), MyFlag(true), FuelUsed(0.0), ParasiticElecPower(0.0), BoilerLoad(0.0), + BoilerMassFlowRate(0.0), BoilerOutletTemp(0.0), BoilerPLR(0.0), BoilerEff(0.0), BoilerEnergy(0.0), FuelConsumed(0.0), + BoilerInletTemp(0.0), ParasiticElecConsumption(0.0), BoilerFuelTypeForOutputVariable("") { } diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index 7041d8a6a7b..21d3c5674e0 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -828,7 +828,7 @@ namespace CTElectricGenerator { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Generator_CTurbine, + DataPlant::PlantEquipmentType::Generator_CTurbine, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 74b4522ee95..1443436db96 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -121,9 +121,6 @@ void SimCoolingPanel(EnergyPlusData &state, // REFERENCES: // Existing code for hot water baseboard models (radiant-convective variety) - // Using/Aliasing - using DataPlant::TypeOf_CoolingPanel_Simple; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CoolingPanelNum; // Index of unit in baseboard array Real64 QZnReq; // Zone load not yet satisfied @@ -187,7 +184,7 @@ void SimCoolingPanel(EnergyPlusData &state, { auto const SELECT_CASE_var(ThisCP.EquipType); - if (SELECT_CASE_var == TypeOf_CoolingPanel_Simple) { // 'ZoneHVAC:CoolingPanel:RadiantConvective:Water' + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoolingPanel_Simple) { // 'ZoneHVAC:CoolingPanel:RadiantConvective:Water' ThisCP.CalcCoolingPanel(state, CoolingPanelNum); } else { ShowSevereError(state, @@ -227,7 +224,6 @@ void GetCoolingPanelInput(EnergyPlusData &state) // Using/Aliasing using BranchNodeConnections::TestCompSet; using DataLoopNode::ObjectIsNotParent; - using DataPlant::TypeOf_CoolingPanel_Simple; using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetScheduleIndex; @@ -305,8 +301,8 @@ void GetCoolingPanelInput(EnergyPlusData &state) } auto &ThisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum)); - ThisCP.EquipID = state.dataIPShortCut->cAlphaArgs(1); // Name of this simple cooling panel - ThisCP.EquipType = TypeOf_CoolingPanel_Simple; //'ZoneHVAC:CoolingPanel:RadiantConvective:Water' + ThisCP.EquipID = state.dataIPShortCut->cAlphaArgs(1); // Name of this simple cooling panel + ThisCP.EquipType = DataPlant::PlantEquipmentType::CoolingPanel_Simple; //'ZoneHVAC:CoolingPanel:RadiantConvective:Water' // Get schedule ThisCP.Schedule = state.dataIPShortCut->cAlphaArgs(2); diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.hh b/src/EnergyPlus/ChilledCeilingPanelSimple.hh index b15b3729889..550d1505650 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.hh +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.hh @@ -55,6 +55,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -88,7 +89,7 @@ namespace CoolingPanelSimple { { // Members std::string EquipID; - int EquipType; + DataPlant::PlantEquipmentType EquipType; std::string Schedule; Array1D_string SurfaceName; Array1D_int SurfacePtr; @@ -144,14 +145,14 @@ namespace CoolingPanelSimple { // Default Constructor CoolingPanelParams() - : EquipType(0), ZonePtr(0), SchedPtr(0), WaterInletNode(0), WaterOutletNode(0), TotSurfToDistrib(0), ControlCompTypeNum(0), - CompErrIndex(0), ControlType(Control::Unassigned), ColdSetptSchedPtr(0), CondCtrlType(CondCtrl::NONE), CondDewPtDeltaT(0.0), - CondErrIndex(0), ColdThrottlRange(0.0), RatedWaterTemp(0.0), CoolingCapMethod(0), ScaledCoolingCapacity(0.0), UA(0.0), Offset(0.0), - WaterMassFlowRate(0.0), WaterMassFlowRateMax(0.0), RatedWaterFlowRate(0.0), WaterVolFlowRateMax(0.0), WaterInletTempStd(0.0), - WaterInletTemp(0.0), WaterInletEnthalpy(0.0), WaterOutletTempStd(0.0), WaterOutletTemp(0.0), WaterOutletEnthalpy(0.0), - RatedZoneAirTemp(0.0), FracRadiant(0.0), FracConvect(0.0), FracDistribPerson(0.0), TotPower(0.0), Power(0.0), ConvPower(0.0), - RadPower(0.0), TotEnergy(0.0), Energy(0.0), ConvEnergy(0.0), RadEnergy(0.0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), - CoolingPanelLoadReSimIndex(0), CoolingPanelMassFlowReSimIndex(0), CoolingPanelInletTempFlowReSimIndex(0) + : EquipType(DataPlant::PlantEquipmentType::Invalid), ZonePtr(0), SchedPtr(0), WaterInletNode(0), WaterOutletNode(0), TotSurfToDistrib(0), + ControlCompTypeNum(0), CompErrIndex(0), ControlType(Control::Unassigned), ColdSetptSchedPtr(0), CondCtrlType(CondCtrl::NONE), + CondDewPtDeltaT(0.0), CondErrIndex(0), ColdThrottlRange(0.0), RatedWaterTemp(0.0), CoolingCapMethod(0), ScaledCoolingCapacity(0.0), + UA(0.0), Offset(0.0), WaterMassFlowRate(0.0), WaterMassFlowRateMax(0.0), RatedWaterFlowRate(0.0), WaterVolFlowRateMax(0.0), + WaterInletTempStd(0.0), WaterInletTemp(0.0), WaterInletEnthalpy(0.0), WaterOutletTempStd(0.0), WaterOutletTemp(0.0), + WaterOutletEnthalpy(0.0), RatedZoneAirTemp(0.0), FracRadiant(0.0), FracConvect(0.0), FracDistribPerson(0.0), TotPower(0.0), Power(0.0), + ConvPower(0.0), RadPower(0.0), TotEnergy(0.0), Energy(0.0), ConvEnergy(0.0), RadEnergy(0.0), LoopNum(0), LoopSideNum(0), BranchNum(0), + CompNum(0), CoolingPanelLoadReSimIndex(0), CoolingPanelMassFlowReSimIndex(0), CoolingPanelInletTempFlowReSimIndex(0) { } diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index ee2804be1cb..b85281a5fe2 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -151,7 +151,7 @@ void BLASTAbsorberSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, calledFromLocation.loopNum, calledFromLocation.loopSideNum, - DataPlant::TypeOf_Chiller_Absorption, + DataPlant::PlantEquipmentType::Chiller_Absorption, this->CondInletNodeNum, this->CondOutletNodeNum, this->Report.QCond, @@ -165,7 +165,7 @@ void BLASTAbsorberSpecs::simulate( PlantUtilities::UpdateAbsorberChillerComponentGeneratorSide(state, calledFromLocation.loopNum, calledFromLocation.loopSideNum, - DataPlant::TypeOf_Chiller_Absorption, + DataPlant::PlantEquipmentType::Chiller_Absorption, this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum, this->GenHeatSourceType, @@ -695,7 +695,7 @@ void BLASTAbsorberSpecs::oneTimeInit(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_Absorption, + DataPlant::PlantEquipmentType::Chiller_Absorption, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -709,7 +709,7 @@ void BLASTAbsorberSpecs::oneTimeInit(EnergyPlusData &state) if (this->CondInletNodeNum > 0) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_Absorption, + DataPlant::PlantEquipmentType::Chiller_Absorption, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -720,13 +720,18 @@ void BLASTAbsorberSpecs::oneTimeInit(EnergyPlusData &state) _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_Absorption, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_Absorption, + true); } if (this->GeneratorInletNodeNum > 0) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_Absorption, + DataPlant::PlantEquipmentType::Chiller_Absorption, this->GenLoopNum, this->GenLoopSideNum, this->GenBranchNum, @@ -738,13 +743,18 @@ void BLASTAbsorberSpecs::oneTimeInit(EnergyPlusData &state) this->GeneratorInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Absorption, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::PlantEquipmentType::Chiller_Absorption, true); } // Fill in connection data if ((this->CondInletNodeNum > 0) && (this->GeneratorInletNodeNum > 0)) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Absorption, false); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CDLoopNum, + this->CDLoopSideNum, + this->GenLoopNum, + this->GenCompNum, + DataPlant::PlantEquipmentType::Chiller_Absorption, + false); } if (errFlag) { ShowFatalError(state, "InitBLASTAbsorberModel: Program terminated due to previous condition(s)."); @@ -1535,7 +1545,7 @@ void BLASTAbsorberSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, bool R // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); // limit by max capacity @@ -1556,10 +1566,10 @@ void BLASTAbsorberSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, bool R // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -1582,9 +1592,9 @@ void BLASTAbsorberSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, bool R this->CWCompNum); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -1632,25 +1642,25 @@ void BLASTAbsorberSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, bool R { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { TempEvapOutSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -1780,7 +1790,7 @@ void BLASTAbsorberSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, bool R state.dataLoopNodes->Node(this->GeneratorInletNodeNum).Temp, state.dataPlnt->PlantLoop(GenLoopSideNum).FluidIndex, RoutineName); - if (state.dataPlnt->PlantLoop(this->GenLoopNum).LoopSide(this->GenLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->GenLoopNum).LoopSide(this->GenLoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { GenMassFlowRate = this->GenMassFlowRateMax; } else { // LeavingSetpointModulated diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index b666c40c4d6..7c2e1bd0120 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -154,7 +154,7 @@ void ElectricEIRChillerSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, calledFromLocation.loopNum, this->CDLoopSideNum, - DataPlant::TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, this->CondInletNodeNum, this->CondOutletNodeNum, this->QCondenser, @@ -167,7 +167,7 @@ void ElectricEIRChillerSpecs::simulate( PlantUtilities::UpdateComponentHeatRecoverySide(state, this->HRLoopNum, this->HRLoopSideNum, - DataPlant::TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, this->QHeatRecovered, @@ -1118,7 +1118,7 @@ void ElectricEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -1132,7 +1132,7 @@ void ElectricEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -1143,13 +1143,18 @@ void ElectricEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, + true); } if (this->HeatRecActive) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, @@ -1160,14 +1165,24 @@ void ElectricEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) _, this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->HRLoopNum, + this->HRLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, + true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, false); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CDLoopNum, + this->CDLoopSideNum, + this->HRLoopNum, + this->HRLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, + false); } if (errFlag) { @@ -1304,9 +1319,9 @@ void ElectricEIRChillerSpecs::initEachEnvironment(EnergyPlusData &state) Real64 THeatRecSetPoint(0.0); // tests set point node for proper set point value { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); @@ -1666,7 +1681,7 @@ void ElectricEIRChillerSpecs::size(EnergyPlusData &state) // Auto size condenser air flow to Total Capacity * 0.000114 m3/s/w (850 cfm/ton) if (state.dataPlnt->PlantFinalSizesOkayToReport) { - std::string CompType = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_Chiller_ElectricEIR); + std::string_view CompType = DataPlant::PlantEquipTypeNames[static_cast(DataPlant::PlantEquipmentType::Chiller_ElectricEIR)]; state.dataSize->DataConstantUsedForSizing = this->RefCap; state.dataSize->DataFractionUsedForSizing = 0.000114; Real64 TempSize = this->CondVolFlowRate; @@ -1745,7 +1760,7 @@ void ElectricEIRChillerSpecs::size(EnergyPlusData &state) Real64 IPLV = 0.0; StandardRatings::CalcChillerIPLV(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, this->RefCap, this->RefCOP, this->CondenserType, @@ -1839,7 +1854,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { this->EvapMassFlowRate = state.dataLoopNodes->Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { @@ -1945,7 +1960,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { @@ -1966,26 +1981,26 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; @@ -2028,7 +2043,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b if (this->ChillerCapFT < 0) { if (this->ChillerCapFTError < 1 && - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); @@ -2038,7 +2053,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b EvapOutletTempSetPoint, condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowRecurringWarningErrorAtEnd(state, @@ -2056,7 +2071,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b // Only perform this check for temperature setpoint control if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).CurOpSchemeType == - DataPlant::CompSetPtBasedSchemeType) { + DataPlant::OpScheme::CompSetPtBased) { // Calculate water side load Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, @@ -2067,10 +2082,10 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b this->EvapMassFlowRate = state.dataLoopNodes->Node(this->EvapInletNodeNum).MassFlowRate; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempLoad = this->EvapMassFlowRate * Cp * (state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint); - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempLoad = this->EvapMassFlowRate * Cp * (state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi); @@ -2099,7 +2114,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b RoutineName); if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).CurOpSchemeType == - DataPlant::CompSetPtBasedSchemeType) { + DataPlant::OpScheme::CompSetPtBased) { this->PossibleSubcooling = false; } else { this->PossibleSubcooling = true; @@ -2134,10 +2149,10 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -2163,9 +2178,9 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b // Should we recalculate this with the corrected setpoint? { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -2328,7 +2343,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b this->ChillerEIRFT = CurveManager::CurveValue(state, this->ChillerEIRFTIndex, this->EvapOutletTemp, AvgCondSinkTemp); if (this->ChillerEIRFT < 0.0) { if (this->ChillerEIRFTError < 1 && - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); @@ -2338,7 +2353,7 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b this->EvapOutletTemp, condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowRecurringWarningErrorAtEnd(state, @@ -2354,14 +2369,14 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b this->ChillerEIRFPLR = CurveManager::CurveValue(state, this->ChillerEIRFPLRIndex, PartLoadRat); if (this->ChillerEIRFPLR < 0.0) { if (this->ChillerEIRFPLRError < 1 && - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); ShowContinueError(state, format(" Chiller EIR as a function of PLR curve output is negative ({:.3R}).", this->ChillerEIRFPLR)); ShowContinueError(state, format(" Negative value occurs using a part-load ratio of {:.3R}.", PartLoadRat)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowRecurringWarningErrorAtEnd(state, @@ -2480,9 +2495,9 @@ void ElectricEIRChillerSpecs::calcHeatRecovery(EnergyPlusData &state, { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index dee85325749..cc39ef356d5 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -177,7 +177,7 @@ void ExhaustAbsorberSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption, this->CondReturnNodeNum, this->CondSupplyNodeNum, this->TowerLoad, @@ -830,7 +830,7 @@ void ExhaustAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -847,7 +847,7 @@ void ExhaustAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption, this->HWLoopNum, this->HWLoopSideNum, this->HWBranchNum, @@ -865,7 +865,7 @@ void ExhaustAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) if (this->isWaterCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -879,14 +879,29 @@ void ExhaustAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) if (errFlag) { ShowFatalError(state, "InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->HWLoopNum, this->HWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption, + true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->HWLoopNum, + this->HWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption, + true); } - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->HWLoopNum, + this->HWLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption, + true); // check if outlet node of chilled water side has a setpoint. if ((state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && @@ -1600,9 +1615,9 @@ void ExhaustAbsorberSpecs::calcChiller(EnergyPlusData &state, Real64 &MyLoad) lCondReturnTemp = state.dataLoopNodes->Node(lCondReturnNodeNum).Temp; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { ChillSupplySetPointTemp = state.dataLoopNodes->Node(lChillSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { ChillSupplySetPointTemp = state.dataLoopNodes->Node(lChillSupplyNodeNum).TempSetPointHi; } else { assert(false); @@ -1707,7 +1722,7 @@ void ExhaustAbsorberSpecs::calcChiller(EnergyPlusData &state, Real64 &MyLoad) LoopSideNum = this->CWLoopSideNum; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); - if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components + if (SELECT_CASE_var == DataPlant::FlowLock::Unlocked) { // mass flow rates may be changed by loop components this->PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); if (ChillDeltaTemp != 0.0) { @@ -1731,7 +1746,7 @@ void ExhaustAbsorberSpecs::calcChiller(EnergyPlusData &state, Real64 &MyLoad) this->DeltaTempCoolErrCount); } lChillSupplyTemp = ChillSupplySetPointTemp; - } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::FlowLock::Locked) { // mass flow rates may not be changed by loop components lChillWaterMassFlowRate = state.dataLoopNodes->Node(lChillReturnNodeNum).MassFlowRate; if (this->PossibleSubcooling) { lCoolingLoad = std::abs(MyLoad); @@ -2022,9 +2037,9 @@ void ExhaustAbsorberSpecs::calcHeater(EnergyPlusData &state, Real64 &MyLoad, boo lHotWaterMassFlowRate = state.dataLoopNodes->Node(lHeatReturnNodeNum).MassFlowRate; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { HeatSupplySetPointTemp = state.dataLoopNodes->Node(lHeatSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { HeatSupplySetPointTemp = state.dataLoopNodes->Node(lHeatSupplyNodeNum).TempSetPointLo; } else { assert(false); @@ -2055,7 +2070,7 @@ void ExhaustAbsorberSpecs::calcHeater(EnergyPlusData &state, Real64 &MyLoad, boo // supply temperature { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); - if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components + if (SELECT_CASE_var == DataPlant::FlowLock::Unlocked) { // mass flow rates may be changed by loop components lHeatingLoad = std::abs(MyLoad); if (HeatDeltaTemp != 0) { lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp)); @@ -2077,7 +2092,7 @@ void ExhaustAbsorberSpecs::calcHeater(EnergyPlusData &state, Real64 &MyLoad, boo this->DeltaTempHeatErrCount); } lHotWaterSupplyTemp = HeatSupplySetPointTemp; - } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::FlowLock::Locked) { // mass flow rates may not be changed by loop components lHotWaterSupplyTemp = HeatSupplySetPointTemp; lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp); } diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index fbfd2904e6c..5b07f058f0e 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -177,7 +177,7 @@ void GasAbsorberSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::TypeOf_Chiller_DFAbsorption, + DataPlant::PlantEquipmentType::Chiller_DFAbsorption, this->CondReturnNodeNum, this->CondSupplyNodeNum, this->TowerLoad, @@ -842,7 +842,7 @@ void GasAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_DFAbsorption, + DataPlant::PlantEquipmentType::Chiller_DFAbsorption, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -859,7 +859,7 @@ void GasAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_DFAbsorption, + DataPlant::PlantEquipmentType::Chiller_DFAbsorption, this->HWLoopNum, this->HWLoopSideNum, this->HWBranchNum, @@ -877,7 +877,7 @@ void GasAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) if (this->isWaterCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_DFAbsorption, + DataPlant::PlantEquipmentType::Chiller_DFAbsorption, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -891,14 +891,24 @@ void GasAbsorberSpecs::oneTimeInit_new(EnergyPlusData &state) if (errFlag) { ShowFatalError(state, "InitGasAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_DFAbsorption, true); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->HWLoopNum, this->HWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_DFAbsorption, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_DFAbsorption, + true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->HWLoopNum, + this->HWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_DFAbsorption, + true); } PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_DFAbsorption, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::PlantEquipmentType::Chiller_DFAbsorption, true); // check if outlet node of chilled water side has a setpoint. if ((state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && @@ -1576,9 +1586,9 @@ void GasAbsorberSpecs::calculateChiller(EnergyPlusData &state, Real64 &MyLoad) // Commenting this could be cause of diffs - lCondWaterMassFlowRate = Node(lCondReturnNodeNum).MassFlowRate; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { ChillSupplySetPointTemp = state.dataLoopNodes->Node(lChillSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { ChillSupplySetPointTemp = state.dataLoopNodes->Node(lChillSupplyNodeNum).TempSetPointHi; } else { assert(false); @@ -1681,7 +1691,7 @@ void GasAbsorberSpecs::calculateChiller(EnergyPlusData &state, Real64 &MyLoad) LoopSideNum = this->CWLoopSideNum; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); - if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components + if (SELECT_CASE_var == DataPlant::FlowLock::Unlocked) { // mass flow rates may be changed by loop components this->PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); if (ChillDeltaTemp != 0.0) { @@ -1705,7 +1715,7 @@ void GasAbsorberSpecs::calculateChiller(EnergyPlusData &state, Real64 &MyLoad) this->DeltaTempCoolErrCount); } lChillSupplyTemp = ChillSupplySetPointTemp; - } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::FlowLock::Locked) { // mass flow rates may not be changed by loop components lChillWaterMassFlowRate = state.dataLoopNodes->Node(lChillReturnNodeNum).MassFlowRate; if (this->PossibleSubcooling) { lCoolingLoad = std::abs(MyLoad); @@ -1937,9 +1947,9 @@ void GasAbsorberSpecs::calculateHeater(EnergyPlusData &state, Real64 &MyLoad, bo lHotWaterMassFlowRate = state.dataLoopNodes->Node(lHeatReturnNodeNum).MassFlowRate; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { HeatSupplySetPointTemp = state.dataLoopNodes->Node(lHeatSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { HeatSupplySetPointTemp = state.dataLoopNodes->Node(lHeatSupplyNodeNum).TempSetPointLo; } else { assert(false); @@ -1971,7 +1981,7 @@ void GasAbsorberSpecs::calculateHeater(EnergyPlusData &state, Real64 &MyLoad, bo // supply temperature { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); - if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components + if (SELECT_CASE_var == DataPlant::FlowLock::Unlocked) { // mass flow rates may be changed by loop components lHeatingLoad = std::abs(MyLoad); if (HeatDeltaTemp != 0) { lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp)); @@ -1992,7 +2002,7 @@ void GasAbsorberSpecs::calculateHeater(EnergyPlusData &state, Real64 &MyLoad, bo this->DeltaTempHeatErrCount); } lHotWaterSupplyTemp = HeatSupplySetPointTemp; - } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::FlowLock::Locked) { // mass flow rates may not be changed by loop components lHotWaterSupplyTemp = HeatSupplySetPointTemp; lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp); } diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 257324c72ca..e0ae87c4c09 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -141,7 +141,7 @@ void IndirectAbsorberSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, calledFromLocation.loopNum, calledFromLocation.loopSideNum, - DataPlant::TypeOf_Chiller_Indirect_Absorption, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, this->CondInletNodeNum, this->CondOutletNodeNum, this->Report.QCond, @@ -155,7 +155,7 @@ void IndirectAbsorberSpecs::simulate( PlantUtilities::UpdateAbsorberChillerComponentGeneratorSide(state, calledFromLocation.loopNum, calledFromLocation.loopSideNum, - DataPlant::TypeOf_Chiller_Indirect_Absorption, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum, this->GenHeatSourceType, @@ -803,7 +803,7 @@ void IndirectAbsorberSpecs::oneTimeInit(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_Indirect_Absorption, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -817,7 +817,7 @@ void IndirectAbsorberSpecs::oneTimeInit(EnergyPlusData &state) PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_Indirect_Absorption, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -828,13 +828,18 @@ void IndirectAbsorberSpecs::oneTimeInit(EnergyPlusData &state) _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_Indirect_Absorption, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, + true); if (this->GeneratorInletNodeNum > 0) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_Indirect_Absorption, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, this->GenLoopNum, this->GenLoopSideNum, this->GenBranchNum, @@ -845,13 +850,23 @@ void IndirectAbsorberSpecs::oneTimeInit(EnergyPlusData &state) _, this->GeneratorInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Indirect_Absorption, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->GenLoopNum, + this->GenCompNum, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, + true); } if ((this->CondInletNodeNum > 0) && (this->GeneratorInletNodeNum > 0)) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Indirect_Absorption, false); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CDLoopNum, + this->CDLoopSideNum, + this->GenLoopNum, + this->GenCompNum, + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption, + false); } if (errFlag) { ShowFatalError(state, "InitIndirectAbsorpChiller: Program terminated due to previous condition(s)."); @@ -1786,7 +1801,7 @@ void IndirectAbsorberSpecs::calculate(EnergyPlusData &state, Real64 const MyLoad // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); @@ -1805,10 +1820,10 @@ void IndirectAbsorberSpecs::calculate(EnergyPlusData &state, Real64 const MyLoad // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -1831,9 +1846,9 @@ void IndirectAbsorberSpecs::calculate(EnergyPlusData &state, Real64 const MyLoad this->CWCompNum); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -1878,25 +1893,25 @@ void IndirectAbsorberSpecs::calculate(EnergyPlusData &state, Real64 const MyLoad } else { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { TempEvapOutSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 1956ffbf4c3..5011ea061cd 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -191,7 +191,7 @@ void ReformulatedEIRChillerSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, calledFromLocation.loopNum, LoopSide, - DataPlant::TypeOf_Chiller_ElectricReformEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, this->CondInletNodeNum, this->CondOutletNodeNum, this->QCondenser, @@ -203,7 +203,7 @@ void ReformulatedEIRChillerSpecs::simulate( PlantUtilities::UpdateComponentHeatRecoverySide(state, this->HRLoopNum, this->HRLoopSideNum, - DataPlant::TypeOf_Chiller_ElectricReformEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, this->QHeatRecovery, @@ -897,7 +897,7 @@ void ReformulatedEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -911,7 +911,7 @@ void ReformulatedEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) if (this->CondenserType != DataPlant::CondenserType::AirCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -922,13 +922,18 @@ void ReformulatedEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, + true); } if (this->HeatRecActive) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, @@ -939,13 +944,23 @@ void ReformulatedEIRChillerSpecs::oneTimeInit(EnergyPlusData &state) _, this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->HRLoopNum, + this->HRLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, + true); } if ((this->CondenserType != DataPlant::CondenserType::AirCooled) && (this->HeatRecActive)) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, false); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CDLoopNum, + this->CDLoopSideNum, + this->HRLoopNum, + this->HRLoopSideNum, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, + false); } if (errFlag) { @@ -1484,7 +1499,7 @@ void ReformulatedEIRChillerSpecs::size(EnergyPlusData &state) Real64 IPLV = 0.0; StandardRatings::CalcChillerIPLV(state, this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR, this->RefCap, this->RefCOP, this->CondenserType, @@ -1872,9 +1887,9 @@ void ReformulatedEIRChillerSpecs::calcHeatRecovery(EnergyPlusData &state, { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); @@ -2056,7 +2071,7 @@ void ReformulatedEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoa // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { this->EvapMassFlowRate = state.dataLoopNodes->Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { @@ -2114,7 +2129,7 @@ void ReformulatedEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoa this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; @@ -2123,20 +2138,20 @@ void ReformulatedEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoa Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == - DataPlant::CompSetPtBasedSchemeType) || + DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == - DataPlant::CompSetPtBasedSchemeType) || + DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; @@ -2222,9 +2237,9 @@ void ReformulatedEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoa this->ChillerPartLoadRatio = PartLoadRat; // If FlowLock is False (0), the chiller sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used - if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { this->PossibleSubcooling = !(state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == - DataPlant::CompSetPtBasedSchemeType); + DataPlant::OpScheme::CompSetPtBased); Real64 EvapDeltaTemp(0.0); // Evaporator temperature difference [C] @@ -2251,11 +2266,11 @@ void ReformulatedEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoa } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -2280,9 +2295,9 @@ void ReformulatedEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoa // Should we recalculate this with the corrected setpoint? { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -2526,7 +2541,7 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta int CompNum = this->CWCompNum; if (FirstIteration || state.dataGlobal->WarmupFlag || - state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) + state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] @@ -2749,20 +2764,20 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == - DataPlant::CompSetPtBasedSchemeType) || + DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == - DataPlant::CompSetPtBasedSchemeType) || + DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; @@ -2777,7 +2792,7 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta this->ChillerCapFT = CurveManager::CurveValue(state, this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->CondOutletTemp); if (this->ChillerCapFT < 0) { - if (this->ChillerCapFTError < 1 && state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + if (this->ChillerCapFTError < 1 && state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); @@ -2787,7 +2802,7 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta EvapOutletTempSetPoint, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowRecurringWarningErrorAtEnd(state, @@ -2802,7 +2817,7 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta this->ChillerEIRFT = CurveManager::CurveValue(state, this->ChillerEIRFTIndex, this->EvapOutletTemp, this->CondOutletTemp); if (this->ChillerEIRFT < 0.0) { - if (this->ChillerEIRFTError < 1 && state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + if (this->ChillerEIRFTError < 1 && state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); @@ -2813,7 +2828,7 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta this->EvapOutletTemp, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowRecurringWarningErrorAtEnd(state, @@ -2851,7 +2866,7 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta if (this->ChillerEIRFPLR < 0.0) { if (this->ChillerEIRFPLRError < 1 && - state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); @@ -2863,7 +2878,7 @@ void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(EnergyPlusData &sta this->ChillerPartLoadRatio, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::FlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowRecurringWarningErrorAtEnd(state, diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index b9b026e5de9..817534d24cc 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -136,14 +136,21 @@ namespace CondenserLoopTowers { bool const RunFlag) { this->initialize(state); - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { + switch (this->TowerType) { + case DataPlant::PlantEquipmentType::CoolingTower_SingleSpd: this->calculateSingleSpeedTower(state); - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + break; + case DataPlant::PlantEquipmentType::CoolingTower_TwoSpd: this->calculateTwoSpeedTower(state); - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpdMerkel) { - this->calculateMerkelVariableSpeedTower(state, CurLoad); - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpd) { + break; + case DataPlant::PlantEquipmentType::CoolingTower_VarSpd: this->calculateVariableSpeedTower(state); + break; + case DataPlant::PlantEquipmentType::CoolingTower_VarSpdMerkel: + this->calculateMerkelVariableSpeedTower(state, CurLoad); + break; + default: + ShowFatalError(state, format("Plant Equipment Type specified for {} is not a Cooling Tower.", this->Name)); } this->calculateWaterUsage(state); this->update(state); @@ -169,7 +176,7 @@ namespace CondenserLoopTowers { void CoolingTower::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation) { this->initialize(state); - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpdMerkel) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_VarSpdMerkel) { this->SizeVSMerkelTower(state); } else { this->SizeTower(state); @@ -277,8 +284,7 @@ namespace CondenserLoopTowers { ErrorsFound); state.dataCondenserLoopTowers->towers(TowerNum).Name = AlphArray(1); state.dataCondenserLoopTowers->towers(TowerNum).thisTowerNum = TowerNum; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType = cCurrentModuleObject; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType_Num = DataPlant::TypeOf_CoolingTower_SingleSpd; + state.dataCondenserLoopTowers->towers(TowerNum).TowerType = DataPlant::PlantEquipmentType::CoolingTower_SingleSpd; state.dataCondenserLoopTowers->towers(TowerNum).TowerMassFlowRateMultiplier = 2.5; state.dataCondenserLoopTowers->towers(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode(state, @@ -545,9 +551,11 @@ namespace CondenserLoopTowers { } } else { ShowSevereError(state, "Illegal " + state.dataIPShortCut->cAlphaFieldNames(12) + " = " + AlphArray(12)); - ShowContinueError(state, - "Occurs in " + state.dataCondenserLoopTowers->towers(TowerNum).TowerType + '=' + - state.dataCondenserLoopTowers->towers(TowerNum).Name); + ShowContinueError( + state, + format("Occurs in {}={}", + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + state.dataCondenserLoopTowers->towers(TowerNum).Name)); ErrorsFound = true; } } @@ -685,8 +693,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(TowerNum).Name = AlphArray(1); state.dataCondenserLoopTowers->towers(TowerNum).thisTowerNum = TowerNum; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType = cCurrentModuleObject; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType_Num = DataPlant::TypeOf_CoolingTower_TwoSpd; + state.dataCondenserLoopTowers->towers(TowerNum).TowerType = DataPlant::PlantEquipmentType::CoolingTower_TwoSpd; state.dataCondenserLoopTowers->towers(TowerNum).TowerMassFlowRateMultiplier = 2.5; state.dataCondenserLoopTowers->towers(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode(state, @@ -915,9 +922,11 @@ namespace CondenserLoopTowers { } } else { ShowSevereError(state, "Illegal " + state.dataIPShortCut->cAlphaFieldNames(12) + " = " + AlphArray(12)); - ShowContinueError(state, - "Occurs in " + state.dataCondenserLoopTowers->towers(TowerNum).TowerType + '=' + - state.dataCondenserLoopTowers->towers(TowerNum).Name); + ShowContinueError( + state, + format("Occurs in {}={}", + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + state.dataCondenserLoopTowers->towers(TowerNum).Name)); ErrorsFound = true; } } @@ -1138,8 +1147,7 @@ namespace CondenserLoopTowers { state.dataCondenserLoopTowers->towers(TowerNum).VSTower = VariableSpeedTowerNumber; state.dataCondenserLoopTowers->towers(TowerNum).Name = AlphArray(1); state.dataCondenserLoopTowers->towers(TowerNum).thisTowerNum = TowerNum; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType = cCurrentModuleObject; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType_Num = DataPlant::TypeOf_CoolingTower_VarSpd; + state.dataCondenserLoopTowers->towers(TowerNum).TowerType = DataPlant::PlantEquipmentType::CoolingTower_VarSpd; state.dataCondenserLoopTowers->towers(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode(state, AlphArray(2), @@ -1650,9 +1658,11 @@ namespace CondenserLoopTowers { } } else { ShowSevereError(state, "Illegal " + state.dataIPShortCut->cAlphaFieldNames(13) + " = " + AlphArray(13)); - ShowContinueError(state, - "Occurs in " + state.dataCondenserLoopTowers->towers(TowerNum).TowerType + '=' + - state.dataCondenserLoopTowers->towers(TowerNum).Name); + ShowContinueError( + state, + format("Occurs in {}={}", + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + state.dataCondenserLoopTowers->towers(TowerNum).Name)); ErrorsFound = true; } } @@ -1727,8 +1737,7 @@ namespace CondenserLoopTowers { ErrorsFound); state.dataCondenserLoopTowers->towers(TowerNum).Name = AlphArray(1); state.dataCondenserLoopTowers->towers(TowerNum).thisTowerNum = TowerNum; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType = cCurrentModuleObject; - state.dataCondenserLoopTowers->towers(TowerNum).TowerType_Num = DataPlant::TypeOf_CoolingTower_VarSpdMerkel; + state.dataCondenserLoopTowers->towers(TowerNum).TowerType = DataPlant::PlantEquipmentType::CoolingTower_VarSpdMerkel; state.dataCondenserLoopTowers->towers(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode(state, AlphArray(2), @@ -1971,9 +1980,11 @@ namespace CondenserLoopTowers { } } else { ShowSevereError(state, "Illegal " + state.dataIPShortCut->cAlphaFieldNames(15) + " = " + AlphArray(15)); - ShowContinueError(state, - "Occurs in " + state.dataCondenserLoopTowers->towers(TowerNum).TowerType + '=' + - state.dataCondenserLoopTowers->towers(TowerNum).Name); + ShowContinueError( + state, + format("Occurs in {}={}", + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + state.dataCondenserLoopTowers->towers(TowerNum).Name)); ErrorsFound = true; } } @@ -2035,7 +2046,7 @@ namespace CondenserLoopTowers { // Locate the tower on the plant loops for later usage bool ErrorsFound = false; PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->TowerType_Num, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); + state, this->Name, this->TowerType, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); if (ErrorsFound) { ShowFatalError(state, "initialize: Program terminated due to previous condition(s)."); } @@ -2137,7 +2148,7 @@ namespace CondenserLoopTowers { void CoolingTower::setupOutputVariables(EnergyPlusData &state) { // Set up output variables CurrentModuleObject='CoolingTower:SingleSpeed' - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd) { SetupOutputVariable(state, "Cooling Tower Inlet Temperature", OutputProcessor::Unit::C, @@ -2231,7 +2242,7 @@ namespace CondenserLoopTowers { } // CurrentModuleObject='CoolingTower:TwoSpeed' - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { SetupOutputVariable(state, "Cooling Tower Inlet Temperature", OutputProcessor::Unit::C, @@ -2324,7 +2335,7 @@ namespace CondenserLoopTowers { } // CurrentModuleObject='CoolingTower:VariableSpeed' - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_VarSpd) { SetupOutputVariable(state, "Cooling Tower Inlet Temperature", OutputProcessor::Unit::C, @@ -2417,7 +2428,7 @@ namespace CondenserLoopTowers { } // CurrentModuleObject='CoolingTower:VariableSpeed:Merkel' - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpdMerkel) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_VarSpdMerkel) { SetupOutputVariable(state, "Cooling Tower Inlet Temperature", OutputProcessor::Unit::C, @@ -2693,7 +2704,8 @@ namespace CondenserLoopTowers { // Find the appropriate Plant Sizing object int PltSizCondNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd || this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd || + this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { if (this->TowerInletCondsAutoSize) { if (PltSizCondNum > 0) { // use plant sizing data @@ -2803,11 +2815,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; } if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } } else { if (state.dataPlnt->PlantFinalSizesOkayToReport) { @@ -2821,32 +2840,32 @@ 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(this->TowerType, "CoolingTower:SingleSpeed")) { + if (UtilityRoutines::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:SingleSpeed")) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Water Flow Rate based on tower nominal capacity [m3/s]", this->DesignWaterFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial Design Water Flow Rate based on tower nominal capacity [m3/s]", this->DesignWaterFlowRate); } - } else if (UtilityRoutines::SameString(this->TowerType, "CoolingTower:TwoSpeed")) { + } else if (UtilityRoutines::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:TwoSpeed")) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Water Flow Rate based on tower high-speed nominal capacity [m3/s]", this->DesignWaterFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial Design Water Flow Rate based on tower high-speed nominal capacity [m3/s]", this->DesignWaterFlowRate); @@ -2888,22 +2907,36 @@ namespace CondenserLoopTowers { } } } - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd || this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd || + this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_VarSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Fan Power at Design Air Flow Rate [W]", + this->HighSpeedFanPower); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Fan Power at Design Air Flow Rate [W]", + this->HighSpeedFanPower); } - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + } else if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Fan Power at High Fan Speed [W]", + this->HighSpeedFanPower); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Fan Power at High Fan Speed [W]", + this->HighSpeedFanPower); } } } @@ -2913,22 +2946,36 @@ namespace CondenserLoopTowers { tmpHighSpeedAirFlowRate = tmpHighSpeedFanPower * 0.5 * (101325.0 / state.dataEnvrn->StdBaroPress) / 190.0; if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd || this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd || + this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_VarSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + } else if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Air Flow Rate at High Fan Speed [m3/s]", + this->HighSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Air Flow Rate at High Fan Speed [m3/s]", + this->HighSpeedAirFlowRate); } } } @@ -3001,26 +3048,35 @@ namespace CondenserLoopTowers { this->HighSpeedTowerUA = 0.0; } } - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at Design Air Flow Rate [W/C]", + this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + } else if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at High Fan Speed [W/C]", + this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial U-Factor Times Area Value at High Fan Speed [W/C]", + this->HighSpeedTowerUA); } } } else { @@ -3108,26 +3164,35 @@ namespace CondenserLoopTowers { this->HighSpeedTowerUA = 0.0; } } - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at Design Air Flow Rate [W/C]", + this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + } else if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at High Fan Speed [W/C]", + this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial U-Factor Times Area Value at High Fan Speed [W/C]", + this->HighSpeedTowerUA); } } } @@ -3178,26 +3243,35 @@ namespace CondenserLoopTowers { this->HighSpeedTowerUA = 0.0; } } - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at Design Air Flow Rate [W/C]", + this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + } else if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at High Fan Speed [W/C]", + this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial U-Factor Times Area Value at High Fan Speed [W/C]", + this->HighSpeedTowerUA); } } } @@ -3208,11 +3282,18 @@ namespace CondenserLoopTowers { this->LowSpeedAirFlowRate = this->LowSpeedAirFlowRateSizingFactor * this->HighSpeedAirFlowRate; tmpLowSpeedAirFlowRate = this->LowSpeedAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Low Fan Speed Air Flow Rate [m3/s]", this->LowSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Low Fan Speed Air Flow Rate [m3/s]", + this->LowSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Low Fan Speed Air Flow Rate [m3/s]", this->LowSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Low Fan Speed Air Flow Rate [m3/s]", + this->LowSpeedAirFlowRate); } } else { tmpLowSpeedAirFlowRate = this->LowSpeedAirFlowRateSizingFactor * tmpHighSpeedAirFlowRate; @@ -3223,11 +3304,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedFanPower = this->LowSpeedFanPowerSizingFactor * this->HighSpeedFanPower; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Fan Power at Low Fan Speed [W]", + this->LowSpeedFanPower); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Fan Power at Low Fan Speed [W]", + this->LowSpeedFanPower); } } } @@ -3235,12 +3323,18 @@ namespace CondenserLoopTowers { if (this->LowSpeedTowerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedTowerUA = this->LowSpeedTowerUASizingFactor * this->HighSpeedTowerUA; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at Low Fan Speed [W/K]", + this->LowSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial U-Factor Times Area Value at Low Fan Speed [W/K]", + this->LowSpeedTowerUA); } } @@ -3249,11 +3343,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerLowSpeedNomCap = this->TowerLowSpeedNomCapSizingFactor * this->TowerNominalCapacity; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Low Speed Nominal Capacity [W]", this->TowerLowSpeedNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Low Speed Nominal Capacity [W]", + this->TowerLowSpeedNomCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Low Speed Nominal Capacity [W]", this->TowerLowSpeedNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Low Speed Nominal Capacity [W]", + this->TowerLowSpeedNomCap); } } } @@ -3261,18 +3362,25 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerFreeConvNomCap = this->TowerFreeConvNomCapSizingFactor * this->TowerNominalCapacity; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } } } } - if (this->PerformanceInputMethod_Num == PIM::NominalCapacity && UtilityRoutines::SameString(this->TowerType, "CoolingTower:TwoSpeed")) { + if (this->PerformanceInputMethod_Num == PIM::NominalCapacity && + UtilityRoutines::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 @@ -3316,12 +3424,18 @@ namespace CondenserLoopTowers { this->LowSpeedTowerUA = 0.0; } if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Low Fan Speed U-Factor Times Area Value [W/K]", this->LowSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Low Fan Speed U-Factor Times Area Value [W/K]", + this->LowSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Low Fan Speed U-Factor Times Area Value [W/K]", this->LowSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Low Fan Speed U-Factor Times Area Value [W/K]", + this->LowSpeedTowerUA); } } @@ -3330,12 +3444,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvAirFlowRate = this->FreeConvAirFlowRateSizingFactor * this->HighSpeedAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Free Convection Regime Air Flow Rate [m3/s]", + this->FreeConvAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Free Convection Regime Air Flow Rate [m3/s]", + this->FreeConvAirFlowRate); } } } @@ -3344,12 +3464,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvTowerUA = this->FreeConvTowerUASizingFactor * this->HighSpeedTowerUA; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Free Convection U-Factor Times Area Value [W/K]", this->FreeConvTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Free Convection U-Factor Times Area Value [W/K]", + this->FreeConvTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Free Convection U-Factor Times Area Value [W/K]", this->FreeConvTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Free Convection U-Factor Times Area Value [W/K]", + this->FreeConvTowerUA); } } } @@ -3417,12 +3543,15 @@ namespace CondenserLoopTowers { this->FreeConvTowerUA = 0.0; } if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", + this->FreeConvTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); @@ -3431,7 +3560,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(this->TowerType, "CoolingTower:VariableSpeed")) { + if (UtilityRoutines::SameString(DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], "CoolingTower:VariableSpeed")) { Par[0] = this->thisTowerNum; // Index to cooling tower Par[1] = 1.0; // air flow rate ratio @@ -3520,33 +3649,47 @@ namespace CondenserLoopTowers { this->TowerNominalCapacity = ((rho * tmpDesignWaterFlowRate) * Cp * this->DesignRange); if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } this->FreeConvAirFlowRate = this->MinimumVSAirFlowFrac * this->HighSpeedAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Air Flow Rate in free convection regime [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Air Flow Rate in free convection regime [m3/s]", + this->FreeConvAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Air Flow Rate in free convection regime [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Air Flow Rate in free convection regime [m3/s]", + this->FreeConvAirFlowRate); } this->TowerFreeConvNomCap = this->TowerNominalCapacity * this->FreeConvectionCapacityFraction; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Tower capacity in free convection regime at design conditions [W]", this->TowerFreeConvNomCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial Tower capacity in free convection regime at design conditions [W]", this->TowerFreeConvNomCap); @@ -3554,14 +3697,15 @@ namespace CondenserLoopTowers { } if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, this->TowerType); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchMechType, this->Name, DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)]); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->TowerNominalCapacity); } // input error checking bool ErrorsFound = false; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd) { if (this->DesignWaterFlowRate > 0.0) { if (this->FreeConvAirFlowRate >= this->HighSpeedAirFlowRate) { ShowSevereError(state, @@ -3577,7 +3721,7 @@ namespace CondenserLoopTowers { } } - if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { + if (this->TowerType == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { if (this->DesignWaterFlowRate > 0.0) { if (this->HighSpeedAirFlowRate <= this->LowSpeedAirFlowRate) { ShowSevereError(state, @@ -3753,11 +3897,18 @@ namespace CondenserLoopTowers { if (this->TowerNominalCapacityWasAutoSized) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Nominal Capacity [W]", tmpNomTowerCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Nominal Capacity [W]", + tmpNomTowerCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Nominal Capacity [W]", + this->TowerNominalCapacity); } } else { // Hard-sized with sizing data if (this->TowerNominalCapacity > 0.0 && tmpNomTowerCap > 0.0) { @@ -3765,7 +3916,7 @@ namespace CondenserLoopTowers { NomCapUser = this->TowerNominalCapacity; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Nominal Capacity [W]", tmpNomTowerCap, @@ -3791,12 +3942,18 @@ namespace CondenserLoopTowers { if (this->TowerFreeConvNomCapWasAutoSized) { this->TowerFreeConvNomCap = tmpTowerFreeConvNomCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Design Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } } else { // Hard-sized with sizing data if (this->TowerFreeConvNomCap > 0.0 && tmpTowerFreeConvNomCap > 0.0) { @@ -3804,7 +3961,7 @@ namespace CondenserLoopTowers { NomCapUser = this->TowerFreeConvNomCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Free Convection Nominal Capacity [W]", tmpTowerFreeConvNomCap, @@ -3834,11 +3991,18 @@ namespace CondenserLoopTowers { this->DesignWaterFlowRate = tmpDesignWaterFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } } else { // Hard-sized with sizing data @@ -3847,7 +4011,7 @@ namespace CondenserLoopTowers { NomDesWaterFlowUser = this->DesignWaterFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate, @@ -3880,18 +4044,25 @@ namespace CondenserLoopTowers { if (this->HighSpeedAirFlowRateWasAutoSized) { this->HighSpeedAirFlowRate = tmpDesignAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } } else { // Hard-sized with sizing data Real64 DesignAirFlowRateUser(0.0); DesignAirFlowRateUser = this->HighSpeedAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Air Flow Rate [m3/s]", tmpDesignAirFlowRate, @@ -3917,12 +4088,15 @@ namespace CondenserLoopTowers { if (this->FreeConvAirFlowRateWasAutoSized) { this->FreeConvAirFlowRate = tmpFreeConvAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Design Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Free Convection Regime Air Flow Rate [m3/s]", + this->FreeConvAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial Design Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); @@ -3932,7 +4106,7 @@ namespace CondenserLoopTowers { FreeConvAirFlowUser = this->FreeConvAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Free Convection Regime Air Flow Rate [m3/s]", tmpFreeConvAirFlowRate, @@ -4004,12 +4178,15 @@ namespace CondenserLoopTowers { } this->HighSpeedTowerUA = UA; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", this->HighSpeedTowerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", + this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", this->HighSpeedTowerUA); @@ -4040,14 +4217,14 @@ namespace CondenserLoopTowers { this->FreeConvTowerUA = UA; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); @@ -4064,12 +4241,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->DesignWaterFlowRate = tmpDesignWaterFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } } } else { @@ -4082,12 +4265,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->DesignWaterFlowRate = tmpDesignWaterFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } } } else { @@ -4122,11 +4311,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } } } else { @@ -4134,11 +4330,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } } } @@ -4160,12 +4363,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } } } else { @@ -4173,12 +4382,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } } } @@ -4194,12 +4409,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerFreeConvNomCap = tmpTowerFreeConvNomCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } } } @@ -4212,12 +4433,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedAirFlowRate = tmpDesignAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } } } @@ -4226,12 +4453,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvAirFlowRate = tmpFreeConvAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Free Convection Regime Air Flow Rate [m3/s]", + this->FreeConvAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Free Convection Regime Air Flow Rate [m3/s]", + this->FreeConvAirFlowRate); } } } @@ -4272,14 +4505,14 @@ namespace CondenserLoopTowers { this->HighSpeedTowerUA = UA; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", this->HighSpeedTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", this->HighSpeedTowerUA); @@ -4309,14 +4542,14 @@ namespace CondenserLoopTowers { this->LowSpeedTowerUA = UA; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); @@ -4330,14 +4563,14 @@ namespace CondenserLoopTowers { this->FreeConvTowerUA = this->HighSpeedTowerUA * this->FreeConvTowerUASizingFactor; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); @@ -4365,12 +4598,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } } } else { @@ -4378,12 +4617,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } } } @@ -4404,12 +4649,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedAirFlowRate = tmpDesignAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } } @@ -4438,11 +4689,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Nominal Capacity [W]", + this->TowerNominalCapacity); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Nominal Capacity [W]", + this->TowerNominalCapacity); } } @@ -4453,12 +4711,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvAirFlowRate = tmpFreeConvAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Free Convection Regime Air Flow Rate [m3/s]", + this->FreeConvAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Free Convection Regime Air Flow Rate [m3/s]", + this->FreeConvAirFlowRate); } } } @@ -4470,12 +4734,18 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerFreeConvNomCap = tmpTowerFreeConvNomCap; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->TowerType, this->Name, "Initial Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Free Convection Nominal Capacity [W]", + this->TowerFreeConvNomCap); } } } @@ -4487,17 +4757,25 @@ namespace CondenserLoopTowers { this->HighSpeedFanPower = tmpHighSpeedFanPower; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Fan Power [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Design Fan Power [W]", + this->HighSpeedFanPower); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Fan Power [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + "Initial Design Fan Power [W]", + this->HighSpeedFanPower); } } else { // Hard-sized with sizing data Real64 HighSpeedFanPowerUser(0.0); HighSpeedFanPowerUser = this->HighSpeedAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->TowerType, + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name, "Design Fan Power [W]", tmpHighSpeedFanPower, @@ -4605,13 +4883,13 @@ namespace CondenserLoopTowers { Real64 TempSetPoint = 0.0; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if (this->SetpointIsOnOutlet) { TempSetPoint = state.dataLoopNodes->Node(this->WaterOutletNodeNum).TempSetPoint; } else { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if (this->SetpointIsOnOutlet) { TempSetPoint = state.dataLoopNodes->Node(this->WaterOutletNodeNum).TempSetPointHi; } else { @@ -4910,13 +5188,13 @@ namespace CondenserLoopTowers { Real64 TempSetPoint = 0.0; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if (this->SetpointIsOnOutlet) { TempSetPoint = state.dataLoopNodes->Node(this->WaterOutletNodeNum).TempSetPoint; } else { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if (this->SetpointIsOnOutlet) { TempSetPoint = state.dataLoopNodes->Node(this->WaterOutletNodeNum).TempSetPointHi; } else { @@ -4953,7 +5231,7 @@ namespace CondenserLoopTowers { } // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // TODO: WTF // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower( @@ -5172,9 +5450,9 @@ namespace CondenserLoopTowers { Real64 TempSetPoint(0.0); // Outlet water temperature setpoint (C) { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } else { assert(false); @@ -5197,7 +5475,7 @@ namespace CondenserLoopTowers { Real64 Ta = TempSetPoint - this->AirWetBulb; // Do not RETURN here if flow rate is less than MassFlowTolerance. Check basin heater and then RETURN. - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // TODO: WTF // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower( @@ -5378,8 +5656,9 @@ namespace CondenserLoopTowers { ShowContinueError(state, state.dataCondenserLoopTowers->towers(this->VSTower).LGBuffer2); } else { ShowRecurringWarningErrorAtEnd(state, - this->TowerType + " \"" + this->Name + - "\" - Liquid to gas ratio is out of range error continues...", + format("{} \"{}\" - Liquid to gas ratio is out of range error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), state.dataCondenserLoopTowers->towers(this->VSTower).ErrIndexLG, state.dataCondenserLoopTowers->towers(this->VSTower).LGLast, state.dataCondenserLoopTowers->towers(this->VSTower).LGLast); @@ -5403,7 +5682,10 @@ namespace CondenserLoopTowers { if (!state.dataGlobal->WarmupFlag) { state.dataCondenserLoopTowers->towers(this->VSTower).PrintLGMessage = true; state.dataCondenserLoopTowers->towers(this->VSTower).LGBuffer1 = - format("{} \"{}\" - Liquid to gas ratio (L/G) is out of range at {:5.2F}.", this->TowerType, this->Name, FlowFraction); + format("{} \"{}\" - Liquid to gas ratio (L/G) is out of range at {:5.2F}.", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + FlowFraction); state.dataCondenserLoopTowers->towers(this->VSTower).LGBuffer2 = format(" ...Valid maximum ratio = {:5.2F}. Occurrence info = {}, {} {}", state.dataCondenserLoopTowers->towers(this->VSTower).MaxLiquidToGasRatio, @@ -5908,9 +6190,9 @@ namespace CondenserLoopTowers { Real64 TempSetPoint(0.0); // local temporary for loop setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } else { assert(false); @@ -6088,8 +6370,9 @@ namespace CondenserLoopTowers { ShowContinueError(state, " ...This is not an unexpected occurrence when simulating actual conditions."); } else { ShowRecurringWarningErrorAtEnd(state, - this->TowerType + " \"" + this->Name + - "\" - Tower range temperature is out of range error continues...", + format("{} \"{}\" - Tower range temperature is out of range error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), state.dataCondenserLoopTowers->towers(this->VSTower).ErrIndexTR, state.dataCondenserLoopTowers->towers(this->VSTower).TrLast, state.dataCondenserLoopTowers->towers(this->VSTower).TrLast); @@ -6104,8 +6387,9 @@ namespace CondenserLoopTowers { ShowContinueError(state, " ...Wet-bulb temperatures outside model boundaries may not adversely affect tower performance."); } else { ShowRecurringWarningErrorAtEnd(state, - this->TowerType + " \"" + this->Name + - "\" - Inlet air wet-bulb temperature is out of range error continues...", + format("{} \"{}\" - Inlet air wet-bulb temperature is out of range error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), state.dataCondenserLoopTowers->towers(this->VSTower).ErrIndexIAWB, state.dataCondenserLoopTowers->towers(this->VSTower).TwbLast, state.dataCondenserLoopTowers->towers(this->VSTower).TwbLast); @@ -6121,8 +6405,9 @@ namespace CondenserLoopTowers { ShowContinueError(state, " ...This is not an unexpected occurrence when simulating actual conditions."); } else { ShowRecurringWarningErrorAtEnd(state, - this->TowerType + " \"" + this->Name + - "\" - Tower approach temperature is out of range error continues...", + format("{} \"{}\" - Tower approach temperature is out of range error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), state.dataCondenserLoopTowers->towers(this->VSTower).ErrIndexTA, state.dataCondenserLoopTowers->towers(this->VSTower).TaLast, state.dataCondenserLoopTowers->towers(this->VSTower).TaLast); @@ -6137,8 +6422,9 @@ namespace CondenserLoopTowers { ShowContinueError(state, " ...Water flow rate ratios outside model boundaries may not adversely affect tower performance."); } else { ShowRecurringWarningErrorAtEnd(state, - this->TowerType + " \"" + this->Name + - "\" - Water flow rate ratio is out of range error continues...", + format("{} \"{}\" - Water flow rate ratio is out of range error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), state.dataCondenserLoopTowers->towers(this->VSTower).ErrIndexWFRR, state.dataCondenserLoopTowers->towers(this->VSTower).WaterFlowRateRatioLast, state.dataCondenserLoopTowers->towers(this->VSTower).WaterFlowRateRatioLast); @@ -6165,7 +6451,10 @@ namespace CondenserLoopTowers { if (!state.dataGlobal->WarmupFlag) { state.dataCondenserLoopTowers->towers(this->VSTower).PrintTwbMessage = true; state.dataCondenserLoopTowers->towers(this->VSTower).TwbBuffer1 = - this->TowerType + " \"" + this->Name + "\" - Inlet air wet-bulb temperature is outside model boundaries at " + OutputChar + '.'; + format("{} \"{}\" - Inlet air wet-bulb temperature is outside model boundaries at {}.", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + OutputChar); state.dataCondenserLoopTowers->towers(this->VSTower).TwbBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + state.dataEnvrn->EnvironmentName + ", " + state.dataEnvrn->CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); @@ -6194,7 +6483,10 @@ namespace CondenserLoopTowers { if (!state.dataGlobal->WarmupFlag) { state.dataCondenserLoopTowers->towers(this->VSTower).PrintTrMessage = true; state.dataCondenserLoopTowers->towers(this->VSTower).TrBuffer1 = - this->TowerType + " \"" + this->Name + "\" - Tower range temperature is outside model boundaries at " + OutputChar + '.'; + format("{} \"{}\" - Tower range temperature is outside model boundaries at {}.", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + OutputChar); state.dataCondenserLoopTowers->towers(this->VSTower).TrBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + state.dataEnvrn->EnvironmentName + ", " + state.dataEnvrn->CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); @@ -6222,7 +6514,10 @@ namespace CondenserLoopTowers { if (!state.dataGlobal->WarmupFlag) { state.dataCondenserLoopTowers->towers(this->VSTower).PrintTaMessage = true; state.dataCondenserLoopTowers->towers(this->VSTower).TaBuffer1 = - this->TowerType + " \"" + this->Name + "\" - Tower approach temperature is outside model boundaries at " + OutputChar + '.'; + format("{} \"{}\" - Tower approach temperature is outside model boundaries at {}.", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + OutputChar); state.dataCondenserLoopTowers->towers(this->VSTower).TaBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + state.dataEnvrn->EnvironmentName + ", " + state.dataEnvrn->CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); @@ -6255,7 +6550,10 @@ namespace CondenserLoopTowers { if (!state.dataGlobal->WarmupFlag) { state.dataCondenserLoopTowers->towers(this->VSTower).PrintWFRRMessage = true; state.dataCondenserLoopTowers->towers(this->VSTower).WFRRBuffer1 = - this->TowerType + " \"" + this->Name + "\" - Water flow rate ratio is outside model boundaries at " + OutputChar + '.'; + format("{} \"{}\" - Water flow rate ratio is outside model boundaries at {}.", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name, + OutputChar); state.dataCondenserLoopTowers->towers(this->VSTower).WFRRBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + ". Occurrence info = " + state.dataEnvrn->EnvironmentName + ", " + state.dataEnvrn->CurMnDy + ' ' + General::CreateSysTimeIntervalString(state); @@ -6535,7 +6833,7 @@ namespace CondenserLoopTowers { // set node information state.dataLoopNodes->Node(this->WaterOutletNodeNum).Temp = this->OutletWaterTemp; - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked || state.dataGlobal->WarmupFlag) return; @@ -6543,7 +6841,7 @@ namespace CondenserLoopTowers { if (state.dataLoopNodes->Node(this->WaterOutletNodeNum).MassFlowRate > this->DesWaterMassFlowRate * this->TowerMassFlowRateMultiplier) { ++this->HighMassFlowErrorCount; if (this->HighMassFlowErrorCount < 2) { - ShowWarningError(state, this->TowerType + " \"" + this->Name + "\""); + ShowWarningError(state, format("{} \"{}\"", DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name)); ShowContinueError(state, " Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate."); ShowContinueError( state, format(" Condenser Loop Mass Flow Rate = {:.6T}", state.dataLoopNodes->Node(this->WaterOutletNodeNum).MassFlowRate)); @@ -6552,8 +6850,9 @@ namespace CondenserLoopTowers { } else { ShowRecurringWarningErrorAtEnd( state, - this->TowerType + " \"" + this->Name + - "\" Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate error continues...", + format("{} \"{}\" Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), this->HighMassFlowErrorIndex, state.dataLoopNodes->Node(this->WaterOutletNodeNum).MassFlowRate, state.dataLoopNodes->Node(this->WaterOutletNodeNum).MassFlowRate); @@ -6568,7 +6867,7 @@ namespace CondenserLoopTowers { ++this->OutletWaterTempErrorCount; strip(CharErrOut); if (this->OutletWaterTempErrorCount < 2) { - ShowWarningError(state, this->TowerType + " \"" + this->Name + "\""); + ShowWarningError(state, format("{} \"{}\"", DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name)); ShowContinueError( state, format("Cooling tower water outlet temperature ({:.2F} C) is below the specified minimum condenser loop temp of {:.2F} C", @@ -6578,8 +6877,9 @@ namespace CondenserLoopTowers { } else { ShowRecurringWarningErrorAtEnd( state, - this->TowerType + " \"" + this->Name + - "\" Cooling tower water outlet temperature is below the specified minimum condenser loop temp error continues...", + format("{} \"{}\" Cooling tower water outlet temperature is below the specified minimum condenser loop temp error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), this->OutletWaterTempErrorIndex, this->OutletWaterTemp, this->OutletWaterTemp); @@ -6590,14 +6890,15 @@ namespace CondenserLoopTowers { if (this->WaterMassFlowRate > 0.0 && this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { ++this->SmallWaterMassFlowErrorCount; if (this->SmallWaterMassFlowErrorCount < 2) { - ShowWarningError(state, this->TowerType + " \"" + this->Name + "\""); + ShowWarningError(state, format("{} \"{}\"", DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], this->Name)); ShowContinueError(state, "Cooling tower water mass flow rate near zero."); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, format("Actual Mass flow = {:.2T}", this->WaterMassFlowRate)); } else { ShowRecurringWarningErrorAtEnd(state, - this->TowerType + " \"" + this->Name + - "\" Cooling tower water mass flow rate near zero error continues...", + format("{} \"{}\" Cooling tower water mass flow rate near zero error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->TowerType)], + this->Name), this->SmallWaterMassFlowErrorIndex, this->WaterMassFlowRate, this->WaterMassFlowRate); diff --git a/src/EnergyPlus/CondenserLoopTowers.hh b/src/EnergyPlus/CondenserLoopTowers.hh index 8c2f05ffb2c..1154d255806 100644 --- a/src/EnergyPlus/CondenserLoopTowers.hh +++ b/src/EnergyPlus/CondenserLoopTowers.hh @@ -58,6 +58,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -113,9 +114,8 @@ namespace CondenserLoopTowers { struct CoolingTower : PlantComponent { // Members - std::string Name; // User identifier - std::string TowerType; // Type of cooling tower - int TowerType_Num; + std::string Name; // User identifier + DataPlant::PlantEquipmentType TowerType; PIM PerformanceInputMethod_Num; // Method of entering tower performance: UA and Design Water // Flow Rate, or Nominal Capacity std::string ModelCoeffObjectName; // Cooling Tower:Variable Speed Model Coefficient Object name @@ -352,9 +352,9 @@ namespace CondenserLoopTowers { // Default Constructor CoolingTower() - : TowerType_Num(0), PerformanceInputMethod_Num(PIM::Unassigned), Available(true), ON(true), DesignWaterFlowRate(0.0), - DesignWaterFlowRateWasAutoSized(false), DesignWaterFlowPerUnitNomCap(0.0), DesWaterMassFlowRate(0.0), DesWaterMassFlowRatePerCell(0.0), - HighSpeedAirFlowRate(0.0), HighSpeedAirFlowRateWasAutoSized(false), DesignAirFlowPerUnitNomCap(0.0), + : TowerType(DataPlant::PlantEquipmentType::Invalid), PerformanceInputMethod_Num(PIM::Unassigned), Available(true), ON(true), + DesignWaterFlowRate(0.0), DesignWaterFlowRateWasAutoSized(false), DesignWaterFlowPerUnitNomCap(0.0), DesWaterMassFlowRate(0.0), + DesWaterMassFlowRatePerCell(0.0), HighSpeedAirFlowRate(0.0), HighSpeedAirFlowRateWasAutoSized(false), DesignAirFlowPerUnitNomCap(0.0), DefaultedDesignAirFlowScalingFactor(false), HighSpeedFanPower(0.0), HighSpeedFanPowerWasAutoSized(false), DesignFanPowerPerUnitNomCap(0.0), HighSpeedTowerUA(0.0), HighSpeedTowerUAWasAutoSized(false), LowSpeedAirFlowRate(0.0), LowSpeedAirFlowRateWasAutoSized(false), LowSpeedAirFlowRateSizingFactor(0.0), LowSpeedFanPower(0.0), diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 63095aeaaea..53600c2cdae 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -5034,7 +5034,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) daylightControl.AvailSchedNum = DataGlobalConstants::ScheduleAlwaysOn; } - int typeNum = getEnumerationValue(DataDaylighting::LtgCtrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5)); + int typeNum = getEnumerationValue(DataDaylighting::LtgCtrlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5))); daylightControl.LightControlType = static_cast(typeNum); if (daylightControl.LightControlType == DataDaylighting::LtgCtrlType::Invalid) { ShowWarningError(state, diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index 981c4560cf9..3bc4918afc8 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -1792,8 +1792,6 @@ namespace DesiccantDehumidifiers { using Psychrometrics::PsyRhoAirFnPbTdbW; using SteamCoils::SimulateSteamCoilComponents; auto &GetCoilMaxSteamFlowRate(SteamCoils::GetCoilMaxSteamFlowRate); - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataSizing::AutoSize; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; @@ -1840,7 +1838,7 @@ namespace DesiccantDehumidifiers { ErrorFlag = false; ScanPlantLoopsForObject(state, DesicDehum(DesicDehumNum).RegenCoilName, - TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, DesicDehum(DesicDehumNum).LoopNum, DesicDehum(DesicDehumNum).LoopSide, DesicDehum(DesicDehumNum).BranchNum, @@ -1872,7 +1870,7 @@ namespace DesiccantDehumidifiers { ErrorFlag = false; ScanPlantLoopsForObject(state, DesicDehum(DesicDehumNum).RegenCoilName, - TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, DesicDehum(DesicDehumNum).LoopNum, DesicDehum(DesicDehumNum).LoopSide, DesicDehum(DesicDehumNum).BranchNum, diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 33e7d5de535..b1b63ccbefb 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -528,10 +528,10 @@ void ElectricPowerServiceManager::reportPVandWindCapacity(EnergyPlusData &state) for (auto &lc : elecLoadCenterObjs) { if (lc->numGenerators > 0) { for (auto &g : lc->elecGenCntrlObj) { - if (g->compGenTypeOf_Num == GeneratorType::PV) { + if (g->generatorType == GeneratorType::PV) { pvTotalCapacity_ += g->maxPowerOut; } - if (g->compGenTypeOf_Num == GeneratorType::WindTurbine) { + if (g->generatorType == GeneratorType::WindTurbine) { windTotalCapacity_ += g->maxPowerOut; } } @@ -1043,7 +1043,10 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje errorsFound = true; ShowSevereError(state, std::string{routineName} + "ElectricLoadCenter:Distribution=\"" + name_ + "\","); ShowContinueError(state, "ElectricLoadCenter:Inverter:PVWatts can only be used with Generator:PVWatts"); - ShowContinueError(state, "\"" + generatorController->name + "\" is of type " + generatorController->typeOfName); + ShowContinueError(state, + format("\"{}\" is of type {}", + generatorController->name, + GeneratorTypeNames[static_cast(generatorController->generatorType)])); } else { totalDCCapacity += generatorController->pvwattsGenerator->getDCSystemCapacity(); @@ -2106,7 +2109,7 @@ Real64 ElectPowerLoadCenter::calcLoadCenterThermalLoad(EnergyPlusData &state) plantNotFound = false; PlantUtilities::ScanPlantLoopsForObject(state, g->compPlantName, - g->compPlantTypeOf_Num, + g->compPlantType, g->cogenLocation.loopNum, g->cogenLocation.loopSideNum, g->cogenLocation.branchNum, @@ -2142,40 +2145,40 @@ GeneratorController::GeneratorController(EnergyPlusData &state, Real64 ratedElecPowerOutput, std::string const &availSchedName, Real64 thermalToElectRatio) - : compGenTypeOf_Num(GeneratorType::Unassigned), compPlantTypeOf_Num(0), generatorType(GeneratorType::Unassigned), generatorIndex(0), - maxPowerOut(0.0), availSchedPtr(0), powerRequestThisTimestep(0.0), onThisTimestep(false), eMSPowerRequest(0.0), eMSRequestOn(false), - plantInfoFound(false), cogenLocation(PlantLocation(0, 0, 0, 0)), nominalThermElectRatio(0.0), dCElectricityProd(0.0), dCElectProdRate(0.0), - electricityProd(0.0), electProdRate(0.0), thermalProd(0.0), thermProdRate(0.0), pvwattsGenerator(nullptr), errCountNegElectProd_(0) + : generatorType(GeneratorType::Unassigned), compPlantType(DataPlant::PlantEquipmentType::Invalid), generatorIndex(0), maxPowerOut(0.0), + availSchedPtr(0), powerRequestThisTimestep(0.0), onThisTimestep(false), eMSPowerRequest(0.0), eMSRequestOn(false), plantInfoFound(false), + cogenLocation(PlantLocation(0, 0, 0, 0)), nominalThermElectRatio(0.0), dCElectricityProd(0.0), dCElectProdRate(0.0), electricityProd(0.0), + electProdRate(0.0), thermalProd(0.0), thermProdRate(0.0), pvwattsGenerator(nullptr), errCountNegElectProd_(0) { static constexpr std::string_view routineName = "GeneratorController constructor "; name = objectName; - typeOfName = objectType; - if (UtilityRoutines::SameString(objectType, "Generator:InternalCombustionEngine")) { - generatorType = GeneratorType::ICEngine; - compGenTypeOf_Num = GeneratorType::ICEngine; - compPlantTypeOf_Num = DataPlant::TypeOf_Generator_ICEngine; + + generatorType = static_cast(getEnumerationValue(GeneratorTypeNamesUC, UtilityRoutines::MakeUPPERCase(objectType))); + switch (generatorType) { + case GeneratorType::ICEngine: { + compPlantType = DataPlant::PlantEquipmentType::Generator_ICEngine; compPlantName = name; - } else if (UtilityRoutines::SameString(objectType, "Generator:CombustionTurbine")) { - generatorType = GeneratorType::CombTurbine; - compGenTypeOf_Num = GeneratorType::CombTurbine; - compPlantTypeOf_Num = DataPlant::TypeOf_Generator_CTurbine; + break; + } + case GeneratorType::CombTurbine: { + compPlantType = DataPlant::PlantEquipmentType::Generator_CTurbine; compPlantName = name; - } else if (UtilityRoutines::SameString(objectType, "Generator:MicroTurbine")) { - generatorType = GeneratorType::Microturbine; - compGenTypeOf_Num = GeneratorType::Microturbine; - compPlantTypeOf_Num = DataPlant::TypeOf_Generator_MicroTurbine; + break; + } + case GeneratorType::Microturbine: { + compPlantType = DataPlant::PlantEquipmentType::Generator_MicroTurbine; compPlantName = name; - } else if (UtilityRoutines::SameString(objectType, "Generator:Photovoltaic")) { - generatorType = GeneratorType::PV; - compGenTypeOf_Num = GeneratorType::PV; - compPlantTypeOf_Num = DataPlant::TypeOf_PVTSolarCollectorFlatPlate; + break; + } + case GeneratorType::PV: { + compPlantType = DataPlant::PlantEquipmentType::PVTSolarCollectorFlatPlate; compPlantName = name; - } else if (UtilityRoutines::SameString(objectType, "Generator:PVWatts")) { - generatorType = GeneratorType::PVWatts; - compGenTypeOf_Num = GeneratorType::PVWatts; - compPlantTypeOf_Num = DataPlant::TypeOf_Other; + break; + } + case GeneratorType::PVWatts: { + compPlantType = DataPlant::PlantEquipmentType::Invalid; int ObjNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Generator:PVWatts", UtilityRoutines::MakeUPPERCase(objectName)); @@ -2185,28 +2188,31 @@ GeneratorController::GeneratorController(EnergyPlusData &state, } pvwattsGenerator = PVWatts::PVWattsGenerator::createFromIdfObj(state, ObjNum); pvwattsGenerator->setupOutputVariables(state); - - } else if (UtilityRoutines::SameString(objectType, "Generator:FuelCell")) { - generatorType = GeneratorType::FuelCell; - compGenTypeOf_Num = GeneratorType::FuelCell; + break; + } + case GeneratorType::FuelCell: { // fuel cell has two possible plant component types, stack cooler and exhaust gas HX. // exhaust gas HX is required and it assumed that it has more thermal capacity and is used for control - compPlantTypeOf_Num = DataPlant::TypeOf_Generator_FCExhaust; + compPlantType = DataPlant::PlantEquipmentType::Generator_FCExhaust; // and the name of plant component is not the same as the generator because of child object references, so fetch that name auto thisFC = FuelCellElectricGenerator::FCDataStruct::factory(state, name); compPlantName = dynamic_cast(thisFC)->ExhaustHX.Name; - } else if (UtilityRoutines::SameString(objectType, "Generator:MicroCHP")) { - generatorType = GeneratorType::MicroCHP; - compGenTypeOf_Num = GeneratorType::MicroCHP; - compPlantTypeOf_Num = DataPlant::TypeOf_Generator_MicroCHP; + break; + } + case GeneratorType::MicroCHP: { + compPlantType = DataPlant::PlantEquipmentType::Generator_MicroCHP; compPlantName = name; - } else if (UtilityRoutines::SameString(objectType, "Generator:WindTurbine")) { - generatorType = GeneratorType::WindTurbine; - compGenTypeOf_Num = GeneratorType::WindTurbine; - compPlantTypeOf_Num = DataPlant::TypeOf_Other; - } else { + break; + } + case GeneratorType::WindTurbine: { + compPlantType = DataPlant::PlantEquipmentType::Invalid; + break; + } + default: { ShowSevereError(state, std::string{routineName} + state.dataIPShortCut->cCurrentModuleObject + " invalid entry."); ShowContinueError(state, "Invalid " + objectType + " associated with generator = " + objectName); + break; + } } availSched = availSchedName; @@ -2398,7 +2404,8 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, thermalPowerOutput = thermProdRate; break; } - case GeneratorType::Unassigned: { + case GeneratorType::Unassigned: + case GeneratorType::Num: { // do nothing break; } @@ -2407,15 +2414,19 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, // check if generator production has gone wrong and is negative, reset to zero and warn if (electricPowerOutput < 0.0) { if (errCountNegElectProd_ == 0) { - ShowWarningMessage(state, typeOfName + " named " + name + " is producing negative electric power, check generator inputs."); + ShowWarningMessage(state, + format("{} named {} is producing negative electric power, check generator inputs.", + GeneratorTypeNames[static_cast(generatorType)], + name)); ShowContinueError(state, format("Electric power production rate ={:.4R}", electricPowerOutput)); ShowContinueError(state, "The power will be set to zero, and the simulation continues... "); } - ShowRecurringWarningErrorAtEnd(state, - typeOfName + " named " + name + " is producing negative electric power ", - errCountNegElectProd_, - electricPowerOutput, - electricPowerOutput); + ShowRecurringWarningErrorAtEnd( + state, + format("{} named {} is producing negative electric power ", GeneratorTypeNames[static_cast(generatorType)], name), + errCountNegElectProd_, + electricPowerOutput, + electricPowerOutput); electricPowerOutput = 0.0; } } diff --git a/src/EnergyPlus/ElectricPowerServiceManager.hh b/src/EnergyPlus/ElectricPowerServiceManager.hh index d70b23bc149..6b1232ce7ec 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.hh +++ b/src/EnergyPlus/ElectricPowerServiceManager.hh @@ -61,6 +61,7 @@ #include #include #include +#include #include // SSC Headers @@ -68,16 +69,9 @@ namespace EnergyPlus { -enum class ThermalLossDestination : int -{ - heatLossNotDetermined = 0, - zoneGains, // device thermal losses are added to a zone as internal gains - lostToOutside // device thermal losses have no destination -}; - enum class GeneratorType { - Unassigned, + Unassigned = -1, ICEngine, CombTurbine, PV, @@ -85,7 +79,33 @@ enum class GeneratorType MicroCHP, Microturbine, WindTurbine, - PVWatts + PVWatts, + Num +}; + +constexpr std::array(GeneratorType::Num)> GeneratorTypeNames{"Generator:InternalCombustionEngine", + "Generator:CombustionTurbine", + "Generator:Photovoltaic", + "Generator:FuelCell", + "Generator:MicroCHP", + "Generator:MicroTurbine", + "Generator:WindTurbine", + "Generator:PVWatts"}; + +constexpr std::array(GeneratorType::Num)> GeneratorTypeNamesUC{"GENERATOR:INTERNALCOMBUSTIONENGINE", + "GENERATOR:COMBUSTIONTURBINE", + "GENERATOR:PHOTOVOLTAIC", + "GENERATOR:FUELCELL", + "GENERATOR:MICROCHP", + "GENERATOR:MICROTURBINE", + "GENERATOR:WINDTURBINE", + "GENERATOR:PVWATTS"}; + +enum class ThermalLossDestination : int +{ + heatLossNotDetermined = 0, + zoneGains, // device thermal losses are added to a zone as internal gains + lostToOutside // device thermal losses have no destination }; void initializeElectricPowerServiceZoneGains(EnergyPlusData &state); @@ -546,21 +566,19 @@ public: // Method void reinitAtBeginEnvironment(); -public: // data // might make this class a friend of ElectPowerLoadCenter? - std::string name; // user identifier - std::string typeOfName; // equipment type - GeneratorType compGenTypeOf_Num; // Numeric designator for generator CompType (TypeOf), in DataGlobalConstants - int compPlantTypeOf_Num; // numeric designator for plant component, in DataPlant - std::string compPlantName; // name of plant component if heat recovery - GeneratorType generatorType; - int generatorIndex; // index in generator model data struct - Real64 maxPowerOut; // Maximum Power Output (W) - std::string availSched; // Operation Schedule. - int availSchedPtr; // pointer to operation schedule - Real64 powerRequestThisTimestep; // Current Demand on Equipment (W) - bool onThisTimestep; // Indicator whether Generator on - Real64 eMSPowerRequest; // EMS actuator for current demand on equipment (W) - bool eMSRequestOn; // EMS actuating On if true. +public: // data // might make this class a friend of ElectPowerLoadCenter? + std::string name; // user identifier + GeneratorType generatorType; // Numeric designator for generator CompType (TypeOf), in DataGlobalConstants + DataPlant::PlantEquipmentType compPlantType{DataPlant::PlantEquipmentType::Invalid}; // numeric designator for plant component, in DataPlant + std::string compPlantName; // name of plant component if heat recovery + int generatorIndex; // index in generator model data struct + Real64 maxPowerOut; // Maximum Power Output (W) + std::string availSched; // Operation Schedule. + int availSchedPtr; // pointer to operation schedule + Real64 powerRequestThisTimestep; // Current Demand on Equipment (W) + bool onThisTimestep; // Indicator whether Generator on + Real64 eMSPowerRequest; // EMS actuator for current demand on equipment (W) + bool eMSRequestOn; // EMS actuating On if true. bool plantInfoFound; PlantLocation cogenLocation; Real64 nominalThermElectRatio; // Cogen: nominal ratio of thermal to elect production diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 2cfe89152dd..c8be131c685 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -98,7 +98,7 @@ namespace EvaporativeFluidCoolers { std::string const cEvapFluidCooler_SingleSpeed("EvaporativeFluidCooler:SingleSpeed"); std::string const cEvapFluidCooler_TwoSpeed("EvaporativeFluidCooler:TwoSpeed"); - PlantComponent *EvapFluidCoolerSpecs::factory(EnergyPlusData &state, int objectType, std::string const &objectName) + PlantComponent *EvapFluidCoolerSpecs::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName) { // Process the input data if it hasn't been done already if (state.dataEvapFluidCoolers->GetEvapFluidCoolerInputFlag) { @@ -108,7 +108,7 @@ namespace EvaporativeFluidCoolers { // Now look for this particular object for (auto &thisEFC : state.dataEvapFluidCoolers->SimpleEvapFluidCooler) { - if ((thisEFC.TypeOf_Num == objectType) && (thisEFC.Name == objectName)) { + if ((thisEFC.Type == objectType) && (thisEFC.Name == objectName)) { return &thisEFC; } } @@ -189,7 +189,7 @@ namespace EvaporativeFluidCoolers { thisEFC.Name = AlphArray(1); thisEFC.EvapFluidCoolerType = state.dataIPShortCut->cCurrentModuleObject; - thisEFC.TypeOf_Num = DataPlant::TypeOf_EvapFluidCooler_SingleSpd; + thisEFC.Type = DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd; thisEFC.EvapFluidCoolerMassFlowRateMultiplier = 2.5; thisEFC.WaterInletNodeNum = NodeInputManager::GetOnlySingleNode(state, AlphArray(2), @@ -495,7 +495,7 @@ namespace EvaporativeFluidCoolers { thisEFC.Name = AlphArray(1); thisEFC.EvapFluidCoolerType = state.dataIPShortCut->cCurrentModuleObject; - thisEFC.TypeOf_Num = DataPlant::TypeOf_EvapFluidCooler_TwoSpd; + thisEFC.Type = DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd; thisEFC.EvapFluidCoolerMassFlowRateMultiplier = 2.5; thisEFC.WaterInletNodeNum = NodeInputManager::GetOnlySingleNode(state, AlphArray(2), @@ -894,7 +894,7 @@ namespace EvaporativeFluidCoolers { { // Set up output variables // CurrentModuleObject='EvaporativeFluidCooler:SingleSpeed' - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { // Added for fluid bypass SetupOutputVariable(state, @@ -1131,13 +1131,13 @@ namespace EvaporativeFluidCoolers { void EvapFluidCoolerSpecs::getDesignCapacities(EnergyPlusData &state, const PlantLocation &, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) { - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { MinLoad = 0.0; // signifies non-load based model (i.e. forward) MaxLoad = this->HighSpeedStandardDesignCapacity * this->HeatRejectCapNomCapSizingRatio; OptLoad = this->HighSpeedStandardDesignCapacity; - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { MinLoad = 0.0; // signifies non-load based model (i.e. forward heat exchanger model) MaxLoad = this->HighSpeedStandardDesignCapacity * this->HeatRejectCapNomCapSizingRatio; @@ -1172,9 +1172,9 @@ namespace EvaporativeFluidCoolers { this->InitEvapFluidCooler(state); - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { this->CalcSingleSpeedEvapFluidCooler(state); - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { this->CalcTwoSpeedEvapFluidCooler(state); } else { ShowFatalError(state, "SimEvapFluidCoolers: Invalid evaporative fluid cooler Type Requested = " + EvapFluidCoolerType); @@ -1383,7 +1383,7 @@ namespace EvaporativeFluidCoolers { tmpDesignWaterFlowRate = 5.382e-8 * this->HighSpeedStandardDesignCapacity; if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->DesignWaterFlowRate = tmpDesignWaterFlowRate; - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, @@ -1399,7 +1399,7 @@ namespace EvaporativeFluidCoolers { "Initial Design Water Flow Rate based on evaporative fluid cooler Standard Design Capacity [m3/s]", this->DesignWaterFlowRate); } - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput( state, @@ -1461,7 +1461,7 @@ namespace EvaporativeFluidCoolers { } } if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput( state, cEvapFluidCooler_SingleSpeed, this->Name, "Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); @@ -1473,7 +1473,7 @@ namespace EvaporativeFluidCoolers { "Initial Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); } - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput( state, cEvapFluidCooler_TwoSpeed, this->Name, "Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); @@ -1493,7 +1493,7 @@ namespace EvaporativeFluidCoolers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput( state, cEvapFluidCooler_SingleSpeed, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); @@ -1502,7 +1502,7 @@ namespace EvaporativeFluidCoolers { BaseSizer::reportSizerOutput( state, cEvapFluidCooler_SingleSpeed, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput( state, cEvapFluidCooler_TwoSpeed, this->Name, "Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); @@ -1623,7 +1623,7 @@ namespace EvaporativeFluidCoolers { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedEvapFluidCoolerUA = 0.0; } if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, @@ -1638,7 +1638,7 @@ namespace EvaporativeFluidCoolers { "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, @@ -1702,7 +1702,7 @@ namespace EvaporativeFluidCoolers { this->HighSpeedEvapFluidCoolerUA = 0.0; } if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, @@ -1717,7 +1717,7 @@ namespace EvaporativeFluidCoolers { "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, @@ -1814,7 +1814,7 @@ namespace EvaporativeFluidCoolers { this->HighSpeedEvapFluidCoolerUA = 0.0; } if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, @@ -1829,7 +1829,7 @@ namespace EvaporativeFluidCoolers { "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } - } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + } else if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, @@ -1889,7 +1889,7 @@ namespace EvaporativeFluidCoolers { } } - if (this->PerformanceInputMethod_Num == PIM::StandardDesignCapacity && this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + if (this->PerformanceInputMethod_Num == PIM::StandardDesignCapacity && this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && this->LowSpeedStandardDesignCapacity > 0.0) { // Standard design capacity doesn't include compressor heat; // predefined factor was 1.25 W heat rejection per W of delivered cooling, now user input with default 1.25 @@ -1948,7 +1948,8 @@ namespace EvaporativeFluidCoolers { } } - if (this->PerformanceInputMethod_Num == PIM::UserSpecifiedDesignCapacity && this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + if (this->PerformanceInputMethod_Num == PIM::UserSpecifiedDesignCapacity && + this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && this->LowSpeedUserSpecifiedDesignCapacity > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, @@ -2104,9 +2105,9 @@ namespace EvaporativeFluidCoolers { AirFlowRate = 0.0; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } @@ -2117,7 +2118,7 @@ namespace EvaporativeFluidCoolers { // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; if (inletWaterTemp > TempSetPoint) { @@ -2286,16 +2287,16 @@ namespace EvaporativeFluidCoolers { Real64 TempSetPoint = 0.0; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; if (this->InletWaterTemp > TempSetPoint) { @@ -2624,7 +2625,7 @@ namespace EvaporativeFluidCoolers { state.dataLoopNodes->Node(this->WaterOutletNode).Temp = this->OutletWaterTemp; - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || state.dataGlobal->WarmupFlag) + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked || state.dataGlobal->WarmupFlag) return; // Check flow rate through evaporative fluid cooler and compare to design flow rate, @@ -2755,13 +2756,13 @@ namespace EvaporativeFluidCoolers { if (this->OneTimeFlagForEachEvapFluidCooler) { // Locate the tower on the plant loops for later usage PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->TypeOf_Num, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); + state, this->Name, this->Type, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); if (ErrorsFound) { ShowFatalError(state, "InitEvapFluidCooler: Program terminated due to previous condition(s)."); } - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + if (this->Type == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { if (this->DesignWaterFlowRate > 0.0) { if (this->HighSpeedAirFlowRate <= this->LowSpeedAirFlowRate) { ShowSevereError(state, diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.hh b/src/EnergyPlus/EvaporativeFluidCoolers.hh index 40c374926d4..f87127092a3 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.hh +++ b/src/EnergyPlus/EvaporativeFluidCoolers.hh @@ -104,7 +104,7 @@ namespace EvaporativeFluidCoolers { // Members std::string Name; // User identifier std::string EvapFluidCoolerType; // Type of evaporative fluid cooler - int TypeOf_Num; + DataPlant::PlantEquipmentType Type; std::string PerformanceInputMethod; PIM PerformanceInputMethod_Num; bool Available; // need an array of logicals--load identifiers of available equipment @@ -223,13 +223,14 @@ namespace EvaporativeFluidCoolers { // Default Constructor EvapFluidCoolerSpecs() - : TypeOf_Num(0), PerformanceInputMethod_Num(PIM::StandardDesignCapacity), Available(true), ON(true), DesignWaterFlowRate(0.0), - DesignWaterFlowRateWasAutoSized(false), DesignSprayWaterFlowRate(0.0), DesWaterMassFlowRate(0.0), HighSpeedAirFlowRate(0.0), - HighSpeedAirFlowRateWasAutoSized(false), HighSpeedFanPower(0.0), HighSpeedFanPowerWasAutoSized(false), HighSpeedEvapFluidCoolerUA(0.0), - HighSpeedEvapFluidCoolerUAWasAutoSized(false), LowSpeedAirFlowRate(0.0), LowSpeedAirFlowRateWasAutoSized(false), - LowSpeedAirFlowRateSizingFactor(0.0), LowSpeedFanPower(0.0), LowSpeedFanPowerWasAutoSized(false), LowSpeedFanPowerSizingFactor(0.0), - LowSpeedEvapFluidCoolerUA(0.0), LowSpeedEvapFluidCoolerUAWasAutoSized(false), LowSpeedEvapFluidCoolerUASizingFactor(0.0), - DesignEnteringWaterTemp(0.0), DesignEnteringAirTemp(0.0), DesignEnteringAirWetBulbTemp(0.0), EvapFluidCoolerMassFlowRateMultiplier(0.0), + : Type(DataPlant::PlantEquipmentType::Invalid), PerformanceInputMethod_Num(PIM::StandardDesignCapacity), Available(true), ON(true), + DesignWaterFlowRate(0.0), DesignWaterFlowRateWasAutoSized(false), DesignSprayWaterFlowRate(0.0), DesWaterMassFlowRate(0.0), + HighSpeedAirFlowRate(0.0), HighSpeedAirFlowRateWasAutoSized(false), HighSpeedFanPower(0.0), HighSpeedFanPowerWasAutoSized(false), + HighSpeedEvapFluidCoolerUA(0.0), HighSpeedEvapFluidCoolerUAWasAutoSized(false), LowSpeedAirFlowRate(0.0), + LowSpeedAirFlowRateWasAutoSized(false), LowSpeedAirFlowRateSizingFactor(0.0), LowSpeedFanPower(0.0), + LowSpeedFanPowerWasAutoSized(false), LowSpeedFanPowerSizingFactor(0.0), LowSpeedEvapFluidCoolerUA(0.0), + LowSpeedEvapFluidCoolerUAWasAutoSized(false), LowSpeedEvapFluidCoolerUASizingFactor(0.0), DesignEnteringWaterTemp(0.0), + DesignEnteringAirTemp(0.0), DesignEnteringAirWetBulbTemp(0.0), EvapFluidCoolerMassFlowRateMultiplier(0.0), HeatRejectCapNomCapSizingRatio(0.0), HighSpeedStandardDesignCapacity(0.0), LowSpeedStandardDesignCapacity(0.0), LowSpeedStandardDesignCapacitySizingFactor(0.0), HighSpeedUserSpecifiedDesignCapacity(0.0), LowSpeedUserSpecifiedDesignCapacity(0.0), LowSpeedUserSpecifiedDesignCapacitySizingFactor(0.0), Concentration(0.0), FluidIndex(0), SizFac(0.0), WaterInletNodeNum(0), @@ -248,7 +249,7 @@ namespace EvaporativeFluidCoolers { { } - static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string const &objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName); void setupOutputVars(EnergyPlusData &state); diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 2693da283b5..6cf698f1720 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -254,9 +254,6 @@ namespace FanCoilUnits { using DataHVACGlobals::FanType_SimpleConstVolume; using DataHVACGlobals::FanType_SimpleOnOff; using DataHVACGlobals::FanType_SimpleVAV; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; using HVACHXAssistedCoolingCoil::GetHXCoilTypeAndName; using MixedAir::GetOAMixerIndex; using MixedAir::GetOAMixerNodeNumbers; @@ -453,30 +450,30 @@ namespace FanCoilUnits { if (UtilityRoutines::SameString(Alphas(11), "Coil:Cooling:Water")) { FanCoil(FanCoilNum).CCoilType_Num = CCoil::Water; FanCoil(FanCoilNum).CCoilPlantName = FanCoil(FanCoilNum).CCoilName; - FanCoil(FanCoilNum).CCoilPlantTypeOfNum = TypeOf_CoilWaterCooling; + FanCoil(FanCoilNum).CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterCooling; } if (UtilityRoutines::SameString(Alphas(11), "Coil:Cooling:Water:DetailedGeometry")) { FanCoil(FanCoilNum).CCoilType_Num = CCoil::Detailed; FanCoil(FanCoilNum).CCoilPlantName = FanCoil(FanCoilNum).CCoilName; - FanCoil(FanCoilNum).CCoilPlantTypeOfNum = TypeOf_CoilWaterDetailedFlatCooling; + FanCoil(FanCoilNum).CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } if (UtilityRoutines::SameString(Alphas(11), "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { FanCoil(FanCoilNum).CCoilType_Num = CCoil::HXAssist; + std::string CCoilType; GetHXCoilTypeAndName(state, FanCoil(FanCoilNum).CCoilType, FanCoil(FanCoilNum).CCoilName, ErrorsFound, - FanCoil(FanCoilNum).CCoilPlantType, + CCoilType, FanCoil(FanCoilNum).CCoilPlantName); - if (UtilityRoutines::SameString(FanCoil(FanCoilNum).CCoilPlantType, "Coil:Cooling:Water")) { - FanCoil(FanCoilNum).CCoilPlantTypeOfNum = TypeOf_CoilWaterCooling; - } else if (UtilityRoutines::SameString(FanCoil(FanCoilNum).CCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { - FanCoil(FanCoilNum).CCoilPlantTypeOfNum = TypeOf_CoilWaterDetailedFlatCooling; + if (UtilityRoutines::SameString(CCoilType, "Coil:Cooling:Water")) { + FanCoil(FanCoilNum).CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterCooling; + } else if (UtilityRoutines::SameString(CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { + FanCoil(FanCoilNum).CCoilPlantType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } else { ShowSevereError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + FanCoil(FanCoilNum).Name + "\", invalid"); ShowContinueError(state, "For: " + cAlphaFields(11) + "=\"" + Alphas(11) + "\"."); - ShowContinueError(state, - "Invalid Coil Type=" + FanCoil(FanCoilNum).CCoilPlantType + ", Name=" + FanCoil(FanCoilNum).CCoilPlantName); + ShowContinueError(state, format("Invalid Coil Type={}, Name={}", CCoilType, FanCoil(FanCoilNum).CCoilPlantName)); ShowContinueError(state, "must be \"Coil:Cooling:Water\" or \"Coil:Cooling:Water:DetailedGeometry\""); ErrorsFound = true; } @@ -517,7 +514,7 @@ namespace FanCoilUnits { if (UtilityRoutines::SameString(Alphas(13), "Coil:Heating:Water")) { FanCoil(FanCoilNum).HCoilType_Num = HCoil::Water; - FanCoil(FanCoilNum).HCoilPlantTypeOfNum = TypeOf_CoilWaterSimpleHeating; + FanCoil(FanCoilNum).HCoilPlantTypeOf = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; IsNotOK = false; ValidateComponent(state, FanCoil(FanCoilNum).HCoilType, FanCoil(FanCoilNum).HCoilName, IsNotOK, CurrentModuleObject); if (IsNotOK) { @@ -1123,8 +1120,6 @@ namespace FanCoilUnits { // Using/Aliasing auto &ZoneComp = state.dataHVACGlobal->ZoneComp; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::FanCoil4Pipe_Num; using FluidProperties::GetDensityGlycol; @@ -1178,7 +1173,7 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).HCoilType_Num == HCoil::Water) { ScanPlantLoopsForObject(state, FanCoil(FanCoilNum).HCoilName, - FanCoil(FanCoilNum).HCoilPlantTypeOfNum, + FanCoil(FanCoilNum).HCoilPlantTypeOf, FanCoil(FanCoilNum).HeatCoilLoopNum, FanCoil(FanCoilNum).HeatCoilLoopSide, FanCoil(FanCoilNum).HeatCoilBranchNum, @@ -1207,11 +1202,11 @@ namespace FanCoilUnits { ShowFatalError(state, "InitFanCoilUnits: FanCoil=" + FanCoil(FanCoilNum).Name + ", invalid heating coil type. Program terminated."); } - if ((FanCoil(FanCoilNum).CCoilPlantTypeOfNum == TypeOf_CoilWaterCooling) || - (FanCoil(FanCoilNum).CCoilPlantTypeOfNum == TypeOf_CoilWaterDetailedFlatCooling)) { + if ((FanCoil(FanCoilNum).CCoilPlantType == DataPlant::PlantEquipmentType::CoilWaterCooling) || + (FanCoil(FanCoilNum).CCoilPlantType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { ScanPlantLoopsForObject(state, FanCoil(FanCoilNum).CCoilPlantName, - FanCoil(FanCoilNum).CCoilPlantTypeOfNum, + FanCoil(FanCoilNum).CCoilPlantType, FanCoil(FanCoilNum).CoolCoilLoopNum, FanCoil(FanCoilNum).CoolCoilLoopSide, FanCoil(FanCoilNum).CoolCoilBranchNum, @@ -2421,7 +2416,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).CoolCoilBranchNum, FanCoil(FanCoilNum).CoolCoilCompNum); if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == - DataPlant::iFlowLock::Locked) { + DataPlant::FlowLock::Locked) { ColdFlowLocked = true; // check for flow lock } if (FanCoil(FanCoilNum).HCoilType_Num == HCoil::Water) { @@ -2435,7 +2430,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).HeatCoilBranchNum, FanCoil(FanCoilNum).HeatCoilCompNum); if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == - DataPlant::iFlowLock::Locked) { + DataPlant::FlowLock::Locked) { HotFlowLocked = true; // save locked flow } } @@ -2804,7 +2799,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).CoolCoilBranchNum, FanCoil(FanCoilNum).CoolCoilCompNum); if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == - DataPlant::iFlowLock::Locked) { + DataPlant::FlowLock::Locked) { ColdFlowLocked = true; // check for flow lock } if (FanCoil(FanCoilNum).HCoilType_Num == HCoil::Water) { @@ -2818,7 +2813,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).HeatCoilBranchNum, FanCoil(FanCoilNum).HeatCoilCompNum); if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == - DataPlant::iFlowLock::Locked) { + DataPlant::FlowLock::Locked) { HotFlowLocked = true; // save locked flow } } diff --git a/src/EnergyPlus/FanCoilUnits.hh b/src/EnergyPlus/FanCoilUnits.hh index 70105606da6..a47b33686a1 100644 --- a/src/EnergyPlus/FanCoilUnits.hh +++ b/src/EnergyPlus/FanCoilUnits.hh @@ -61,6 +61,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -155,8 +156,7 @@ namespace FanCoilUnits { // 'CoilSystem:Cooling:Water:HeatExchangerAssisted' CCoil CCoilType_Num; // Numeric equivalent for type of cooling coil std::string CCoilPlantName; // name of cooling coil (child<=CoilSystem:Cooling:Water:HeatExchangerAssisted) - std::string CCoilPlantType; // type of cooling coil (child<=CoilSystem:Cooling:Water:HeatExchangerAssisted) - int CCoilPlantTypeOfNum; + DataPlant::PlantEquipmentType CCoilPlantType; int ControlCompTypeNum; int CompErrIndex; Real64 MaxColdWaterVolFlow; // m3/s @@ -168,7 +168,7 @@ namespace FanCoilUnits { std::string HCoilType; // type of heating coil: // 'Coil:Heating:Water' or HCoil HCoilType_Num; // Numeric equivalent for type of cooling coil - int HCoilPlantTypeOfNum; + DataPlant::PlantEquipmentType HCoilPlantTypeOf{DataPlant::PlantEquipmentType::Invalid}; Real64 MaxHotWaterVolFlow; // m3/s Real64 MinHotWaterVolFlow; // m3/s Real64 MinHotWaterFlow; // kg/s @@ -254,11 +254,11 @@ namespace FanCoilUnits { MaxIterIndexH(0), BadMassFlowLimIndexH(0), MaxIterIndexC(0), BadMassFlowLimIndexC(0), FanAirVolFlow(0.0), MaxAirVolFlow(0.0), MaxAirMassFlow(0.0), LowSpeedRatio(0.0), MedSpeedRatio(0.0), SpeedFanRatSel(0.0), OutAirVolFlow(0.0), OutAirMassFlow(0.0), AirInNode(0), AirOutNode(0), OutsideAirNode(0), AirReliefNode(0), MixedAirNode(0), OAMixIndex(0), FanIndex(0), CCoilName_Index(0), - CCoilType_Num(CCoil::Unassigned), CCoilPlantTypeOfNum(0), ControlCompTypeNum(0), CompErrIndex(0), MaxColdWaterVolFlow(0.0), - MinColdWaterVolFlow(0.0), MinColdWaterFlow(0.0), ColdControlOffset(0.0), HCoilName_Index(0), HCoilType_Num(HCoil::Unassigned), - MaxHotWaterVolFlow(0.0), MinHotWaterVolFlow(0.0), MinHotWaterFlow(0.0), HotControlOffset(0.0), DesignHeatingCapacity(0.0), - AvailStatus(0), ATMixerIndex(0), ATMixerType(0), ATMixerPriNode(0), ATMixerSecNode(0), HVACSizingIndex(0), SpeedRatio(0.0), - FanOpModeSchedPtr(0), FanOpMode(1), ASHRAETempControl(false), QUnitOutNoHC(0.0), QUnitOutMaxH(0.0), QUnitOutMaxC(0.0), + CCoilType_Num(CCoil::Unassigned), CCoilPlantType(DataPlant::PlantEquipmentType::Invalid), ControlCompTypeNum(0), CompErrIndex(0), + MaxColdWaterVolFlow(0.0), MinColdWaterVolFlow(0.0), MinColdWaterFlow(0.0), ColdControlOffset(0.0), HCoilName_Index(0), + HCoilType_Num(HCoil::Unassigned), MaxHotWaterVolFlow(0.0), MinHotWaterVolFlow(0.0), MinHotWaterFlow(0.0), HotControlOffset(0.0), + DesignHeatingCapacity(0.0), AvailStatus(0), ATMixerIndex(0), ATMixerType(0), ATMixerPriNode(0), ATMixerSecNode(0), HVACSizingIndex(0), + SpeedRatio(0.0), FanOpModeSchedPtr(0), FanOpMode(1), ASHRAETempControl(false), QUnitOutNoHC(0.0), QUnitOutMaxH(0.0), QUnitOutMaxC(0.0), LimitErrCountH(0), LimitErrCountC(0), ConvgErrCountH(0), ConvgErrCountC(0), HeatPower(0.0), HeatEnergy(0.0), TotCoolPower(0.0), TotCoolEnergy(0.0), SensCoolPower(0.0), SensCoolEnergy(0.0), ElecPower(0.0), ElecEnergy(0.0), DesCoolingLoad(0.0), DesHeatingLoad(0.0), DesZoneCoolingLoad(0.0), DesZoneHeatingLoad(0.0), DSOAPtr(0), FirstPass(true), fanAvailSchIndex(0), MaxCoolCoilFluidFlow(0.0), diff --git a/src/EnergyPlus/FaultsManager.cc b/src/EnergyPlus/FaultsManager.cc index 96585c779e6..8536c72ffcb 100644 --- a/src/EnergyPlus/FaultsManager.cc +++ b/src/EnergyPlus/FaultsManager.cc @@ -1066,14 +1066,15 @@ namespace FaultsManager { state.dataCondenserLoopTowers->towers(TowerNum).FaultyTowerFoulingIndex = jFault_TowerFouling; // Check the faulty tower type - if (!UtilityRoutines::SameString(state.dataCondenserLoopTowers->towers(TowerNum).TowerType, - state.dataFaultsMgr->FaultsTowerFouling(jFault_TowerFouling).TowerType)) { + if (!UtilityRoutines::SameString( + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + state.dataFaultsMgr->FaultsTowerFouling(jFault_TowerFouling).TowerType)) { ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(4) + " = \"" + cAlphaArgs(4) + "\" not match the type of " + cAlphaFieldNames(5) + ". Tower type in the fault model is updated. "); state.dataFaultsMgr->FaultsTowerFouling(jFault_TowerFouling).TowerType = - state.dataCondenserLoopTowers->towers(TowerNum).TowerType; + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)]; } // Check the tower model @@ -1181,13 +1182,14 @@ namespace FaultsManager { state.dataCondenserLoopTowers->towers(TowerNum).FaultyCondenserSWTIndex = jFault_CondenserSWT; // Check the faulty tower type - if (!UtilityRoutines::SameString(state.dataCondenserLoopTowers->towers(TowerNum).TowerType, - state.dataFaultsMgr->FaultsCondenserSWTSensor(jFault_CondenserSWT).TowerType)) { + if (!UtilityRoutines::SameString( + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)], + state.dataFaultsMgr->FaultsCondenserSWTSensor(jFault_CondenserSWT).TowerType)) { ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(4) + " = \"" + cAlphaArgs(4) + "\" not match the type of " + cAlphaFieldNames(5) + ". Tower type is updated. "); state.dataFaultsMgr->FaultsCondenserSWTSensor(jFault_CondenserSWT).TowerType = - state.dataCondenserLoopTowers->towers(TowerNum).TowerType; + DataPlant::PlantEquipTypeNames[static_cast(state.dataCondenserLoopTowers->towers(TowerNum).TowerType)]; } } } @@ -1750,14 +1752,13 @@ namespace FaultsManager { state.dataFaultsMgr->ErrorsFound = true; } else { // Coil is found: check if the right type - if ((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) || - (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling)) { + if ((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || + (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling)) { // Link the Coil with the fault model state.dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingFlag = true; state.dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingIndex = jFault_FoulingCoil; - state.dataFaultsMgr->FouledCoils(jFault_FoulingCoil).FouledCoiledType = - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; + state.dataFaultsMgr->FouledCoils(jFault_FoulingCoil).FouledCoilType = state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; state.dataFaultsMgr->FouledCoils(jFault_FoulingCoil).FouledCoilNum = CoilNum; SetupOutputVariable(state, @@ -1770,7 +1771,7 @@ namespace FaultsManager { // Coil:Cooling:Water doesn't report UA because it's not variable, // but here, it's useful since we do change it via fouling, so report it - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { SetupOutputVariable(state, "Cooling Coil Total U Factor Times Area Value", OutputProcessor::Unit::W_K, diff --git a/src/EnergyPlus/FaultsManager.hh b/src/EnergyPlus/FaultsManager.hh index 960fcc3a93a..6c442f44fce 100644 --- a/src/EnergyPlus/FaultsManager.hh +++ b/src/EnergyPlus/FaultsManager.hh @@ -55,6 +55,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -218,8 +219,8 @@ namespace FaultsManager { struct FaultPropertiesFoulingCoil : public FaultProperties // Class for FaultModel:Fouling:Coil { // Members - std::string FouledCoilName; // The fouled coil name - int FouledCoiledType; // Type of coil that's fouled + std::string FouledCoilName; // The fouled coil name + DataPlant::PlantEquipmentType FouledCoilType; // Type of coil that's fouled int FouledCoilNum; // The "FouledUARated" implies having to use the Coil's UA, which could be autosized, so have to use this index FouledCoil FoulingInputMethod; // Coil fouling input method Real64 UAFouled; // Fouling coil UA under rating conditions @@ -230,8 +231,8 @@ namespace FaultsManager { // Default Constructor FaultPropertiesFoulingCoil() - : FouledCoilName(""), FouledCoiledType(0), FouledCoilNum(0), FoulingInputMethod(FouledCoil::Unassigned), UAFouled(0.0), Rfw(0.0), - Rfa(0.0), Aout(0.0), Aratio(0.0) + : FouledCoilName(""), FouledCoilType(DataPlant::PlantEquipmentType::Invalid), FouledCoilNum(0), + FoulingInputMethod(FouledCoil::Unassigned), UAFouled(0.0), Rfw(0.0), Rfa(0.0), Aout(0.0), Aratio(0.0) { } diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index f0036cab95e..fa386beef32 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -97,7 +97,7 @@ namespace EnergyPlus::FluidCoolers { std::string const cFluidCooler_SingleSpeed("FluidCooler:SingleSpeed"); std::string const cFluidCooler_TwoSpeed("FluidCooler:TwoSpeed"); -PlantComponent *FluidCoolerspecs::factory(EnergyPlusData &state, int objectType, std::string const &objectName) +PlantComponent *FluidCoolerspecs::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName) { if (state.dataFluidCoolers->GetFluidCoolerInputFlag) { GetFluidCoolerInput(state); @@ -105,7 +105,7 @@ PlantComponent *FluidCoolerspecs::factory(EnergyPlusData &state, int objectType, } // Now look for this particular fluid cooler in the list for (auto &fc : state.dataFluidCoolers->SimpleFluidCooler) { - if (fc.FluidCoolerType_Num == objectType && fc.Name == objectName) { + if (fc.FluidCoolerType == objectType && fc.Name == objectName) { return &fc; } } @@ -122,7 +122,7 @@ void FluidCoolerspecs::simulate(EnergyPlusData &state, bool const RunFlag) { this->initialize(state); - if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { + if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_SingleSpd) { this->calcSingleSpeed(state); } else { this->calcTwoSpeed(state); @@ -219,8 +219,7 @@ void GetFluidCoolerInput(EnergyPlusData &state) ErrorsFound); state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).Name = AlphArray(1); - state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerType = cCurrentModuleObject; - state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerType_Num = DataPlant::TypeOf_FluidCooler_SingleSpd; + state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerType = DataPlant::PlantEquipmentType::FluidCooler_SingleSpd; state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).indexInArray = FluidCoolerNum; state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerMassFlowRateMultiplier = 2.5; state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).WaterInletNodeNum = @@ -318,8 +317,7 @@ void GetFluidCoolerInput(EnergyPlusData &state) ErrorsFound); state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).Name = AlphArray(1); - state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerType = cCurrentModuleObject; - state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerType_Num = DataPlant::TypeOf_FluidCooler_TwoSpd; + state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerType = DataPlant::PlantEquipmentType::FluidCooler_TwoSpd; state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).indexInArray = FluidCoolerNum; state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).FluidCoolerMassFlowRateMultiplier = 2.5; state.dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).WaterInletNodeNum = @@ -764,7 +762,7 @@ void FluidCoolerspecs::oneTimeInit_new(EnergyPlusData &state) bool ErrorsFound = false; // Locate the tower on the plant loops for later usage PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->FluidCoolerType_Num, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); + state, this->Name, this->FluidCoolerType, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); if (ErrorsFound) { ShowFatalError(state, "InitFluidCooler: Program terminated due to previous condition(s)."); @@ -912,12 +910,18 @@ void FluidCoolerspecs::size(EnergyPlusData &state) } if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Design Water Flow Rate [m3/s]", + this->DesignWaterFlowRate); } } } else { @@ -1019,26 +1023,38 @@ void FluidCoolerspecs::size(EnergyPlusData &state) } } } - if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { + if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_SingleSpd) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Fan Power at Design Air Flow Rate [W]", + this->HighSpeedFanPower); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Fan Power at Design Air Flow Rate [W]", + this->HighSpeedFanPower); } } - } else if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { + } else if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_TwoSpd) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Fan Power at High Fan Speed [W]", + this->HighSpeedFanPower); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Fan Power at High Fan Speed [W]", + this->HighSpeedFanPower); } } } @@ -1096,25 +1112,38 @@ void FluidCoolerspecs::size(EnergyPlusData &state) } } } - if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { + if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_SingleSpd) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Design Air Flow Rate [m3/s]", + this->HighSpeedAirFlowRate); } } - } else if (this->FluidCoolerType == "FluidCooler:TwoSpeed") { + } else if (DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)] == "FluidCooler:TwoSpeed") { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Air Flow Rate at High Fan Speed [m3/s]", + this->HighSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Air Flow Rate at High Fan Speed [m3/s]", + this->HighSpeedAirFlowRate); } } } @@ -1208,35 +1237,35 @@ void FluidCoolerspecs::size(EnergyPlusData &state) tmpHighSpeedEvapFluidCoolerUA = 0.0; if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = tmpHighSpeedEvapFluidCoolerUA; } - if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { + if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_SingleSpd) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "U-factor Times Area Value at Design Air Flow Rate [W/K]", this->HighSpeedFluidCoolerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "Initial U-factor Times Area Value at Design Air Flow Rate [W/K]", this->HighSpeedFluidCoolerUA); } } - } else if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { + } else if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_TwoSpd) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "U-factor Times Area Value at High Fan Speed [W/K]", this->HighSpeedFluidCoolerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "Initial U-factor Times Area Value at High Fan Speed [W/K]", this->HighSpeedFluidCoolerUA); @@ -1323,35 +1352,35 @@ void FluidCoolerspecs::size(EnergyPlusData &state) } else { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = 0.0; } - if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { + if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_SingleSpd) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "Fluid cooler UA value at design air flow rate based on nominal capacity input [W/K]", this->HighSpeedFluidCoolerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "Initial Fluid cooler UA value at design air flow rate based on nominal capacity input [W/K]", this->HighSpeedFluidCoolerUA); } } - } else if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { + } else if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_TwoSpd) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "Fluid cooler UA value at high fan speed based on nominal capacity input [W/K]", this->HighSpeedFluidCoolerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "Initial Fluid cooler UA value at high fan speed based on nominal capacity input [W/K]", this->HighSpeedFluidCoolerUA); @@ -1363,47 +1392,74 @@ void FluidCoolerspecs::size(EnergyPlusData &state) if (this->LowSpeedAirFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedAirFlowRate = this->LowSpeedAirFlowRateSizingFactor * this->HighSpeedAirFlowRate; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Air Flow Rate at Low Fan Speed [m3/s]", this->LowSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Air Flow Rate at Low Fan Speed [m3/s]", + this->LowSpeedAirFlowRate); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial Air Flow Rate at Low Fan Speed [m3/s]", this->LowSpeedAirFlowRate); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Air Flow Rate at Low Fan Speed [m3/s]", + this->LowSpeedAirFlowRate); } } if (this->LowSpeedFanPowerWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedFanPower = this->LowSpeedFanPowerSizingFactor * this->HighSpeedFanPower; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Fan Power at Low Fan Speed [W]", + this->LowSpeedFanPower); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Fan Power at Low Fan Speed [W]", + this->LowSpeedFanPower); } } if (this->LowSpeedFluidCoolerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedFluidCoolerUA = this->LowSpeedFluidCoolerUASizingFactor * this->HighSpeedFluidCoolerUA; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "U-factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedFluidCoolerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "U-factor Times Area Value at Low Fan Speed [W/K]", + this->LowSpeedFluidCoolerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial U-factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedFluidCoolerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial U-factor Times Area Value at Low Fan Speed [W/K]", + this->LowSpeedFluidCoolerUA); } } - if (this->PerformanceInputMethod_Num == PerfInputMethod::NOMINAL_CAPACITY && this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { + if (this->PerformanceInputMethod_Num == PerfInputMethod::NOMINAL_CAPACITY && + this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_TwoSpd) { if (this->FluidCoolerLowSpeedNomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FluidCoolerLowSpeedNomCap = this->FluidCoolerLowSpeedNomCapSizingFactor * this->FluidCoolerNominalCapacity; if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Low Fan Speed Nominal Capacity [W]", this->FluidCoolerLowSpeedNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Low Fan Speed Nominal Capacity [W]", + this->FluidCoolerLowSpeedNomCap); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "Initial Low Fan Speed Nominal Capacity [W]", this->FluidCoolerLowSpeedNomCap); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "Initial Low Fan Speed Nominal Capacity [W]", + this->FluidCoolerLowSpeedNomCap); } } @@ -1474,12 +1530,15 @@ void FluidCoolerspecs::size(EnergyPlusData &state) } if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (state.dataPlnt->PlantFinalSizesOkayToReport) { - BaseSizer::reportSizerOutput( - state, this->FluidCoolerType, this->Name, "U-factor Times Area Value at Low Fan Speed [W/C]", this->LowSpeedFluidCoolerUA); + BaseSizer::reportSizerOutput(state, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name, + "U-factor Times Area Value at Low Fan Speed [W/C]", + this->LowSpeedFluidCoolerUA); } if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, - this->FluidCoolerType, + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name, "Initial U-factor Times Area Value at Low Fan Speed [W/C]", this->LowSpeedFluidCoolerUA); @@ -1492,11 +1551,12 @@ void FluidCoolerspecs::size(EnergyPlusData &state) if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report equipName = this->Name; - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, this->FluidCoolerType); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchMechType, equipName, DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)]); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, equipName, this->FluidCoolerNominalCapacity); } - if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd && state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (this->FluidCoolerType == DataPlant::PlantEquipmentType::FluidCooler_TwoSpd && state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesignWaterFlowRate > 0.0) { if (this->HighSpeedAirFlowRate <= this->LowSpeedAirFlowRate) { ShowSevereError(state, @@ -1573,9 +1633,9 @@ void FluidCoolerspecs::calcSingleSpeed(EnergyPlusData &state) this->OutletWaterTemp = state.dataLoopNodes->Node(waterInletNode).Temp; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } @@ -1679,16 +1739,16 @@ void FluidCoolerspecs::calcTwoSpeed(EnergyPlusData &state) this->OutletWaterTemp = state.dataLoopNodes->Node(waterInletNode).Temp; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // set local variable for fluid cooler @@ -1868,7 +1928,7 @@ void FluidCoolerspecs::update(EnergyPlusData &state) auto &waterOutletNode = this->WaterOutletNodeNum; state.dataLoopNodes->Node(waterOutletNode).Temp = this->OutletWaterTemp; - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked || state.dataGlobal->WarmupFlag) return; @@ -1876,7 +1936,7 @@ void FluidCoolerspecs::update(EnergyPlusData &state) if (state.dataLoopNodes->Node(waterOutletNode).MassFlowRate > this->DesWaterMassFlowRate * this->FluidCoolerMassFlowRateMultiplier) { ++this->HighMassFlowErrorCount; if (this->HighMassFlowErrorCount < 2) { - ShowWarningError(state, this->FluidCoolerType + " \"" + this->Name + "\""); + ShowWarningError(state, format("{} \"{}\"", DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name)); ShowContinueError(state, " Condenser Loop Mass Flow Rate is much greater than the fluid coolers design mass flow rate."); ShowContinueError(state, format(" Condenser Loop Mass Flow Rate = {:.6T}", state.dataLoopNodes->Node(waterOutletNode).MassFlowRate)); ShowContinueError(state, format(" Fluid Cooler Design Mass Flow Rate = {:.6T}", this->DesWaterMassFlowRate)); @@ -1884,8 +1944,9 @@ void FluidCoolerspecs::update(EnergyPlusData &state) } else { ShowRecurringWarningErrorAtEnd( state, - this->FluidCoolerType + " \"" + this->Name + - "\" Condenser Loop Mass Flow Rate is much greater than the fluid coolers design mass flow rate error continues...", + format("{} \"{}\" Condenser Loop Mass Flow Rate is much greater than the fluid coolers design mass flow rate. Error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name), this->HighMassFlowErrorIndex, state.dataLoopNodes->Node(waterOutletNode).MassFlowRate, state.dataLoopNodes->Node(waterOutletNode).MassFlowRate); @@ -1898,7 +1959,7 @@ void FluidCoolerspecs::update(EnergyPlusData &state) ++this->OutletWaterTempErrorCount; if (this->OutletWaterTempErrorCount < 2) { - ShowWarningError(state, format("{} \"{}\"", this->FluidCoolerType, this->Name)); + ShowWarningError(state, format("{} \"{}\"", DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name)); ShowContinueError(state, format(" Fluid cooler water outlet temperature ({.2F} C) is below the specified minimum condenser loop temp of {.2F} C", this->OutletWaterTemp, @@ -1907,8 +1968,9 @@ void FluidCoolerspecs::update(EnergyPlusData &state) } else { ShowRecurringWarningErrorAtEnd( state, - this->FluidCoolerType + " \"" + this->Name + - "\" Fluid cooler water outlet temperature is below the specified minimum condenser loop temp error continues...", + format("{} \"{}\" Fluid cooler water outlet temperature is below the specified minimum condenser loop temp. Error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name), this->OutletWaterTempErrorIndex, this->OutletWaterTemp, this->OutletWaterTemp); @@ -1919,14 +1981,15 @@ void FluidCoolerspecs::update(EnergyPlusData &state) if (this->WaterMassFlowRate > 0.0 && this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { ++this->SmallWaterMassFlowErrorCount; if (this->SmallWaterMassFlowErrorCount < 2) { - ShowWarningError(state, this->FluidCoolerType + " \"" + this->Name + "\""); + ShowWarningError(state, format("{} \"{}\"", DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], this->Name)); ShowContinueError(state, " Fluid cooler water mass flow rate near zero."); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, format("Actual Mass flow = {:.2T}", this->WaterMassFlowRate)); } else { ShowRecurringWarningErrorAtEnd(state, - this->FluidCoolerType + " \"" + this->Name + - "\" Fluid cooler water mass flow rate near zero error continues...", + format("{} \"{}\" Fluid cooler water mass flow rate is near zero. Error continues...", + DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)], + this->Name), this->SmallWaterMassFlowErrorIndex, this->WaterMassFlowRate, this->WaterMassFlowRate); diff --git a/src/EnergyPlus/FluidCoolers.hh b/src/EnergyPlus/FluidCoolers.hh index 3ff86724f68..b815237b2f9 100644 --- a/src/EnergyPlus/FluidCoolers.hh +++ b/src/EnergyPlus/FluidCoolers.hh @@ -55,6 +55,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -70,9 +71,8 @@ namespace FluidCoolers { struct FluidCoolerspecs : PlantComponent { // Members - std::string Name; // User identifier - std::string FluidCoolerType; // Type of fluid cooler - int FluidCoolerType_Num; + std::string Name; // User identifier + DataPlant::PlantEquipmentType FluidCoolerType; PerfInputMethod PerformanceInputMethod_Num; bool Available; // need an array of logicals--load identifiers of available equipment bool ON; // Simulate the machine at it's operating part load ratio @@ -144,8 +144,8 @@ namespace FluidCoolers { // Default Constructor FluidCoolerspecs() - : FluidCoolerType_Num(0), PerformanceInputMethod_Num(PerfInputMethod::NOMINAL_CAPACITY), Available(true), ON(true), - DesignWaterFlowRate(0.0), DesignWaterFlowRateWasAutoSized(false), DesWaterMassFlowRate(0.0), HighSpeedAirFlowRate(0.0), + : FluidCoolerType(DataPlant::PlantEquipmentType::Invalid), PerformanceInputMethod_Num(PerfInputMethod::NOMINAL_CAPACITY), Available(true), + ON(true), DesignWaterFlowRate(0.0), DesignWaterFlowRateWasAutoSized(false), DesWaterMassFlowRate(0.0), HighSpeedAirFlowRate(0.0), HighSpeedAirFlowRateWasAutoSized(false), HighSpeedFanPower(0.0), HighSpeedFanPowerWasAutoSized(false), HighSpeedFluidCoolerUA(0.0), HighSpeedFluidCoolerUAWasAutoSized(false), LowSpeedAirFlowRate(0.0), LowSpeedAirFlowRateWasAutoSized(false), LowSpeedAirFlowRateSizingFactor(0.0), LowSpeedFanPower(0.0), LowSpeedFanPowerWasAutoSized(false), LowSpeedFanPowerSizingFactor(0.0), @@ -208,7 +208,7 @@ namespace FluidCoolers { void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation) override; - static PlantComponent *factory(EnergyPlusData &state, int typeOf, std::string const &objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType typeOf, std::string const &objectName); }; void GetFluidCoolerInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index 8218b3232e5..50b27344002 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -808,7 +808,7 @@ namespace FuelCellElectricGenerator { int thisFuelCell = UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameExhaustHX); if (thisFuelCell > 0) { - state.dataFuelCellElectGen->FuelCell(thisFuelCell).TypeOf = DataPlant::TypeOf_Generator_FCExhaust; + state.dataFuelCellElectGen->FuelCell(thisFuelCell).Type = DataPlant::PlantEquipmentType::Generator_FCExhaust; state.dataFuelCellElectGen->FuelCell(thisFuelCell).ExhaustHX.Name = AlphArray(1); state.dataFuelCellElectGen->FuelCell(thisFuelCell).ExhaustHX.WaterInNodeName = AlphArray(2); state.dataFuelCellElectGen->FuelCell(thisFuelCell).ExhaustHX.WaterOutNodeName = AlphArray(3); @@ -1039,7 +1039,7 @@ namespace FuelCellElectricGenerator { UtilityRoutines::FindItemInList(AlphArray(1), state.dataFuelCellElectGen->FuelCell, &FCDataStruct::NameStackCooler); if (thisFuelCell > 0) { - state.dataFuelCellElectGen->FuelCell(thisFuelCell).TypeOf = DataPlant::TypeOf_Generator_FCStackCooler; + state.dataFuelCellElectGen->FuelCell(thisFuelCell).Type = DataPlant::PlantEquipmentType::Generator_FCStackCooler; state.dataFuelCellElectGen->FuelCell(thisFuelCell).StackCooler.Name = AlphArray(1); state.dataFuelCellElectGen->FuelCell(thisFuelCell).StackCooler.WaterInNodeName = AlphArray(2); @@ -3349,11 +3349,11 @@ namespace FuelCellElectricGenerator { [[maybe_unused]] Real64 &CurLoad, [[maybe_unused]] bool RunFlag) { - if (this->TypeOf == DataPlant::TypeOf_Generator_FCStackCooler) { + if (this->Type == DataPlant::PlantEquipmentType::Generator_FCStackCooler) { PlantUtilities::UpdateComponentHeatRecoverySide(state, this->CWLoopNum, this->CWLoopSideNum, - DataPlant::TypeOf_Generator_FCStackCooler, + DataPlant::PlantEquipmentType::Generator_FCStackCooler, this->StackCooler.WaterInNode, this->StackCooler.WaterOutNode, this->Report.qHX, @@ -3361,11 +3361,11 @@ namespace FuelCellElectricGenerator { this->Report.HeatRecOutletTemp, this->Report.HeatRecMdot, FirstHVACIteration); - } else if (this->TypeOf == DataPlant::TypeOf_Generator_FCExhaust) { + } else if (this->Type == DataPlant::PlantEquipmentType::Generator_FCExhaust) { PlantUtilities::UpdateComponentHeatRecoverySide(state, this->CWLoopNum, this->CWLoopSideNum, - DataPlant::TypeOf_Generator_FCExhaust, + DataPlant::PlantEquipmentType::Generator_FCExhaust, this->ExhaustHX.WaterInNode, this->ExhaustHX.WaterOutNode, this->ExhaustHX.qHX, @@ -3733,7 +3733,7 @@ namespace FuelCellElectricGenerator { PlantUtilities::ScanPlantLoopsForObject(state, this->NameExhaustHX, - DataPlant::TypeOf_Generator_FCExhaust, + DataPlant::PlantEquipmentType::Generator_FCExhaust, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, diff --git a/src/EnergyPlus/FuelCellElectricGenerator.hh b/src/EnergyPlus/FuelCellElectricGenerator.hh index e1052e48077..8d3fd63e3df 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.hh +++ b/src/EnergyPlus/FuelCellElectricGenerator.hh @@ -55,6 +55,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -505,7 +506,7 @@ namespace FuelCellElectricGenerator { { // Members // from input data and nested types for subsystems - int TypeOf; + DataPlant::PlantEquipmentType Type; std::string Name; // user identifier std::string NameFCPM; // name of FC Power Module FCPowerModuleStruct FCPM; // data for Power Module @@ -547,9 +548,10 @@ namespace FuelCellElectricGenerator { // Default Constructor FCDataStruct() - : TypeOf(0), FuelSupNum(0), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), ACPowerGen(0.0), QconvZone(0.0), QradZone(0.0), - DynamicsControlID(0), TimeElapsed(0.0), MyEnvrnFlag_Init(true), MyWarmupFlag_Init(false), MyPlantScanFlag_Init(true), - SolverErr_Type1_Iter(0), SolverErr_Type1_IterIndex(0), SolverErr_Type2_Iter(0), SolverErr_Type2_IterIndex(0) + : Type(DataPlant::PlantEquipmentType::Invalid), FuelSupNum(0), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), + ACPowerGen(0.0), QconvZone(0.0), QradZone(0.0), DynamicsControlID(0), TimeElapsed(0.0), MyEnvrnFlag_Init(true), + MyWarmupFlag_Init(false), MyPlantScanFlag_Init(true), SolverErr_Type1_Iter(0), SolverErr_Type1_IterIndex(0), SolverErr_Type2_Iter(0), + SolverErr_Type2_IterIndex(0) { } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 6b42cc57873..4455488da66 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -5207,8 +5207,6 @@ namespace Furnaces { // REFERENCES: // Using/Aliasing - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; using Fans::GetFanDesignVolumeFlowRate; using Fans::GetFanSpeedRatioCurveIndex; @@ -5385,7 +5383,7 @@ namespace Furnaces { errFlag = false; ScanPlantLoopsForObject(state, state.dataFurnaces->Furnace(FurnaceNum).HeatingCoilName, - TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, state.dataFurnaces->Furnace(FurnaceNum).LoopNum, state.dataFurnaces->Furnace(FurnaceNum).LoopSide, state.dataFurnaces->Furnace(FurnaceNum).BranchNum, @@ -5414,7 +5412,7 @@ namespace Furnaces { errFlag = false; ScanPlantLoopsForObject(state, state.dataFurnaces->Furnace(FurnaceNum).HeatingCoilName, - TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, state.dataFurnaces->Furnace(FurnaceNum).LoopNum, state.dataFurnaces->Furnace(FurnaceNum).LoopSide, state.dataFurnaces->Furnace(FurnaceNum).BranchNum, @@ -5459,7 +5457,7 @@ namespace Furnaces { errFlag = false; ScanPlantLoopsForObject(state, state.dataFurnaces->Furnace(FurnaceNum).SuppHeatCoilName, - TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, state.dataFurnaces->Furnace(FurnaceNum).LoopNumSupp, state.dataFurnaces->Furnace(FurnaceNum).LoopSideSupp, state.dataFurnaces->Furnace(FurnaceNum).BranchNumSupp, @@ -5487,7 +5485,7 @@ namespace Furnaces { errFlag = false; ScanPlantLoopsForObject(state, state.dataFurnaces->Furnace(FurnaceNum).SuppHeatCoilName, - TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, state.dataFurnaces->Furnace(FurnaceNum).LoopNumSupp, state.dataFurnaces->Furnace(FurnaceNum).LoopSideSupp, state.dataFurnaces->Furnace(FurnaceNum).BranchNumSupp, diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 41c7f790160..ba61b92f3c4 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -751,7 +751,7 @@ void CheckThisZoneForSizing(EnergyPlusData &state, } void ValidateComponent(EnergyPlusData &state, - std::string const &CompType, // Component Type (e.g. Chiller:Electric) + std::string_view CompType, // Component Type (e.g. Chiller:Electric) std::string const &CompName, // Component Name (e.g. Big Chiller) bool &IsNotOK, // .TRUE. if this component pair is invalid std::string const &CallString // Context of this pair -- for error message @@ -781,15 +781,15 @@ void ValidateComponent(EnergyPlusData &state, IsNotOK = false; - ItemNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, CompType, CompName); + ItemNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, std::string{CompType}, CompName); if (ItemNum < 0) { - ShowSevereError(state, "During " + CallString + " Input, Invalid Component Type input=" + CompType); + ShowSevereError(state, format("During {} Input, Invalid Component Type input={}", CallString, CompType)); ShowContinueError(state, "Component name=" + CompName); IsNotOK = true; } else if (ItemNum == 0) { ShowSevereError(state, "During " + CallString + " Input, Invalid Component Name input=" + CompName); - ShowContinueError(state, "Component type=" + CompType); + ShowContinueError(state, format("Component type={}", CompType)); IsNotOK = true; } } diff --git a/src/EnergyPlus/GeneralRoutines.hh b/src/EnergyPlus/GeneralRoutines.hh index 6e0ba382142..82e89f5ffd7 100644 --- a/src/EnergyPlus/GeneralRoutines.hh +++ b/src/EnergyPlus/GeneralRoutines.hh @@ -163,7 +163,7 @@ void CheckThisZoneForSizing(EnergyPlusData &state, bool &ZoneWasSized); void ValidateComponent(EnergyPlusData &state, - std::string const &CompType, // Component Type (e.g. Chiller:Electric) + std::string_view CompType, // Component Type (e.g. Chiller:Electric) std::string const &CompName, // Component Name (e.g. Big Chiller) bool &IsNotOK, // .TRUE. if this component pair is invalid std::string const &CallString // Context of this pair -- for error message diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index bbc101d54a3..b4b17847d88 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -821,19 +821,19 @@ void GLHEBase::simulate(EnergyPlusData &state, //****************************************************************************** -PlantComponent *GLHEBase::factory(EnergyPlusData &state, int const objectType, std::string const &objectName) +PlantComponent *GLHEBase::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName) { if (state.dataGroundHeatExchanger->GetInput) { GetGroundHeatExchangerInput(state); state.dataGroundHeatExchanger->GetInput = false; } - if (objectType == DataPlant::TypeOf_GrndHtExchgSystem) { + if (objectType == DataPlant::PlantEquipmentType::GrndHtExchgSystem) { for (auto &ghx : state.dataGroundHeatExchanger->verticalGLHE) { if (ghx.name == objectName) { return &ghx; } } - } else if (objectType == DataPlant::TypeOf_GrndHtExchgSlinky) { + } else if (objectType == DataPlant::PlantEquipmentType::GrndHtExchgSlinky) { for (auto &ghx : state.dataGroundHeatExchanger->slinkyGLHE) { if (ghx.name == objectName) { return &ghx; @@ -3158,13 +3158,23 @@ void GLHEVert::initEnvironment(EnergyPlusData &state, [[maybe_unused]] Real64 co void GLHEVert::oneTimeInit_new(EnergyPlusData &state) { - using DataPlant::TypeOf_GrndHtExchgSystem; using PlantUtilities::ScanPlantLoopsForObject; // Locate the hx on the plant loops for later usage bool errFlag = false; - ScanPlantLoopsForObject( - state, this->name, TypeOf_GrndHtExchgSystem, this->loopNum, this->loopSideNum, this->branchNum, this->compNum, errFlag, _, _, _, _, _); + ScanPlantLoopsForObject(state, + this->name, + DataPlant::PlantEquipmentType::GrndHtExchgSystem, + this->loopNum, + this->loopSideNum, + this->branchNum, + this->compNum, + errFlag, + _, + _, + _, + _, + _); if (errFlag) { ShowFatalError(state, "initGLHESimVars: Program terminated due to previous condition(s)."); } @@ -3244,13 +3254,23 @@ void GLHESlinky::initEnvironment(EnergyPlusData &state, Real64 const &CurTime) void GLHESlinky::oneTimeInit_new(EnergyPlusData &state) { - using DataPlant::TypeOf_GrndHtExchgSlinky; using PlantUtilities::ScanPlantLoopsForObject; // Locate the hx on the plant loops for later usage bool errFlag = false; - ScanPlantLoopsForObject( - state, this->name, TypeOf_GrndHtExchgSlinky, this->loopNum, this->loopSideNum, this->branchNum, this->compNum, errFlag, _, _, _, _, _); + ScanPlantLoopsForObject(state, + this->name, + DataPlant::PlantEquipmentType::GrndHtExchgSlinky, + this->loopNum, + this->loopSideNum, + this->branchNum, + this->compNum, + errFlag, + _, + _, + _, + _, + _); if (errFlag) { ShowFatalError(state, "initGLHESimVars: Program terminated due to previous condition(s)."); } diff --git a/src/EnergyPlus/GroundHeatExchangers.hh b/src/EnergyPlus/GroundHeatExchangers.hh index 671b6a59fd7..d315dbbea63 100644 --- a/src/EnergyPlus/GroundHeatExchangers.hh +++ b/src/EnergyPlus/GroundHeatExchangers.hh @@ -59,6 +59,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -300,7 +301,7 @@ namespace GroundHeatExchangers { Real64 &CurLoad, bool RunFlag) override; - static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string const &objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName); virtual Real64 getGFunc(Real64) = 0; diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index b51b11ee965..9db55ca92e6 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -299,7 +299,7 @@ void ManageControllers(EnergyPlusData &state, if (state.dataPlnt->PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum) .LoopSide(ControllerProps(ControlNum).ActuatedNodePlantLoopSide) - .FlowLock == DataPlant::iFlowLock::Locked) { + .FlowLock == DataPlant::FlowLock::Locked) { // plant is rigid so controller cannot change anything. // Update the current Controller to the outlet nodes UpdateController(state, ControlNum); @@ -710,14 +710,14 @@ void GetControllerInput(EnergyPlusData &state) // check that actuator nodes are matched by a water coil inlet node for (Num = 1; Num <= NumSimpleControllers; ++Num) { - int iNodeType; - CheckActuatorNode(state, ControllerProps(Num).ActuatedNode, iNodeType, ActuatorNodeNotFound); + DataPlant::PlantEquipmentType WaterCoilType{}; + CheckActuatorNode(state, ControllerProps(Num).ActuatedNode, WaterCoilType, ActuatorNodeNotFound); if (ActuatorNodeNotFound) { ErrorsFound = true; ShowSevereError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + ControllerProps(Num).ControllerName + "\":"); ShowContinueError(state, "...the actuator node must also be a water inlet node of a water coil"); } else { // Node found, check type and action - if (iNodeType == DataPlant::TypeOf_CoilWaterCooling) { + if (WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { if (ControllerProps(Num).Action == ControllerAction::NoAction) { ControllerProps(Num).Action = ControllerAction::ReverseAction; } else if (ControllerProps(Num).Action == ControllerAction::NormalAction) { @@ -726,7 +726,7 @@ void GetControllerInput(EnergyPlusData &state) ShowContinueError(state, "...overriding user input action with Reverse Action."); ControllerProps(Num).Action = ControllerAction::ReverseAction; } - } else if (iNodeType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + } else if (WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { if (ControllerProps(Num).Action == ControllerAction::NoAction) { ControllerProps(Num).Action = ControllerAction::NormalAction; } else if (ControllerProps(Num).Action == ControllerAction::ReverseAction) { diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index a57734ff1c0..fcc1ec7a176 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -509,7 +509,6 @@ namespace HVACCooledBeam { // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::TypeOf_CooledBeamAirTerminal; using DataZoneEquipment::CheckZoneEquipmentList; using FluidProperties::GetDensityGlycol; using PlantUtilities::InitComponentNodes; @@ -539,7 +538,7 @@ namespace HVACCooledBeam { errFlag = false; ScanPlantLoopsForObject(state, CoolBeam(CBNum).Name, - TypeOf_CooledBeamAirTerminal, + DataPlant::PlantEquipmentType::CooledBeamAirTerminal, CoolBeam(CBNum).CWLoopNum, CoolBeam(CBNum).CWLoopSideNum, CoolBeam(CBNum).CWBranchNum, diff --git a/src/EnergyPlus/HVACFourPipeBeam.cc b/src/EnergyPlus/HVACFourPipeBeam.cc index c07456d581d..9bf1bd160fa 100644 --- a/src/EnergyPlus/HVACFourPipeBeam.cc +++ b/src/EnergyPlus/HVACFourPipeBeam.cc @@ -559,7 +559,6 @@ namespace FourPipeBeam { { // Using - using DataPlant::TypeOf_FourPipeBeamAirTerminal; using DataZoneEquipment::CheckZoneEquipmentList; using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; @@ -575,7 +574,7 @@ namespace FourPipeBeam { if (this->beamCoolingPresent) { ScanPlantLoopsForObject(state, this->name, - TypeOf_FourPipeBeamAirTerminal, + DataPlant::PlantEquipmentType::FourPipeBeamAirTerminal, this->cWLocation.loopNum, this->cWLocation.loopSideNum, this->cWLocation.branchNum, @@ -593,7 +592,7 @@ namespace FourPipeBeam { if (this->beamHeatingPresent) { ScanPlantLoopsForObject(state, this->name, - TypeOf_FourPipeBeamAirTerminal, + DataPlant::PlantEquipmentType::FourPipeBeamAirTerminal, this->hWLocation.loopNum, this->hWLocation.loopSideNum, this->hWLocation.branchNum, diff --git a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc index 3601b63f236..16967a07519 100644 --- a/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc +++ b/src/EnergyPlus/HVACHXAssistedCoolingCoil.cc @@ -1396,7 +1396,7 @@ namespace HVACHXAssistedCoolingCoil { } int GetCoilInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1436,7 +1436,7 @@ namespace HVACHXAssistedCoolingCoil { if (WhichCoil != 0) { NodeNumber = state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).HXAssistedCoilInletNodeNum; } else { - ShowSevereError(state, "GetCoilInletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilInletNode: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } @@ -1514,7 +1514,7 @@ namespace HVACHXAssistedCoolingCoil { } int GetCoilOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1554,7 +1554,7 @@ namespace HVACHXAssistedCoolingCoil { if (WhichCoil != 0) { NodeNumber = state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).HXAssistedCoilOutletNodeNum; } else { - ShowSevereError(state, "GetCoilOutletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilOutletNode: Could not find Coil, Type=\"{}\" Name=\"{}", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } @@ -1612,7 +1612,7 @@ namespace HVACHXAssistedCoolingCoil { } std::string GetHXDXCoilName(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1652,7 +1652,7 @@ namespace HVACHXAssistedCoolingCoil { if (WhichCoil != 0) { DXCoilName = state.dataHVACAssistedCC->HXAssistedCoil(WhichCoil).CoolingCoilName; } else { - ShowSevereError(state, "Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; DXCoilName = ""; } @@ -1806,7 +1806,7 @@ namespace HVACHXAssistedCoolingCoil { } Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1854,22 +1854,19 @@ namespace HVACHXAssistedCoolingCoil { } } else if (UtilityRoutines::SameString(CoilType, "CoilSystem:Cooling:Water:HeatExchangerAssisted")) { if (WhichCoil != 0) { - MaxWaterFlowRate = GetWaterCoilMaxFlowRate(state, - cAllCoilTypes(GetCoilObjectTypeNum(state, CoilType, CoilName, ErrorsFound)), - GetHXDXCoilName(state, CoilType, CoilName, ErrorsFound), - ErrorsFound); + MaxWaterFlowRate = GetWaterCoilMaxFlowRate(state, CoilType, GetHXDXCoilName(state, CoilType, CoilName, ErrorsFound), ErrorsFound); } } else { WhichCoil = 0; } if (WhichCoil == 0) { - ShowSevereError(state, "GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; MaxWaterFlowRate = -1000.0; } } else { - ShowSevereError(state, "GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; MaxWaterFlowRate = -1000.0; } diff --git a/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh b/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh index 7287e84bf58..62c0e100d00 100644 --- a/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh +++ b/src/EnergyPlus/HVACHXAssistedCoolingCoil.hh @@ -162,7 +162,7 @@ namespace HVACHXAssistedCoolingCoil { ); int GetCoilInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -174,7 +174,7 @@ namespace HVACHXAssistedCoolingCoil { ); int GetCoilOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -186,7 +186,7 @@ namespace HVACHXAssistedCoolingCoil { ); std::string GetHXDXCoilName(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -212,7 +212,7 @@ namespace HVACHXAssistedCoolingCoil { ); Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/HVACInterfaceManager.cc b/src/EnergyPlus/HVACInterfaceManager.cc index 13ccd812baa..92f5c3a50b6 100644 --- a/src/EnergyPlus/HVACInterfaceManager.cc +++ b/src/EnergyPlus/HVACInterfaceManager.cc @@ -397,7 +397,7 @@ void UpdatePlantLoopInterface(EnergyPlusData &state, int const ThisLoopSideOutletNode, // Node number for the inlet of the side that needs the outlet node data int const OtherLoopSideInletNode, // Node number for the outlet of the side of the loop just simulated bool &OutOfToleranceFlag, // True when the other side of the loop need to be (re)simulated - DataPlant::iCommonPipeType const CommonPipeType) + DataPlant::CommonPipeType const CommonPipeType) { // SUBROUTINE INFORMATION: @@ -460,7 +460,7 @@ void UpdatePlantLoopInterface(EnergyPlusData &state, // update the temperatures and flow rates auto &flow_demand_to_supply_tol(convergence.PlantFlowDemandToSupplyTolValue); auto &flow_supply_to_demand_tol(convergence.PlantFlowSupplyToDemandTolValue); - if (CommonPipeType == DataPlant::iCommonPipeType::Single || CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { + if (CommonPipeType == DataPlant::CommonPipeType::Single || CommonPipeType == DataPlant::CommonPipeType::TwoWay) { // update the temperature UpdateCommonPipe(state, LoopNum, ThisLoopSideNum, CommonPipeType, MixedOutletTemp); state.dataLoopNodes->Node(OtherLoopSideInletNode).Temp = MixedOutletTemp; @@ -696,7 +696,7 @@ void UpdateHalfLoopInletTemp(EnergyPlusData &state, int const LoopNum, int const } void UpdateCommonPipe( - EnergyPlusData &state, int const LoopNum, int const TankInletLoopSide, DataPlant::iCommonPipeType const CommonPipeType, Real64 &MixedOutletTemp) + EnergyPlusData &state, int const LoopNum, int const TankInletLoopSide, DataPlant::CommonPipeType const CommonPipeType, Real64 &MixedOutletTemp) { // SUBROUTINE INFORMATION: @@ -825,10 +825,10 @@ void UpdateCommonPipe( } } // Common Pipe Simulation - if (CommonPipeType == DataPlant::iCommonPipeType::Single) { + if (CommonPipeType == DataPlant::CommonPipeType::Single) { ManageSingleCommonPipe(state, LoopNum, TankOutletLoopSide, TankAverageTemp, MixedOutletTemp); // 2-way (controlled) common pipe simulation - } else if (CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { + } else if (CommonPipeType == DataPlant::CommonPipeType::TwoWay) { ManageTwoWayCommonPipe(state, LoopNum, TankOutletLoopSide, TankAverageTemp); MixedOutletTemp = state.dataLoopNodes->Node(TankOutletNode).Temp; @@ -1243,16 +1243,16 @@ void SetupCommonPipes(EnergyPlusData &state) for (CurLoopNum = 1; CurLoopNum <= state.dataPlnt->TotNumLoops; ++CurLoopNum) { // reference to easily lookup the first item once - auto &first_demand_component_typenum(state.dataPlnt->PlantLoop(CurLoopNum).LoopSide(DemandSide).Branch(1).Comp(1).TypeOf_Num); - auto &first_supply_component_typenum(state.dataPlnt->PlantLoop(CurLoopNum).LoopSide(SupplySide).Branch(1).Comp(1).TypeOf_Num); + auto &first_demand_component_type(state.dataPlnt->PlantLoop(CurLoopNum).LoopSide(DemandSide).Branch(1).Comp(1).Type); + auto &first_supply_component_type(state.dataPlnt->PlantLoop(CurLoopNum).LoopSide(SupplySide).Branch(1).Comp(1).Type); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(CurLoopNum).CommonPipeType); - if (SELECT_CASE_var == DataPlant::iCommonPipeType::No) { - PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::iCommonPipeType::No; + if (SELECT_CASE_var == DataPlant::CommonPipeType::No) { + PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::CommonPipeType::No; - } else if (SELECT_CASE_var == DataPlant::iCommonPipeType::Single) { // Uncontrolled ('single') common pipe - PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::iCommonPipeType::Single; + } else if (SELECT_CASE_var == DataPlant::CommonPipeType::Single) { // Uncontrolled ('single') common pipe + PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::CommonPipeType::Single; SetupOutputVariable(state, "Plant Common Pipe Mass Flow Rate", OutputProcessor::Unit::kg_s, @@ -1275,7 +1275,7 @@ void SetupCommonPipes(EnergyPlusData &state) OutputProcessor::SOVStoreType::Average, state.dataPlnt->PlantLoop(CurLoopNum).Name); - if (first_supply_component_typenum == TypeOf_PumpVariableSpeed) { + if (first_supply_component_type == PlantEquipmentType::PumpVariableSpeed) { // If/when the model supports variable-pumping primary, this can be removed. ShowWarningError(state, "SetupCommonPipes: detected variable speed pump on supply inlet of CommonPipe plant loop"); ShowContinueError(state, "Occurs on plant loop name = " + state.dataPlnt->PlantLoop(CurLoopNum).Name); @@ -1283,8 +1283,8 @@ void SetupCommonPipes(EnergyPlusData &state) ShowContinueError(state, "The primary/supply side will operate as if constant speed, and the simulation continues"); } - } else if (SELECT_CASE_var == DataPlant::iCommonPipeType::TwoWay) { // Controlled ('two-way') common pipe - PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::iCommonPipeType::TwoWay; + } else if (SELECT_CASE_var == DataPlant::CommonPipeType::TwoWay) { // Controlled ('two-way') common pipe + PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::CommonPipeType::TwoWay; SetupOutputVariable(state, "Plant Common Pipe Primary Mass Flow Rate", OutputProcessor::Unit::kg_s, @@ -1315,9 +1315,9 @@ void SetupCommonPipes(EnergyPlusData &state) state.dataPlnt->PlantLoop(CurLoopNum).Name); // check type of pump on supply side inlet - if (first_supply_component_typenum == TypeOf_PumpConstantSpeed) { + if (first_supply_component_type == PlantEquipmentType::PumpConstantSpeed) { PlantCommonPipe(CurLoopNum).SupplySideInletPumpType = FlowType::Constant; - } else if (first_supply_component_typenum == TypeOf_PumpVariableSpeed) { + } else if (first_supply_component_type == PlantEquipmentType::PumpVariableSpeed) { PlantCommonPipe(CurLoopNum).SupplySideInletPumpType = FlowType::Variable; // If/when the model supports variable-pumping primary, this can be removed. ShowWarningError(state, "SetupCommonPipes: detected variable speed pump on supply inlet of TwoWayCommonPipe plant loop"); @@ -1326,9 +1326,9 @@ void SetupCommonPipes(EnergyPlusData &state) ShowContinueError(state, "The primary/supply side will operate as if constant speed, and the simulation continues"); } // check type of pump on demand side inlet - if (first_demand_component_typenum == TypeOf_PumpConstantSpeed) { + if (first_demand_component_type == PlantEquipmentType::PumpConstantSpeed) { PlantCommonPipe(CurLoopNum).DemandSideInletPumpType = FlowType::Constant; - } else if (first_demand_component_typenum == TypeOf_PumpVariableSpeed) { + } else if (first_demand_component_type == PlantEquipmentType::PumpVariableSpeed) { PlantCommonPipe(CurLoopNum).DemandSideInletPumpType = FlowType::Variable; } } diff --git a/src/EnergyPlus/HVACInterfaceManager.hh b/src/EnergyPlus/HVACInterfaceManager.hh index fcc02a2e4aa..f0be5ec1423 100644 --- a/src/EnergyPlus/HVACInterfaceManager.hh +++ b/src/EnergyPlus/HVACInterfaceManager.hh @@ -80,7 +80,7 @@ namespace HVACInterfaceManager { struct CommonPipeData { // Members - DataPlant::iCommonPipeType CommonPipeType; // type of common pipe used if any + DataPlant::CommonPipeType CommonPipeType; // type of common pipe used if any FlowType SupplySideInletPumpType; FlowType DemandSideInletPumpType; // Following report variables are used in uncontrolled common pipe @@ -104,7 +104,7 @@ namespace HVACInterfaceManager { // Default Constructor CommonPipeData() - : CommonPipeType(DataPlant::iCommonPipeType::No), SupplySideInletPumpType(FlowType::Unassigned), + : CommonPipeType(DataPlant::CommonPipeType::No), SupplySideInletPumpType(FlowType::Unassigned), DemandSideInletPumpType(FlowType::Unassigned), FlowDir(0), Flow(0.0), Temp(0.0), SecCPLegFlow(0.0), PriCPLegFlow(0.0), SecToPriFlow(0.0), PriToSecFlow(0.0), PriInTemp(0.0), PriOutTemp(0.0), SecInTemp(0.0), SecOutTemp(0.0), PriInletSetPoint(0.0), SecInletSetPoint(0.0), PriInletControlled(false), SecInletControlled(false), PriFlowRequest(0.0) @@ -130,14 +130,14 @@ namespace HVACInterfaceManager { int ThisLoopSideOutletNode, // Node number for the inlet of the side that needs the outlet node data int OtherLoopSideInletNode, // Node number for the outlet of the side of the loop just simulated bool &OutOfToleranceFlag, // True when the other side of the loop need to be (re)simulated - DataPlant::iCommonPipeType CommonPipeType); + DataPlant::CommonPipeType CommonPipeType); //*************** void UpdateHalfLoopInletTemp(EnergyPlusData &state, int LoopNum, int TankInletLoopSide, Real64 &TankOutletTemp); void - UpdateCommonPipe(EnergyPlusData &state, int LoopNum, int TankInletLoopSide, DataPlant::iCommonPipeType CommonPipeType, Real64 &MixedOutletTemp); + UpdateCommonPipe(EnergyPlusData &state, int LoopNum, int TankInletLoopSide, DataPlant::CommonPipeType CommonPipeType, Real64 &MixedOutletTemp); void ManageSingleCommonPipe(EnergyPlusData &state, int LoopNum, // plant loop number diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index cdbea3529d5..434586b94ae 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -1887,9 +1887,9 @@ void SimSelectedEquipment(EnergyPlusData &state, // This requires that the plant flow resolver carefully set the min/max avail limits on // air side components to ensure they request within bounds. if (LockPlantFlows) { - SetAllFlowLocks(state, DataPlant::iFlowLock::Locked); + SetAllFlowLocks(state, DataPlant::FlowLock::Locked); } else { - SetAllFlowLocks(state, DataPlant::iFlowLock::Unlocked); + SetAllFlowLocks(state, DataPlant::FlowLock::Unlocked); } ResetAllPlantInterConnectFlags(state); diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index 876307f92fc..944b9375da4 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -1884,9 +1884,6 @@ namespace HVACMultiSpeedHeatPump { // temperatures float in the deadband, additional iterations are required to converge on mass flow rate. // Using/Aliasing - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; - using DataPlant::TypeOf_MultiSpeedHeatPumpRecovery; using DataSizing::AutoSize; using Fans::GetFanIndex; using Fans::GetFanVolFlow; @@ -1954,7 +1951,7 @@ namespace HVACMultiSpeedHeatPump { errFlag = false; ScanPlantLoopsForObject(state, MSHeatPump(MSHeatPumpNum).Name, - TypeOf_MultiSpeedHeatPumpRecovery, + DataPlant::PlantEquipmentType::MultiSpeedHeatPumpRecovery, MSHeatPump(MSHeatPumpNum).HRLoopNum, MSHeatPump(MSHeatPumpNum).HRLoopSideNum, MSHeatPump(MSHeatPumpNum).HRBranchNum, @@ -1977,7 +1974,7 @@ namespace HVACMultiSpeedHeatPump { errFlag = false; ScanPlantLoopsForObject(state, MSHeatPump(MSHeatPumpNum).HeatCoilName, - TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, MSHeatPump(MSHeatPumpNum).LoopNum, MSHeatPump(MSHeatPumpNum).LoopSide, MSHeatPump(MSHeatPumpNum).BranchNum, @@ -2015,7 +2012,7 @@ namespace HVACMultiSpeedHeatPump { errFlag = false; ScanPlantLoopsForObject(state, MSHeatPump(MSHeatPumpNum).HeatCoilName, - TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, MSHeatPump(MSHeatPumpNum).LoopNum, MSHeatPump(MSHeatPumpNum).LoopSide, MSHeatPump(MSHeatPumpNum).BranchNum, @@ -2049,7 +2046,7 @@ namespace HVACMultiSpeedHeatPump { errFlag = false; ScanPlantLoopsForObject(state, MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, - TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, MSHeatPump(MSHeatPumpNum).SuppLoopNum, MSHeatPump(MSHeatPumpNum).SuppLoopSide, MSHeatPump(MSHeatPumpNum).SuppBranchNum, @@ -2087,7 +2084,7 @@ namespace HVACMultiSpeedHeatPump { errFlag = false; ScanPlantLoopsForObject(state, MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, - TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, MSHeatPump(MSHeatPumpNum).SuppLoopNum, MSHeatPump(MSHeatPumpNum).SuppLoopSide, MSHeatPump(MSHeatPumpNum).SuppBranchNum, diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index 0d3a8fafa66..8013f3fde54 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -218,9 +218,7 @@ namespace HVACSingleDuctInduc { using BranchNodeConnections::TestCompSet; using NodeInputManager::GetOnlySingleNode; using namespace DataSizing; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using MixerComponent::GetZoneMixerIndex; using WaterCoils::GetCoilWaterInletNode; @@ -339,7 +337,7 @@ namespace HVACSingleDuctInduc { state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType = Alphas(6); // type (key) of heating coil if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoilType, "Coil:Heating:Water")) { - state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; + state.dataHVACSingleDuctInduc->IndUnit(IUNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; } state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil = Alphas(7); // name of heating coil object @@ -360,9 +358,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")) { - state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; + state.dataHVACSingleDuctInduc->IndUnit(IUNum).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; } else if (UtilityRoutines::SameString(state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoilType, "Coil:Cooling:Water:DetailedGeometry")) { - state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; + state.dataHVACSingleDuctInduc->IndUnit(IUNum).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil = Alphas(9); // name of cooling coil object @@ -513,9 +511,7 @@ namespace HVACSingleDuctInduc { // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataZoneEquipment::CheckZoneEquipmentList; using FluidProperties::GetDensityGlycol; using PlantUtilities::InitComponentNodes; @@ -556,11 +552,11 @@ namespace HVACSingleDuctInduc { } if (state.dataHVACSingleDuctInduc->MyPlantScanFlag(IUNum) && allocated(state.dataPlnt->PlantLoop)) { - if (state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) { + if (state.dataHVACSingleDuctInduc->IndUnit(IUNum).HeatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { errFlag = false; ScanPlantLoopsForObject(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil, - state.dataHVACSingleDuctInduc->IndUnit(IUNum).HCoil_PlantTypeNum, + state.dataHVACSingleDuctInduc->IndUnit(IUNum).HeatingCoilType, state.dataHVACSingleDuctInduc->IndUnit(IUNum).HWLoopNum, state.dataHVACSingleDuctInduc->IndUnit(IUNum).HWLoopSide, state.dataHVACSingleDuctInduc->IndUnit(IUNum).HWBranchNum, @@ -577,12 +573,12 @@ namespace HVACSingleDuctInduc { "Reference Unit=\"" + state.dataHVACSingleDuctInduc->IndUnit(IUNum).Name + "\", type=" + state.dataHVACSingleDuctInduc->IndUnit(IUNum).UnitType); } - if (state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling || - state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling) { + if (state.dataHVACSingleDuctInduc->IndUnit(IUNum).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling || + state.dataHVACSingleDuctInduc->IndUnit(IUNum).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { errFlag = false; ScanPlantLoopsForObject(state, state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil, - state.dataHVACSingleDuctInduc->IndUnit(IUNum).CCoil_PlantTypeNum, + state.dataHVACSingleDuctInduc->IndUnit(IUNum).CoolingCoilType, state.dataHVACSingleDuctInduc->IndUnit(IUNum).CWLoopNum, state.dataHVACSingleDuctInduc->IndUnit(IUNum).CWLoopSide, state.dataHVACSingleDuctInduc->IndUnit(IUNum).CWBranchNum, diff --git a/src/EnergyPlus/HVACSingleDuctInduc.hh b/src/EnergyPlus/HVACSingleDuctInduc.hh index 7b2ff746ba8..e787cbad5dd 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.hh +++ b/src/EnergyPlus/HVACSingleDuctInduc.hh @@ -55,6 +55,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -90,7 +91,7 @@ namespace HVACSingleDuctInduc { std::string HCoilType; // type of heating coil component std::string HCoil; // name of heating coil component int HCoil_Num; // index to this coil - int HCoil_PlantTypeNum; + DataPlant::PlantEquipmentType HeatingCoilType; Real64 MaxVolHotWaterFlow; // m3/s (autosizable) Real64 MaxHotWaterFlow; // kg/s Real64 MinVolHotWaterFlow; // m3/s @@ -105,7 +106,7 @@ namespace HVACSingleDuctInduc { std::string CCoilType; // type of cooling coil component std::string CCoil; // name of cooling coil component int CCoil_Num; // index to this coil - int CCoil_PlantTypeNum; + DataPlant::PlantEquipmentType CoolingCoilType; Real64 MaxVolColdWaterFlow; // m3/s (autosizable) Real64 MaxColdWaterFlow; // kg/s Real64 MinVolColdWaterFlow; // m3/s @@ -132,9 +133,10 @@ namespace HVACSingleDuctInduc { // Default Constructor IndUnitData() : UnitType_Num(SingleDuct_CV::Unassigned), SchedPtr(0), MaxTotAirVolFlow(0.0), MaxTotAirMassFlow(0.0), InducRatio(2.5), PriAirInNode(0), - SecAirInNode(0), OutAirNode(0), HWControlNode(0), CWControlNode(0), HCoil_Num(0), HCoil_PlantTypeNum(0), MaxVolHotWaterFlow(0.0), - MaxHotWaterFlow(0.0), MinVolHotWaterFlow(0.0), MinHotWaterFlow(0.0), HotControlOffset(0.0), HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), - HWCompNum(0), HWCoilFailNum1(0), HWCoilFailNum2(0), CCoil_Num(0), CCoil_PlantTypeNum(0), MaxVolColdWaterFlow(0.0), + SecAirInNode(0), OutAirNode(0), HWControlNode(0), CWControlNode(0), HCoil_Num(0), + HeatingCoilType(DataPlant::PlantEquipmentType::Invalid), MaxVolHotWaterFlow(0.0), MaxHotWaterFlow(0.0), MinVolHotWaterFlow(0.0), + MinHotWaterFlow(0.0), HotControlOffset(0.0), HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0), HWCoilFailNum1(0), + HWCoilFailNum2(0), CCoil_Num(0), CoolingCoilType(DataPlant::PlantEquipmentType::Invalid), MaxVolColdWaterFlow(0.0), MaxColdWaterFlow(0.0), MinVolColdWaterFlow(0.0), MinColdWaterFlow(0.0), ColdControlOffset(0.0), CWLoopNum(0), CWLoopSide(0), CWBranchNum(0), CWCompNum(0), CWCoilFailNum1(0), CWCoilFailNum2(0), Mixer_Num(0), MaxPriAirMassFlow(0.0), MaxSecAirMassFlow(0.0), ADUNum(0), DesCoolingLoad(0.0), DesHeatingLoad(0.0), CtrlZoneNum(0), CtrlZoneInNodeIndex(0), AirLoopNum(0), OutdoorAirFlowRate(0.0) diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index e8c152543c2..bf579ae903f 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -1485,7 +1485,7 @@ namespace HVACUnitaryBypassVAV { ErrorFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, CBVAV(CBVAVNum).HeatCoilName, - DataPlant::TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, CBVAV(CBVAVNum).LoopNum, CBVAV(CBVAVNum).LoopSide, CBVAV(CBVAVNum).BranchNum, @@ -1519,7 +1519,7 @@ namespace HVACUnitaryBypassVAV { ErrorFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, CBVAV(CBVAVNum).HeatCoilName, - DataPlant::TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, CBVAV(CBVAVNum).LoopNum, CBVAV(CBVAVNum).LoopSide, CBVAV(CBVAVNum).BranchNum, diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 7a978501074..a184f2afdfc 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -207,7 +207,7 @@ void SimulateVRF(EnergyPlusData &state, bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, state.dataHVACVarRefFlow->VRF(VRFCondenser).Name, - state.dataHVACVarRefFlow->VRF(VRFCondenser).VRFPlantTypeOfNum, + state.dataHVACVarRefFlow->VRF(VRFCondenser).VRFType, state.dataHVACVarRefFlow->VRF(VRFCondenser).SourceLoopNum, state.dataHVACVarRefFlow->VRF(VRFCondenser).SourceLoopSideNum, state.dataHVACVarRefFlow->VRF(VRFCondenser).SourceBranchNum, @@ -331,7 +331,7 @@ void VRFCondenserEquipment::simulate(EnergyPlusData &state, PlantUtilities::UpdateChillerComponentCondenserSide(state, this->SourceLoopNum, this->SourceLoopSideNum, - TypeOf_HeatPumpVRF, + PlantEquipmentType::HeatPumpVRF, this->CondenserNodeNum, this->CondenserOutletNodeNum, this->QCondenser, @@ -625,8 +625,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } ShowRecurringWarningErrorAtEnd( state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + state.dataHVACVarRefFlow->VRF(VRFCond).Name + - "\": Cooling Capacity Modifier curve (function of temperature) output is negative warning continues...", + format("{} \"{}\": Cooling Capacity Modifier curve (function of temperature) output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + state.dataHVACVarRefFlow->VRF(VRFCond).Name), state.dataHVACVarRefFlow->VRF(VRFCond).CoolCapFTErrorIndex, TotCoolCapTempModFac, TotCoolCapTempModFac); @@ -651,8 +652,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } ShowRecurringWarningErrorAtEnd( state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + state.dataHVACVarRefFlow->VRF(VRFCond).Name + - "\": Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative warning continues...", + format("{} \"{}\": Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + state.dataHVACVarRefFlow->VRF(VRFCond).Name), state.dataHVACVarRefFlow->VRF(VRFCond).EIRFTempCoolErrorIndex, TotCoolEIRTempModFac, TotCoolEIRTempModFac); @@ -687,8 +689,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } ShowRecurringWarningErrorAtEnd( state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + state.dataHVACVarRefFlow->VRF(VRFCond).Name + - "\": Cooling Capacity Modifier curve (function of temperature) output is negative warning continues...", + format("{} \"{}\": Cooling Capacity Modifier curve (function of temperature) output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + state.dataHVACVarRefFlow->VRF(VRFCond).Name), state.dataHVACVarRefFlow->VRF(VRFCond).CoolCapFTErrorIndex, TotCoolCapTempModFac, TotCoolCapTempModFac); @@ -712,8 +715,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } ShowRecurringWarningErrorAtEnd( state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + state.dataHVACVarRefFlow->VRF(VRFCond).Name + - "\": Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative warning continues...", + format("{} \"{}\": Cooling Energy Input Ratio Modifier curve (function of temperature) output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + state.dataHVACVarRefFlow->VRF(VRFCond).Name), state.dataHVACVarRefFlow->VRF(VRFCond).EIRFTempCoolErrorIndex, TotCoolEIRTempModFac, TotCoolEIRTempModFac); @@ -810,8 +814,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } ShowRecurringWarningErrorAtEnd( state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + state.dataHVACVarRefFlow->VRF(VRFCond).Name + - "\": Heating Capacity Ratio Modifier curve (function of temperature) output is negative warning continues...", + format("{} \"{}\": Heating Capacity Ratio Modifier curve (function of temperature) output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + state.dataHVACVarRefFlow->VRF(VRFCond).Name), state.dataHVACVarRefFlow->VRF(VRFCond).HeatCapFTErrorIndex, TotHeatCapTempModFac, TotHeatCapTempModFac); @@ -848,8 +853,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } ShowRecurringWarningErrorAtEnd( state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + state.dataHVACVarRefFlow->VRF(VRFCond).Name + - "\": Heating Energy Input Ratio Modifier curve (function of temperature) output is negative warning continues...", + format("{} \"{}\": Heating Energy Input Ratio Modifier curve (function of temperature) output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + state.dataHVACVarRefFlow->VRF(VRFCond).Name), state.dataHVACVarRefFlow->VRF(VRFCond).EIRFTempHeatErrorIndex, TotHeatEIRTempModFac, TotHeatEIRTempModFac); @@ -911,10 +917,10 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + - state.dataHVACVarRefFlow->VRF(VRFCond).Name + - "\": Defrost Energy Input Ratio Modifier curve (function of temperature) output " - "is negative warning continues...", + format("{} \"{}\": Defrost Energy Input Ratio Modifier curve (function of temperature) " + "output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + state.dataHVACVarRefFlow->VRF(VRFCond).Name), state.dataHVACVarRefFlow->VRF(VRFCond).DefrostHeatErrorIndex, DefrostEIRTempModFac, DefrostEIRTempModFac); @@ -2268,7 +2274,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataHVACVarRefFlow->VRF(VRFNum).CondenserType = DataHeatBalance::RefrigCondenserType::Evap; if (UtilityRoutines::SameString(cAlphaArgs(34), "WaterCooled")) { state.dataHVACVarRefFlow->VRF(VRFNum).CondenserType = DataHeatBalance::RefrigCondenserType::Water; - state.dataHVACVarRefFlow->VRF(VRFNum).VRFPlantTypeOfNum = TypeOf_HeatPumpVRF; + state.dataHVACVarRefFlow->VRF(VRFNum).VRFType = PlantEquipmentType::HeatPumpVRF; if (state.dataHVACVarRefFlow->VRF(VRFNum).HeatingPerformanceOATType == DataHVACGlobals::WetBulbIndicator) { ShowSevereError(state, cCurrentModuleObject + " = " + state.dataHVACVarRefFlow->VRF(VRFNum).Name); ShowContinueError(state, cAlphaFieldNames(34) + " = " + cAlphaArgs(34)); @@ -5999,7 +6005,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, - TypeOf_CoilWaterSimpleHeating, + PlantEquipmentType::CoilWaterSimpleHeating, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopSide, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilBranchNum, @@ -6047,7 +6053,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, - TypeOf_CoilSteamAirHeating, + PlantEquipmentType::CoilSteamAirHeating, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopSide, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilBranchNum, @@ -12361,9 +12367,10 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); } ShowRecurringWarningErrorAtEnd(state, - ccSimPlantEquipTypes(TypeOf_HeatPumpVRF) + " \"" + this->Name + - "\": Defrost Energy Input Ratio Modifier curve (function of temperature) output " - "is negative warning continues...", + format("{} \"{}\": Defrost Energy Input Ratio Modifier curve (function of temperature) " + "output is negative warning continues...", + PlantEquipTypeNames[static_cast(PlantEquipmentType::HeatPumpVRF)], + this->Name), this->DefrostHeatErrorIndex, DefrostEIRTempModFac, DefrostEIRTempModFac); diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index cc32a41b655..961d69561c0 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -134,7 +134,7 @@ namespace HVACVariableRefrigerantFlow { std::string Name; // Name of the VRF Terminal Unit int VRFSystemTypeNum; // integer equivalent of system type iAlgorithmType VRFAlgorithmTypeNum; // Algorithm type: 1_system curve based model; 2_physics based model (FluidTCtrl) - int VRFPlantTypeOfNum; // integer equivalent of index to DataPlant type + DataPlant::PlantEquipmentType VRFType; // integer equivalent of index to DataPlant type int SourceLoopNum; // plant data for water-cooled only int SourceLoopSideNum; // plant data for water-cooled only int SourceBranchNum; // plant data for water-cooled only @@ -370,20 +370,20 @@ namespace HVACVariableRefrigerantFlow { // Default Constructor VRFCondenserEquipment() - : VRFSystemTypeNum(0), VRFAlgorithmTypeNum(iAlgorithmType::Unassigned), VRFPlantTypeOfNum(0), SourceLoopNum(0), SourceLoopSideNum(0), - SourceBranchNum(0), SourceCompNum(0), WaterCondenserDesignMassFlow(0.0), WaterCondenserMassFlow(0.0), QCondenser(0.0), QCondEnergy(0.0), - CondenserSideOutletTemp(0.0), SchedPtr(-1), CoolingCapacity(0.0), TotalCoolingCapacity(0.0), CoolingCombinationRatio(1.0), - VRFCondPLR(0.0), VRFCondRTF(0.0), VRFCondCyclingRatio(0.0), CondenserInletTemp(0.0), CoolingCOP(0.0), OperatingCoolingCOP(0.0), - RatedCoolingPower(0.0), HeatingCapacity(0.0), HeatingCapacitySizeRatio(1.0), LockHeatingCapacity(false), TotalHeatingCapacity(0.0), - HeatingCombinationRatio(1.0), HeatingCOP(0.0), OperatingHeatingCOP(0.0), RatedHeatingPower(0.0), MinOATCooling(0.0), MaxOATCooling(0.0), - MinOATHeating(0.0), MaxOATHeating(0.0), CoolCapFT(0), CoolEIRFT(0), HeatCapFT(0), HeatEIRFT(0), CoolBoundaryCurvePtr(0), - HeatBoundaryCurvePtr(0), EIRCoolBoundaryCurvePtr(0), CoolEIRFPLR1(0), CoolEIRFPLR2(0), CoolCapFTHi(0), CoolEIRFTHi(0), HeatCapFTHi(0), - HeatEIRFTHi(0), EIRHeatBoundaryCurvePtr(0), HeatEIRFPLR1(0), HeatEIRFPLR2(0), CoolPLFFPLR(0), HeatPLFFPLR(0), - HeatingPerformanceOATType(0), MinPLR(0.0), MasterZonePtr(0), MasterZoneTUIndex(0), ThermostatPriority(iThermostatCtrlType::Unassigned), - SchedPriorityPtr(0), ZoneTUListPtr(0), HeatRecoveryUsed(false), VertPipeLngth(0.0), PCFLengthCoolPtr(0), PCFHeightCool(0.0), - EquivPipeLngthCool(0.0), PipingCorrectionCooling(1.0), PCFLengthHeatPtr(0), PCFHeightHeat(0.0), EquivPipeLngthHeat(0.0), - PipingCorrectionHeating(1.0), CCHeaterPower(0.0), CompressorSizeRatio(0.0), NumCompressors(0), MaxOATCCHeater(0.0), DefrostEIRPtr(0), - DefrostFraction(0.0), DefrostStrategy(StandardRatings::DefrostStrat::Unassigned), + : VRFSystemTypeNum(0), VRFAlgorithmTypeNum(iAlgorithmType::Unassigned), VRFType(DataPlant::PlantEquipmentType::Invalid), SourceLoopNum(0), + SourceLoopSideNum(0), SourceBranchNum(0), SourceCompNum(0), WaterCondenserDesignMassFlow(0.0), WaterCondenserMassFlow(0.0), + QCondenser(0.0), QCondEnergy(0.0), CondenserSideOutletTemp(0.0), SchedPtr(-1), CoolingCapacity(0.0), TotalCoolingCapacity(0.0), + CoolingCombinationRatio(1.0), VRFCondPLR(0.0), VRFCondRTF(0.0), VRFCondCyclingRatio(0.0), CondenserInletTemp(0.0), CoolingCOP(0.0), + OperatingCoolingCOP(0.0), RatedCoolingPower(0.0), HeatingCapacity(0.0), HeatingCapacitySizeRatio(1.0), LockHeatingCapacity(false), + TotalHeatingCapacity(0.0), HeatingCombinationRatio(1.0), HeatingCOP(0.0), OperatingHeatingCOP(0.0), RatedHeatingPower(0.0), + MinOATCooling(0.0), MaxOATCooling(0.0), MinOATHeating(0.0), MaxOATHeating(0.0), CoolCapFT(0), CoolEIRFT(0), HeatCapFT(0), HeatEIRFT(0), + CoolBoundaryCurvePtr(0), HeatBoundaryCurvePtr(0), EIRCoolBoundaryCurvePtr(0), CoolEIRFPLR1(0), CoolEIRFPLR2(0), CoolCapFTHi(0), + CoolEIRFTHi(0), HeatCapFTHi(0), HeatEIRFTHi(0), EIRHeatBoundaryCurvePtr(0), HeatEIRFPLR1(0), HeatEIRFPLR2(0), CoolPLFFPLR(0), + HeatPLFFPLR(0), HeatingPerformanceOATType(0), MinPLR(0.0), MasterZonePtr(0), MasterZoneTUIndex(0), + ThermostatPriority(iThermostatCtrlType::Unassigned), SchedPriorityPtr(0), ZoneTUListPtr(0), HeatRecoveryUsed(false), VertPipeLngth(0.0), + PCFLengthCoolPtr(0), PCFHeightCool(0.0), EquivPipeLngthCool(0.0), PipingCorrectionCooling(1.0), PCFLengthHeatPtr(0), PCFHeightHeat(0.0), + EquivPipeLngthHeat(0.0), PipingCorrectionHeating(1.0), CCHeaterPower(0.0), CompressorSizeRatio(0.0), NumCompressors(0), + MaxOATCCHeater(0.0), DefrostEIRPtr(0), DefrostFraction(0.0), DefrostStrategy(StandardRatings::DefrostStrat::Unassigned), DefrostControl(StandardRatings::HPdefrostControl::Unassigned), DefrostCapacity(0.0), DefrostPower(0.0), DefrostConsumption(0.0), MaxOATDefrost(0.0), CondenserType(DataHeatBalance::RefrigCondenserType::Unassigned), CondenserNodeNum(0), SkipCondenserNodeNumCheck(false), CondenserOutletNodeNum(0), WaterCondVolFlowRate(0.0), EvapCondEffectiveness(0.0), diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 923f0848697..6b660fb4c48 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -115,7 +115,7 @@ namespace HWBaseboardRadiator { // Use statements for data only modules // Using/Aliasing using DataHVACGlobals::SmallLoad; - using DataPlant::TypeOf_Baseboard_Rad_Conv_Water; + using DataZoneEquipment::CheckZoneEquipmentList; using FluidProperties::GetDensityGlycol; @@ -213,7 +213,7 @@ namespace HWBaseboardRadiator { { auto const SELECT_CASE_var(HWBaseboard(BaseboardNum).EquipType); - if (SELECT_CASE_var == TypeOf_Baseboard_Rad_Conv_Water) { // 'ZoneHVAC:Baseboard:RadiantConvective:Water' + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Water) { // 'ZoneHVAC:Baseboard:RadiantConvective:Water' ControlCompOutput(state, HWBaseboard(BaseboardNum).EquipID, cCMO_BBRadiator_Water, @@ -492,7 +492,8 @@ namespace HWBaseboardRadiator { state, cCMO_BBRadiator_Water, state.dataIPShortCut->cAlphaArgs(1), ErrorsFound, cCMO_BBRadiator_Water + " Name"); HWBaseboard(BaseboardNum).EquipID = state.dataIPShortCut->cAlphaArgs(1); // Name of this baseboard - HWBaseboard(BaseboardNum).EquipType = TypeOf_Baseboard_Rad_Conv_Water; //'ZoneHVAC:Baseboard:RadiantConvective:Water' + HWBaseboard(BaseboardNum).EquipType = + DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Water; //'ZoneHVAC:Baseboard:RadiantConvective:Water' HWBaseboard(BaseboardNum).designObjectName = state.dataIPShortCut->cAlphaArgs(2); // Name of the design object for this baseboard HWBaseboard(BaseboardNum).DesignObjectPtr = @@ -1884,8 +1885,7 @@ namespace HWBaseboardRadiator { // check input, provide comp index, call utility routines // Using/Aliasing - using DataPlant::ccSimPlantEquipTypes; - using DataPlant::TypeOf_Baseboard_Rad_Conv_Water; + using DataPlant::PlantEquipTypeNames; using PlantUtilities::PullCompInterconnectTrigger; @@ -1921,13 +1921,13 @@ namespace HWBaseboardRadiator { BaseboardName, HWBaseboard(BaseboardNum).EquipID)); } - if (BaseboardTypeNum != TypeOf_Baseboard_Rad_Conv_Water) { + if (BaseboardTypeNum != static_cast(DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Water)) { ShowFatalError(state, format("UpdateHWBaseboardPlantConnection: Invalid CompIndex passed={}, baseboard name={}, stored baseboard Name " "for that index={}", BaseboardNum, BaseboardName, - ccSimPlantEquipTypes(BaseboardTypeNum))); + PlantEquipTypeNames[BaseboardTypeNum])); } } } @@ -1944,7 +1944,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).BBLoadReSimIndex, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, - DataPlant::iCriteriaType::HeatTransferRate, + DataPlant::CriteriaType::HeatTransferRate, HWBaseboard(BaseboardNum).Power); PullCompInterconnectTrigger(state, @@ -1955,7 +1955,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).BBMassFlowReSimIndex, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, HWBaseboard(BaseboardNum).WaterMassFlowRate); PullCompInterconnectTrigger(state, @@ -1966,7 +1966,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).BBInletTempFlowReSimIndex, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, - DataPlant::iCriteriaType::Temperature, + DataPlant::CriteriaType::Temperature, HWBaseboard(BaseboardNum).WaterOutletTemp); } diff --git a/src/EnergyPlus/HWBaseboardRadiator.hh b/src/EnergyPlus/HWBaseboardRadiator.hh index 43903927389..eb7fa44e49d 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.hh +++ b/src/EnergyPlus/HWBaseboardRadiator.hh @@ -55,6 +55,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -69,7 +70,7 @@ namespace HWBaseboardRadiator { { // Members std::string EquipID; - int EquipType; + DataPlant::PlantEquipmentType EquipType; std::string designObjectName; // Design Object int DesignObjectPtr; std::string Schedule; @@ -125,14 +126,14 @@ namespace HWBaseboardRadiator { // Default Constructor HWBaseboardParams() - : EquipType(0), DesignObjectPtr(0), ZonePtr(0), SchedPtr(0), WaterInletNode(0), WaterOutletNode(0), TotSurfToDistrib(0), - ControlCompTypeNum(0), CompErrIndex(0), AirMassFlowRate(0.0), AirMassFlowRateStd(0.0), WaterTempAvg(0.0), RatedCapacity(0.0), UA(0.0), - WaterMassFlowRate(0.0), WaterMassFlowRateMax(0.0), WaterMassFlowRateStd(0.0), WaterVolFlowRateMax(0.0), WaterInletTempStd(0.0), - WaterInletTemp(0.0), WaterInletEnthalpy(0.0), WaterOutletTempStd(0.0), WaterOutletTemp(0.0), WaterOutletEnthalpy(0.0), - AirInletTempStd(0.0), AirInletTemp(0.0), AirOutletTemp(0.0), AirInletHumRat(0.0), AirOutletTempStd(0.0), FracConvect(0.0), - TotPower(0.0), Power(0.0), ConvPower(0.0), RadPower(0.0), TotEnergy(0.0), Energy(0.0), ConvEnergy(0.0), RadEnergy(0.0), LoopNum(0), - LoopSideNum(0), BranchNum(0), CompNum(0), BBLoadReSimIndex(0), BBMassFlowReSimIndex(0), BBInletTempFlowReSimIndex(0), - HeatingCapMethod(0), ScaledHeatingCapacity(0.0) + : EquipType(DataPlant::PlantEquipmentType::Invalid), DesignObjectPtr(0), ZonePtr(0), SchedPtr(0), WaterInletNode(0), WaterOutletNode(0), + TotSurfToDistrib(0), ControlCompTypeNum(0), CompErrIndex(0), AirMassFlowRate(0.0), AirMassFlowRateStd(0.0), WaterTempAvg(0.0), + RatedCapacity(0.0), UA(0.0), WaterMassFlowRate(0.0), WaterMassFlowRateMax(0.0), WaterMassFlowRateStd(0.0), WaterVolFlowRateMax(0.0), + WaterInletTempStd(0.0), WaterInletTemp(0.0), WaterInletEnthalpy(0.0), WaterOutletTempStd(0.0), WaterOutletTemp(0.0), + WaterOutletEnthalpy(0.0), AirInletTempStd(0.0), AirInletTemp(0.0), AirOutletTemp(0.0), AirInletHumRat(0.0), AirOutletTempStd(0.0), + FracConvect(0.0), TotPower(0.0), Power(0.0), ConvPower(0.0), RadPower(0.0), TotEnergy(0.0), Energy(0.0), ConvEnergy(0.0), + RadEnergy(0.0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), BBLoadReSimIndex(0), BBMassFlowReSimIndex(0), + BBInletTempFlowReSimIndex(0), HeatingCapMethod(0), ScaledHeatingCapacity(0.0) { } }; diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index caf13bb9380..33e89050dd3 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -179,8 +179,8 @@ namespace HeatBalFiniteDiffManager { if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) { { - state.dataHeatBalFiniteDiffMgr->CondFDSchemeType = - static_cast(getEnumerationValue(CondFDSchemeTypeNamesUC, state.dataIPShortCut->cAlphaArgs(1))); + state.dataHeatBalFiniteDiffMgr->CondFDSchemeType = static_cast( + getEnumerationValue(CondFDSchemeTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1)))); if (state.dataHeatBalFiniteDiffMgr->CondFDSchemeType == CondFDScheme::Unassigned) { ShowSevereError(state, cCurrentModuleObject + ": invalid " + state.dataIPShortCut->cAlphaFieldNames(1) + diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index dc28cebf569..6c50493842c 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -574,8 +574,9 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } { - state.dataHeatBal->ZoneAirBalance(Loop).BalanceMethod = static_cast(getEnumerationValue( - DataHeatBalance::AirBalanceTypeNamesUC, cAlphaArgs(3))); // Air balance method type character input-->convert to enum + state.dataHeatBal->ZoneAirBalance(Loop).BalanceMethod = static_cast( + getEnumerationValue(DataHeatBalance::AirBalanceTypeNamesUC, + UtilityRoutines::MakeUPPERCase(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum if (state.dataHeatBal->ZoneAirBalance(Loop).BalanceMethod == AirBalance::Unassigned) { state.dataHeatBal->ZoneAirBalance(Loop).BalanceMethod = AirBalance::None; ShowWarningError(state, diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 1b4d9b3386c..fadb270aa18 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -1211,7 +1211,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cNumericFieldNames); if (NumAlpha > 0) { { - int FlowTypeNum = getEnumerationValue(AdjustmentTypeNamesUC, AlphaName(1)); + int FlowTypeNum = getEnumerationValue(AdjustmentTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphaName(1))); state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = static_cast(FlowTypeNum); AlphaName(1) = AdjustmentTypeNamesCC[FlowTypeNum]; if (BITF_TEST_ANY(BITF(state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment), @@ -1232,7 +1232,7 @@ namespace HeatBalanceManager { } if (NumAlpha > 1) { { - int FlowTypeNum = getEnumerationValue(InfiltrationFlowTypeNamesUC, AlphaName(2)); + int FlowTypeNum = getEnumerationValue(InfiltrationFlowTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphaName(2))); state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment = static_cast(FlowTypeNum); AlphaName(2) = InfiltrationFlowTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment == DataHeatBalance::InfiltrationFlow::Add || @@ -1259,7 +1259,7 @@ namespace HeatBalanceManager { } else { if (NumAlpha > 2) { { - int FlowTypeNum = getEnumerationValue(InfiltrationZoneTypeNamesUC, AlphaName(3)); + int FlowTypeNum = getEnumerationValue(InfiltrationZoneTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphaName(3))); state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones = static_cast(FlowTypeNum); AlphaName(3) = InfiltrationZoneTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones == DataHeatBalance::InfiltrationZoneType::Unassigned) { diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc index f5522d60f1c..1ea35801596 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -125,7 +125,7 @@ void GshpPeCoolingSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, this->SourceLoopNum, this->SourceLoopSideNum, - DataPlant::TypeOf_HPWaterEFCooling, + DataPlant::PlantEquipmentType::HPWaterEFCooling, this->SourceSideInletNodeNum, this->SourceSideOutletNodeNum, this->QSource, @@ -156,7 +156,7 @@ void GshpPeCoolingSpecs::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_HPWaterPECooling, + DataPlant::PlantEquipmentType::HPWaterPECooling, this->SourceLoopNum, this->SourceLoopSideNum, this->SourceBranchNum, @@ -169,7 +169,7 @@ void GshpPeCoolingSpecs::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] _); PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_HPWaterPECooling, + DataPlant::PlantEquipmentType::HPWaterPECooling, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, @@ -206,7 +206,6 @@ void GetGshpInput(EnergyPlusData &state) // Using/Aliasing using BranchNodeConnections::TestCompSet; - using DataPlant::TypeOf_HPWaterPECooling; using FluidProperties::FindRefrigerant; using NodeInputManager::GetOnlySingleNode; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -238,7 +237,7 @@ void GetGshpInput(EnergyPlusData &state) state.dataHPWaterToWaterClg->GSHP(GSHPNum).Name = AlphArray(1); - state.dataHPWaterToWaterClg->GSHP(GSHPNum).WWHPPlantTypeOfNum = TypeOf_HPWaterPECooling; + state.dataHPWaterToWaterClg->GSHP(GSHPNum).WWHPPlantTypeOfNum = DataPlant::PlantEquipmentType::HPWaterPECooling; state.dataHPWaterToWaterClg->GSHP(GSHPNum).COP = NumArray(1); if (NumArray(1) == 0.0) { @@ -678,7 +677,7 @@ void GshpPeCoolingSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad) this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); // now initialize simulation variables for "heat pump off" this->QLoad = 0.0; @@ -743,7 +742,7 @@ void GshpPeCoolingSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad) this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); this->QLoad = 0.0; this->QSource = 0.0; @@ -762,7 +761,7 @@ void GshpPeCoolingSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad) this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh index 28a0421c537..3386923519d 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh @@ -55,6 +55,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -68,7 +69,7 @@ namespace HeatPumpWaterToWaterCOOLING { { // Members std::string Name; // user identifier - int WWHPPlantTypeOfNum; + DataPlant::PlantEquipmentType WWHPPlantTypeOfNum; bool Available; // need an array of logicals--load identifiers of available equipment bool ON; // simulate the machine at it's operating part load ratio Real64 COP; // Coefficient of Performance of the machine @@ -129,15 +130,15 @@ namespace HeatPumpWaterToWaterCOOLING { // Default Constructor GshpPeCoolingSpecs() - : WWHPPlantTypeOfNum(0), Available(false), ON(false), COP(0.0), NomCap(0.0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), - OptPartLoadRat(0.0), LoadSideVolFlowRate(0.0), LoadSideDesignMassFlow(0.0), SourceSideVolFlowRate(0.0), SourceSideDesignMassFlow(0.0), - SourceSideInletNodeNum(0), SourceSideOutletNodeNum(0), LoadSideInletNodeNum(0), LoadSideOutletNodeNum(0), SourceSideUACoeff(0.0), - LoadSideUACoeff(0.0), CompPistonDisp(0.0), CompClearanceFactor(0.0), CompSucPressDrop(0.0), SuperheatTemp(0.0), PowerLosses(0.0), - LossFactor(0.0), HighPressCutoff(0.0), LowPressCutoff(0.0), IsOn(false), MustRun(false), SourceLoopNum(0), SourceLoopSideNum(0), - SourceBranchNum(0), SourceCompNum(0), LoadLoopNum(0), LoadLoopSideNum(0), LoadBranchNum(0), LoadCompNum(0), CondMassFlowIndex(0), - Power(0.0), Energy(0.0), QLoad(0.0), QLoadEnergy(0.0), QSource(0.0), QSourceEnergy(0.0), LoadSideWaterInletTemp(0.0), - SourceSideWaterInletTemp(0.0), LoadSideWaterOutletTemp(0.0), SourceSideWaterOutletTemp(0.0), Running(0), LoadSideWaterMassFlowRate(0.0), - SourceSideWaterMassFlowRate(0.0), plantScanFlag(true), beginEnvironFlag(true) + : WWHPPlantTypeOfNum(DataPlant::PlantEquipmentType::Invalid), Available(false), ON(false), COP(0.0), NomCap(0.0), MinPartLoadRat(0.0), + MaxPartLoadRat(0.0), OptPartLoadRat(0.0), LoadSideVolFlowRate(0.0), LoadSideDesignMassFlow(0.0), SourceSideVolFlowRate(0.0), + SourceSideDesignMassFlow(0.0), SourceSideInletNodeNum(0), SourceSideOutletNodeNum(0), LoadSideInletNodeNum(0), LoadSideOutletNodeNum(0), + SourceSideUACoeff(0.0), LoadSideUACoeff(0.0), CompPistonDisp(0.0), CompClearanceFactor(0.0), CompSucPressDrop(0.0), SuperheatTemp(0.0), + PowerLosses(0.0), LossFactor(0.0), HighPressCutoff(0.0), LowPressCutoff(0.0), IsOn(false), MustRun(false), SourceLoopNum(0), + SourceLoopSideNum(0), SourceBranchNum(0), SourceCompNum(0), LoadLoopNum(0), LoadLoopSideNum(0), LoadBranchNum(0), LoadCompNum(0), + CondMassFlowIndex(0), Power(0.0), Energy(0.0), QLoad(0.0), QLoadEnergy(0.0), QSource(0.0), QSourceEnergy(0.0), + LoadSideWaterInletTemp(0.0), SourceSideWaterInletTemp(0.0), LoadSideWaterOutletTemp(0.0), SourceSideWaterOutletTemp(0.0), Running(0), + LoadSideWaterMassFlowRate(0.0), SourceSideWaterMassFlowRate(0.0), plantScanFlag(true), beginEnvironFlag(true) { } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc index 8af52633ca0..d5afbd8321d 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -127,7 +127,7 @@ void GshpPeHeatingSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, this->SourceLoopNum, this->SourceLoopSideNum, - DataPlant::TypeOf_HPWaterEFHeating, + DataPlant::PlantEquipmentType::HPWaterEFHeating, this->SourceSideInletNodeNum, this->SourceSideOutletNodeNum, -this->QSource, @@ -158,7 +158,7 @@ void GshpPeHeatingSpecs::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_HPWaterPEHeating, + DataPlant::PlantEquipmentType::HPWaterPEHeating, this->SourceLoopNum, this->SourceLoopSideNum, this->SourceBranchNum, @@ -171,7 +171,7 @@ void GshpPeHeatingSpecs::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] _); PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_HPWaterPEHeating, + DataPlant::PlantEquipmentType::HPWaterPEHeating, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, @@ -187,7 +187,7 @@ void GshpPeHeatingSpecs::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] } PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->LoadLoopNum, this->LoadLoopSideNum, this->SourceLoopNum, this->SourceLoopSideNum, this->WWHPPlantTypeOfNum, true); + state, this->LoadLoopNum, this->LoadLoopSideNum, this->SourceLoopNum, this->SourceLoopSideNum, this->WWHPPlantType, true); this->plantScanFlag = false; } } @@ -210,7 +210,6 @@ void GetGshpInput(EnergyPlusData &state) // Using/Aliasing using BranchNodeConnections::TestCompSet; - using DataPlant::TypeOf_HPWaterPEHeating; using FluidProperties::FindRefrigerant; using NodeInputManager::GetOnlySingleNode; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -242,7 +241,7 @@ void GetGshpInput(EnergyPlusData &state) state.dataHPWaterToWaterHtg->GSHP(GSHPNum).Name = AlphArray(1); - state.dataHPWaterToWaterHtg->GSHP(GSHPNum).WWHPPlantTypeOfNum = TypeOf_HPWaterPEHeating; + state.dataHPWaterToWaterHtg->GSHP(GSHPNum).WWHPPlantType = DataPlant::PlantEquipmentType::HPWaterPEHeating; state.dataHPWaterToWaterHtg->GSHP(GSHPNum).COP = NumArray(1); if (NumArray(1) == 0.0) { @@ -654,7 +653,7 @@ void GshpPeHeatingSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad) this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); // now initialize simulation variables for "heat pump off" this->LoadSideWaterOutletTemp = this->LoadSideWaterInletTemp; @@ -710,7 +709,7 @@ void GshpPeHeatingSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad) this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); this->LoadSideWaterOutletTemp = this->LoadSideWaterInletTemp; this->SourceSideWaterOutletTemp = this->SourceSideWaterInletTemp; @@ -724,7 +723,7 @@ void GshpPeHeatingSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad) this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh index 35cefd5aa0b..a3ad73e711b 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh @@ -55,6 +55,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -67,31 +68,31 @@ namespace HeatPumpWaterToWaterHEATING { struct GshpPeHeatingSpecs : PlantComponent { // Members - std::string Name; // user identifier - int WWHPPlantTypeOfNum; // equipment type num - bool Available; // need an array of logicals--load identifiers of available equipment - bool ON; // simulate the machine at it's operating part load ratio - Real64 COP; // Coefficient of Performance of the machine - Real64 NomCap; // Nominal Capacity of the HeatPump - Real64 MinPartLoadRat; // Minimum operating Part Load Ratio - Real64 MaxPartLoadRat; // Maximum operating Part Load Ratio - Real64 OptPartLoadRat; // Optimal operating Part Load Ratio - Real64 LoadSideVolFlowRate; // Design Flow Rate on the Load side m3/sec - Real64 LoadSideDesignMassFlow; // Design flow rate (kg/s) - Real64 SourceSideVolFlowRate; // Design Flow Rate on th Source Side m3/sec - Real64 SourceSideDesignMassFlow; // Design flow rate (kg/s) - int SourceSideInletNodeNum; // Node number on the inlet side of the plant - int SourceSideOutletNodeNum; // Node number on the outlet side of the plant - int LoadSideInletNodeNum; // Node number on the inlet side of the Load Side - int LoadSideOutletNodeNum; // Node number on the outlet side of the Load Side - Real64 SourceSideUACoeff; // Source Side heat transfer coeff W/K - Real64 LoadSideUACoeff; // Load Side heat transfer coeff W/K - Real64 CompPistonDisp; // compressor piston displacement m3 - Real64 CompClearanceFactor; // compressor clearance factor - Real64 CompSucPressDrop; // deltap , compressor suction and discharge pressure drop Pascals - Real64 SuperheatTemp; // deltatsh , super heating °C - Real64 PowerLosses; // constant part of electro mechanical power losses watts Joules/sec - Real64 LossFactor; // loss factor used ot define the electro mechanical + std::string Name; // user identifier + DataPlant::PlantEquipmentType WWHPPlantType; // equipment type num + bool Available; // need an array of logicals--load identifiers of available equipment + bool ON; // simulate the machine at it's operating part load ratio + Real64 COP; // Coefficient of Performance of the machine + Real64 NomCap; // Nominal Capacity of the HeatPump + Real64 MinPartLoadRat; // Minimum operating Part Load Ratio + Real64 MaxPartLoadRat; // Maximum operating Part Load Ratio + Real64 OptPartLoadRat; // Optimal operating Part Load Ratio + Real64 LoadSideVolFlowRate; // Design Flow Rate on the Load side m3/sec + Real64 LoadSideDesignMassFlow; // Design flow rate (kg/s) + Real64 SourceSideVolFlowRate; // Design Flow Rate on th Source Side m3/sec + Real64 SourceSideDesignMassFlow; // Design flow rate (kg/s) + int SourceSideInletNodeNum; // Node number on the inlet side of the plant + int SourceSideOutletNodeNum; // Node number on the outlet side of the plant + int LoadSideInletNodeNum; // Node number on the inlet side of the Load Side + int LoadSideOutletNodeNum; // Node number on the outlet side of the Load Side + Real64 SourceSideUACoeff; // Source Side heat transfer coeff W/K + Real64 LoadSideUACoeff; // Load Side heat transfer coeff W/K + Real64 CompPistonDisp; // compressor piston displacement m3 + Real64 CompClearanceFactor; // compressor clearance factor + Real64 CompSucPressDrop; // deltap , compressor suction and discharge pressure drop Pascals + Real64 SuperheatTemp; // deltatsh , super heating °C + Real64 PowerLosses; // constant part of electro mechanical power losses watts Joules/sec + Real64 LossFactor; // loss factor used ot define the electro mechanical // loss that is supposed to be proportional to the theoretical power Real64 HighPressCutoff; // Maximum Design Pressure on the Load Side Pascals Real64 LowPressCutoff; // Minimum Design Pressure on the Source Side Pascals @@ -127,15 +128,15 @@ namespace HeatPumpWaterToWaterHEATING { // Default Constructor GshpPeHeatingSpecs() - : WWHPPlantTypeOfNum(0), Available(false), ON(false), COP(0.0), NomCap(0.0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), - OptPartLoadRat(0.0), LoadSideVolFlowRate(0.0), LoadSideDesignMassFlow(0.0), SourceSideVolFlowRate(0.0), SourceSideDesignMassFlow(0.0), - SourceSideInletNodeNum(0), SourceSideOutletNodeNum(0), LoadSideInletNodeNum(0), LoadSideOutletNodeNum(0), SourceSideUACoeff(0.0), - LoadSideUACoeff(0.0), CompPistonDisp(0.0), CompClearanceFactor(0.0), CompSucPressDrop(0.0), SuperheatTemp(0.0), PowerLosses(0.0), - LossFactor(0.0), HighPressCutoff(0.0), LowPressCutoff(0.0), IsOn(false), MustRun(false), SourceLoopNum(0), SourceLoopSideNum(0), - SourceBranchNum(0), SourceCompNum(0), LoadLoopNum(0), LoadLoopSideNum(0), LoadBranchNum(0), LoadCompNum(0), CondMassFlowIndex(0), - Power(0.0), Energy(0.0), QLoad(0.0), QLoadEnergy(0.0), QSource(0.0), QSourceEnergy(0.0), LoadSideWaterInletTemp(0.0), - SourceSideWaterInletTemp(0.0), LoadSideWaterOutletTemp(0.0), SourceSideWaterOutletTemp(0.0), LoadSideWaterMassFlowRate(0.0), - SourceSideWaterMassFlowRate(0.0), Running(0), plantScanFlag(true), beginEnvironFlag(true) + : WWHPPlantType(DataPlant::PlantEquipmentType::Invalid), Available(false), ON(false), COP(0.0), NomCap(0.0), MinPartLoadRat(0.0), + MaxPartLoadRat(0.0), OptPartLoadRat(0.0), LoadSideVolFlowRate(0.0), LoadSideDesignMassFlow(0.0), SourceSideVolFlowRate(0.0), + SourceSideDesignMassFlow(0.0), SourceSideInletNodeNum(0), SourceSideOutletNodeNum(0), LoadSideInletNodeNum(0), LoadSideOutletNodeNum(0), + SourceSideUACoeff(0.0), LoadSideUACoeff(0.0), CompPistonDisp(0.0), CompClearanceFactor(0.0), CompSucPressDrop(0.0), SuperheatTemp(0.0), + PowerLosses(0.0), LossFactor(0.0), HighPressCutoff(0.0), LowPressCutoff(0.0), IsOn(false), MustRun(false), SourceLoopNum(0), + SourceLoopSideNum(0), SourceBranchNum(0), SourceCompNum(0), LoadLoopNum(0), LoadLoopSideNum(0), LoadBranchNum(0), LoadCompNum(0), + CondMassFlowIndex(0), Power(0.0), Energy(0.0), QLoad(0.0), QLoadEnergy(0.0), QSource(0.0), QSourceEnergy(0.0), + LoadSideWaterInletTemp(0.0), SourceSideWaterInletTemp(0.0), LoadSideWaterOutletTemp(0.0), SourceSideWaterOutletTemp(0.0), + LoadSideWaterMassFlowRate(0.0), SourceSideWaterMassFlowRate(0.0), Running(0), plantScanFlag(true), beginEnvironFlag(true) { } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index c68c8f7cb7f..9677cd3e0af 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -109,7 +109,7 @@ std::string const HPEqFitHeatingUC("HEATPUMP:WATERTOWATER:EQUATIONFIT:HEATING"); std::string const HPEqFitCooling("HeatPump:WatertoWater:EquationFit:Cooling"); std::string const HPEqFitCoolingUC("HEATPUMP:WATERTOWATER:EQUATIONFIT:COOLING"); -PlantComponent *GshpSpecs::factory(EnergyPlusData &state, int wwhp_type, std::string eir_wwhp_name) +PlantComponent *GshpSpecs::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType wwhp_type, std::string eir_wwhp_name) { if (state.dataHPWaterToWaterSimple->GetInputFlag) { GshpSpecs::GetWatertoWaterHPInput(state); @@ -117,7 +117,7 @@ PlantComponent *GshpSpecs::factory(EnergyPlusData &state, int wwhp_type, std::st } for (auto &wwhp : state.dataHPWaterToWaterSimple->GSHP) { - if (wwhp.Name == eir_wwhp_name && wwhp.WWHPPlantTypeOfNum == wwhp_type) { + if (wwhp.Name == eir_wwhp_name && wwhp.WWHPType == wwhp_type) { return &wwhp; } } @@ -132,16 +132,16 @@ void GshpSpecs::simulate(EnergyPlusData &state, Real64 &CurLoad, [[maybe_unused]] bool const RunFlag) { - if (this->WWHPPlantTypeOfNum == DataPlant::TypeOf_HPWaterEFCooling) { + if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFCooling) { if (calledFromLocation.loopNum == this->LoadLoopNum) { // chilled water loop - this->InitWatertoWaterHP(state, this->WWHPPlantTypeOfNum, this->Name, FirstHVACIteration, CurLoad); + this->InitWatertoWaterHP(state, this->WWHPType, this->Name, FirstHVACIteration, CurLoad); this->CalcWatertoWaterHPCooling(state, CurLoad); this->UpdateGSHPRecords(state); } else if (calledFromLocation.loopNum == this->SourceLoopNum) { // condenser loop PlantUtilities::UpdateChillerComponentCondenserSide(state, this->SourceLoopNum, this->SourceLoopSideNum, - DataPlant::TypeOf_HPWaterEFCooling, + DataPlant::PlantEquipmentType::HPWaterEFCooling, this->SourceSideInletNodeNum, this->SourceSideOutletNodeNum, this->reportQSource, @@ -152,16 +152,16 @@ void GshpSpecs::simulate(EnergyPlusData &state, } else { ShowFatalError(state, "SimHPWatertoWaterSimple:: Invalid loop connection " + HPEqFitCooling + ", Requested Unit=" + this->Name); } - } else if (this->WWHPPlantTypeOfNum == DataPlant::TypeOf_HPWaterEFHeating) { + } else if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFHeating) { if (calledFromLocation.loopNum == this->LoadLoopNum) { // chilled water loop - this->InitWatertoWaterHP(state, this->WWHPPlantTypeOfNum, this->Name, FirstHVACIteration, CurLoad); + this->InitWatertoWaterHP(state, this->WWHPType, this->Name, FirstHVACIteration, CurLoad); this->CalcWatertoWaterHPHeating(state, CurLoad); this->UpdateGSHPRecords(state); } else if (calledFromLocation.loopNum == this->SourceLoopNum) { // condenser loop PlantUtilities::UpdateChillerComponentCondenserSide(state, this->SourceLoopNum, this->SourceLoopSideNum, - DataPlant::TypeOf_HPWaterEFHeating, + DataPlant::PlantEquipmentType::HPWaterEFHeating, this->SourceSideInletNodeNum, this->SourceSideOutletNodeNum, -this->reportQSource, @@ -182,10 +182,10 @@ void GshpSpecs::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] const Pl bool initFirstHVAC = true; Real64 initCurLoad = 0.0; - this->InitWatertoWaterHP(state, this->WWHPPlantTypeOfNum, this->Name, initFirstHVAC, initCurLoad); - if (this->WWHPPlantTypeOfNum == DataPlant::TypeOf_HPWaterEFCooling) { + this->InitWatertoWaterHP(state, this->WWHPType, this->Name, initFirstHVAC, initCurLoad); + if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFCooling) { this->sizeCoolingWaterToWaterHP(state); - } else if (this->WWHPPlantTypeOfNum == DataPlant::TypeOf_HPWaterEFHeating) { + } else if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFHeating) { this->sizeHeatingWaterToWaterHP(state); } } @@ -193,11 +193,11 @@ void GshpSpecs::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] const Pl void GshpSpecs::getDesignCapacities(EnergyPlusData &state, const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) { if (calledFromLocation.loopNum == this->LoadLoopNum) { - if (this->WWHPPlantTypeOfNum == DataPlant::TypeOf_HPWaterEFCooling) { + if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFCooling) { MinLoad = 0.0; MaxLoad = this->RatedCapCool; OptLoad = this->RatedCapCool; - } else if (this->WWHPPlantTypeOfNum == DataPlant::TypeOf_HPWaterEFHeating) { + } else if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFHeating) { MinLoad = 0.0; MaxLoad = this->RatedCapHeat; OptLoad = this->RatedCapHeat; @@ -231,8 +231,6 @@ void GshpSpecs::GetWatertoWaterHPInput(EnergyPlusData &state) // Using/Aliasing using BranchNodeConnections::TestCompSet; using CurveManager::GetCurveIndex; - using DataPlant::TypeOf_HPWaterEFCooling; - using DataPlant::TypeOf_HPWaterEFHeating; using NodeInputManager::GetOnlySingleNode; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -278,7 +276,7 @@ void GshpSpecs::GetWatertoWaterHPInput(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks); GlobalNames::VerifyUniqueInterObjectName( state, state.dataHPWaterToWaterSimple->HeatPumpWaterUniqueNames, state.dataIPShortCut->cAlphaArgs(1), HPEqFitCoolingUC, ErrorsFound); - state.dataHPWaterToWaterSimple->GSHP(GSHPNum).WWHPPlantTypeOfNum = TypeOf_HPWaterEFCooling; + state.dataHPWaterToWaterSimple->GSHP(GSHPNum).WWHPType = DataPlant::PlantEquipmentType::HPWaterEFCooling; state.dataHPWaterToWaterSimple->GSHP(GSHPNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataHPWaterToWaterSimple->GSHP(GSHPNum).RatedLoadVolFlowCool = state.dataIPShortCut->rNumericArgs(1); if (state.dataHPWaterToWaterSimple->GSHP(GSHPNum).RatedLoadVolFlowCool == DataSizing::AutoSize) { @@ -450,7 +448,7 @@ void GshpSpecs::GetWatertoWaterHPInput(EnergyPlusData &state) state.dataIPShortCut->lAlphaFieldBlanks); GlobalNames::VerifyUniqueInterObjectName( state, state.dataHPWaterToWaterSimple->HeatPumpWaterUniqueNames, state.dataIPShortCut->cAlphaArgs(1), HPEqFitHeatingUC, ErrorsFound); - state.dataHPWaterToWaterSimple->GSHP(GSHPNum).WWHPPlantTypeOfNum = TypeOf_HPWaterEFHeating; + state.dataHPWaterToWaterSimple->GSHP(GSHPNum).WWHPType = DataPlant::PlantEquipmentType::HPWaterEFHeating; state.dataHPWaterToWaterSimple->GSHP(GSHPNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataHPWaterToWaterSimple->GSHP(GSHPNum).RatedLoadVolFlowHeat = state.dataIPShortCut->rNumericArgs(1); if (state.dataHPWaterToWaterSimple->GSHP(GSHPNum).RatedLoadVolFlowHeat == DataSizing::AutoSize) { @@ -695,8 +693,8 @@ void GshpSpecs::GetWatertoWaterHPInput(EnergyPlusData &state) } void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, - int const GSHPTypeNum, // Type of GSHP - [[maybe_unused]] std::string const &GSHPName, // User Specified Name of GSHP + DataPlant::PlantEquipmentType const GSHPTypeNum, // Type of GSHP + [[maybe_unused]] std::string const &GSHPName, // User Specified Name of GSHP [[maybe_unused]] bool const FirstHVACIteration, Real64 const MyLoad // Demand Load ) @@ -725,8 +723,6 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, // Using/Aliasing auto &SysTimeElapsed = state.dataHVACGlobal->SysTimeElapsed; - using DataPlant::TypeOf_HPWaterEFCooling; - using DataPlant::TypeOf_HPWaterEFHeating; using FluidProperties::GetDensityGlycol; using PlantUtilities::InitComponentNodes; using PlantUtilities::SetComponentFlowRate; @@ -756,7 +752,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->WWHPPlantTypeOfNum, + this->WWHPType, this->SourceLoopNum, this->SourceLoopSideNum, this->SourceBranchNum, @@ -769,7 +765,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, _); PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->WWHPPlantTypeOfNum, + this->WWHPType, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, @@ -783,7 +779,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, if (!errFlag) { PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->LoadLoopNum, this->LoadLoopSideNum, this->SourceLoopNum, this->SourceLoopSideNum, this->WWHPPlantTypeOfNum, true); + state, this->LoadLoopNum, this->LoadLoopSideNum, this->SourceLoopNum, this->SourceLoopSideNum, this->WWHPType, true); } if (errFlag) { @@ -810,7 +806,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, this->IsOn = false; this->MustRun = true; - if (this->WWHPPlantTypeOfNum == TypeOf_HPWaterEFHeating) { + if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFHeating) { rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, @@ -823,7 +819,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->RatedSourceVolFlowHeat * rho; - } else if (this->WWHPPlantTypeOfNum == TypeOf_HPWaterEFCooling) { + } else if (this->WWHPType == DataPlant::PlantEquipmentType::HPWaterEFCooling) { rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, @@ -878,10 +874,10 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, LoopNum = this->LoadLoopNum; LoopSideNum = this->LoadLoopSideNum; - if (MyLoad > 0.0 && GSHPTypeNum == TypeOf_HPWaterEFHeating) { + if (MyLoad > 0.0 && GSHPTypeNum == DataPlant::PlantEquipmentType::HPWaterEFHeating) { this->MustRun = true; this->IsOn = true; - } else if (MyLoad < 0.0 && GSHPTypeNum == TypeOf_HPWaterEFCooling) { + } else if (MyLoad < 0.0 && GSHPTypeNum == DataPlant::PlantEquipmentType::HPWaterEFCooling) { this->MustRun = true; this->IsOn = true; } else { @@ -919,7 +915,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, // IS THIS RIGHT? - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->reportSourceSideMassFlowRate); // Set flows if the heat pump is running } else { // the heat pump must run @@ -974,7 +970,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->reportSourceSideMassFlowRate); return; } @@ -986,7 +982,7 @@ void GshpSpecs::InitWatertoWaterHP(EnergyPlusData &state, this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->reportSourceSideMassFlowRate); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh b/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh index 420a462836e..5c9638f8fec 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh @@ -67,15 +67,14 @@ namespace HeatPumpWaterToWaterSimple { struct GshpSpecs : public PlantComponent { // Members - std::string Name; // user identifier - bool checkEquipName; // name check flag - std::string WatertoWaterHPType; // Type of WatertoAirHP ie. Heating or Cooling - int WWHPPlantTypeOfNum; // equipment type num - bool Available; // need an array of logicals--load identifiers of available equipment - bool ON; // simulate the machine at it's operating part load ratio - bool IsOn; // flag that the heat pump is ON during current time step - bool MustRun; // flag that the heat pump is MUST RUN during current time step - Real64 SourceSideDesignMassFlow; // Design flow rate (kg/s) + std::string Name; // user identifier + bool checkEquipName; // name check flag + DataPlant::PlantEquipmentType WWHPType; // equipment type num + bool Available; // need an array of logicals--load identifiers of available equipment + bool ON; // simulate the machine at it's operating part load ratio + bool IsOn; // flag that the heat pump is ON during current time step + bool MustRun; // flag that the heat pump is MUST RUN during current time step + Real64 SourceSideDesignMassFlow; // Design flow rate (kg/s) Real64 LoadSideDesignMassFlow; // Design flow rate (kg/s) @@ -150,26 +149,26 @@ namespace HeatPumpWaterToWaterSimple { // Default Constructor GshpSpecs() - : checkEquipName(true), WWHPPlantTypeOfNum(0), Available(false), ON(false), IsOn(false), MustRun(false), SourceSideDesignMassFlow(0.0), - LoadSideDesignMassFlow(0.0), RatedLoadVolFlowCool(0.0), ratedLoadVolFlowCoolWasAutoSized(false), RatedSourceVolFlowCool(0.0), - ratedSourceVolFlowCoolWasAutoSized(false), RatedCapCool(0.0), ratedCapCoolWasAutoSized(false), RatedPowerCool(0.0), - ratedPowerCoolWasAutoSized(false), CoolCapCurveIndex(0), CoolPowCurveIndex(0), CoolCapNegativeCounter(0), CoolCapNegativeIndex(0), - CoolPowerNegativeCounter(0), CoolPowerNegativeIndex(0), RatedLoadVolFlowHeat(0.0), ratedLoadVolFlowHeatWasAutoSized(false), - RatedSourceVolFlowHeat(0.0), ratedSourceVolFlowHeatWasAutoSized(false), RatedCapHeat(0.0), ratedCapHeatWasAutoSized(false), - RatedPowerHeat(0.0), ratedPowerHeatWasAutoSized(false), HeatCapCurveIndex(0), HeatPowCurveIndex(0), LoadSideInletNodeNum(0), - LoadSideOutletNodeNum(0), SourceSideInletNodeNum(0), SourceSideOutletNodeNum(0), HeatCapNegativeCounter(0), HeatCapNegativeIndex(0), - HeatPowerNegativeCounter(0), HeatPowerNegativeIndex(0), SourceLoopNum(0), SourceLoopSideNum(0), SourceBranchNum(0), SourceCompNum(0), - LoadLoopNum(0), LoadLoopSideNum(0), LoadBranchNum(0), LoadCompNum(0), CondMassFlowIndex(0), refCOP(0.0), sizFac(0.0), companionIndex(0), - companionIdentified(false), reportPower(0.0), reportEnergy(0.0), reportQLoad(0.0), reportQLoadEnergy(0.0), reportQSource(0.0), - reportQSourceEnergy(0.0), reportLoadSideMassFlowRate(0.0), reportLoadSideInletTemp(0.0), reportLoadSideOutletTemp(0.0), - reportSourceSideMassFlowRate(0.0), reportSourceSideInletTemp(0.0), reportSourceSideOutletTemp(0.0), MyPlantScanFlag(true), - MyEnvrnFlag(true), myCoolingSizesReported(false), myHeatingSizesReported(false) + : checkEquipName(true), WWHPType(DataPlant::PlantEquipmentType::Invalid), Available(false), ON(false), IsOn(false), MustRun(false), + SourceSideDesignMassFlow(0.0), LoadSideDesignMassFlow(0.0), RatedLoadVolFlowCool(0.0), ratedLoadVolFlowCoolWasAutoSized(false), + RatedSourceVolFlowCool(0.0), ratedSourceVolFlowCoolWasAutoSized(false), RatedCapCool(0.0), ratedCapCoolWasAutoSized(false), + RatedPowerCool(0.0), ratedPowerCoolWasAutoSized(false), CoolCapCurveIndex(0), CoolPowCurveIndex(0), CoolCapNegativeCounter(0), + CoolCapNegativeIndex(0), CoolPowerNegativeCounter(0), CoolPowerNegativeIndex(0), RatedLoadVolFlowHeat(0.0), + ratedLoadVolFlowHeatWasAutoSized(false), RatedSourceVolFlowHeat(0.0), ratedSourceVolFlowHeatWasAutoSized(false), RatedCapHeat(0.0), + ratedCapHeatWasAutoSized(false), RatedPowerHeat(0.0), ratedPowerHeatWasAutoSized(false), HeatCapCurveIndex(0), HeatPowCurveIndex(0), + LoadSideInletNodeNum(0), LoadSideOutletNodeNum(0), SourceSideInletNodeNum(0), SourceSideOutletNodeNum(0), HeatCapNegativeCounter(0), + HeatCapNegativeIndex(0), HeatPowerNegativeCounter(0), HeatPowerNegativeIndex(0), SourceLoopNum(0), SourceLoopSideNum(0), + SourceBranchNum(0), SourceCompNum(0), LoadLoopNum(0), LoadLoopSideNum(0), LoadBranchNum(0), LoadCompNum(0), CondMassFlowIndex(0), + refCOP(0.0), sizFac(0.0), companionIndex(0), companionIdentified(false), reportPower(0.0), reportEnergy(0.0), reportQLoad(0.0), + reportQLoadEnergy(0.0), reportQSource(0.0), reportQSourceEnergy(0.0), reportLoadSideMassFlowRate(0.0), reportLoadSideInletTemp(0.0), + reportLoadSideOutletTemp(0.0), reportSourceSideMassFlowRate(0.0), reportSourceSideInletTemp(0.0), reportSourceSideOutletTemp(0.0), + MyPlantScanFlag(true), MyEnvrnFlag(true), myCoolingSizesReported(false), myHeatingSizesReported(false) { } virtual ~GshpSpecs() = default; - static PlantComponent *factory(EnergyPlusData &state, int wwhp_type, std::string eir_wwhp_name); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType wwhp_type, std::string eir_wwhp_name); static void GetWatertoWaterHPInput(EnergyPlusData &state); @@ -185,8 +184,8 @@ namespace HeatPumpWaterToWaterSimple { void getSizingFactor(Real64 &sizingFactor) override; void InitWatertoWaterHP(EnergyPlusData &state, - int GSHPTypeNum, // Type of GSHP - std::string const &GSHPName, // User Specified Name of GSHP + DataPlant::PlantEquipmentType GSHPTypeNum, // Type of GSHP + std::string const &GSHPName, // User Specified Name of GSHP bool FirstHVACIteration, Real64 MyLoad // Demand Load ); diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index be68629f4a0..07261166b5e 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -3305,7 +3305,7 @@ namespace HeatingCoils { } int GetCoilInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -3349,7 +3349,7 @@ namespace HeatingCoils { } if (WhichCoil == 0) { - ShowSevereError(state, "GetCoilInletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilInletNode: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } @@ -3358,7 +3358,7 @@ namespace HeatingCoils { } int GetCoilOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -3402,7 +3402,7 @@ namespace HeatingCoils { } if (WhichCoil == 0) { - ShowSevereError(state, "GetCoilOutletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilOutletNode: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } diff --git a/src/EnergyPlus/HeatingCoils.hh b/src/EnergyPlus/HeatingCoils.hh index d29847fa803..23100e5be39 100644 --- a/src/EnergyPlus/HeatingCoils.hh +++ b/src/EnergyPlus/HeatingCoils.hh @@ -279,13 +279,13 @@ namespace HeatingCoils { ); int GetCoilInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index ba3e401eb8b..5b65e538f06 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -509,7 +509,7 @@ namespace ICEngineElectricGenerator { PlantUtilities::UpdateComponentHeatRecoverySide(state, this->HRLoopNum, this->HRLoopSideNum, - DataPlant::TypeOf_Generator_ICEngine, + DataPlant::PlantEquipmentType::Generator_ICEngine, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, this->QTotalHeatRecovered, @@ -894,7 +894,7 @@ namespace ICEngineElectricGenerator { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Generator_ICEngine, + DataPlant::PlantEquipmentType::Generator_ICEngine, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index 5a25f95b299..72a94cbff98 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -174,7 +174,7 @@ namespace IceThermalStorage { // then reset CurLoad to original EquipDemand. // Allow negative CurLoad. For cold storage this means the storage should // charge, for hot storage, this means the storage should discharge. - if (thisComp.CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { + if (thisComp.CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) { Real64 localCurLoad = thisComp.EquipDemand; if (localCurLoad != 0) RunFlag = true; } @@ -211,9 +211,9 @@ namespace IceThermalStorage { Real64 TempIn = state.dataLoopNodes->Node(this->PltInletNodeNum).Temp; { auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPt = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPt = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPointHi; } else { assert(false); @@ -332,9 +332,9 @@ namespace IceThermalStorage { Real64 TempSetPt(0.0); // Setpoint temperature defined by loop controls [C] { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPt = state.dataLoopNodes->Node(NodeNumOut).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPt = state.dataLoopNodes->Node(NodeNumOut).TempSetPointHi; } else { assert(false); @@ -348,7 +348,7 @@ namespace IceThermalStorage { this->MassFlowRate = state.dataLoopNodes->Node(NodeNumIn).MassFlowRate; // if two-way common pipe and no mass flow and tank is not full, then use design flow rate - if ((state.dataPlnt->PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && + if ((state.dataPlnt->PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::CommonPipeType::TwoWay) && (std::abs(this->MassFlowRate) < DataBranchAirLoopPlant::MassFlowTolerance) && (this->IceFracRemaining < TankChargeToler)) { this->MassFlowRate = this->DesignMassFlowRate; } @@ -1332,7 +1332,7 @@ namespace IceThermalStorage { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_TS_IceDetailed, + DataPlant::PlantEquipmentType::TS_IceDetailed, this->PlantLoopNum, this->PlantLoopSideNum, this->PlantBranchNum, @@ -1371,7 +1371,7 @@ namespace IceThermalStorage { this->PlantBranchNum, this->PlantCompNum); - if ((state.dataPlnt->PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && + if ((state.dataPlnt->PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::CommonPipeType::TwoWay) && (this->PlantLoopSideNum == DataPlant::SupplySide)) { // up flow priority of other components on the same branch as the Ice tank for (CompNum = 1; @@ -1415,7 +1415,7 @@ namespace IceThermalStorage { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_TS_IceSimple, + DataPlant::PlantEquipmentType::TS_IceSimple, this->LoopNum, this->LoopSideNum, this->BranchNum, @@ -1446,7 +1446,7 @@ namespace IceThermalStorage { this->LoopSideNum, this->BranchNum, this->CompNum); - if ((state.dataPlnt->PlantLoop(this->LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && + if ((state.dataPlnt->PlantLoop(this->LoopNum).CommonPipeType == DataPlant::CommonPipeType::TwoWay) && (this->LoopSideNum == DataPlant::SupplySide)) { // up flow priority of other components on the same branch as the Ice tank for (int compNum = 1; @@ -1541,9 +1541,9 @@ namespace IceThermalStorage { this->ITSOutletTemp = this->ITSInletTemp; //[C] { auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->ITSOutletSetPointTemp = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPointHi; } } @@ -1576,9 +1576,9 @@ namespace IceThermalStorage { this->ITSOutletTemp = this->ITSInletTemp; //[C] { auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->ITSOutletSetPointTemp = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPointHi; } } @@ -1723,9 +1723,9 @@ namespace IceThermalStorage { { auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->ITSOutletSetPointTemp = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPointHi; } } @@ -1820,9 +1820,9 @@ namespace IceThermalStorage { Real64 ITSOutletTemp_loc = 0.0; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { ITSOutletTemp_loc = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { ITSOutletTemp_loc = state.dataLoopNodes->Node(this->PltOutletNodeNum).TempSetPointHi; } else { assert(false); diff --git a/src/EnergyPlus/IntegratedHeatPump.cc b/src/EnergyPlus/IntegratedHeatPump.cc index 307467a6bd4..d1a24f7a3f6 100644 --- a/src/EnergyPlus/IntegratedHeatPump.cc +++ b/src/EnergyPlus/IntegratedHeatPump.cc @@ -2451,24 +2451,30 @@ void DecideWorkMode(EnergyPlusData &state, state.dataLoopNodes->Node(state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WaterOutletNodeNum).Temp = state.dataLoopNodes->Node(state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WaterInletNodeNum).Temp; - int tankType = state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WHtankType; + DataPlant::PlantEquipmentType tankType = state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WHtankType; - if ((tankType == DataPlant::TypeOf_WtrHeaterMixed) || (tankType == DataPlant::TypeOf_WtrHeaterStratified) || - (tankType == DataPlant::TypeOf_ChilledWaterTankMixed) || (tankType == DataPlant::TypeOf_ChilledWaterTankStratified)) { + switch (tankType) { + case DataPlant::PlantEquipmentType::WtrHeaterMixed: + case DataPlant::PlantEquipmentType::WtrHeaterStratified: + case DataPlant::PlantEquipmentType::ChilledWaterTankMixed: + case DataPlant::PlantEquipmentType::ChilledWaterTankStratified: + { int tankIDX = WaterThermalTanks::getTankIDX(state, state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WHtankName, state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WHtankID); auto &tank = state.dataWaterThermalTanks->WaterThermalTank(tankIDX); tank.callerLoopNum = state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).LoopNum; - PlantLocation A(0, 0, 0, 0); tank.simulate(state, A, true, MyLoad, true); - tank.callerLoopNum = 0; - } else if (tankType == DataPlant::TypeOf_HeatPumpWtrHeaterPumped || tankType == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) { + break; + } + case DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped: + case DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped: + { int hpIDX = WaterThermalTanks::getHPTankIDX(state, state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WHtankName, state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WHtankID); @@ -2477,11 +2483,13 @@ void DecideWorkMode(EnergyPlusData &state, auto &tank = state.dataWaterThermalTanks->WaterThermalTank(tankIDX); tank.callerLoopNum = state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).LoopNum; state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).WHtankType = tankType; - PlantLocation A(0, 0, 0, 0); HPWH.simulate(state, A, true, MyLoad, true); - tank.callerLoopNum = 0; + break; + } + default: + break; } } state.dataIntegratedHP->IntegratedHeatPumps(DXCoilNum).CheckWHCall = false; // clear checking flag diff --git a/src/EnergyPlus/IntegratedHeatPump.hh b/src/EnergyPlus/IntegratedHeatPump.hh index 8b2f74fa5f8..df4a9690702 100644 --- a/src/EnergyPlus/IntegratedHeatPump.hh +++ b/src/EnergyPlus/IntegratedHeatPump.hh @@ -56,6 +56,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -138,7 +139,7 @@ namespace IntegratedHeatPump { // limit of water volume before switching from SCDWH to SCWH Real64 TimeLimitSHDWH; // time limit before turning from SHDWH to electric heating - int WHtankType; + DataPlant::PlantEquipmentType WHtankType; std::string WHtankName; int WHtankID; int LoopNum; @@ -212,10 +213,10 @@ namespace IntegratedHeatPump { SHDWHWHCoilIndex(0), AirCoolInletNodeNum(0), AirHeatInletNodeNum(0), AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), WaterTankoutNod(0), ModeMatchSCWH(0), MinSpedSCWH(1), MinSpedSCDWH(1), MinSpedSHDWH(1), TindoorOverCoolAllow(0.0), TambientOverCoolAllow(0.0), TindoorWHHighPriority(0.0), TambientWHHighPriority(0.0), WaterVolSCDWH(0.0), TimeLimitSHDWH(0.0), - WHtankType(0), WHtankID(0), LoopNum(0), LoopSideNum(0), IsWHCallAvail(false), CheckWHCall(false), CurMode(IHPOperationMode::IdleMode), - ControlledZoneTemp(0), WaterFlowAccumVol(0), SHDWHRunTime(0), CoolVolFlowScale(0), HeatVolFlowScale(0), MaxHeatAirMassFlow(0), - MaxHeatAirVolFlow(0), MaxCoolAirMassFlow(0), MaxCoolAirVolFlow(0), IHPCoilsSized(false), IDFanID(0), IDFanPlace(0), - ODAirInletNodeNum(0), // oudoor coil inlet Nod + WHtankType(DataPlant::PlantEquipmentType::Invalid), WHtankID(0), LoopNum(0), LoopSideNum(0), IsWHCallAvail(false), CheckWHCall(false), + CurMode(IHPOperationMode::IdleMode), ControlledZoneTemp(0), WaterFlowAccumVol(0), SHDWHRunTime(0), CoolVolFlowScale(0), + HeatVolFlowScale(0), MaxHeatAirMassFlow(0), MaxHeatAirVolFlow(0), MaxCoolAirMassFlow(0), MaxCoolAirVolFlow(0), IHPCoilsSized(false), + IDFanID(0), IDFanPlace(0), ODAirInletNodeNum(0), // oudoor coil inlet Nod ODAirOutletNodeNum(0), // oudoor coil outlet Nod TankSourceWaterMassFlowRate(0), AirFlowSavInWaterLoop(0), AirFlowSavInAirLoop(0), AirLoopFlowRate(0.0), // air loop mass flow rate TotalCoolingRate(0.0), // total cooling rate [w] diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index b574557d9f6..9a218c2db39 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -80,7 +80,7 @@ #include #include #include -#include +#include #include #include #include @@ -1919,8 +1919,7 @@ namespace LowTempRadiantSystem { // DATE WRITTEN November 2000 // Using/Aliasing - using DataPlant::TypeOf_LowTempRadiant_ConstFlow; - using DataPlant::TypeOf_LowTempRadiant_VarFlow; + using DataSizing::AutoSize; using DataZoneEquipment::CheckZoneEquipmentList; using FluidProperties::GetDensityGlycol; @@ -2053,7 +2052,7 @@ namespace LowTempRadiantSystem { if (state.dataLowTempRadSys->HydrRadSys(RadSysNum).HotWaterInNode > 0) { ScanPlantLoopsForObject(state, state.dataLowTempRadSys->HydrRadSys(RadSysNum).Name, - TypeOf_LowTempRadiant_VarFlow, + DataPlant::PlantEquipmentType::LowTempRadiant_VarFlow, state.dataLowTempRadSys->HydrRadSys(RadSysNum).HWLoopNum, state.dataLowTempRadSys->HydrRadSys(RadSysNum).HWLoopSide, state.dataLowTempRadSys->HydrRadSys(RadSysNum).HWBranchNum, @@ -2071,7 +2070,7 @@ namespace LowTempRadiantSystem { if (state.dataLowTempRadSys->HydrRadSys(RadSysNum).ColdWaterInNode > 0) { ScanPlantLoopsForObject(state, state.dataLowTempRadSys->HydrRadSys(RadSysNum).Name, - TypeOf_LowTempRadiant_VarFlow, + DataPlant::PlantEquipmentType::LowTempRadiant_VarFlow, state.dataLowTempRadSys->HydrRadSys(RadSysNum).CWLoopNum, state.dataLowTempRadSys->HydrRadSys(RadSysNum).CWLoopSide, state.dataLowTempRadSys->HydrRadSys(RadSysNum).CWBranchNum, @@ -2098,7 +2097,7 @@ namespace LowTempRadiantSystem { if (state.dataLowTempRadSys->CFloRadSys(RadSysNum).HotWaterInNode > 0) { ScanPlantLoopsForObject(state, state.dataLowTempRadSys->CFloRadSys(RadSysNum).Name, - TypeOf_LowTempRadiant_ConstFlow, + DataPlant::PlantEquipmentType::LowTempRadiant_ConstFlow, state.dataLowTempRadSys->CFloRadSys(RadSysNum).HWLoopNum, state.dataLowTempRadSys->CFloRadSys(RadSysNum).HWLoopSide, state.dataLowTempRadSys->CFloRadSys(RadSysNum).HWBranchNum, @@ -2116,7 +2115,7 @@ namespace LowTempRadiantSystem { if (state.dataLowTempRadSys->CFloRadSys(RadSysNum).ColdWaterInNode > 0) { ScanPlantLoopsForObject(state, state.dataLowTempRadSys->CFloRadSys(RadSysNum).Name, - TypeOf_LowTempRadiant_ConstFlow, + DataPlant::PlantEquipmentType::LowTempRadiant_ConstFlow, state.dataLowTempRadSys->CFloRadSys(RadSysNum).CWLoopNum, state.dataLowTempRadSys->CFloRadSys(RadSysNum).CWLoopSide, state.dataLowTempRadSys->CFloRadSys(RadSysNum).CWBranchNum, diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index d8018919440..6a46a319add 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -691,7 +691,7 @@ void MicroCHPDataStruct::simulate(EnergyPlusData &state, PlantUtilities::UpdateComponentHeatRecoverySide(state, this->CWLoopNum, this->CWLoopSideNum, - DataPlant::TypeOf_Generator_MicroCHP, + DataPlant::PlantEquipmentType::Generator_MicroCHP, this->PlantInletNodeID, this->PlantOutletNodeID, this->A42Model.QdotHR, @@ -1528,7 +1528,7 @@ void MicroCHPDataStruct::oneTimeInit(EnergyPlusData &state) errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Generator_MicroCHP, + DataPlant::PlantEquipmentType::Generator_MicroCHP, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 22084ba650f..b8e0fdb4f17 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -1975,7 +1975,7 @@ void MTGeneratorSpecs::oneTimeInit(EnergyPlusData &state) errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_Generator_MicroTurbine, + DataPlant::PlantEquipmentType::Generator_MicroTurbine, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index b8e03a334c7..1c542ca63b6 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -247,10 +247,7 @@ namespace OutdoorAirUnit { auto &GetWHXCoilInletNode(HVACHXAssistedCoolingCoil::GetCoilInletNode); auto &GetWHXCoilOutletNode(HVACHXAssistedCoolingCoil::GetCoilOutletNode); using DataHVACGlobals::cFanTypes; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using Fans::GetFanAvailSchPtr; using Fans::GetFanDesignVolumeFlowRate; using Fans::GetFanIndex; @@ -657,255 +654,260 @@ namespace OutdoorAirUnit { // Get information of component for (InListNum = 1; InListNum <= NumInList; ++InListNum) { OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentName = AlphArray(InListNum * 2 + 1); - OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType = AlphArray(InListNum * 2); + + OutAirUnit(OAUnitNum).OAEquip(InListNum).Type = + static_cast(getEnumerationValue(CompTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(InListNum * 2)))); + CompNum = InListNum; - { - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType)); - // Coil Types - if (SELECT_CASE_var == "COIL:COOLING:WATER") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::WaterCoil_Cooling; - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum = TypeOf_CoilWaterCooling; - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = - GetWaterCoilIndex(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = - GetWCoilInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + + // Coil Types + switch (OutAirUnit(OAUnitNum).OAEquip(InListNum).Type) { + case (CompType::WaterCoil_Cooling): { + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = + GetWaterCoilIndex(state, + CompTypeNamesUC[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = + GetWCoilInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = + GetWCoilOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = + GetCoilWaterInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = - GetWCoilOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = + GetCoilWaterOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; - - } else if (SELECT_CASE_var == "COIL:HEATING:WATER") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::WaterCoil_SimpleHeat; - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum = TypeOf_CoilWaterSimpleHeating; - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = - GetWaterCoilIndex(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = - GetWCoilInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = GetWCoilOutletNode( - state, "Coil:Heating:Water", OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate( - state, "Coil:Heating:Water", OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; - - } else if (SELECT_CASE_var == "COIL:HEATING:STEAM") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::SteamCoil_AirHeat; - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum = TypeOf_CoilSteamAirHeating; - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = - GetSteamCoilIndex(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = + WaterCoils::GetCoilMaxWaterFlowRate(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; + break; + } + case (CompType::WaterCoil_SimpleHeat): { + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = + GetWaterCoilIndex(state, + CompTypeNamesUC[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = + GetWCoilInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = + GetWCoilOutletNode(state, "Coil:Heating:Water", OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = + GetCoilWaterInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = - GetCoilAirInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = - GetCoilAirOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = - GetCoilSteamInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = - GetCoilSteamOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - - OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = - GetCoilMaxSteamFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; - // below: no extra error needed if steam properties not in input - // file because getting the steam coil will have done that. - OutAirUnit(OAUnitNum).OAEquip(CompNum).FluidIndex = FindRefrigerant(state, "Steam"); - - } else if (SELECT_CASE_var == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::WaterCoil_DetailedCool; - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = - GetWaterCoilIndex(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = + GetCoilWaterOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate( + state, "Coil:Heating:Water", OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; + break; + } + case (CompType::SteamCoil_AirHeat): { + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = + GetSteamCoilIndex(state, + CompTypeNamesUC[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = + GetCoilAirInletNode(state, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = + GetCoilAirOutletNode(state, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = + GetCoilSteamInletNode(state, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum = TypeOf_CoilWaterDetailedFlatCooling; - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = - GetWCoilInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = + GetCoilSteamOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + + OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = + GetCoilMaxSteamFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; + // below: no extra error needed if steam properties not in input + // file because getting the steam coil will have done that. + OutAirUnit(OAUnitNum).OAEquip(CompNum).FluidIndex = FindRefrigerant(state, "Steam"); + break; + } + case (CompType::WaterCoil_DetailedCool): { + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex = + GetWaterCoilIndex(state, + CompTypeNamesUC[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = + GetWCoilInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = + GetWCoilOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = + GetCoilWaterInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = - GetWCoilOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = + GetCoilWaterOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = - WaterCoils::GetCoilMaxWaterFlowRate(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; - - } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::WaterCoil_CoolingHXAsst; - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = - GetWHXCoilInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = - GetWHXCoilOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = - GetCoilWaterInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = - GetCoilWaterOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = - GetHXAssistedCoilFlowRate(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; - - } else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::Coil_ElectricHeat; - // Get OutAirUnit( OAUnitNum ).OAEquip( CompNum ).ComponentIndex, 2 types of mining functions to choose from - GetHeatingCoilIndex(state, + OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = + WaterCoils::GetCoilMaxWaterFlowRate(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; + break; + } + case (CompType::WaterCoil_CoolingHXAsst): { + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = + GetWHXCoilInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = - GetElecCoilInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = - GetElecCoilOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = + GetWHXCoilOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterInletNode = + GetCoilWaterInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilWaterOutletNode = + GetCoilWaterOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow = + GetHXAssistedCoilFlowRate(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - - } else if (SELECT_CASE_var == "COIL:HEATING:FUEL") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::Coil_GasHeat; - // Get OutAirUnit( OAUnitNum ).OAEquip( CompNum ).ComponentIndex, 2 types of mining functions to choose from - GetHeatingCoilIndex(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, - ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = - GetCoilInletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).MinVolWaterFlow = 0.0; + break; + } + case (CompType::Coil_ElectricHeat): { + // Get OutAirUnit( OAUnitNum ).OAEquip( CompNum ).ComponentIndex, 2 types of mining functions to choose from + GetHeatingCoilIndex(state, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = + GetElecCoilInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); - OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = - GetCoilOutletNode(state, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = + GetElecCoilOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, ErrorsFound); + break; + } + case (CompType::Coil_GasHeat): { + // Get OutAirUnit( OAUnitNum ).OAEquip( CompNum ).ComponentIndex, 2 types of mining functions to choose from + GetHeatingCoilIndex(state, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirInletNode = + GetCoilInletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilAirOutletNode = + GetCoilOutletNode(state, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)], + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + ErrorsFound); + break; + } + case (CompType::DXSystem): { + // set the data for 100% DOAS DX cooling coil + // is a different function call needed here? similar to one in HVACDXSystem + // CheckDXCoolingCoilInOASysExists(state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName); + break; + } + case (CompType::DXHeatPumpSystem): { + break; + } + case (CompType::UnitarySystemModel): { + UnitarySystems::UnitarySys thisSys; + OutAirUnit(OAUnitNum).OAEquip(CompNum).compPointer = thisSys.factory(state, + DataHVACGlobals::UnitarySys_AnyCoilType, + OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, + false, + OAUnitNum); + UnitarySystems::UnitarySys::checkUnitarySysCoilInOASysExists( + state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, OAUnitNum); - } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:DX") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::DXSystem; - // set the data for 100% DOAS DX cooling coil - // is a different function call needed here? similar to one in HVACDXSystem - // CheckDXCoolingCoilInOASysExists(state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName); - - } else if (SELECT_CASE_var == "COILSYSTEM:HEATING:DX") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::DXHeatPumpSystem; - - } else if (SELECT_CASE_var == "AIRLOOPHVAC:UNITARYSYSTEM") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::UnitarySystemModel; - UnitarySystems::UnitarySys thisSys; - OutAirUnit(OAUnitNum).OAEquip(CompNum).compPointer = - thisSys.factory(state, - DataHVACGlobals::UnitarySys_AnyCoilType, - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, - false, - OAUnitNum); - UnitarySystems::UnitarySys::checkUnitarySysCoilInOASysExists( - state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, OAUnitNum); - - // Heat recovery - } else if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:FLATPLATE") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::HeatXchngr; - - } else if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:SENSIBLEANDLATENT") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::HeatXchngr; - // CASE('HEATEXCHANGER:DESICCANT:BALANCEDFLOW') - // OutAirUnit(OAUnitNum)%OAEquip(CompNum)%ComponentType_Num= CompType::HeatXchngr - - // Desiccant Dehumidifier - } else if (SELECT_CASE_var == "DEHUMIDIFIER:DESICCANT:NOFANS") { - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType_Num = CompType::Desiccant; - // Futher Enhancement - // CASE('DEHUMIDIFIER:DESICCANT:SYSTEM') - // OutAirUnit(OAUnitNum)%OAEquip(CompNum)%ComponentType_Num= CompType::Desiccant - - } else { - ShowSevereError(state, - std::string{CurrentModuleObject} + " = \"" + AlphArray(1) + "\" invalid Outside Air Component=\"" + - OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentType + "\"."); - ErrorsFound = true; - } + // Heat recovery + break; + } + case (CompType::HeatXchngrFP): + case (CompType::HeatXchngrSL): { + // CASE('HEATEXCHANGER:DESICCANT:BALANCEDFLOW') + // OutAirUnit(OAUnitNum)%OAEquip(CompNum)%Type= CompType::HeatXchngr + + // Desiccant Dehumidifier + break; + } + case (CompType::Desiccant): { + // Futher Enhancement + // CASE('DEHUMIDIFIER:DESICCANT:SYSTEM') + // OutAirUnit(OAUnitNum)%OAEquip(CompNum)%Type= CompType::Desiccant + break; + } + default: { + ShowSevereError(state, + format("{}= \"{}\" invalid Outside Air Component=\"{}\".", + CurrentModuleObject, + AlphArray(1), + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(CompNum).Type)])); + ErrorsFound = true; + } } + // Add equipment to component sets array // Node set up if (OutAirUnit(OAUnitNum).FanPlace == BlowThru) { @@ -913,7 +915,7 @@ namespace OutdoorAirUnit { SetUpCompSets(state, "ZoneHVAC:OutdoorAirUnit", OutAirUnit(OAUnitNum).Name, - OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(InListNum).Type)], OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentName, state.dataIPShortCut->cAlphaArgs(15), "UNDEFINED"); @@ -921,7 +923,7 @@ namespace OutdoorAirUnit { SetUpCompSets(state, "ZoneHVAC:OutdoorAirUnit", OutAirUnit(OAUnitNum).Name, - OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(InListNum).Type)], OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentName, "UNDEFINED", "UNDEFINED"); @@ -929,7 +931,7 @@ namespace OutdoorAirUnit { SetUpCompSets(state, "ZoneHVAC:OutdoorAirUnit", OutAirUnit(OAUnitNum).Name, - OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(InListNum).Type)], OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentName, "UNDEFINED", state.dataIPShortCut->cAlphaArgs(13)); @@ -940,7 +942,7 @@ namespace OutdoorAirUnit { SetUpCompSets(state, "ZoneHVAC:OutdoorAirUnit", OutAirUnit(OAUnitNum).Name, - OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(InListNum).Type)], OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentName, state.dataIPShortCut->cAlphaArgs(12), "UNDEFINED"); @@ -948,7 +950,7 @@ namespace OutdoorAirUnit { SetUpCompSets(state, "ZoneHVAC:OutdoorAirUnit", OutAirUnit(OAUnitNum).Name, - OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(InListNum).Type)], OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentName, "UNDEFINED", "UNDEFINED"); @@ -956,14 +958,14 @@ namespace OutdoorAirUnit { SetUpCompSets(state, "ZoneHVAC:OutdoorAirUnit", OutAirUnit(OAUnitNum).Name, - OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(InListNum).Type)], OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentName, "UNDEFINED", "UNDEFINED"); } } // Must call after SetUpCompSets since this will add another CoilSystem:Cooling:DX object in CompSets - if (OutAirUnit(OAUnitNum).OAEquip(InListNum).ComponentType == "COILSYSTEM:COOLING:DX") { + if (CompTypeNamesUC[static_cast(OutAirUnit(OAUnitNum).OAEquip(InListNum).Type)] == "COILSYSTEM:COOLING:DX") { UnitarySystems::UnitarySys::checkUnitarySysCoilInOASysExists( state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, OAUnitNum); } @@ -1155,10 +1157,7 @@ namespace OutdoorAirUnit { auto &ZoneComp = state.dataHVACGlobal->ZoneComp; auto &ZoneCompTurnFansOff = state.dataHVACGlobal->ZoneCompTurnFansOff; auto &ZoneCompTurnFansOn = state.dataHVACGlobal->ZoneCompTurnFansOn; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::OutdoorAirUnit_Num; using FluidProperties::GetDensityGlycol; @@ -1216,15 +1215,20 @@ namespace OutdoorAirUnit { if (MyPlantScanFlag(OAUnitNum) && allocated(state.dataPlnt->PlantLoop)) { for (compLoop = 1; compLoop <= OutAirUnit(OAUnitNum).NumComponents; ++compLoop) { - if ((OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterCooling) || - (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterDetailedFlatCooling) || - (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterSimpleHeating) || - (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilSteamAirHeating)) { + CompType Type = OutAirUnit(OAUnitNum).OAEquip(compLoop).Type; + + switch (Type) { + case CompType::WaterCoil_Cooling: + case CompType::WaterCoil_DetailedCool: + case CompType::WaterCoil_SimpleHeat: + case CompType::SteamCoil_AirHeat: + + { errFlag = false; ScanPlantLoopsForObject(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, - OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum, + OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilType, OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum, OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopSideNum, OutAirUnit(OAUnitNum).OAEquip(compLoop).BranchNum, @@ -1238,6 +1242,10 @@ namespace OutdoorAirUnit { if (errFlag) { ShowFatalError(state, "InitOutdoorAirUnit: Program terminated for previous conditions."); } + break; + } + default: + break; } } @@ -1297,11 +1305,11 @@ namespace OutdoorAirUnit { if (!MyPlantScanFlag(OAUnitNum)) { for (compLoop = 1; compLoop <= OutAirUnit(OAUnitNum).NumComponents; ++compLoop) { - if ((OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterCooling) || - (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterDetailedFlatCooling)) { + if ((OutAirUnit(OAUnitNum).OAEquip(compLoop).Type == CompType::WaterCoil_Cooling) || + (OutAirUnit(OAUnitNum).OAEquip(compLoop).Type == CompType::WaterCoil_DetailedCool)) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, - OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(compLoop).Type)], OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); rho = GetDensityGlycol(state, @@ -1322,10 +1330,10 @@ namespace OutdoorAirUnit { OutAirUnit(OAUnitNum).OAEquip(compLoop).CompNum); } - if (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterSimpleHeating) { + if (OutAirUnit(OAUnitNum).OAEquip(compLoop).Type == CompType::WaterCoil_SimpleHeat) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, - OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(compLoop).Type)], OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); rho = GetDensityGlycol(state, @@ -1345,7 +1353,7 @@ namespace OutdoorAirUnit { OutAirUnit(OAUnitNum).OAEquip(compLoop).BranchNum, OutAirUnit(OAUnitNum).OAEquip(compLoop).CompNum); } - if (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilSteamAirHeating) { + if (OutAirUnit(OAUnitNum).OAEquip(compLoop).Type == CompType::SteamCoil_AirHeat) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = GetCoilMaxSteamFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentIndex, errFlag); Real64 rho = GetSatDensityRefrig(state, @@ -1366,10 +1374,10 @@ namespace OutdoorAirUnit { OutAirUnit(OAUnitNum).OAEquip(compLoop).BranchNum, OutAirUnit(OAUnitNum).OAEquip(compLoop).CompNum); } - if (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == static_cast(CompType::WaterCoil_CoolingHXAsst)) { + if (OutAirUnit(OAUnitNum).OAEquip(compLoop).Type == CompType::WaterCoil_CoolingHXAsst) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, - OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(compLoop).Type)], OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); rho = GetDensityGlycol(state, @@ -1489,10 +1497,7 @@ namespace OutdoorAirUnit { // Using/Aliasing using namespace DataSizing; using DataHVACGlobals::cFanTypes; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using Fans::GetFanDesignVolumeFlowRate; using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; @@ -1681,8 +1686,8 @@ namespace OutdoorAirUnit { } for (CompNum = 1; CompNum <= OutAirUnit(OAUnitNum).NumComponents; ++CompNum) { - if ((OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum == TypeOf_CoilWaterCooling) || - (OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum == TypeOf_CoilWaterDetailedFlatCooling)) { + if ((OutAirUnit(OAUnitNum).OAEquip(CompNum).Type == CompType::WaterCoil_Cooling) || + (OutAirUnit(OAUnitNum).OAEquip(CompNum).Type == CompType::WaterCoil_DetailedCool)) { if (OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow == AutoSize) { SimulateWaterCoilComponents(state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, @@ -1693,7 +1698,7 @@ namespace OutdoorAirUnit { 0.0); } } - if (OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum == TypeOf_CoilWaterSimpleHeating) { + if (OutAirUnit(OAUnitNum).OAEquip(CompNum).Type == CompType::WaterCoil_SimpleHeat) { if (OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow == AutoSize) { SimulateWaterCoilComponents(state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, @@ -1704,13 +1709,13 @@ namespace OutdoorAirUnit { 0.0); } } - if (OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum == TypeOf_CoilSteamAirHeating) { + if (OutAirUnit(OAUnitNum).OAEquip(CompNum).Type == CompType::SteamCoil_AirHeat) { if (OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow == AutoSize) { SimulateSteamCoilComponents( state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, true, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentIndex); } } - if (OutAirUnit(OAUnitNum).OAEquip(CompNum).CoilPlantTypeOfNum == static_cast(CompType::WaterCoil_CoolingHXAsst)) { + if (OutAirUnit(OAUnitNum).OAEquip(CompNum).Type == CompType::WaterCoil_CoolingHXAsst) { if (OutAirUnit(OAUnitNum).OAEquip(CompNum).MaxVolWaterFlow == AutoSize) { SimHXAssistedCoolingCoil(state, OutAirUnit(OAUnitNum).OAEquip(CompNum).ComponentName, @@ -2137,14 +2142,13 @@ namespace OutdoorAirUnit { Sim = true; auto &OutAirUnit(state.dataOutdoorAirUnit->OutAirUnit); for (EquipNum = 1; EquipNum <= OutAirUnit(OAUnitNum).NumComponents; ++EquipNum) { - EquipType = OutAirUnit(OAUnitNum).OAEquip(EquipNum).ComponentType; EquipName = OutAirUnit(OAUnitNum).OAEquip(EquipNum).ComponentName; SimOutdoorAirEquipComps(state, OAUnitNum, - EquipType, + CompTypeNames[static_cast(OutAirUnit(OAUnitNum).OAEquip(EquipNum).Type)], EquipName, EquipNum, - OutAirUnit(OAUnitNum).OAEquip(EquipNum).ComponentType_Num, + OutAirUnit(OAUnitNum).OAEquip(EquipNum).Type, FirstHVACIteration, OutAirUnit(OAUnitNum).OAEquip(EquipNum).ComponentIndex, Sim); @@ -2155,7 +2159,7 @@ namespace OutdoorAirUnit { void SimOutdoorAirEquipComps(EnergyPlusData &state, int const OAUnitNum, // actual outdoor air unit num - std::string const &EquipType, // the component type + std::string_view EquipType, // the component type std::string const &EquipName, // the component Name int const EquipNum, [[maybe_unused]] CompType const CompTypeNum, // Component Type -- Integerized for this module @@ -2232,7 +2236,7 @@ namespace OutdoorAirUnit { CompAirOutTemp = OutAirUnit(OAUnitNum).CompOutSetTemp; Operation OpMode = OutAirUnit(OAUnitNum).OperatingMode; SimCompNum = EquipNum; - EquipTypeNum = OutAirUnit(OAUnitNum).OAEquip(SimCompNum).ComponentType_Num; + EquipTypeNum = OutAirUnit(OAUnitNum).OAEquip(SimCompNum).Type; OAMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; DrawFan = OutAirUnit(OAUnitNum).FanEffect; DXSystemIndex = 0; @@ -2249,8 +2253,11 @@ namespace OutdoorAirUnit { { switch (EquipTypeNum) { // Heat recovery - case (CompType::HeatXchngr): { // 'HeatExchanger:AirToAir:FlatPlate', 'HeatExchanger:AirToAir:SensibleAndLatent', - // 'HeatExchanger:Desiccant:BalancedFlow' + case (CompType::HeatXchngrFP): // 'HeatExchanger:AirToAir:FlatPlate', + case (CompType::HeatXchngrSL): // 'HeatExchanger:AirToAir:SensibleAndLatent', + // 'HeatExchanger:Desiccant:BalancedFlow' - unused + { + if (Sim) { SimHeatRecovery(state, EquipName, FirstHVACIteration, CompIndex, ContFanCycCoil, _, _, _, _, false, false); } @@ -2549,7 +2556,7 @@ namespace OutdoorAirUnit { } } break; default: { - ShowFatalError(state, "Invalid Outdoor Air Unit Component=" + EquipType); // validate + ShowFatalError(state, format("Invalid Outdoor Air Unit Component={}", EquipType)); // validate } break; } } @@ -2606,7 +2613,7 @@ namespace OutdoorAirUnit { CoilIndex = 0; OAUnitNum = CompNum; CompoNum = EquipIndex; - CoilTypeNum = OutAirUnit(OAUnitNum).OAEquip(CompoNum).ComponentType_Num; + CoilTypeNum = OutAirUnit(OAUnitNum).OAEquip(CompoNum).Type; OpMode = OutAirUnit(OAUnitNum).OperatingMode; CoilAirOutTemp = OutAirUnit(OAUnitNum).CompOutSetTemp; DrawFan = OutAirUnit(OAUnitNum).FanEffect; diff --git a/src/EnergyPlus/OutdoorAirUnit.hh b/src/EnergyPlus/OutdoorAirUnit.hh index 6abe25ebf4d..fb41f709977 100644 --- a/src/EnergyPlus/OutdoorAirUnit.hh +++ b/src/EnergyPlus/OutdoorAirUnit.hh @@ -58,6 +58,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -71,19 +72,53 @@ namespace OutdoorAirUnit { enum class CompType : int { Unassigned = -1, - WaterCoil_SimpleCool = 0, - WaterCoil_Cooling = 1, - WaterCoil_SimpleHeat = 2, - SteamCoil_AirHeat = 3, - Coil_ElectricHeat = 4, - WaterCoil_DetailedCool = 5, - WaterCoil_CoolingHXAsst = 6, - Coil_GasHeat = 7, - DXSystem = 8, - HeatXchngr = 9, - Desiccant = 10, - DXHeatPumpSystem = 11, - UnitarySystemModel = 12 + WaterCoil_Cooling, // "COIL:COOLING:WATER", + WaterCoil_SimpleHeat, // "COIL:HEATING:WATER", + SteamCoil_AirHeat, // "COIL:HEATING:STEAM", + Coil_ElectricHeat, // "COIL:HEATING:ELECTRIC", + WaterCoil_DetailedCool, // "COIL:COOLING:WATER:DETAILEDGEOMETRY", + WaterCoil_CoolingHXAsst, // "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED", + Coil_GasHeat, // "COIL:HEATING:FUEL", + DXSystem, // "COILSYSTEM:COOLING:DX", + HeatXchngrFP, // "HEATEXCHANGER:AIRTOAIR:FLATPLATE", + HeatXchngrSL, // "HEATEXCHANGER:AIRTOAIR:SENSIBLEANDLATENT", + Desiccant, // "DEHUMIDIFIER:DESICCANT:NOFANS", + DXHeatPumpSystem, // "COILSYSTEM:HEATING:DX", + UnitarySystemModel, // "AIRLOOPHVAC:UNITARYSYSTEM", + Num + }; + + constexpr std::array(CompType::Num)> CompTypeNames{ + "Coil:Cooling:Water", + "Coil:Heating:Water", + "Coil:Heating:Steam", + "Coil:Heating:Electric", + "Coil:Cooling:Water:DetailedGeometry", + "CoilSystem:Cooling:Water:HeatExchangerAssisted", + "Coil:Heating:Fuel", + "CoilSystem:Cooling:DX", + "HeatExchanger:AirToAir:FlatPlate", + "HeatExchanger:AirToAir:SensibleAndLatent", + "Dehumidifier:Desiccant:NoFans", + "CoilSystem:Heating:DX", + "AirLoopHVAC:UnitarySystem", + }; + + constexpr std::array(CompType::Num)> CompTypeNamesUC{ + + "COIL:COOLING:WATER", + "COIL:HEATING:WATER", + "COIL:HEATING:STEAM", + "COIL:HEATING:ELECTRIC", + "COIL:COOLING:WATER:DETAILEDGEOMETRY", + "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED", + "COIL:HEATING:FUEL", + "COILSYSTEM:COOLING:DX", + "HEATEXCHANGER:AIRTOAIR:FLATPLATE", + "HEATEXCHANGER:AIRTOAIR:SENSIBLEANDLATENT", + "DEHUMIDIFIER:DESICCANT:NOFANS", + "COILSYSTEM:HEATING:DX", + "AIRLOOPHVAC:UNITARYSYSTEM", }; enum class Control @@ -124,15 +159,14 @@ namespace OutdoorAirUnit { // Members // Equipment List Data std::string ComponentName; - std::string ComponentType; - CompType ComponentType_Num; // Parameterized Component Types this module can address - int ComponentIndex; // Which one in list -- updated by routines called from here + CompType Type; // Parameterized Component Types this module can address + int ComponentIndex; // Which one in list -- updated by routines called from here HVACSystemData *compPointer = nullptr; int CoilAirInletNode; int CoilAirOutletNode; int CoilWaterInletNode; int CoilWaterOutletNode; - int CoilPlantTypeOfNum; + DataPlant::PlantEquipmentType CoilType; int LoopNum; int LoopSideNum; int BranchNum; @@ -147,8 +181,8 @@ namespace OutdoorAirUnit { // Default Constructor OAEquipList() - : ComponentType_Num(CompType::Unassigned), ComponentIndex(0), CoilAirInletNode(0), CoilAirOutletNode(0), CoilWaterInletNode(0), - CoilWaterOutletNode(0), CoilPlantTypeOfNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), FluidIndex(0), + : Type(CompType::Unassigned), ComponentIndex(0), CoilAirInletNode(0), CoilAirOutletNode(0), CoilWaterInletNode(0), CoilWaterOutletNode(0), + CoilType(DataPlant::PlantEquipmentType::Invalid), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), FluidIndex(0), MaxVolWaterFlow(0.0), MaxWaterMassFlow(0.0), MinVolWaterFlow(0.0), MinWaterMassFlow(0.0), FirstPass(true) { } @@ -272,7 +306,7 @@ namespace OutdoorAirUnit { void SimOutdoorAirEquipComps(EnergyPlusData &state, int OAUnitNum, // actual outdoor air unit num - std::string const &EquipType, // the component type + std::string_view EquipType, // the component type std::string const &EquipName, // the component Name int EquipNum, CompType CompTypeNum, // Component Type -- Integerized for this module diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index 5b76069fa44..df22be55434 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -86,7 +86,7 @@ namespace EnergyPlus::OutsideEnergySources { // PURPOSE OF THIS MODULE: // Module containing the routines dealing with the OutsideEnergySources -PlantComponent *OutsideEnergySourceSpecs::factory(EnergyPlusData &state, int objectType, std::string objectName) +PlantComponent *OutsideEnergySourceSpecs::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string_view objectName) { // Process the input data for outside energy sources if it hasn't been done already if (state.dataOutsideEnergySrcs->SimOutsideEnergyGetInputFlag) { @@ -100,7 +100,7 @@ PlantComponent *OutsideEnergySourceSpecs::factory(EnergyPlusData &state, int obj } } // If we didn't find it, fatal - ShowFatalError(state, "OutsideEnergySourceSpecsFactory: Error getting inputs for source named: " + objectName); // LCOV_EXCL_LINE + ShowFatalError(state, format("OutsideEnergySourceSpecsFactory: Error getting inputs for source named: {}", objectName)); // LCOV_EXCL_LINE // Shut up the compiler return nullptr; // LCOV_EXCL_LINE } @@ -163,20 +163,20 @@ void GetOutsideEnergySourcesInput(EnergyPlusData &state) std::string reportVarPrefix; std::string nodeNames; - int typeOf; + DataPlant::PlantEquipmentType EnergyType; int thisIndex; if (EnergySourceNum <= NumDistrictUnitsHeat) { state.dataIPShortCut->cCurrentModuleObject = "DistrictHeating"; reportVarPrefix = "District Heating "; nodeNames = "Hot Water Nodes"; - typeOf = DataPlant::TypeOf_PurchHotWater; + EnergyType = DataPlant::PlantEquipmentType::PurchHotWater; heatIndex++; thisIndex = heatIndex; } else { state.dataIPShortCut->cCurrentModuleObject = "DistrictCooling"; reportVarPrefix = "District Cooling "; nodeNames = "Chilled Water Nodes"; - typeOf = DataPlant::TypeOf_PurchChilledWater; + EnergyType = DataPlant::PlantEquipmentType::PurchChilledWater; coolIndex++; thisIndex = coolIndex; } @@ -235,7 +235,7 @@ void GetOutsideEnergySourcesInput(EnergyPlusData &state) } state.dataOutsideEnergySrcs->EnergySource(EnergySourceNum).EnergyTransfer = 0.0; state.dataOutsideEnergySrcs->EnergySource(EnergySourceNum).EnergyRate = 0.0; - state.dataOutsideEnergySrcs->EnergySource(EnergySourceNum).EnergyType = typeOf; + state.dataOutsideEnergySrcs->EnergySource(EnergySourceNum).EnergyType = EnergyType; if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { state.dataOutsideEnergySrcs->EnergySource(EnergySourceNum).CapFractionSchedNum = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); @@ -334,7 +334,7 @@ void OutsideEnergySourceSpecs::size(EnergyPlusData &state) // Type name string variable to collapse the sizing for cooling and heating into one block std::string typeName; - if (this->EnergyType == DataPlant::TypeOf_PurchChilledWater) { + if (this->EnergyType == DataPlant::PlantEquipmentType::PurchChilledWater) { typeName = "Cooling"; } else { // Heating typeName = "Heating"; @@ -428,9 +428,9 @@ void OutsideEnergySourceSpecs::calculate(EnergyPlusData &state, bool runFlag, Re MyLoad = sign(CurrentCap, MyLoad); } - if (this->EnergyType == DataPlant::TypeOf_PurchChilledWater) { + if (this->EnergyType == DataPlant::PlantEquipmentType::PurchChilledWater) { if (MyLoad > 0.0) MyLoad = 0.0; - } else if (this->EnergyType == DataPlant::TypeOf_PurchHotWater) { + } else if (this->EnergyType == DataPlant::PlantEquipmentType::PurchHotWater) { if (MyLoad < 0.0) MyLoad = 0.0; } @@ -480,12 +480,12 @@ void OutsideEnergySourceSpecs::oneTimeInit_new(EnergyPlusData &state) std::string hotOrChilled = "Hot "; std::string reportVarPrefix = "District Heating "; std::string heatingOrCooling = "Heating"; - std::string typeName = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_PurchHotWater); - if (this->EnergyType == DataPlant::TypeOf_PurchChilledWater) { + std::string_view typeName = DataPlant::PlantEquipTypeNames[static_cast(DataPlant::PlantEquipmentType::PurchHotWater)]; + if (this->EnergyType == DataPlant::PlantEquipmentType::PurchChilledWater) { hotOrChilled = "Chilled "; reportVarPrefix = "District Cooling "; heatingOrCooling = "Cooling"; - typeName = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_PurchChilledWater); + typeName = DataPlant::PlantEquipTypeNames[static_cast(DataPlant::PlantEquipmentType::PurchChilledWater)]; } SetupOutputVariable(state, reportVarPrefix + hotOrChilled + "Water Energy", diff --git a/src/EnergyPlus/OutsideEnergySources.hh b/src/EnergyPlus/OutsideEnergySources.hh index b4a4de39f45..7ff00d7699f 100644 --- a/src/EnergyPlus/OutsideEnergySources.hh +++ b/src/EnergyPlus/OutsideEnergySources.hh @@ -68,15 +68,15 @@ namespace OutsideEnergySources { { // Members - std::string Name; // user identifier - Real64 NomCap = 0.0; // design nominal capacity of district service - bool NomCapWasAutoSized = false; // ture if Nominal Capacity was autosize on input - int CapFractionSchedNum = 0; // capacity modifier schedule number - int InletNodeNum = 0; // Node number on the inlet side of the plant - int OutletNodeNum = 0; // Node number on the inlet side of the plant - Real64 EnergyTransfer = 0.0; // cooling energy provided in time step - Real64 EnergyRate = 0.0; // cooling power - int EnergyType = 0; // flag for district heating OR cooling + std::string Name; // user identifier + Real64 NomCap = 0.0; // design nominal capacity of district service + bool NomCapWasAutoSized = false; // ture if Nominal Capacity was autosize on input + int CapFractionSchedNum = 0; // capacity modifier schedule number + int InletNodeNum = 0; // Node number on the inlet side of the plant + int OutletNodeNum = 0; // Node number on the inlet side of the plant + Real64 EnergyTransfer = 0.0; // cooling energy provided in time step + Real64 EnergyRate = 0.0; // cooling power + DataPlant::PlantEquipmentType EnergyType{DataPlant::PlantEquipmentType::Invalid}; // flag for district heating OR cooling // loop topology variables int LoopNum = 0; int LoopSideNum = 0; @@ -93,7 +93,7 @@ namespace OutsideEnergySources { virtual ~OutsideEnergySourceSpecs() = default; - static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string_view objectName); void simulate([[maybe_unused]] EnergyPlusData &state, const PlantLocation &calledFromLocation, diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index ebb40d958ce..3f1e119bd89 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -4040,8 +4040,7 @@ void InitPTUnit(EnergyPlusData &state, using SteamCoils::SimulateSteamCoilComponents; auto &GetCoilMaxSteamFlowRate(SteamCoils::GetCoilMaxSteamFlowRate); auto &GetSteamCoilCapacity(SteamCoils::GetCoilCapacity); - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using Fans::GetFanVolFlow; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; @@ -4132,7 +4131,7 @@ void InitPTUnit(EnergyPlusData &state, errFlag = false; ScanPlantLoopsForObject(state, state.dataPTHP->PTUnit(PTUnitNum).ACHeatCoilName, - TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, state.dataPTHP->PTUnit(PTUnitNum).HeatCoilLoopNum, state.dataPTHP->PTUnit(PTUnitNum).HeatCoilLoopSide, state.dataPTHP->PTUnit(PTUnitNum).HeatCoilBranchNum, @@ -4169,7 +4168,7 @@ void InitPTUnit(EnergyPlusData &state, errFlag = false; ScanPlantLoopsForObject(state, state.dataPTHP->PTUnit(PTUnitNum).ACHeatCoilName, - TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, state.dataPTHP->PTUnit(PTUnitNum).HeatCoilLoopNum, state.dataPTHP->PTUnit(PTUnitNum).HeatCoilLoopSide, state.dataPTHP->PTUnit(PTUnitNum).HeatCoilBranchNum, @@ -4214,7 +4213,7 @@ void InitPTUnit(EnergyPlusData &state, errFlag = false; ScanPlantLoopsForObject(state, state.dataPTHP->PTUnit(PTUnitNum).SuppHeatCoilName, - TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, state.dataPTHP->PTUnit(PTUnitNum).SuppCoilLoopNum, state.dataPTHP->PTUnit(PTUnitNum).SuppCoilLoopSide, state.dataPTHP->PTUnit(PTUnitNum).SuppCoilBranchNum, @@ -4244,7 +4243,7 @@ void InitPTUnit(EnergyPlusData &state, errFlag = false; ScanPlantLoopsForObject(state, state.dataPTHP->PTUnit(PTUnitNum).SuppHeatCoilName, - TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, state.dataPTHP->PTUnit(PTUnitNum).SuppCoilLoopNum, state.dataPTHP->PTUnit(PTUnitNum).SuppCoilLoopSide, state.dataPTHP->PTUnit(PTUnitNum).SuppCoilBranchNum, diff --git a/src/EnergyPlus/PackagedThermalStorageCoil.cc b/src/EnergyPlus/PackagedThermalStorageCoil.cc index 37690e44164..04aa83104b7 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -2187,7 +2187,7 @@ void InitTESCoil(EnergyPlusData &state, int &TESCoilNum) // RE-ENGINEERED na // Using/Aliasing - using DataPlant::TypeOf_PackagedTESCoolingCoil; + using PlantUtilities::ScanPlantLoopsForObject; using ScheduleManager::GetCurrentScheduleValue; @@ -2222,7 +2222,7 @@ void InitTESCoil(EnergyPlusData &state, int &TESCoilNum) errFlag = false; ScanPlantLoopsForObject(state, state.dataPackagedThermalStorageCoil->TESCoil(TESCoilNum).Name, - TypeOf_PackagedTESCoolingCoil, + DataPlant::PlantEquipmentType::PackagedTESCoolingCoil, plloopnum, lsnum, brnum, diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 019d7cd818c..1a5c94096a7 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -235,7 +235,7 @@ namespace PhotovoltaicThermalCollectors { continue; state.dataPhotovoltaicThermalCollector->PVT(Item).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataPhotovoltaicThermalCollector->PVT(Item).TypeNum = DataPlant::TypeOf_PVTSolarCollectorFlatPlate; + state.dataPhotovoltaicThermalCollector->PVT(Item).Type = DataPlant::PlantEquipmentType::PVTSolarCollectorFlatPlate; state.dataPhotovoltaicThermalCollector->PVT(Item).SurfNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface); @@ -1128,7 +1128,7 @@ namespace PhotovoltaicThermalCollectors { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->TypeNum, + this->Type, this->WLoopNum, this->WLoopSideNum, this->WLoopBranchNum, diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.hh b/src/EnergyPlus/PhotovoltaicThermalCollectors.hh index 9701cf999c5..ca96fd024a3 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.hh +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.hh @@ -54,6 +54,7 @@ // EnergyPlus Headers #include #include +#include #include namespace EnergyPlus { @@ -119,21 +120,21 @@ namespace PhotovoltaicThermalCollectors { struct PVTCollectorStruct : PlantComponent { // Members - std::string Name; // Name of PVT collector - int TypeNum; // Plant Side Connection: 'TypeOf_Num' assigned in DataPlant - int WLoopNum; // Water plant loop index number - int WLoopSideNum; // Water plant loop side index - int WLoopBranchNum; // Water plant loop branch index - int WLoopCompNum; // Water plant loop component index - bool EnvrnInit; // manage begin environment inits - bool SizingInit; // manage when sizing is complete - std::string PVTModelName; // Name of PVT performance object - int PVTModelType; // model type indicator, only simple avail now - int SurfNum; // surface index - std::string PVname; // named Generator:Photovoltaic object - int PVnum; // PV index - bool PVfound; // init, need to delay get input until PV gotten - SimplePVTModelStruct Simple; // performance data structure. + std::string Name; // Name of PVT collector + DataPlant::PlantEquipmentType Type; // Plant Side Connection: 'Type' assigned in DataPlant + int WLoopNum; // Water plant loop index number + int WLoopSideNum; // Water plant loop side index + int WLoopBranchNum; // Water plant loop branch index + int WLoopCompNum; // Water plant loop component index + bool EnvrnInit; // manage begin environment inits + bool SizingInit; // manage when sizing is complete + std::string PVTModelName; // Name of PVT performance object + int PVTModelType; // model type indicator, only simple avail now + int SurfNum; // surface index + std::string PVname; // named Generator:Photovoltaic object + int PVnum; // PV index + bool PVfound; // init, need to delay get input until PV gotten + SimplePVTModelStruct Simple; // performance data structure. WorkingFluidEnum WorkingFluidType; int PlantInletNodeNum; int PlantOutletNodeNum; @@ -154,11 +155,11 @@ namespace PhotovoltaicThermalCollectors { // Default Constructor PVTCollectorStruct() - : TypeNum(0), WLoopNum(0), WLoopSideNum(0), WLoopBranchNum(0), WLoopCompNum(0), EnvrnInit(true), SizingInit(true), PVTModelType(0), - SurfNum(0), PVnum(0), PVfound(false), WorkingFluidType(WorkingFluidEnum::LIQUID), PlantInletNodeNum(0), PlantOutletNodeNum(0), - HVACInletNodeNum(0), HVACOutletNodeNum(0), DesignVolFlowRate(0.0), DesignVolFlowRateWasAutoSized(false), MaxMassFlowRate(0.0), - MassFlowRate(0.0), AreaCol(0.0), BypassDamperOff(true), CoolingUseful(false), HeatingUseful(false), MySetPointCheckFlag(true), - MyOneTimeFlag(true), SetLoopIndexFlag(true) + : Type(DataPlant::PlantEquipmentType::Invalid), WLoopNum(0), WLoopSideNum(0), WLoopBranchNum(0), WLoopCompNum(0), EnvrnInit(true), + SizingInit(true), PVTModelType(0), SurfNum(0), PVnum(0), PVfound(false), WorkingFluidType(WorkingFluidEnum::LIQUID), + PlantInletNodeNum(0), PlantOutletNodeNum(0), HVACInletNodeNum(0), HVACOutletNodeNum(0), DesignVolFlowRate(0.0), + DesignVolFlowRateWasAutoSized(false), MaxMassFlowRate(0.0), MassFlowRate(0.0), AreaCol(0.0), BypassDamperOff(true), + CoolingUseful(false), HeatingUseful(false), MySetPointCheckFlag(true), MyOneTimeFlag(true), SetLoopIndexFlag(true) { } diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index 63f6cdffb72..dc9d5d2380b 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -113,13 +113,10 @@ namespace EnergyPlus::PipeHeatTransfer { // Using/Aliasing using namespace GroundTemperatureManager; -using DataPlant::TypeOf_PipeExterior; -using DataPlant::TypeOf_PipeInterior; -using DataPlant::TypeOf_PipeUnderground; // Functions -PlantComponent *PipeHTData::factory(EnergyPlusData &state, int objectType, std::string const &objectName) +PlantComponent *PipeHTData::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName) { // Process the input data for pipes if it hasn't been done already if (state.dataPipeHT->GetPipeInputFlag) { @@ -128,7 +125,7 @@ PlantComponent *PipeHTData::factory(EnergyPlusData &state, int objectType, std:: } // Now look for this particular pipe in the list for (auto &pipe : state.dataPipeHT->PipeHT) { - if (pipe.TypeOf == objectType && pipe.Name == objectName) { + if (pipe.Type == objectType && pipe.Name == objectName) { return &pipe; } } @@ -261,7 +258,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames(1), ErrorsFound); state.dataPipeHT->PipeHT(Item).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataPipeHT->PipeHT(Item).TypeOf = TypeOf_PipeInterior; + state.dataPipeHT->PipeHT(Item).Type = DataPlant::PlantEquipmentType::PipeInterior; // General user input data state.dataPipeHT->PipeHT(Item).Construction = state.dataIPShortCut->cAlphaArgs(2); @@ -416,7 +413,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames(1), ErrorsFound); state.dataPipeHT->PipeHT(Item).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataPipeHT->PipeHT(Item).TypeOf = TypeOf_PipeExterior; + state.dataPipeHT->PipeHT(Item).Type = DataPlant::PlantEquipmentType::PipeExterior; // General user input data state.dataPipeHT->PipeHT(Item).Construction = state.dataIPShortCut->cAlphaArgs(2); @@ -553,7 +550,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames(1), ErrorsFound); state.dataPipeHT->PipeHT(Item).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataPipeHT->PipeHT(Item).TypeOf = TypeOf_PipeUnderground; + state.dataPipeHT->PipeHT(Item).Type = DataPlant::PlantEquipmentType::PipeUnderground; // General user input data state.dataPipeHT->PipeHT(Item).Construction = state.dataIPShortCut->cAlphaArgs(2); @@ -913,7 +910,7 @@ void PipeHTData::oneTimeInit_new(EnergyPlusData &state) { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->TypeOf, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, errFlag, _, _, _, _, _); + state, this->Name, this->Type, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, errFlag, _, _, _, _, _); if (errFlag) { ShowFatalError(state, "InitPipesHeatTransfer: Program terminated due to previous condition(s)."); } @@ -1572,7 +1569,7 @@ void PipeHTData::UpdatePipesHeatTransfer(EnergyPlusData &state) state.dataLoopNodes->Node(state.dataPipeHT->nsvOutletNodeNum).Quality = state.dataLoopNodes->Node(state.dataPipeHT->nsvInletNodeNum).Quality; // Only pass pressure if we aren't doing a pressure simulation switch (state.dataPlnt->PlantLoop(this->LoopNum).PressureSimType) { - case DataPlant::iPressSimType::NoPressure: + case DataPlant::PressSimType::NoPressure: state.dataLoopNodes->Node(state.dataPipeHT->nsvOutletNodeNum).Press = state.dataLoopNodes->Node(state.dataPipeHT->nsvInletNodeNum).Press; break; default: @@ -1879,9 +1876,9 @@ Real64 PipeHTData::OutsidePipeHeatTransCoef(EnergyPlusData &state) // Set environmental variables { - auto const SELECT_CASE_var(this->TypeOf); + auto const SELECT_CASE_var(this->Type); - if (SELECT_CASE_var == TypeOf_PipeInterior) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeInterior) { { auto const SELECT_CASE_var1(this->EnvironmentPtr); @@ -1895,7 +1892,7 @@ Real64 PipeHTData::OutsidePipeHeatTransCoef(EnergyPlusData &state) } } - } else if (SELECT_CASE_var == TypeOf_PipeExterior) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeExterior) { { auto const SELECT_CASE_var1(this->EnvironmentPtr); diff --git a/src/EnergyPlus/PipeHeatTransfer.hh b/src/EnergyPlus/PipeHeatTransfer.hh index 328663176aa..3d592f7d6a9 100644 --- a/src/EnergyPlus/PipeHeatTransfer.hh +++ b/src/EnergyPlus/PipeHeatTransfer.hh @@ -61,6 +61,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -99,18 +100,18 @@ namespace PipeHeatTransfer { // Members // Input data std::string Name; - std::string Construction; // construction object name - std::string Environment; // keyword: 'Schedule', 'OutdoorAir', 'Zone' - std::string EnvrSchedule; // temperature schedule for environmental temp - std::string EnvrVelSchedule; // temperature schedule for environmental temp - std::string EnvrAirNode; // outside air node providing environmental temp - Real64 Length; // total pipe length [m] - Real64 PipeID; // pipe inside diameter [m] - std::string InletNode; // inlet node name - std::string OutletNode; // outlet node name - int InletNodeNum; // inlet node number - int OutletNodeNum; // outlet node number - int TypeOf; // Type of pipe + std::string Construction; // construction object name + std::string Environment; // keyword: 'Schedule', 'OutdoorAir', 'Zone' + std::string EnvrSchedule; // temperature schedule for environmental temp + std::string EnvrVelSchedule; // temperature schedule for environmental temp + std::string EnvrAirNode; // outside air node providing environmental temp + Real64 Length; // total pipe length [m] + Real64 PipeID; // pipe inside diameter [m] + std::string InletNode; // inlet node name + std::string OutletNode; // outlet node name + int InletNodeNum; // inlet node number + int OutletNodeNum; // outlet node number + DataPlant::PlantEquipmentType Type; // Type of pipe // derived data int ConstructionNum; // construction ref number iEnvrnPtr EnvironmentPtr; @@ -196,13 +197,13 @@ namespace PipeHeatTransfer { // Default Constructor PipeHTData() - : Length(0.0), PipeID(0.0), InletNodeNum(0), OutletNodeNum(0), TypeOf(0), ConstructionNum(0), EnvironmentPtr(iEnvrnPtr::None), - EnvrSchedPtr(0), EnvrVelSchedPtr(0), EnvrZonePtr(0), EnvrAirNodeNum(0), NumSections(0), FluidSpecHeat(0.0), FluidDensity(0.0), - MaxFlowRate(0.0), InsideArea(0.0), OutsideArea(0.0), SectionArea(0.0), PipeHeatCapacity(0.0), PipeOD(0.0), PipeCp(0.0), - PipeDensity(0.0), PipeConductivity(0.0), InsulationOD(0.0), InsulationCp(0.0), InsulationDensity(0.0), InsulationConductivity(0.0), - InsulationThickness(0.0), InsulationResistance(0.0), CurrentSimTime(0.0), PreviousSimTime(0.0), NumDepthNodes(0), PipeNodeDepth(0), - PipeNodeWidth(0), PipeDepth(0.0), DomainDepth(0.0), dSregular(0.0), OutdoorConvCoef(0.0), SoilMaterialNum(0), MonthOfMinSurfTemp(0), - MinSurfTemp(0.0), SoilDensity(0.0), SoilDepth(0.0), SoilCp(0.0), SoilConductivity(0.0), + : Length(0.0), PipeID(0.0), InletNodeNum(0), OutletNodeNum(0), Type(DataPlant::PlantEquipmentType::Invalid), ConstructionNum(0), + EnvironmentPtr(iEnvrnPtr::None), EnvrSchedPtr(0), EnvrVelSchedPtr(0), EnvrZonePtr(0), EnvrAirNodeNum(0), NumSections(0), + FluidSpecHeat(0.0), FluidDensity(0.0), MaxFlowRate(0.0), InsideArea(0.0), OutsideArea(0.0), SectionArea(0.0), PipeHeatCapacity(0.0), + PipeOD(0.0), PipeCp(0.0), PipeDensity(0.0), PipeConductivity(0.0), InsulationOD(0.0), InsulationCp(0.0), InsulationDensity(0.0), + InsulationConductivity(0.0), InsulationThickness(0.0), InsulationResistance(0.0), CurrentSimTime(0.0), PreviousSimTime(0.0), + NumDepthNodes(0), PipeNodeDepth(0), PipeNodeWidth(0), PipeDepth(0.0), DomainDepth(0.0), dSregular(0.0), OutdoorConvCoef(0.0), + SoilMaterialNum(0), MonthOfMinSurfTemp(0), MinSurfTemp(0.0), SoilDensity(0.0), SoilDepth(0.0), SoilCp(0.0), SoilConductivity(0.0), SoilRoughness(DataSurfaces::SurfaceRoughness::Unassigned), SoilThermAbs(0.0), SoilSolarAbs(0.0), CoefA1(0.0), CoefA2(0.0), FourierDS(0.0), SoilDiffusivity(0.0), SoilDiffusivityPerDay(0.0), BeginSimInit(true), BeginSimEnvrn(true), FirstHVACupdateFlag(true), BeginEnvrnupdateFlag(true), SolarExposed(true), SumTK(0.0), ZoneHeatGainRate(0.0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), @@ -212,7 +213,7 @@ namespace PipeHeatTransfer { { } - static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string const &objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName); void simulate([[maybe_unused]] EnergyPlusData &state, const PlantLocation &calledFromLocation, diff --git a/src/EnergyPlus/Pipes.cc b/src/EnergyPlus/Pipes.cc index c10d9c2c412..5b94b8628b8 100644 --- a/src/EnergyPlus/Pipes.cc +++ b/src/EnergyPlus/Pipes.cc @@ -75,7 +75,7 @@ namespace EnergyPlus::Pipes { // MODIFIED Rahul Chillar , Jan 2005 // RE-ENGINEERED na -PlantComponent *LocalPipeData::factory(EnergyPlusData &state, int objectType, std::string const &objectName) +PlantComponent *LocalPipeData::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName) { // Process the input data for pipes if it hasn't been done already if (state.dataPipes->GetPipeInputFlag) { @@ -84,7 +84,7 @@ PlantComponent *LocalPipeData::factory(EnergyPlusData &state, int objectType, st } // Now look for this particular pipe in the list for (auto &pipe : state.dataPipes->LocalPipe) { - if (pipe.TypeOf == objectType && pipe.Name == objectName) { + if (pipe.Type == objectType && pipe.Name == objectName) { return &pipe; } } @@ -116,7 +116,7 @@ void LocalPipeData::oneTimeInit_new(EnergyPlusData &state) int FoundOnLoop = 0; bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->TypeOf, this->LoopNum, this->LoopSide, this->BranchIndex, this->CompIndex, errFlag, _, _, FoundOnLoop, _, _); + state, this->Name, this->Type, this->LoopNum, this->LoopSide, this->BranchIndex, this->CompIndex, errFlag, _, _, FoundOnLoop, _, _); // Clang can't tell that the FoundOnLoop argument is actually passed by reference since it is an optional, so it thinks FoundOnLoop is always 0. #pragma clang diagnostic push #pragma ide diagnostic ignored "ConstantConditionsOC" @@ -185,7 +185,7 @@ void GetPipeInput(EnergyPlusData &state) GlobalNames::VerifyUniqueInterObjectName( state, state.dataPipes->LocalPipeUniqueNames, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataPipes->LocalPipe(PipeNum).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataPipes->LocalPipe(PipeNum).TypeOf = DataPlant::TypeOf_Pipe; + state.dataPipes->LocalPipe(PipeNum).Type = DataPlant::PlantEquipmentType::Pipe; state.dataPipes->LocalPipe(PipeNum).InletNodeNum = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), @@ -229,7 +229,7 @@ void GetPipeInput(EnergyPlusData &state) GlobalNames::VerifyUniqueInterObjectName( state, state.dataPipes->LocalPipeUniqueNames, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataPipes->LocalPipe(PipeNum).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataPipes->LocalPipe(PipeNum).TypeOf = DataPlant::TypeOf_PipeSteam; + state.dataPipes->LocalPipe(PipeNum).Type = DataPlant::PlantEquipmentType::PipeSteam; state.dataPipes->LocalPipe(PipeNum).InletNodeNum = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), ErrorsFound, diff --git a/src/EnergyPlus/Pipes.hh b/src/EnergyPlus/Pipes.hh index 830357910fd..38763ff7c38 100644 --- a/src/EnergyPlus/Pipes.hh +++ b/src/EnergyPlus/Pipes.hh @@ -56,6 +56,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -72,24 +73,24 @@ namespace Pipes { // Members std::string Name; - int TypeOf; // type of pipe - int InletNodeNum; // Node number on the inlet side of the plant - int OutletNodeNum; // Node number on the inlet side of the plant - int LoopNum; // Index of plant loop where this pipe resides - int LoopSide; // Index of plant loop side where this pipe resides - int BranchIndex; // Index of plant Branch index where this pipe resides - int CompIndex; // Index of plant Comp index where this pipe resides + DataPlant::PlantEquipmentType Type; // type of pipe + int InletNodeNum; // Node number on the inlet side of the plant + int OutletNodeNum; // Node number on the inlet side of the plant + int LoopNum; // Index of plant loop where this pipe resides + int LoopSide; // Index of plant loop side where this pipe resides + int BranchIndex; // Index of plant Branch index where this pipe resides + int CompIndex; // Index of plant Comp index where this pipe resides bool CheckEquipName; bool EnvrnFlag; // Default Constructor LocalPipeData() - : TypeOf(0), InletNodeNum(0), OutletNodeNum(0), LoopNum(0), LoopSide(0), BranchIndex(0), CompIndex(0), CheckEquipName(true), - EnvrnFlag(true) + : Type(DataPlant::PlantEquipmentType::Invalid), InletNodeNum(0), OutletNodeNum(0), LoopNum(0), LoopSide(0), BranchIndex(0), CompIndex(0), + CheckEquipName(true), EnvrnFlag(true) { } - static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string const &objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName); void simulate([[maybe_unused]] EnergyPlusData &states, const PlantLocation &calledFromLocation, bool FirstHVACIteration, diff --git a/src/EnergyPlus/Plant/Component.cc b/src/EnergyPlus/Plant/Component.cc index 334dc6eb7bb..ebab2861aec 100644 --- a/src/EnergyPlus/Plant/Component.cc +++ b/src/EnergyPlus/Plant/Component.cc @@ -52,22 +52,6 @@ namespace EnergyPlus { namespace DataPlant { - bool CompData::isPump() - { - if (this->TypeOf_Num == DataPlant::TypeOf_PumpConstantSpeed) { - return true; - } else if (this->TypeOf_Num == DataPlant::TypeOf_PumpVariableSpeed) { - return true; - } else if (this->TypeOf_Num == DataPlant::TypeOf_PumpBankConstantSpeed) { - return true; - } else if (this->TypeOf_Num == DataPlant::TypeOf_PumpBankVariableSpeed) { - return true; - } else if (this->TypeOf_Num == DataPlant::TypeOf_PumpCondensate) { - return true; - } - return false; - } - void CompData::initLoopEquip(EnergyPlusData &state, bool const GetCompSizFac) { this->compPtr->onInitLoopEquip(state, this->location); diff --git a/src/EnergyPlus/Plant/Component.hh b/src/EnergyPlus/Plant/Component.hh index db838525bf2..4a20ca2ace6 100644 --- a/src/EnergyPlus/Plant/Component.hh +++ b/src/EnergyPlus/Plant/Component.hh @@ -61,11 +61,18 @@ struct EnergyPlusData; namespace DataPlant { + constexpr std::array(PlantEquipmentType::Num)> PlantEquipmentTypeIsPump = { + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, false, false, false, + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}; + struct CompData { // Members std::string TypeOf; // The 'keyWord' identifying component type - int TypeOf_Num; // Reference the "TypeOf" parameters in DataPlant + DataPlant::PlantEquipmentType Type; // Reference the "TypeOf" parameters in DataPlant std::string Name; // Component name int CompNum; // Component ID number DataBranchAirLoopPlant::ControlTypeEnum FlowCtrl; // flow control for splitter/mixer (ACTIVE/PASSIVE/BYPASS) @@ -81,23 +88,23 @@ namespace DataPlant { Real64 MinLoad; // Minimum Load Real64 OptLoad; // Optimal Load Real64 SizFac; // Sizing Fraction - int CurOpSchemeType; // updated pointer to + DataPlant::OpScheme CurOpSchemeType; // updated pointer to // Plant()%OpScheme(CurOpSchemeType)... int NumOpSchemes; // number of schemes held in the pointer array int CurCompLevelOpNum; // pointer to the OpScheme array defined next // PlantLoop()%LoopSide()%Branch()%Comp()%OpScheme(curOpSchemePtr) - Array1D OpScheme; // Pointers to component on lists - Real64 EquipDemand; // Component load request based on inlet temp and outlet SP - bool EMSLoadOverrideOn; // EMS is calling to override load dispatched to component - Real64 EMSLoadOverrideValue; // EMS value to use for load when overridden [W] always positive. - DataPlant::HowMet HowLoadServed; // nature of component in terms of how it can meet load - Real64 MinOutletTemp; // Component exit lower limit temperature - Real64 MaxOutletTemp; // Component exit upper limit temperature - bool FreeCoolCntrlShutDown; // true if component was shut down because of free cooling - Real64 FreeCoolCntrlMinCntrlTemp; // current control temp value for free cooling controls - DataPlant::iFreeCoolControlMode FreeCoolCntrlMode; // type of sensor used for free cooling controls - int FreeCoolCntrlNodeNum; // chiller condenser inlet node number for free cooling controls - int IndexInLoopSidePumps; // If I'm a pump, this tells my index in PL(:)%LS(:)%Pumps + Array1D OpScheme; // Pointers to component on lists + Real64 EquipDemand; // Component load request based on inlet temp and outlet SP + bool EMSLoadOverrideOn; // EMS is calling to override load dispatched to component + Real64 EMSLoadOverrideValue; // EMS value to use for load when overridden [W] always positive. + DataPlant::HowMet HowLoadServed; // nature of component in terms of how it can meet load + Real64 MinOutletTemp; // Component exit lower limit temperature + Real64 MaxOutletTemp; // Component exit upper limit temperature + bool FreeCoolCntrlShutDown; // true if component was shut down because of free cooling + Real64 FreeCoolCntrlMinCntrlTemp; // current control temp value for free cooling controls + DataPlant::FreeCoolControlMode FreeCoolCntrlMode; // type of sensor used for free cooling controls + int FreeCoolCntrlNodeNum; // chiller condenser inlet node number for free cooling controls + int IndexInLoopSidePumps; // If I'm a pump, this tells my index in PL(:)%LS(:)%Pumps Real64 TempDesCondIn; Real64 TempDesEvapOut; PlantComponent *compPtr; @@ -105,12 +112,13 @@ namespace DataPlant { // Default Constructor CompData() - : TypeOf_Num(0), CompNum(0), FlowCtrl(DataBranchAirLoopPlant::ControlTypeEnum::Unknown), FlowPriority(LoopFlowStatus::Unknown), ON(false), - Available(false), NodeNumIn(0), NodeNumOut(0), MyLoad(0.0), MaxLoad(0.0), MinLoad(0.0), OptLoad(0.0), SizFac(0.0), - CurOpSchemeType(UnknownStatusOpSchemeType), NumOpSchemes(0), CurCompLevelOpNum(0), EquipDemand(0.0), EMSLoadOverrideOn(false), - EMSLoadOverrideValue(0.0), HowLoadServed(DataPlant::HowMet::Unknown), MinOutletTemp(0.0), MaxOutletTemp(0.0), - FreeCoolCntrlShutDown(false), FreeCoolCntrlMinCntrlTemp(0.0), FreeCoolCntrlMode(DataPlant::iFreeCoolControlMode::Unassigned), - FreeCoolCntrlNodeNum(0), IndexInLoopSidePumps(0), TempDesCondIn(0.0), TempDesEvapOut(0.0), compPtr(nullptr) + : Type(DataPlant::PlantEquipmentType::Invalid), CompNum(0), FlowCtrl(DataBranchAirLoopPlant::ControlTypeEnum::Unknown), + FlowPriority(LoopFlowStatus::Unknown), ON(false), Available(false), NodeNumIn(0), NodeNumOut(0), MyLoad(0.0), MaxLoad(0.0), + MinLoad(0.0), OptLoad(0.0), SizFac(0.0), CurOpSchemeType(DataPlant::OpScheme::Unassigned), NumOpSchemes(0), CurCompLevelOpNum(0), + EquipDemand(0.0), EMSLoadOverrideOn(false), EMSLoadOverrideValue(0.0), HowLoadServed(DataPlant::HowMet::Unknown), MinOutletTemp(0.0), + MaxOutletTemp(0.0), FreeCoolCntrlShutDown(false), FreeCoolCntrlMinCntrlTemp(0.0), + FreeCoolCntrlMode(DataPlant::FreeCoolControlMode::Unassigned), FreeCoolCntrlNodeNum(0), IndexInLoopSidePumps(0), TempDesCondIn(0.0), + TempDesEvapOut(0.0), compPtr(nullptr) { } @@ -125,8 +133,6 @@ namespace DataPlant { void simulate(EnergyPlusData &state, bool FirstHVACIteration); - bool isPump(); - void oneTimeInit(EnergyPlusData &state) const; }; } // namespace DataPlant diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index a732eeb3e41..af4b9af34a3 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -59,216 +59,6 @@ namespace EnergyPlus::DataPlant { // Condenser Loops. // Parameters for Component/Equipment Types (ref: TypeOf in CompData) -Array1D_string const SimPlantEquipTypes(NumSimPlantEquipTypes, - {"BOILER:HOTWATER", - "BOILER:STEAM", - "CHILLER:ABSORPTION", - "CHILLER:ABSORPTION:INDIRECT", - "CHILLER:COMBUSTIONTURBINE", - "CHILLER:CONSTANTCOP", - "CHILLERHEATER:ABSORPTION:DIRECTFIRED", - "CHILLER:ELECTRIC", - "CHILLER:ELECTRIC:EIR", - "CHILLER:ELECTRIC:REFORMULATEDEIR", - "CHILLER:ENGINEDRIVEN", - "COOLINGTOWER:SINGLESPEED", - "COOLINGTOWER:TWOSPEED", - "COOLINGTOWER:VARIABLESPEED", - "GENERATOR:FUELCELL:EXHAUSTGASTOWATERHEATEXCHANGER", - "WATERHEATER:HEATPUMP:PUMPEDCONDENSER", - "HEATPUMP:WATERTOWATER:EQUATIONFIT:COOLING", - "HEATPUMP:WATERTOWATER:EQUATIONFIT:HEATING", - "HEATPUMP:WATERTOWATER:PARAMETERESTIMATION:COOLING", - "HEATPUMP:WATERTOWATER:PARAMETERESTIMATION:HEATING", - "PIPE:ADIABATIC", - "PIPE:ADIABATIC:STEAM", - "PIPE:OUTDOOR", - "PIPE:INDOOR", - "PIPE:UNDERGROUND", - "DISTRICTCOOLING", - "DISTRICTHEATING", - "THERMALSTORAGE:ICE:DETAILED", - "THERMALSTORAGE:ICE:SIMPLE", - "TEMPERINGVALVE", - "WATERHEATER:MIXED", - "WATERHEATER:STRATIFIED", - "PUMP:VARIABLESPEED", - "PUMP:CONSTANTSPEED", - "PUMP:VARIABLESPEED:CONDENSATE", - "HEADEREDPUMPS:VARIABLESPEED", - "HEADEREDPUMPS:CONSTANTSPEED", - "WATERUSE:CONNECTIONS", - "COIL:COOLING:WATER", - "COIL:COOLING:WATER:DETAILEDGEOMETRY", - "COIL:HEATING:WATER", - "COIL:HEATING:STEAM", - "SOLARCOLLECTOR:FLATPLATE:WATER", - "LOADPROFILE:PLANT", - "GROUNDHEATEXCHANGER:SYSTEM", - "GROUNDHEATEXCHANGER:SURFACE", - "GROUNDHEATEXCHANGER:POND", - "GENERATOR:MICROTURBINE", - "GENERATOR:INTERNALCOMBUSTIONENGINE", - "GENERATOR:COMBUSTIONTURBINE", - "GENERATOR:MICROCHP", - "GENERATOR:FUELCELL:STACKCOOLER", - "FLUIDCOOLER:SINGLESPEED", - "FLUIDCOOLER:TWOSPEED", - "EVAPORATIVEFLUIDCOOLER:SINGLESPEED", - "EVAPORATIVEFLUIDCOOLER:TWOSPEED", - "THERMALSTORAGE:CHILLEDWATER:MIXED", - "THERMALSTORAGE:CHILLEDWATER:STRATIFIED", - "SOLARCOLLECTOR:FLATPLATE:PHOTOVOLTAICTHERMAL", - "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", - "ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", - "ZONEHVAC:LOWTEMPERATURERADIANT:CONSTANTFLOW", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", - "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT", - "COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT", - "COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION", - "COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION", - "REFRIGERATION:CONDENSER:WATERCOOLED", - "REFRIGERATION:COMPRESSORRACK", - "AIRLOOPHVAC:UNITARYHEATPUMP:AIRTOAIR:MULTISPEED", - "CHILLERHEATER:ABSORPTION:DOUBLEEFFECT", - "PIPINGSYSTEM:UNDERGROUND:PIPECIRCUIT", - "SOLARCOLLECTOR:INTEGRALCOLLECTORSTORAGE", - "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT", - "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT", - "PLANTCOMPONENT:USERDEFINED", - "COIL:USERDEFINED", - "ZONEHVAC:FORCEDAIR:USERDEFINED", - "AIRTERMINAL:SINGLEDUCT:USERDEFINED", - "AIRCONDITIONER:VARIABLEREFRIGERANTFLOW", - "GROUNDHEATEXCHANGER:HORIZONTALTRENCH", - "HEATEXCHANGER:FLUIDTOFLUID", - "PLANTCOMPONENT:TEMPERATURESOURCE", - "CENTRALHEATPUMPSYSTEM", - "AIRLOOPHVAC:UNITARYSYSTEM", - "COIL:COOLING:DX:SINGLESPEED:THERMALSTORAGE", - "COOLINGTOWER:VARIABLESPEED:MERKEL", - "SWIMMINGPOOL:INDOOR", - "GROUNDHEATEXCHANGER:SLINKY", - "WATERHEATER:HEATPUMP:WRAPPEDCONDENSER", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEBEAM", - "ZONEHVAC:COOLINGPANEL:RADIANTCONVECTIVE:WATER", - "HEATPUMP:PLANTLOOP:EIR:COOLING", - "HEATPUMP:PLANTLOOP:EIR:HEATING"}); - -Array1D_string const ccSimPlantEquipTypes(NumSimPlantEquipTypes, - {"Boiler:HotWater", - "Boiler:Steam", - "Chiller:Absorption", - "Chiller:Absorption:Indirect", - "Chiller:CombustionTurbine", - "Chiller:ConstantCOP", - "ChillerHeater:Absorption:DirectFired", - "Chiller:Electric", - "Chiller:Electric:EIR", - "Chiller:Electric:ReformulatedEIR", - "Chiller:EngineDriven", - "CoolingTower:SingleSpeed", - "CoolingTower:TwoSpeed", - "CoolingTower:VariableSpeed", - "Generator:Fuelcell:ExhaustGastoWaterHeatExchanger", - "WaterHeater:HeatPump:PumpedCondenser", - "Heatpump:WatertoWater:Equationfit:Cooling", - "Heatpump:WatertoWater:Equationfit:Heating", - "Heatpump:WatertoWater:ParameterEstimation:Cooling", - "Heatpump:WatertoWater:ParameterEstimation:Heating", - "Pipe:Adiabatic", - "Pipe:Adiabatic:Steam", - "Pipe:Outdoor", - "Pipe:Indoor", - "Pipe:Underground", - "DistrictCooling", - "DistrictHeating", - "ThermalStorage:Ice:Detailed", - "ThermalStorage:Ice:Simple", - "TemperingValve", - "WaterHeater:Mixed", - "WaterHeater:Stratified", - "Pump:VariableSpeed", - "Pump:ConstantSpeed", - "Pump:VariableSpeed:Condensate", - "HeaderedPumps:VariableSpeed", - "HeaderedPumps:ConstantSpeed", - "WaterUse:Connections", - "Coil:Cooling:Water", - "Coil:Cooling:Water:DetailedGeometry", - "Coil:Heating:Water", - "Coil:Heating:Steam", - "Solarcollector:Flatplate:Water", - "LoadProfile:Plant", - "GroundHeatExchanger:System", - "GroundHeatExchanger:Surface", - "GroundHeatExchanger:Pond", - "Generator:Microturbine", - "Generator:InternalCombustionEngine", - "Generator:CombustionTurbine", - "Generator:Microchp", - "Generator:Fuelcell:StackCooler", - "FluidCooler:SingleSpeed", - "FluidCooler:TwoSpeed", - "EvaporativeFluidCooler:SingleSpeed", - "EvaporativeFluidCooler:TwoSpeed", - "ThermalStorage:ChilledWater:Mixed", - "ThermalStorage:ChilledWater:Stratified", - "SolarCollector:FlatPlate:PhotovoltaicThermal", - "ZoneHVAC:Baseboard:Convective:Water", - "ZoneHVAC:Baseboard:RadiantConvective:Steam", - "ZoneHVAC:Baseboard:RadiantConvective:Water", - "ZoneHVAC:LowTemperatureRadiant:VariableFlow", - "ZoneHVAC:LowTemperatureRadiant:ConstantFlow", - "AirTerminal:SingleDuct:ConstantVolume:CooledBeam", - "Coil:Heating:WaterToAirHeatPump:EquationFit", - "Coil:Cooling:WaterToAirHeatPump:EquationFit", - "Coil:Heating:WaterToAirHeatPump:ParameterEstimation", - "Coil:Cooling:WaterToAirHeatPump:ParameterEstimation", - "Refrigeration:Condenser:WaterCooled", - "Refrigeration:CompressorRack", - "AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed", - "ChillerHeater:Absorption:DoubleEffect", - "PipingSystem:Underground:PipeCircuit", - "SolarCollector:IntegralCollectorStorage", - "Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit", - "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit", - "PlantComponent:UserDefined", - "Coil:UserDefined", - "ZoneHVAC:ForcedAir:UserDefined", - "AirTerminal:SingleDuct:UserDefined", - "AirConditioner:VariableRefrigerantFlow", - "GroundHeatExchanger:HorizontalTrench", - "HeatExchanger:FluidToFluid", - "PlantComponent:TemperatureSource", - "CentralHeatPumpSystem", - "AirLoopHVAC:UnitarySystem", - "Coil:Cooling:DX:SingleSpeed:ThermalStorage", - "CoolingTower:VariableSpeed:Merkel", - "SwimmingPool:Indoor", - "GroundHeatExchanger:Slinky", - "WaterHeater:HeatPump:WrappedCondenser", - "AirTerminal:SingleDuct:ConstantVolume:FourPipeBeam", - "ZoneHVAC:CoolingPanel:RadiantConvective:Water", - "HeatPump:PlantLoop:EIR:Cooling", - "HeatPump:PlantLoop:EIR:Heating"}); - -Array1D const ValidLoopEquipTypes( - NumSimPlantEquipTypes, - {LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, - LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, - LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, - LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, - LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, - LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, - LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, - LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, - LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, - LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, - LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Both, - LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both}); Array1D const ConvergenceHistoryARR(DataPlant::NumConvergenceHistoryTerms, {0.0, -1.0, -2.0, -3.0, -4.0}); diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 7dd69d03dfd..fefc3083133 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -75,9 +75,6 @@ namespace DataPlant { // Using/Aliasing using DataLoopNode::SensedNodeFlagValue; - constexpr int LoadRangeBasedMin(0); - constexpr int LoadRangeBasedMax(2); - // Criteria percentage limits for determining re-simulation of connected loop sides constexpr Real64 CriteriaDelta_MassFlowRate(0.001); constexpr Real64 CriteriaDelta_Temperature(0.010); @@ -92,126 +89,217 @@ namespace DataPlant { constexpr Real64 LoopDemandTol(0.1); // minimum significant loop cooling or heating demand constexpr Real64 DeltaTempTol(0.0001); // minimum significant loop temperature difference - constexpr std::string_view cPressureSimType(DataPlant::iPressSimType const &d) - { - switch (d) { - case DataPlant::iPressSimType::NoPressure: - return "NONE"; - case DataPlant::iPressSimType::PumpPowerCorrection: - return "PUMPPOWERCORRECTION"; - case DataPlant::iPressSimType::FlowCorrection: - return "LOOPFLOWCORRECTION"; - case DataPlant::iPressSimType::FlowSimulation: - return "PRESSURESIMULATION"; - default: - assert(false); - return ""; - } - } - // Parameters for Component/Equipment Types (ref: TypeOf in CompData) - constexpr int NumSimPlantEquipTypes(96); - extern Array1D_string const SimPlantEquipTypes; - extern Array1D_string const ccSimPlantEquipTypes; - extern Array1D const ValidLoopEquipTypes; - constexpr int TypeOf_Other(-1); - constexpr int TypeOf_Boiler_Simple(1); - constexpr int TypeOf_Boiler_Steam(2); - constexpr int TypeOf_Chiller_Absorption(3); // older BLAST absorption chiller - constexpr int TypeOf_Chiller_Indirect_Absorption(4); // revised absorption chiller - constexpr int TypeOf_Chiller_CombTurbine(5); - constexpr int TypeOf_Chiller_ConstCOP(6); - constexpr int TypeOf_Chiller_DFAbsorption(7); - constexpr int TypeOf_Chiller_Electric(8); // basic BLAST Chiller - constexpr int TypeOf_Chiller_ElectricEIR(9); - constexpr int TypeOf_Chiller_ElectricReformEIR(10); - constexpr int TypeOf_Chiller_EngineDriven(11); - constexpr int TypeOf_CoolingTower_SingleSpd(12); - constexpr int TypeOf_CoolingTower_TwoSpd(13); - constexpr int TypeOf_CoolingTower_VarSpd(14); - constexpr int TypeOf_Generator_FCExhaust(15); - constexpr int TypeOf_HeatPumpWtrHeaterPumped(16); - constexpr int TypeOf_HPWaterEFCooling(17); - constexpr int TypeOf_HPWaterEFHeating(18); - constexpr int TypeOf_HPWaterPECooling(19); - constexpr int TypeOf_HPWaterPEHeating(20); - constexpr int TypeOf_Pipe(21); - constexpr int TypeOf_PipeSteam(22); - constexpr int TypeOf_PipeExterior(23); - constexpr int TypeOf_PipeInterior(24); - constexpr int TypeOf_PipeUnderground(25); - constexpr int TypeOf_PurchChilledWater(26); - constexpr int TypeOf_PurchHotWater(27); - constexpr int TypeOf_TS_IceDetailed(28); - constexpr int TypeOf_TS_IceSimple(29); - constexpr int TypeOf_ValveTempering(30); - constexpr int TypeOf_WtrHeaterMixed(31); - constexpr int TypeOf_WtrHeaterStratified(32); - constexpr int TypeOf_PumpVariableSpeed(33); - constexpr int TypeOf_PumpConstantSpeed(34); - constexpr int TypeOf_PumpCondensate(35); - constexpr int TypeOf_PumpBankVariableSpeed(36); - constexpr int TypeOf_PumpBankConstantSpeed(37); - constexpr int TypeOf_WaterUseConnection(38); - constexpr int TypeOf_CoilWaterCooling(39); // demand side component - constexpr int TypeOf_CoilWaterDetailedFlatCooling(40); // demand side component - constexpr int TypeOf_CoilWaterSimpleHeating(41); // demand side component - constexpr int TypeOf_CoilSteamAirHeating(42); // demand side component - constexpr int TypeOf_SolarCollectorFlatPlate(43); // demand side component - constexpr int TypeOf_PlantLoadProfile(44); // demand side component - constexpr int TypeOf_GrndHtExchgSystem(45); - constexpr int TypeOf_GrndHtExchgSurface(46); - constexpr int TypeOf_GrndHtExchgPond(47); - constexpr int TypeOf_Generator_MicroTurbine(48); // newer FSEC turbine - constexpr int TypeOf_Generator_ICEngine(49); - constexpr int TypeOf_Generator_CTurbine(50); // older BLAST turbine - constexpr int TypeOf_Generator_MicroCHP(51); - constexpr int TypeOf_Generator_FCStackCooler(52); - constexpr int TypeOf_FluidCooler_SingleSpd(53); - constexpr int TypeOf_FluidCooler_TwoSpd(54); - constexpr int TypeOf_EvapFluidCooler_SingleSpd(55); - constexpr int TypeOf_EvapFluidCooler_TwoSpd(56); - constexpr int TypeOf_ChilledWaterTankMixed(57); - constexpr int TypeOf_ChilledWaterTankStratified(58); - constexpr int TypeOf_PVTSolarCollectorFlatPlate(59); - constexpr int TypeOf_Baseboard_Conv_Water(60); - constexpr int TypeOf_Baseboard_Rad_Conv_Steam(61); - constexpr int TypeOf_Baseboard_Rad_Conv_Water(62); - constexpr int TypeOf_LowTempRadiant_VarFlow(63); - constexpr int TypeOf_LowTempRadiant_ConstFlow(64); - constexpr int TypeOf_CooledBeamAirTerminal(65); - constexpr int TypeOf_CoilWAHPHeatingEquationFit(66); - constexpr int TypeOf_CoilWAHPCoolingEquationFit(67); - constexpr int TypeOf_CoilWAHPHeatingParamEst(68); - constexpr int TypeOf_CoilWAHPCoolingParamEst(69); - constexpr int TypeOf_RefrigSystemWaterCondenser(70); - constexpr int TypeOf_RefrigerationWaterCoolRack(71); - constexpr int TypeOf_MultiSpeedHeatPumpRecovery(72); - constexpr int TypeOf_Chiller_ExhFiredAbsorption(73); - constexpr int TypeOf_PipingSystemPipeCircuit(74); - constexpr int TypeOf_SolarCollectorICS(75); - constexpr int TypeOf_CoilVSWAHPHeatingEquationFit(76); - constexpr int TypeOf_CoilVSWAHPCoolingEquationFit(77); - constexpr int TypeOf_PlantComponentUserDefined(78); - constexpr int TypeOf_CoilUserDefined(79); - constexpr int TypeOf_ZoneHVACAirUserDefined(80); - constexpr int TypeOf_AirTerminalUserDefined(81); - constexpr int TypeOf_HeatPumpVRF(82); - constexpr int TypeOf_GrndHtExchgHorizTrench(83); - constexpr int TypeOf_FluidToFluidPlantHtExchg(84); - constexpr int TypeOf_WaterSource(85); - constexpr int TypeOf_CentralGroundSourceHeatPump(86); - constexpr int TypeOf_UnitarySysRecovery(87); - constexpr int TypeOf_PackagedTESCoolingCoil(88); - constexpr int TypeOf_CoolingTower_VarSpdMerkel(89); - constexpr int TypeOf_SwimmingPool_Indoor(90); - constexpr int TypeOf_GrndHtExchgSlinky(91); - constexpr int TypeOf_HeatPumpWtrHeaterWrapped(92); - constexpr int TypeOf_FourPipeBeamAirTerminal(93); - constexpr int TypeOf_CoolingPanel_Simple(94); - constexpr int TypeOf_HeatPumpEIRCooling(95); - constexpr int TypeOf_HeatPumpEIRHeating(96); + constexpr std::array(PlantEquipmentType::Num)> PlantEquipTypeNames{ + "Boiler:HotWater", + "Boiler:Steam", + "Chiller:Absorption", + "Chiller:Absorption:Indirect", + "Chiller:CombustionTurbine", + "Chiller:ConstantCOP", + "ChillerHeater:Absorption:DirectFired", + "Chiller:Electric", + "Chiller:Electric:EIR", + "Chiller:Electric:ReformulatedEIR", + "Chiller:EngineDriven", + "CoolingTower:SingleSpeed", + "CoolingTower:TwoSpeed", + "CoolingTower:VariableSpeed", + "Generator:Fuelcell:ExhaustGastoWaterHeatExchanger", + "WaterHeater:HeatPump:PumpedCondenser", + "Heatpump:WatertoWater:Equationfit:Cooling", + "Heatpump:WatertoWater:Equationfit:Heating", + "Heatpump:WatertoWater:ParameterEstimation:Cooling", + "Heatpump:WatertoWater:ParameterEstimation:Heating", + "Pipe:Adiabatic", + "Pipe:Adiabatic:Steam", + "Pipe:Outdoor", + "Pipe:Indoor", + "Pipe:Underground", + "DistrictCooling", + "DistrictHeating", + "ThermalStorage:Ice:Detailed", + "ThermalStorage:Ice:Simple", + "TemperingValve", + "WaterHeater:Mixed", + "WaterHeater:Stratified", + "Pump:VariableSpeed", + "Pump:ConstantSpeed", + "Pump:VariableSpeed:Condensate", + "HeaderedPumps:VariableSpeed", + "HeaderedPumps:ConstantSpeed", + "WaterUse:Connections", + "Coil:Cooling:Water", + "Coil:Cooling:Water:DetailedGeometry", + "Coil:Heating:Water", + "Coil:Heating:Steam", + "Solarcollector:Flatplate:Water", + "LoadProfile:Plant", + "GroundHeatExchanger:System", + "GroundHeatExchanger:Surface", + "GroundHeatExchanger:Pond", + "Generator:Microturbine", + "Generator:InternalCombustionEngine", + "Generator:CombustionTurbine", + "Generator:Microchp", + "Generator:Fuelcell:StackCooler", + "FluidCooler:SingleSpeed", + "FluidCooler:TwoSpeed", + "EvaporativeFluidCooler:SingleSpeed", + "EvaporativeFluidCooler:TwoSpeed", + "ThermalStorage:ChilledWater:Mixed", + "ThermalStorage:ChilledWater:Stratified", + "SolarCollector:FlatPlate:PhotovoltaicThermal", + "ZoneHVAC:Baseboard:Convective:Water", + "ZoneHVAC:Baseboard:RadiantConvective:Steam", + "ZoneHVAC:Baseboard:RadiantConvective:Water", + "ZoneHVAC:LowTemperatureRadiant:VariableFlow", + "ZoneHVAC:LowTemperatureRadiant:ConstantFlow", + "AirTerminal:SingleDuct:ConstantVolume:CooledBeam", + "Coil:Heating:WaterToAirHeatPump:EquationFit", + "Coil:Cooling:WaterToAirHeatPump:EquationFit", + "Coil:Heating:WaterToAirHeatPump:ParameterEstimation", + "Coil:Cooling:WaterToAirHeatPump:ParameterEstimation", + "Refrigeration:Condenser:WaterCooled", + "Refrigeration:CompressorRack", + "AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed", + "ChillerHeater:Absorption:DoubleEffect", + "PipingSystem:Underground:PipeCircuit", + "SolarCollector:IntegralCollectorStorage", + "Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit", + "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit", + "PlantComponent:UserDefined", + "Coil:UserDefined", + "ZoneHVAC:ForcedAir:UserDefined", + "AirTerminal:SingleDuct:UserDefined", + "AirConditioner:VariableRefrigerantFlow", + "GroundHeatExchanger:HorizontalTrench", + "HeatExchanger:FluidToFluid", + "PlantComponent:TemperatureSource", + "CentralHeatPumpSystem", + "AirLoopHVAC:UnitarySystem", + "Coil:Cooling:DX:SingleSpeed:ThermalStorage", + "CoolingTower:VariableSpeed:Merkel", + "SwimmingPool:Indoor", + "GroundHeatExchanger:Slinky", + "WaterHeater:HeatPump:WrappedCondenser", + "AirTerminal:SingleDuct:ConstantVolume:FourPipeBeam", + "ZoneHVAC:CoolingPanel:RadiantConvective:Water", + "HeatPump:PlantLoop:EIR:Cooling", + "HeatPump:PlantLoop:EIR:Heating"}; + + constexpr std::array(PlantEquipmentType::Num)> PlantEquipTypeNamesUC{ + "BOILER:HOTWATER", + "BOILER:STEAM", + "CHILLER:ABSORPTION", + "CHILLER:ABSORPTION:INDIRECT", + "CHILLER:COMBUSTIONTURBINE", + "CHILLER:CONSTANTCOP", + "CHILLERHEATER:ABSORPTION:DIRECTFIRED", + "CHILLER:ELECTRIC", + "CHILLER:ELECTRIC:EIR", + "CHILLER:ELECTRIC:REFORMULATEDEIR", + "CHILLER:ENGINEDRIVEN", + "COOLINGTOWER:SINGLESPEED", + "COOLINGTOWER:TWOSPEED", + "COOLINGTOWER:VARIABLESPEED", + "GENERATOR:FUELCELL:EXHAUSTGASTOWATERHEATEXCHANGER", + "WATERHEATER:HEATPUMP:PUMPEDCONDENSER", + "HEATPUMP:WATERTOWATER:EQUATIONFIT:COOLING", + "HEATPUMP:WATERTOWATER:EQUATIONFIT:HEATING", + "HEATPUMP:WATERTOWATER:PARAMETERESTIMATION:COOLING", + "HEATPUMP:WATERTOWATER:PARAMETERESTIMATION:HEATING", + "PIPE:ADIABATIC", + "PIPE:ADIABATIC:STEAM", + "PIPE:OUTDOOR", + "PIPE:INDOOR", + "PIPE:UNDERGROUND", + "DISTRICTCOOLING", + "DISTRICTHEATING", + "THERMALSTORAGE:ICE:DETAILED", + "THERMALSTORAGE:ICE:SIMPLE", + "TEMPERINGVALVE", + "WATERHEATER:MIXED", + "WATERHEATER:STRATIFIED", + "PUMP:VARIABLESPEED", + "PUMP:CONSTANTSPEED", + "PUMP:VARIABLESPEED:CONDENSATE", + "HEADEREDPUMPS:VARIABLESPEED", + "HEADEREDPUMPS:CONSTANTSPEED", + "WATERUSE:CONNECTIONS", + "COIL:COOLING:WATER", + "COIL:COOLING:WATER:DETAILEDGEOMETRY", + "COIL:HEATING:WATER", + "COIL:HEATING:STEAM", + "SOLARCOLLECTOR:FLATPLATE:WATER", + "LOADPROFILE:PLANT", + "GROUNDHEATEXCHANGER:SYSTEM", + "GROUNDHEATEXCHANGER:SURFACE", + "GROUNDHEATEXCHANGER:POND", + "GENERATOR:MICROTURBINE", + "GENERATOR:INTERNALCOMBUSTIONENGINE", + "GENERATOR:COMBUSTIONTURBINE", + "GENERATOR:MICROCHP", + "GENERATOR:FUELCELL:STACKCOOLER", + "FLUIDCOOLER:SINGLESPEED", + "FLUIDCOOLER:TWOSPEED", + "EVAPORATIVEFLUIDCOOLER:SINGLESPEED", + "EVAPORATIVEFLUIDCOOLER:TWOSPEED", + "THERMALSTORAGE:CHILLEDWATER:MIXED", + "THERMALSTORAGE:CHILLEDWATER:STRATIFIED", + "SOLARCOLLECTOR:FLATPLATE:PHOTOVOLTAICTHERMAL", + "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", + "ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", + "ZONEHVAC:LOWTEMPERATURERADIANT:CONSTANTFLOW", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", + "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT", + "COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT", + "COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION", + "COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION", + "REFRIGERATION:CONDENSER:WATERCOOLED", + "REFRIGERATION:COMPRESSORRACK", + "AIRLOOPHVAC:UNITARYHEATPUMP:AIRTOAIR:MULTISPEED", + "CHILLERHEATER:ABSORPTION:DOUBLEEFFECT", + "PIPINGSYSTEM:UNDERGROUND:PIPECIRCUIT", + "SOLARCOLLECTOR:INTEGRALCOLLECTORSTORAGE", + "COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT", + "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT", + "PLANTCOMPONENT:USERDEFINED", + "COIL:USERDEFINED", + "ZONEHVAC:FORCEDAIR:USERDEFINED", + "AIRTERMINAL:SINGLEDUCT:USERDEFINED", + "AIRCONDITIONER:VARIABLEREFRIGERANTFLOW", + "GROUNDHEATEXCHANGER:HORIZONTALTRENCH", + "HEATEXCHANGER:FLUIDTOFLUID", + "PLANTCOMPONENT:TEMPERATURESOURCE", + "CENTRALHEATPUMPSYSTEM", + "AIRLOOPHVAC:UNITARYSYSTEM", + "COIL:COOLING:DX:SINGLESPEED:THERMALSTORAGE", + "COOLINGTOWER:VARIABLESPEED:MERKEL", + "SWIMMINGPOOL:INDOOR", + "GROUNDHEATEXCHANGER:SLINKY", + "WATERHEATER:HEATPUMP:WRAPPEDCONDENSER", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEBEAM", + "ZONEHVAC:COOLINGPANEL:RADIANTCONVECTIVE:WATER", + "HEATPUMP:PLANTLOOP:EIR:COOLING", + "HEATPUMP:PLANTLOOP:EIR:HEATING"}; + + constexpr std::array(PlantEquipmentType::Num)> ValidLoopEquipTypes{ + LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, + LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, + LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, + LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, + LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, + LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, + LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, + LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Plant, + LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, + LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, + LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Both, + LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both}; extern Array1D const ConvergenceHistoryARR; diff --git a/src/EnergyPlus/Plant/Enums.hh b/src/EnergyPlus/Plant/Enums.hh index 60b09b932c7..1f8b40c5c2b 100644 --- a/src/EnergyPlus/Plant/Enums.hh +++ b/src/EnergyPlus/Plant/Enums.hh @@ -63,32 +63,135 @@ enum class LoopFlowStatus }; // Parameters for scheme types -// Used in TYPE(OperationData)%OpSchemeType -// As in PlantLoop(:)%OpScheme(:)%OpSchemeType +// Used in TYPE(OperationData)%Type +// As in PlantLoop(:)%OpScheme(:)%Type // Also in PlantLoop()LoopSide()Branch()Comp()%CurOpSchemeType // this may be changed later... -enum OpSchemeType +enum class OpScheme { // Changed to enum: Better semantic fit and allows use in switch statements: Suggest this migration throughout EnergyPlus (and probably C++11 // enum "class") - UnknownStatusOpSchemeType = -2, - NoControlOpSchemeType = -1, // Scheme Type placeholder for items such as pipes - HeatingRBOpSchemeType = 1, // Scheme Type for Heating Load Range Based Operation - CoolingRBOpSchemeType = 2, // Scheme Type for Cooling Load Range Based Operation - WetBulbRBOpSchemeType = 3, // Scheme Type for Wet bulb range based Operation - DryBulbRBOpSchemeType = 4, // Scheme Type for Dry bulb range based Operation - DewPointRBOpSchemeType = 5, // Scheme Type for Dewpoint range based Operation - RelHumRBOpSchemeType = 6, // Scheme Type for relative humidity range based Operation - DryBulbTDBOpSchemeType = 7, // Scheme Type for relative humidity range based Operation - WetBulbTDBOpSchemeType = 8, // Scheme Type for Wet bulb range based Operation - DewPointTDBOpSchemeType = 9, // Scheme Type for Wet bulb range based Operation - CompSetPtBasedSchemeType = 10, // Temp Based Control - UncontrolledOpSchemeType = 11, // Scheme Type for Uncontrolled Operation - EMSOpSchemeType = 12, // Scheme Type for EMS based operation user Define scheme - PumpOpSchemeType = 13, // Not really an OpScheme, just a placeholder - DemandOpSchemeType = 14, // Placeholder for demand side equipment such as coils - FreeRejectionOpSchemeType = 15, // Scheme Type for waterside economizers and the like - WSEconOpSchemeType = 16, // Scheme Type for waterside economizers and the like - ThermalEnergyStorageSchemeType = 17 // Scheme Type for Simplified Thermal Energy Storage operation + Unassigned = -1, + NoControl, // Scheme Type placeholder for items such as pipes + HeatingRB, // Scheme Type for Heating Load Range Based Operation + CoolingRB, // Scheme Type for Cooling Load Range Based Operation + WetBulbRB, // Scheme Type for Wet bulb range based Operation + DryBulbRB, // Scheme Type for Dry bulb range based Operation + DewPointRB, // Scheme Type for Dew point range based Operation + RelHumRB, // Scheme Type for relative humidity range based Operation + DryBulbTDB, // Scheme Type for dry bulb temp range based Operation + WetBulbTDB, // Scheme Type for wet bulb temp based Operation + DewPointTDB, // Scheme Type for dew point temp based Operation + CompSetPtBased, // Temp Based Control + Uncontrolled, // Scheme Type for Uncontrolled Operation + EMS, // Scheme Type for EMS based operation user Define scheme + Pump, // Not really an OpScheme, just a placeholder + Demand, // Placeholder for demand side equipment such as coils + FreeRejection, // Scheme Type for waterside economizers and the like + WSEcon, // Scheme Type for waterside economizers and the like + ThermalEnergyStorage, // Scheme Type for Simplified Thermal Energy Storage operation + Num +}; + +enum class PlantEquipmentType +{ + Invalid = -1, + Boiler_Simple, + Boiler_Steam, + Chiller_Absorption, // older BLAST absorption chiller + Chiller_Indirect_Absorption, // revised absorption chiller + Chiller_CombTurbine, + Chiller_ConstCOP, + Chiller_DFAbsorption, + Chiller_Electric, // basic BLAST Chiller + Chiller_ElectricEIR, + Chiller_ElectricReformEIR, + Chiller_EngineDriven, + CoolingTower_SingleSpd, + CoolingTower_TwoSpd, + CoolingTower_VarSpd, + Generator_FCExhaust, + HeatPumpWtrHeaterPumped, + HPWaterEFCooling, + HPWaterEFHeating, + HPWaterPECooling, + HPWaterPEHeating, + Pipe, + PipeSteam, + PipeExterior, + PipeInterior, + PipeUnderground, + PurchChilledWater, + PurchHotWater, + TS_IceDetailed, + TS_IceSimple, + ValveTempering, + WtrHeaterMixed, + WtrHeaterStratified, + PumpVariableSpeed, + PumpConstantSpeed, + PumpCondensate, + PumpBankVariableSpeed, + PumpBankConstantSpeed, + WaterUseConnection, + CoilWaterCooling, // demand side component + CoilWaterDetailedFlatCooling, // demand side component + CoilWaterSimpleHeating, // demand side component + CoilSteamAirHeating, // demand side component + SolarCollectorFlatPlate, // demand side component + PlantLoadProfile, // demand side component + GrndHtExchgSystem, + GrndHtExchgSurface, + GrndHtExchgPond, + Generator_MicroTurbine, // newer FSEC turbine + Generator_ICEngine, + Generator_CTurbine, // older BLAST turbine + Generator_MicroCHP, + Generator_FCStackCooler, + FluidCooler_SingleSpd, + FluidCooler_TwoSpd, + EvapFluidCooler_SingleSpd, + EvapFluidCooler_TwoSpd, + ChilledWaterTankMixed, + ChilledWaterTankStratified, + PVTSolarCollectorFlatPlate, + Baseboard_Conv_Water, + Baseboard_Rad_Conv_Steam, + Baseboard_Rad_Conv_Water, + LowTempRadiant_VarFlow, + LowTempRadiant_ConstFlow, + CooledBeamAirTerminal, + CoilWAHPHeatingEquationFit, + CoilWAHPCoolingEquationFit, + CoilWAHPHeatingParamEst, + CoilWAHPCoolingParamEst, + RefrigSystemWaterCondenser, + RefrigerationWaterCoolRack, + MultiSpeedHeatPumpRecovery, + Chiller_ExhFiredAbsorption, + PipingSystemPipeCircuit, + SolarCollectorICS, + CoilVSWAHPHeatingEquationFit, + CoilVSWAHPCoolingEquationFit, + PlantComponentUserDefined, + CoilUserDefined, + ZoneHVACAirUserDefined, + AirTerminalUserDefined, + HeatPumpVRF, + GrndHtExchgHorizTrench, + FluidToFluidPlantHtExchg, + WaterSource, + CentralGroundSourceHeatPump, + UnitarySysRecovery, + PackagedTESCoolingCoil, + CoolingTower_VarSpdMerkel, + SwimmingPool_Indoor, + GrndHtExchgSlinky, + HeatPumpWtrHeaterWrapped, + FourPipeBeamAirTerminal, + CoolingPanel_Simple, + HeatPumpEIRCooling, + HeatPumpEIRHeating, + Num }; // Parameters for component character wrt how load gets met (or not) @@ -106,99 +209,126 @@ enum class HowMet NUM }; -enum class iLoadingScheme +enum class LoadingScheme { - Unassigned, + Unassigned = -1, Optimal, // Optimal Load Distribution Scheme Sequential, // Sequential Load Distribution Scheme Uniform, // Uniform Load Distribution Scheme UniformPLR, // Uniform PLR Load Distribution Scheme SequentialUniformPLR, // Sequential Uniform PLR Load Distribution Scheme + Num }; enum class FlowMode { - Unassigned, + Unassigned = -1, Constant, NotModulated, LeavingSetpointModulated, + Num }; enum class CondenserType { - Unassigned, + Unassigned = -1, AirCooled, WaterCooled, EvapCooled, + Num }; +constexpr std::array(CondenserType::Num)> CondenserTypeNamesUC{"AIRCOOLED", "WATERCOOLED", "EVAPORATIVELYCOOLED"}; + // SimFlagCriteriaTypes for use in performing interconnect re-sim checks -enum class iCriteriaType +enum class CriteriaType { + Unassigned = -1, MassFlowRate, Temperature, HeatTransferRate, + Num }; -enum class iFreeCoolControlMode +enum class FreeCoolControlMode { - Unassigned, + Unassigned = -1, WetBulb, // HeatExchanger:Hydronic model control type mode, outdoor wetbulb sensor DryBulb, // HeatExchanger:Hydronic model control type mode, outdoor drybulb sensor Loop, // HeatExchanger:Hydronic model control type mode, loop setpoint sensor + Num }; -enum class iLoopDemandCalcScheme +enum class LoopDemandCalcScheme { - Unassigned, + Unassigned = -1, SingleSetPoint, // Uses a single temp setpoint to calculate loop demand DualSetPointDeadBand, // Uses a dual temp setpoint with a deadband between the high + Num }; -enum class iCommonPipeType +enum class CommonPipeType { + Unassigned = -1, No, Single, TwoWay, + Num }; -enum class iFlowLock +enum class FlowLock { + Unassigned = -1, PumpQuery, // Used to ask the pumps for their min/max avail based on no constraints Unlocked, // components request flow Locked, // components take their inlet flow + Num }; -enum class iPressureCall +enum class PressureCall { + Unassigned = -1, Init, Calc, Update, + Num }; -enum class iPressSimType +enum class PressSimType { + Unassigned = -1, NoPressure, // Nothing for that particular loop PumpPowerCorrection, // Only updating the pump power FlowCorrection, // Update pump flow rate based on pump curve FlowSimulation, // Full pressure network simulation + Num +}; + +constexpr std::array(PressSimType::Num)> PressureSimTypeNamesUC{ + "NONE", + "PUMPPOWERCORRECTION", + "LOOPFLOWCORRECTION", + "PRESSURESIMULATION", }; -enum class iCtrlType +enum class CtrlType { - Unassigned, + Unassigned = -1, HeatingOp, // Constant for Heating Operation CoolingOp, // Constant for Cooling Operation DualOp, // Constant for Cooling or Heating Operation + Num }; // branch loop type for absorption chillerheater models enum class BrLoopType { + Unassigned = -1, Chiller, Heater, Condenser, - NoMatch + NoMatch, + Num }; constexpr std::array(HowMet::NUM)> HowMetTypeNamesUC = {"DEMANDSLOAD", diff --git a/src/EnergyPlus/Plant/EquipAndOperations.hh b/src/EnergyPlus/Plant/EquipAndOperations.hh index 250dcd1f3e0..8bc76f6c3d0 100644 --- a/src/EnergyPlus/Plant/EquipAndOperations.hh +++ b/src/EnergyPlus/Plant/EquipAndOperations.hh @@ -83,11 +83,9 @@ struct OpSchemePtrData struct EquipListCompData { // Members - std::string Name; // The name of each item in the list - std::string TypeOf; // The name of each item in the list - int TypeOf_Num; - std::string CtrlType; // CoolingOp, HeatingOp, DualOp - DataPlant::iCtrlType CtrlTypeNum; // CoolingOp, HeatingOp, DualOp + std::string Name; // The name of each item in the list + std::string TypeOf; // The name of each item in the list + DataPlant::CtrlType CtrlType; // CoolingOp, HeatingOp, DualOp int LoopNumPtr; // pointer to the comp location in the data structure int LoopSideNumPtr; // pointer to the comp location in the data structure int BranchNumPtr; // pointer to the comp location in the data structure @@ -102,8 +100,8 @@ struct EquipListCompData // Default Constructor EquipListCompData() - : TypeOf_Num(0), CtrlTypeNum(DataPlant::iCtrlType::Unassigned), LoopNumPtr(0), LoopSideNumPtr(0), BranchNumPtr(0), CompNumPtr(0), - SetPointFlowRate(0.0), DemandNodeNum(0), SetPointNodeNum(0), EMSIntVarRemainingLoadValue(0.0), EMSActuatorDispatchedLoadValue(0.0) + : CtrlType(DataPlant::CtrlType::Unassigned), LoopNumPtr(0), LoopSideNumPtr(0), BranchNumPtr(0), CompNumPtr(0), SetPointFlowRate(0.0), + DemandNodeNum(0), SetPointNodeNum(0), EMSIntVarRemainingLoadValue(0.0), EMSActuatorDispatchedLoadValue(0.0) { } }; @@ -128,7 +126,7 @@ struct OperationData // Members std::string Name; // The name of each item in the list std::string TypeOf; // The 'keyWord' identifying each item in the list - int OpSchemeType; // Op scheme type (from keyword) + DataPlant::OpScheme Type; // Op scheme type (from keyword) std::string Sched; // The name of the schedule associated with the list int SchedPtr; // ALLOCATABLE to the schedule (for valid schedules) bool Available; // TRUE = designated component or operation scheme available @@ -147,8 +145,9 @@ struct OperationData // Default Constructor OperationData() - : OpSchemeType(0), SchedPtr(0), Available(false), NumEquipLists(0), CurListPtr(0), EquipListNumForLastStage(0), ReferenceNodeNumber(0), - ErlSimProgramMngr(0), ErlInitProgramMngr(0), initPluginLocation(-1), simPluginLocation(-1), EMSIntVarLoopDemandRate(0.0), MyEnvrnFlag(true) + : Type(DataPlant::OpScheme::Unassigned), SchedPtr(0), Available(false), NumEquipLists(0), CurListPtr(0), EquipListNumForLastStage(0), + ReferenceNodeNumber(0), ErlSimProgramMngr(0), ErlInitProgramMngr(0), initPluginLocation(-1), simPluginLocation(-1), + EMSIntVarLoopDemandRate(0.0), MyEnvrnFlag(true) { } }; diff --git a/src/EnergyPlus/Plant/Loop.cc b/src/EnergyPlus/Plant/Loop.cc index 24ad161e492..ae95470cdab 100644 --- a/src/EnergyPlus/Plant/Loop.cc +++ b/src/EnergyPlus/Plant/Loop.cc @@ -140,7 +140,7 @@ void PlantLoopData::CalcUnmetPlantDemand(EnergyPlusData &state) { auto const SELECT_CASE_var(this->LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature LoopSetPointTemperature = this->LoopSide(DataPlant::SupplySide).TempSetPoint; @@ -150,7 +150,7 @@ void PlantLoopData::CalcUnmetPlantDemand(EnergyPlusData &state) // Calculate the demand on the loop LoadToLoopSetPoint = MassFlowRate * Cp * DeltaTemp; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { // Get the range of setpoints LoopSetPointTemperatureHi = state.dataLoopNodes->Node(this->TempSetPointNodeNum).TempSetPointHi; @@ -185,7 +185,7 @@ void PlantLoopData::CalcUnmetPlantDemand(EnergyPlusData &state) { auto const SELECT_CASE_var(this->LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature LoopSetPointTemperature = this->LoopSide(DataPlant::SupplySide).TempSetPoint; diff --git a/src/EnergyPlus/Plant/Loop.hh b/src/EnergyPlus/Plant/Loop.hh index 9f013bb7010..ed5d1e804ad 100644 --- a/src/EnergyPlus/Plant/Loop.hh +++ b/src/EnergyPlus/Plant/Loop.hh @@ -97,15 +97,15 @@ namespace DataPlant { bool EMSCtrl; Real64 EMSValue; // Loop Inlet and Outlet Nodes - Array1D LoopSide; // Half loop data (Demand side or Supply Side) - std::string OperationScheme; // Operation scheme name for the loop - int NumOpSchemes; // Number of items in list identified by "OpScheme" - Array1D OpScheme; // Operation scheme data - DataPlant::iLoadingScheme LoadDistribution; // Load distribution scheme 1 for optimal, 2 for overloading - int PlantSizNum; // index to corresponding plant sizing data array - DataPlant::iLoopDemandCalcScheme LoopDemandCalcScheme; // Load distribution scheme 1 SingleSetPoint, + Array1D LoopSide; // Half loop data (Demand side or Supply Side) + std::string OperationScheme; // Operation scheme name for the loop + int NumOpSchemes; // Number of items in list identified by "OpScheme" + Array1D OpScheme; // Operation scheme data + DataPlant::LoadingScheme LoadDistribution; // Load distribution scheme 1 for optimal, 2 for overloading + int PlantSizNum; // index to corresponding plant sizing data array + DataPlant::LoopDemandCalcScheme LoopDemandCalcScheme; // Load distribution scheme 1 SingleSetPoint, // 2 DualSetPointwithDeadBand - DataPlant::iCommonPipeType CommonPipeType; + DataPlant::CommonPipeType CommonPipeType; int EconPlantSideSensedNodeNum; int EconCondSideSensedNodeNum; int EconPlacement; @@ -114,7 +114,7 @@ namespace DataPlant { Real64 EconControlTempDiff; bool LoopHasConnectionComp; LoopType TypeOfLoop; - DataPlant::iPressSimType PressureSimType; + DataPlant::PressSimType PressureSimType; bool HasPressureComponents; Real64 PressureDrop; bool UsePressureForPumpCalcs; @@ -137,10 +137,10 @@ namespace DataPlant { MFErrIndex(0), MFErrIndex1(0), MFErrIndex2(0), TempSetPointNodeNum(0), MaxBranch(0), MinTemp(0.0), MaxTemp(0.0), MinTempErrIndex(0), MaxTempErrIndex(0), MinVolFlowRate(0.0), MaxVolFlowRate(0.0), MaxVolFlowRateWasAutoSized(false), MinMassFlowRate(0.0), MaxMassFlowRate(0.0), Volume(0.0), VolumeWasAutoSized(false), CirculationTime(2.0), Mass(0.0), EMSCtrl(false), EMSValue(0.0), - NumOpSchemes(0), LoadDistribution(DataPlant::iLoadingScheme::Unassigned), PlantSizNum(0), - LoopDemandCalcScheme(DataPlant::iLoopDemandCalcScheme::Unassigned), CommonPipeType(DataPlant::iCommonPipeType::No), + NumOpSchemes(0), LoadDistribution(DataPlant::LoadingScheme::Unassigned), PlantSizNum(0), + LoopDemandCalcScheme(DataPlant::LoopDemandCalcScheme::Unassigned), CommonPipeType(DataPlant::CommonPipeType::No), EconPlantSideSensedNodeNum(0), EconCondSideSensedNodeNum(0), EconPlacement(0), EconBranch(0), EconComp(0), EconControlTempDiff(0.0), - LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(DataPlant::iPressSimType::NoPressure), + LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(DataPlant::PressSimType::NoPressure), HasPressureComponents(false), PressureDrop(0.0), UsePressureForPumpCalcs(false), PressureEffectiveK(0.0), CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), UnmetDemand(0.0), BypassFrac(0.0), InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), OutletNodeTemperature(0.0), LastLoopSideSimulated(0) diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index b26949f6e43..493977fc422 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -123,7 +123,7 @@ namespace DataPlant { // Do pressure system initialize if this is the demand side (therefore once per whole loop) if (this->myLoopSideNum == DataPlant::DemandSide) { - PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Init); + PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall::Init); } // Turn on any previously disabled branches due to constant speed branch pump issue @@ -154,7 +154,7 @@ namespace DataPlant { } else { // LoopSide == SupplySide // Update pressure drop reporting, calculate total loop pressure drop for use elsewhere - PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Update); + PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall::Update); // Pass the loop information via the HVAC interface manager (only the flow) HVACInterfaceManager::UpdatePlantLoopInterface(state, @@ -232,9 +232,9 @@ namespace DataPlant { auto &this_component(this->Branch(firstBranchIndex).Comp(CompIndex)); { - auto const SELECT_CASE_var(this_component.CurOpSchemeType); - - if ((SELECT_CASE_var >= DataPlant::LoadRangeBasedMin) && (SELECT_CASE_var <= DataPlant::LoadRangeBasedMax)) { //~ load range based + switch (this_component.CurOpSchemeType) { + case (OpScheme::HeatingRB): + case (OpScheme::CoolingRB): { //~ load range based if (EncounteredNonLRBAfterLRB) { // We must have already encountered a LRB, then a non-LRB, and now another LRB, this is bad ShowSevereError(state, "Plant topology problem on \"" + this->loopSideDescription + "\""); @@ -244,27 +244,32 @@ namespace DataPlant { } else { EncounteredLRB = true; } - - } else if (SELECT_CASE_var == DataPlant::PumpOpSchemeType) { //~ pump + break; + } + case (DataPlant::OpScheme::Pump): { //~ pump // For now this is just a placeholder, because I think pumps will be available anywhere, // and they won't affect the load distribution - - } else if (SELECT_CASE_var == DataPlant::NoControlOpSchemeType) { //~ Such as pipes + break; + } + case (DataPlant::OpScheme::NoControl): { //~ Such as pipes // For now this is just a placeholder, because these components shouldn't cause a problem anywhere... - - } else if (SELECT_CASE_var == - DataPlant::UnknownStatusOpSchemeType) { //~ Uninitialized, this should be a sufficient place to catch for this on branch 1 + break; + } + case (DataPlant::OpScheme::Unassigned): { //~ Uninitialized, this should be a sufficient place to catch for this on branch 1 // throw fatal ShowSevereError(state, "ValidateFlowControlPaths: Uninitialized operation scheme type for component Name: " + this_component.Name); ShowFatalError(state, "ValidateFlowControlPaths: developer notice, Inlet path validation loop"); - } else { //~ Other control type + break; + } + default: { //~ Other control type if (EncounteredLRB) { EncounteredNonLRBAfterLRB = true; } else { // For now don't do anything, but we'll see... } } + } } } @@ -294,10 +299,9 @@ namespace DataPlant { auto &this_component(this->Branch(BranchIndex).Comp(CompIndex)); { - auto const SELECT_CASE_var(this_component.CurOpSchemeType); - - if ((SELECT_CASE_var >= DataPlant::LoadRangeBasedMin) && - (SELECT_CASE_var <= DataPlant::LoadRangeBasedMax)) { //~ load range based + switch (this_component.CurOpSchemeType) { + case (OpScheme::HeatingRB): + case (OpScheme::CoolingRB): { //~ load range based if (EncounteredNonLRBAfterLRB) { // We must have already encountered a LRB, then a non-LRB, and now another LRB, this is bad ShowSevereError(state, "Plant topology problem on \"" + this->loopSideDescription + "\""); @@ -307,27 +311,34 @@ namespace DataPlant { } else { EncounteredLRB = true; } + break; + } - } else if (SELECT_CASE_var == DataPlant::NoControlOpSchemeType) { //~ Such as pipes + case (DataPlant::OpScheme::NoControl): { //~ Such as pipes // For now this is just a placeholder, because these components shouldn't cause a problem anywhere... - - } else if (SELECT_CASE_var == DataPlant::PumpOpSchemeType) { //~ pump + break; + } + case (DataPlant::OpScheme::Pump): { //~ pump // For now this is just a placeholder, because I think pumps will be available anywhere, // and they won't affect the load distribution - - } else if (SELECT_CASE_var == DataPlant::UnknownStatusOpSchemeType) { //~ Uninitialized, this should be sufficient place to - // catch for this on other branches + break; + } + case (DataPlant::OpScheme::Unassigned): { //~ Uninitialized, this should be sufficient place to + // catch for this on other branches // throw fatal error ShowSevereError( state, "ValidateFlowControlPaths: Uninitialized operation scheme type for component Name: " + this_component.Name); ShowFatalError(state, "ValidateFlowControlPaths: developer notice, problem in Parallel path validation loop"); - } else { //~ Other control type + break; + } + default: { //~ Other control type if (EncounteredLRB) { EncounteredNonLRBAfterLRB = true; } else { // For now don't do anything, but we'll see... } } + } } } //~ CompIndex @@ -437,7 +448,7 @@ namespace DataPlant { int BranchInletNode; int ComponentInletNode; int ComponentOutletNode; - int ComponentTypeOfNum; + DataPlant::PlantEquipmentType ComponentType; Real64 MassFlowRateFound; Real64 MassFlow; bool PlantIsRigid; @@ -467,7 +478,7 @@ namespace DataPlant { ComponentInletNode = this_comp.NodeNumIn; ComponentOutletNode = this_comp.NodeNumOut; MassFlowRateFound = state.dataLoopNodes->Node(ComponentOutletNode).MassFlowRate; - ComponentTypeOfNum = this_comp.TypeOf_Num; + ComponentType = this_comp.Type; //~ Push the values through state.dataLoopNodes->Node(ComponentOutletNode).MassFlowRate = MassFlow; @@ -489,35 +500,55 @@ namespace DataPlant { //~ For air connections, trip the LoopSide air flag //~ Similar for zone, none zone, and electric load center { - auto const SELECT_CASE_var(ComponentTypeOfNum); - - // possibly air-connected components - if ((SELECT_CASE_var == TypeOf_CoilWaterCooling) || (SELECT_CASE_var == TypeOf_CoilWaterDetailedFlatCooling) || - (SELECT_CASE_var == TypeOf_CoilWaterSimpleHeating) || (SELECT_CASE_var == TypeOf_CoilSteamAirHeating) || - (SELECT_CASE_var == TypeOf_CoilWAHPHeatingEquationFit) || (SELECT_CASE_var == TypeOf_CoilWAHPCoolingEquationFit) || - (SELECT_CASE_var == TypeOf_CoilWAHPHeatingParamEst) || (SELECT_CASE_var == TypeOf_CoilWAHPCoolingParamEst) || - (SELECT_CASE_var == TypeOf_CoilUserDefined) || (SELECT_CASE_var == TypeOf_CoilVSWAHPCoolingEquationFit) || - (SELECT_CASE_var == TypeOf_CoilVSWAHPHeatingEquationFit) || (SELECT_CASE_var == TypeOf_PackagedTESCoolingCoil)) { - + switch (ComponentType) { + + // possibly air-connected components + case DataPlant::PlantEquipmentType::CoilWaterCooling: + case DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling: + case DataPlant::PlantEquipmentType::CoilWaterSimpleHeating: + case DataPlant::PlantEquipmentType::CoilSteamAirHeating: + case DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit: + case DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit: + case DataPlant::PlantEquipmentType::CoilWAHPHeatingParamEst: + case DataPlant::PlantEquipmentType::CoilWAHPCoolingParamEst: + case DataPlant::PlantEquipmentType::CoilUserDefined: + case DataPlant::PlantEquipmentType::CoilVSWAHPCoolingEquationFit: + case DataPlant::PlantEquipmentType::CoilVSWAHPHeatingEquationFit: + case DataPlant::PlantEquipmentType::PackagedTESCoolingCoil: { this->SimAirLoopsNeeded = true; // sometimes these coils are children in ZoneHVAC equipment // PlantLoop(LoopNum)%LoopSide(LoopSideNum)%SimZoneEquipNeeded= .TRUE. + break; + } - } else if ((SELECT_CASE_var == TypeOf_CoolingPanel_Simple) || (SELECT_CASE_var == TypeOf_Baseboard_Conv_Water) || - (SELECT_CASE_var == TypeOf_Baseboard_Rad_Conv_Steam) || (SELECT_CASE_var == TypeOf_Baseboard_Rad_Conv_Water) || - (SELECT_CASE_var == TypeOf_LowTempRadiant_VarFlow) || (SELECT_CASE_var == TypeOf_LowTempRadiant_ConstFlow) || - (SELECT_CASE_var == TypeOf_CooledBeamAirTerminal) || (SELECT_CASE_var == TypeOf_ZoneHVACAirUserDefined) || - (SELECT_CASE_var == TypeOf_AirTerminalUserDefined) || - (SELECT_CASE_var == TypeOf_FourPipeBeamAirTerminal)) { // zone connected components - + // zone connected components + case DataPlant::PlantEquipmentType::CoolingPanel_Simple: + case DataPlant::PlantEquipmentType::Baseboard_Conv_Water: + case DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Steam: + case DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Water: + case DataPlant::PlantEquipmentType::LowTempRadiant_VarFlow: + case DataPlant::PlantEquipmentType::LowTempRadiant_ConstFlow: + case DataPlant::PlantEquipmentType::CooledBeamAirTerminal: + case DataPlant::PlantEquipmentType::ZoneHVACAirUserDefined: + case DataPlant::PlantEquipmentType::AirTerminalUserDefined: + case DataPlant::PlantEquipmentType::FourPipeBeamAirTerminal: { this->SimZoneEquipNeeded = true; + break; + } - } else if ((SELECT_CASE_var == TypeOf_Generator_FCExhaust) || (SELECT_CASE_var == TypeOf_Generator_FCStackCooler) || - (SELECT_CASE_var == TypeOf_Generator_MicroCHP) || (SELECT_CASE_var == TypeOf_Generator_MicroTurbine) || - (SELECT_CASE_var == TypeOf_Generator_ICEngine) || - (SELECT_CASE_var == TypeOf_Generator_CTurbine)) { // electric center connected components - + // electric center connected components + case DataPlant::PlantEquipmentType::Generator_FCExhaust: + case DataPlant::PlantEquipmentType::Generator_FCStackCooler: + case DataPlant::PlantEquipmentType::Generator_MicroCHP: + case DataPlant::PlantEquipmentType::Generator_MicroTurbine: + case DataPlant::PlantEquipmentType::Generator_ICEngine: + case DataPlant::PlantEquipmentType::Generator_CTurbine: { this->SimElectLoadCentrNeeded = true; + break; + } + + default: + break; } } } @@ -633,9 +664,9 @@ namespace DataPlant { Real64 totalDispatchedLoadOnBranch = 0.0; for (int compNum = 1; compNum <= branch.TotalComponents; ++compNum) { auto &component = branch.Comp(compNum); - auto &t = component.TypeOf_Num; - if (t == DataPlant::TypeOf_PumpConstantSpeed || t == DataPlant::TypeOf_PumpBankConstantSpeed || - t == DataPlant::TypeOf_PumpVariableSpeed || t == DataPlant::TypeOf_PumpBankVariableSpeed) { + auto &t = component.Type; + if (t == DataPlant::PlantEquipmentType::PumpConstantSpeed || t == DataPlant::PlantEquipmentType::PumpBankConstantSpeed || + t == DataPlant::PlantEquipmentType::PumpVariableSpeed || t == DataPlant::PlantEquipmentType::PumpBankVariableSpeed) { // don't do anything } else { totalDispatchedLoadOnBranch += component.MyLoad; @@ -672,7 +703,7 @@ namespace DataPlant { // If we are doing a common pipe simulation, and there is greater other-side flow than this side, // then the "other side" demand needs to include getting the flow through the common pipe to the same setpoint // as the flow going through the actual supply side - if (this->hasConstSpeedBranchPumps && this->myLoopSideNum == 2 && thisPlantLoop.CommonPipeType != DataPlant::iCommonPipeType::No) { + if (this->hasConstSpeedBranchPumps && this->myLoopSideNum == 2 && thisPlantLoop.CommonPipeType != DataPlant::CommonPipeType::No) { const int OtherSide = 3 - this->myLoopSideNum; const int otherSideOutletNodeNum = thisPlantLoop.LoopSide(OtherSide).NodeNumOut; Real64 commonPipeFlow = state.dataLoopNodes->Node(otherSideOutletNodeNum).MassFlowRate - ThisLoopSideFlow; @@ -711,9 +742,8 @@ namespace DataPlant { FluidProperties::GetSpecificHeatGlycol(state, thisPlantLoop.FluidName, WeightedInletTemp, thisPlantLoop.FluidIndex, RoutineName); { - auto const SELECT_CASE_var(thisPlantLoop.LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (thisPlantLoop.LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature Real64 LoopSetPointTemperature = this->TempSetPoint; @@ -723,7 +753,7 @@ namespace DataPlant { // Calculate the demand on the loop LoadToLoopSetPoint = SumMdot * Cp * DeltaTemp; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (thisPlantLoop.LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { // Get the range of setpoints Real64 LoopSetPointTemperatureHi = state.dataLoopNodes->Node(thisPlantLoop.TempSetPointNodeNum).TempSetPointHi; @@ -785,9 +815,8 @@ namespace DataPlant { FluidProperties::GetSpecificHeatGlycol(state, thisPlantLoop.FluidName, WeightedInletTemp, thisPlantLoop.FluidIndex, RoutineName); { - auto const SELECT_CASE_var(thisPlantLoop.LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (thisPlantLoop.LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature Real64 LoopSetPointTemperature = this->TempSetPoint; @@ -908,7 +937,7 @@ namespace DataPlant { // reference auto &node_with_request(state.dataLoopNodes->Node(NodeToCheckRequest)); - if (!component.isPump()) { + if (!DataPlant::PlantEquipmentTypeIsPump[static_cast(component.Type)]) { if (FlowPriorityStatus == DataPlant::LoopFlowStatus::Unknown) { // do nothing @@ -922,105 +951,106 @@ namespace DataPlant { } } else { // handle pumps differently if ((BranchCounter == 1) && (LoopSideCounter == DataPlant::SupplySide) && - (loop.CommonPipeType == DataPlant::iCommonPipeType::TwoWay)) { + (loop.CommonPipeType == DataPlant::CommonPipeType::TwoWay)) { // special primary side flow request for two way common pipe int const CompIndex = component.CompNum; - { - auto const SELECT_CASE_var(component.TypeOf_Num); - // remove var speed pumps from this case statement if can set MassFlowRateRequest - if ((SELECT_CASE_var == DataPlant::TypeOf_PumpConstantSpeed) || - (SELECT_CASE_var == DataPlant::TypeOf_PumpVariableSpeed) || - (SELECT_CASE_var == DataPlant::TypeOf_PumpBankVariableSpeed)) { - if (CompIndex > 0) { - ThisBranchFlowRequestNeedIfOn = - max(ThisBranchFlowRequestNeedIfOn, state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax); - } - } else if (SELECT_CASE_var == DataPlant::TypeOf_PumpBankConstantSpeed) { - if (CompIndex > 0) { - ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, - state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax / - state.dataPumps->PumpEquip(CompIndex).NumPumpsInBank); - } - } else { - ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, node_with_request.MassFlowRateRequest); + switch (component.Type) { + // remove var speed pumps from this case statement if can set MassFlowRateRequest + case DataPlant::PlantEquipmentType::PumpConstantSpeed: + case DataPlant::PlantEquipmentType::PumpVariableSpeed: + case DataPlant::PlantEquipmentType::PumpBankVariableSpeed: + if (CompIndex > 0) { + ThisBranchFlowRequestNeedIfOn = + max(ThisBranchFlowRequestNeedIfOn, state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax); + } + break; + case DataPlant::PlantEquipmentType::PumpBankConstantSpeed: + if (CompIndex > 0) { + ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, + state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax / + state.dataPumps->PumpEquip(CompIndex).NumPumpsInBank); } + break; + default: + ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, node_with_request.MassFlowRateRequest); + break; } } else if ((BranchCounter == 1) && (LoopSideCounter == DataPlant::SupplySide) && - (loop.CommonPipeType == DataPlant::iCommonPipeType::Single)) { + (loop.CommonPipeType == DataPlant::CommonPipeType::Single)) { int const CompIndex = component.CompNum; - { - auto const SELECT_CASE_var(component.TypeOf_Num); - // remove var speed pumps from this case statement if can set MassFlowRateRequest - if ((SELECT_CASE_var == DataPlant::TypeOf_PumpConstantSpeed) || - (SELECT_CASE_var == DataPlant::TypeOf_PumpVariableSpeed) || - (SELECT_CASE_var == DataPlant::TypeOf_PumpBankVariableSpeed)) { - if (CompIndex > 0) { - ThisBranchFlowRequestNeedIfOn = - max(ThisBranchFlowRequestNeedIfOn, state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax); - } - } else if (SELECT_CASE_var == DataPlant::TypeOf_PumpBankConstantSpeed) { - if (CompIndex > 0) { - ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, - state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax / - state.dataPumps->PumpEquip(CompIndex).NumPumpsInBank); - } - } else { - ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, node_with_request.MassFlowRateRequest); + switch (component.Type) { + // remove var speed pumps from this case statement if can set MassFlowRateRequest + case DataPlant::PlantEquipmentType::PumpConstantSpeed: + case DataPlant::PlantEquipmentType::PumpVariableSpeed: + case DataPlant::PlantEquipmentType::PumpBankVariableSpeed: { + if (CompIndex > 0) { + ThisBranchFlowRequestNeedIfOn = + max(ThisBranchFlowRequestNeedIfOn, state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax); + } + break; + } + case DataPlant::PlantEquipmentType::PumpBankConstantSpeed: + if (CompIndex > 0) { + ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, + state.dataPumps->PumpEquip(CompIndex).MassFlowRateMax / + state.dataPumps->PumpEquip(CompIndex).NumPumpsInBank); } + break; + default: + ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, node_with_request.MassFlowRateRequest); } } else { int const CompIndex = component.CompNum; - { - auto const SELECT_CASE_var(component.TypeOf_Num); - if (SELECT_CASE_var == DataPlant::TypeOf_PumpConstantSpeed) { - if (CompIndex > 0) { - auto &this_pump(state.dataPumps->PumpEquip(CompIndex)); - if (ParallelBranchIndex >= 1) { // branch pump - if (branch.max_abs_Comp_MyLoad() > DataHVACGlobals::SmallLoad) { - ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax); - } else if (loop.CommonPipeType != - DataPlant::iCommonPipeType::No) { // common pipe and constant branch pumps - ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax); - } - loop_side.hasConstSpeedBranchPumps = true; - branch.HasConstantSpeedBranchPump = true; - branch.ConstantSpeedBranchMassFlow = this_pump.MassFlowRateMax; - } else { // inlet pump + switch (component.Type) { + case DataPlant::PlantEquipmentType::PumpConstantSpeed: + if (CompIndex > 0) { + auto &this_pump(state.dataPumps->PumpEquip(CompIndex)); + if (ParallelBranchIndex >= 1) { // branch pump + if (branch.max_abs_Comp_MyLoad() > DataHVACGlobals::SmallLoad) { + ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax); + } else if (loop.CommonPipeType != DataPlant::CommonPipeType::No) { // common pipe and constant branch pumps ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax); } + loop_side.hasConstSpeedBranchPumps = true; + branch.HasConstantSpeedBranchPump = true; + branch.ConstantSpeedBranchMassFlow = this_pump.MassFlowRateMax; + } else { // inlet pump + ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax); } - } else if (SELECT_CASE_var == DataPlant::TypeOf_PumpBankConstantSpeed) { - if (CompIndex > 0) { - auto &this_pump(state.dataPumps->PumpEquip(CompIndex)); - if (ParallelBranchIndex >= 1) { // branch pump - if (branch.max_abs_Comp_MyLoad() > DataHVACGlobals::SmallLoad) { - ThisBranchFlowRequestNeedIfOn = - max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax / this_pump.NumPumpsInBank); - } else if (loop.CommonPipeType != - DataPlant::iCommonPipeType::No) { // common pipe and constant branch pumps - ThisBranchFlowRequestNeedIfOn = - max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax / this_pump.NumPumpsInBank); - } - loop_side.hasConstSpeedBranchPumps = true; - branch.HasConstantSpeedBranchPump = true; - branch.ConstantSpeedBranchMassFlow = this_pump.MassFlowRateMax / this_pump.NumPumpsInBank; - } else { // inlet pump + } + break; + case DataPlant::PlantEquipmentType::PumpBankConstantSpeed: + if (CompIndex > 0) { + auto &this_pump(state.dataPumps->PumpEquip(CompIndex)); + if (ParallelBranchIndex >= 1) { // branch pump + if (branch.max_abs_Comp_MyLoad() > DataHVACGlobals::SmallLoad) { + ThisBranchFlowRequestNeedIfOn = + max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax / this_pump.NumPumpsInBank); + } else if (loop.CommonPipeType != DataPlant::CommonPipeType::No) { // common pipe and constant branch pumps ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax / this_pump.NumPumpsInBank); } + loop_side.hasConstSpeedBranchPumps = true; + branch.HasConstantSpeedBranchPump = true; + branch.ConstantSpeedBranchMassFlow = this_pump.MassFlowRateMax / this_pump.NumPumpsInBank; + } else { // inlet pump + ThisBranchFlowRequestNeedIfOn = + max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax / this_pump.NumPumpsInBank); } } + break; // overwrite here for branch pumps - if ((SELECT_CASE_var == DataPlant::TypeOf_PumpVariableSpeed) || - (SELECT_CASE_var == DataPlant::TypeOf_PumpBankVariableSpeed) || - (SELECT_CASE_var == DataPlant::TypeOf_PumpCondensate)) { - if (component.CompNum > 0) { - auto &this_pump(state.dataPumps->PumpEquip(component.CompNum)); - this_pump.LoopSolverOverwriteFlag = false; - } + case DataPlant::PlantEquipmentType::PumpVariableSpeed: + case DataPlant::PlantEquipmentType::PumpBankVariableSpeed: + case DataPlant::PlantEquipmentType::PumpCondensate: + if (component.CompNum > 0) { + auto &this_pump(state.dataPumps->PumpEquip(component.CompNum)); + this_pump.LoopSolverOverwriteFlag = false; } + default: + break; } } } @@ -1058,7 +1088,7 @@ namespace DataPlant { this_loop_side.FlowRequest = this_loop_side.flowRequestFinal; other_loop_side.FlowRequest = other_loop_side.flowRequestFinal; - if (loop.CommonPipeType == DataPlant::iCommonPipeType::No) { + if (loop.CommonPipeType == DataPlant::CommonPipeType::No) { // we may or may not have a pump on this side, but the flow request is the larger of the two side's final if ((!this_loop_side.hasConstSpeedBranchPumps) && (!other_loop_side.hasConstSpeedBranchPumps)) { LoopFlow = max(this_loop_side.flowRequestFinal, other_loop_side.flowRequestFinal); @@ -1138,9 +1168,9 @@ namespace DataPlant { } } } - } else if (loop.CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { + } else if (loop.CommonPipeType == DataPlant::CommonPipeType::TwoWay) { LoopFlow = this_loop_side.flowRequestFinal; - } else if (loop.CommonPipeType == DataPlant::iCommonPipeType::Single) { + } else if (loop.CommonPipeType == DataPlant::CommonPipeType::Single) { LoopFlow = this_loop_side.flowRequestFinal; } @@ -1153,13 +1183,16 @@ namespace DataPlant { int const NumCompsOnThisBranch = branch.TotalComponents; for (int CompCounter = 1; CompCounter <= NumCompsOnThisBranch; ++CompCounter) { auto const &component(branch.Comp(CompCounter)); - auto const SELECT_CASE_var(component.TypeOf_Num); - if ((SELECT_CASE_var == DataPlant::TypeOf_PumpVariableSpeed) || - (SELECT_CASE_var == DataPlant::TypeOf_PumpBankVariableSpeed) || (SELECT_CASE_var == DataPlant::TypeOf_PumpCondensate)) { + switch (component.Type) { + case DataPlant::PlantEquipmentType::PumpVariableSpeed: + case DataPlant::PlantEquipmentType::PumpBankVariableSpeed: + case DataPlant::PlantEquipmentType::PumpCondensate: if (component.CompNum > 0) { auto &this_pump(state.dataPumps->PumpEquip(component.CompNum)); this_pump.LoopSolverOverwriteFlag = true; } + default: + break; } } } @@ -1195,7 +1228,7 @@ namespace DataPlant { // We can now make a first pass through the component simulation, requesting flow as necessary. // Normal "supply side" components will set a mass flow rate on their outlet node to request flow, // while "Demand side" components will set a a mass flow request on their inlet node to request flow. - this->FlowLock = DataPlant::iFlowLock::Unlocked; + this->FlowLock = DataPlant::FlowLock::Unlocked; this->SimulateAllLoopSideBranches(state, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); // discussion/comments about loop solver/flow resolver interaction @@ -1232,7 +1265,7 @@ namespace DataPlant { // flag, and resimulate. During this simulation each component will still use the // SetFlowRequest routine, but this routine will also set the outlet flow rate // equal to the inlet flow rate, according to flowlock logic. - this->FlowLock = DataPlant::iFlowLock::Locked; + this->FlowLock = DataPlant::FlowLock::Locked; this->SimulateAllLoopSideBranches(state, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); } @@ -1265,8 +1298,6 @@ namespace DataPlant { // properties. Finally, Max/MinAvail are reset for the next time step. // Using/Aliasing - using DataPlant::TypeOf_PumpBankVariableSpeed; - using DataPlant::TypeOf_PumpVariableSpeed; // SUBROUTINE PARAMETER DEFINITIONS: static Array1D_string const LoopSideName(2, {"Demand", "Supply"}); @@ -1602,7 +1633,8 @@ namespace DataPlant { auto &this_comp(this_splitter_outlet_branch.Comp(CompCounter)); // if this isn't a variable speed pump then just keep cycling - if ((this_comp.TypeOf_Num != TypeOf_PumpVariableSpeed) && (this_comp.TypeOf_Num != TypeOf_PumpBankVariableSpeed)) { + if ((this_comp.Type != PlantEquipmentType::PumpVariableSpeed) && + (this_comp.Type != PlantEquipmentType::PumpBankVariableSpeed)) { continue; } @@ -1694,18 +1726,18 @@ namespace DataPlant { auto const CurOpSchemeType(this_comp.CurOpSchemeType); switch (CurOpSchemeType) { - case DataPlant::WSEconOpSchemeType: //~ coils + case DataPlant::OpScheme::WSEcon: //~ coils this_comp.MyLoad = UpdatedDemandToLoopSetPoint; branch.Comp(CompCounter).simulate(state, FirstHVACIteration); break; - case DataPlant::PumpOpSchemeType: //~ pump + case DataPlant::OpScheme::Pump: //~ pump if (this->BranchPumpsExist) { SimulateSinglePump(state, this_comp.location, branch.RequestedMassFlow); } else { SimulateSinglePump(state, this_comp.location, FlowRequest); } break; - case DataPlant::CompSetPtBasedSchemeType: + case DataPlant::OpScheme::CompSetPtBased: PlantCondLoopOperation::ManagePlantLoadDistribution(state, this->myLoopNum, this->myLoopSideNum, @@ -1718,7 +1750,7 @@ namespace DataPlant { LoadDistributionWasPerformed); branch.Comp(CompCounter).simulate(state, FirstHVACIteration); break; - case DataPlant::EMSOpSchemeType: + case DataPlant::OpScheme::EMS: if (this->myLoopSideNum == DataPlant::SupplySide) { int const curCompOpSchemePtr = this_comp.CurCompLevelOpNum; int const OpSchemePtr = this_comp.OpScheme(curCompOpSchemePtr).OpSchemePtr; @@ -1736,13 +1768,14 @@ namespace DataPlant { LoadDistributionWasPerformed); branch.Comp(CompCounter).simulate(state, FirstHVACIteration); break; - default: - if ((CurOpSchemeType >= DataPlant::LoadRangeBasedMin) && (CurOpSchemeType <= DataPlant::LoadRangeBasedMax)) { //~ load range based - EncounteredLRBObjDuringPass1 = true; - goto components_end; // don't do any more components on this branch - } else { // demand, , etc. - branch.Comp(CompCounter).simulate(state, FirstHVACIteration); - } + case (OpScheme::HeatingRB): + case (OpScheme::CoolingRB): { //~ load range based + EncounteredLRBObjDuringPass1 = true; + goto components_end; // don't do any more components on this branch + break; + } + default: // demand, etc. + branch.Comp(CompCounter).simulate(state, FirstHVACIteration); } // Update loop demand as needed for changes this component may have made @@ -1754,9 +1787,9 @@ namespace DataPlant { } //~ CompCounter components_end:; - if (this->FlowLock == DataPlant::iFlowLock::Locked) { + if (this->FlowLock == DataPlant::FlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem( - state, this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Calc, this->myLoopSideNum, BranchCounter); + state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall::Calc, this->myLoopSideNum, BranchCounter); } } //~ BranchCounter @@ -1786,15 +1819,15 @@ namespace DataPlant { auto const CurOpSchemeType(branch.Comp(CompCounter).CurOpSchemeType); switch (CurOpSchemeType) { - case DataPlant::NoControlOpSchemeType: //~ pipes, for example + case DataPlant::OpScheme::NoControl: //~ pipes, for example branch.Comp(CompCounter).simulate(state, FirstHVACIteration); break; - case DataPlant::DemandOpSchemeType: - case DataPlant::CompSetPtBasedSchemeType: - case DataPlant::FreeRejectionOpSchemeType: //~ other control types + case DataPlant::OpScheme::Demand: + case DataPlant::OpScheme::CompSetPtBased: + case DataPlant::OpScheme::FreeRejection: //~ other control types EncounteredNonLBObjDuringPass2 = true; - goto components2_end; // don't do anymore components on this branch - case DataPlant::PumpOpSchemeType: //~ pump + goto components2_end; // don't do anymore components on this branch + case DataPlant::OpScheme::Pump: //~ pump PumpLocation.loopNum = this->myLoopNum; PumpLocation.loopSideNum = this->myLoopSideNum; PumpLocation.branchNum = BranchCounter; @@ -1805,22 +1838,25 @@ namespace DataPlant { SimulateSinglePump(state, PumpLocation, FlowRequest); } break; - default: - if ((CurOpSchemeType >= DataPlant::LoadRangeBasedMin) && (CurOpSchemeType <= DataPlant::LoadRangeBasedMax)) { //~ load range based - if (!LoadDistributionWasPerformed) { //~ Still need to distribute load among load range based components - PlantCondLoopOperation::ManagePlantLoadDistribution(state, - this->myLoopNum, - this->myLoopSideNum, - BranchCounter, - CompCounter, - LoadToLoopSetPoint, - LoadToLoopSetPointThatWasntMet, - FirstHVACIteration, - LoopShutDownFlag, - LoadDistributionWasPerformed); - } - branch.Comp(CompCounter).simulate(state, FirstHVACIteration); + case (OpScheme::HeatingRB): + case (OpScheme::CoolingRB): { //~ load range based + if (!LoadDistributionWasPerformed) { //~ Still need to distribute load among load range based components + PlantCondLoopOperation::ManagePlantLoadDistribution(state, + this->myLoopNum, + this->myLoopSideNum, + BranchCounter, + CompCounter, + LoadToLoopSetPoint, + LoadToLoopSetPointThatWasntMet, + FirstHVACIteration, + LoopShutDownFlag, + LoadDistributionWasPerformed); } + branch.Comp(CompCounter).simulate(state, FirstHVACIteration); + break; + } + default: + break; } //~ If we didn't EXIT early, we must have simulated, so update array @@ -1830,9 +1866,9 @@ namespace DataPlant { components2_end:; //~ If we are locked, go ahead and simulate the pressure components on this branch - if (this->FlowLock == DataPlant::iFlowLock::Locked) { + if (this->FlowLock == DataPlant::FlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem( - state, this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Calc, this->myLoopSideNum, BranchCounter); + state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall::Calc, this->myLoopSideNum, BranchCounter); } } //~ BranchCounter @@ -1854,10 +1890,10 @@ namespace DataPlant { auto const CurOpSchemeType(branch.Comp(CompCounter).CurOpSchemeType); switch (CurOpSchemeType) { - case DataPlant::DemandOpSchemeType: //~ coils + case DataPlant::OpScheme::Demand: //~ coils branch.Comp(CompCounter).simulate(state, FirstHVACIteration); break; - case DataPlant::PumpOpSchemeType: //~ pump + case DataPlant::OpScheme::Pump: //~ pump PumpLocation.loopNum = this->myLoopNum; PumpLocation.loopSideNum = this->myLoopSideNum; PumpLocation.branchNum = BranchCounter; @@ -1868,12 +1904,14 @@ namespace DataPlant { SimulateSinglePump(state, PumpLocation, FlowRequest); } break; + case (OpScheme::HeatingRB): + case (OpScheme::CoolingRB): { //~ load range based + ShowFatalError(state, "Encountered Load Based Object after other components, invalid."); + break; + } default: - if ((CurOpSchemeType >= DataPlant::LoadRangeBasedMin) && (CurOpSchemeType <= DataPlant::LoadRangeBasedMax)) { //~ load range based - ShowFatalError(state, "Encountered Load Based Object after other components, invalid."); - } else { //~ Typical control equipment - branch.Comp(CompCounter).simulate(state, FirstHVACIteration); - } + //~ Typical control equipment + branch.Comp(CompCounter).simulate(state, FirstHVACIteration); } //~ If we didn't EXIT early, we must have simulated, so update array @@ -1881,9 +1919,9 @@ namespace DataPlant { } //~ CompCounter - if (this->FlowLock == DataPlant::iFlowLock::Locked) { + if (this->FlowLock == DataPlant::FlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem( - state, this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Calc, this->myLoopSideNum, BranchCounter); + state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall::Calc, this->myLoopSideNum, BranchCounter); } } //~ BranchCounter @@ -1918,8 +1956,6 @@ namespace DataPlant { // Therefore they are not included // Using/Aliasing - using DataPlant::LoadRangeBasedMax; - using DataPlant::LoadRangeBasedMin; using FluidProperties::GetSpecificHeatGlycol; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1934,29 +1970,35 @@ namespace DataPlant { int const InletNode(this_comp.NodeNumIn); int const OutletNode(this_comp.NodeNumOut); - if (this->FlowLock == DataPlant::iFlowLock::Unlocked) { - { - auto const SELECT_CASE_var(this_comp.CurOpSchemeType); - if ((SELECT_CASE_var >= LoadRangeBasedMin) && (SELECT_CASE_var <= LoadRangeBasedMax)) { - // Don't do anything for load based components - } else { - // pumps pipes, etc. will be lumped in here with other component types, but they will have no delta T anyway - ComponentMassFlowRate = state.dataLoopNodes->Node(InletNode).MassFlowRateRequest; - // make sure components like economizers use the mass flow request - } + if (this->FlowLock == DataPlant::FlowLock::Unlocked) { + + switch (this_comp.CurOpSchemeType) { + case (OpScheme::HeatingRB): + case (OpScheme::CoolingRB): { //~ load range based + break; // Don't do anything for load based components } - } else if (this->FlowLock == DataPlant::iFlowLock::Locked) { + default: { + // pumps pipes, etc. will be lumped in here with other component types, but they will have no delta T anyway + ComponentMassFlowRate = state.dataLoopNodes->Node(InletNode).MassFlowRateRequest; + // make sure components like economizers use the mass flow request + break; + } + } + + } else if (this->FlowLock == DataPlant::FlowLock::Locked) { // For locked flow just use the mass flow rate - { - auto const SELECT_CASE_var(this_comp.CurOpSchemeType); - if ((SELECT_CASE_var >= LoadRangeBasedMin) && (SELECT_CASE_var <= LoadRangeBasedMax)) { - // Don't do anything for load based components - } else { - // pumps pipes, etc. will be lumped in here with other component types, but they will have no delta T anyway - ComponentMassFlowRate = state.dataLoopNodes->Node(OutletNode).MassFlowRate; - } + + switch (this_comp.CurOpSchemeType) { + case (OpScheme::HeatingRB): + case (OpScheme::CoolingRB): { //~ load range based + break; // Don't do anything for load based components + } + default: { + // pumps pipes, etc. will be lumped in here with other component types, but they will have no delta T anyway + ComponentMassFlowRate = state.dataLoopNodes->Node(OutletNode).MassFlowRate; + } } } else { // flow pump query? problem? @@ -2111,7 +2153,7 @@ namespace DataPlant { e.CurrentMinAvail = 0.0; e.CurrentMaxAvail = 0.0; } - this->FlowLock = DataPlant::iFlowLock::PumpQuery; + this->FlowLock = DataPlant::FlowLock::PumpQuery; //~ Simulate pumps this->SimulateAllLoopSidePumps(state); diff --git a/src/EnergyPlus/Plant/LoopSide.hh b/src/EnergyPlus/Plant/LoopSide.hh index 0b0f4a503fa..1fc21e0a297 100644 --- a/src/EnergyPlus/Plant/LoopSide.hh +++ b/src/EnergyPlus/Plant/LoopSide.hh @@ -101,7 +101,7 @@ namespace DataPlant { Real64 EMSValue; bool FlowRestrictionFlag; // Max available flow at the outlet of the half loop // is less than max available flow at inlet - DataPlant::iFlowLock FlowLock; + DataPlant::FlowLock FlowLock; int TotalConnected; // total number of other loops connected to this loop side Array1D Connected; // Other loops connected to this Loop side Array1D Branch; // Branch data @@ -150,7 +150,7 @@ namespace DataPlant { TempSetPoint(DataLoopNode::SensedNodeFlagValue), TempSetPointHi(DataLoopNode::SensedNodeFlagValue), TempSetPointLo(DataLoopNode::SensedNodeFlagValue), TempInterfaceTankOutlet(0.0), LastTempInterfaceTankOutlet(0.0), TotalBranches(0), NodeNumIn(0), NodeNumOut(0), TotalPumps(0), BranchPumpsExist(false), TotalPumpHeat(0.0), BypassExists(false), InletNodeSetPt(false), - OutletNodeSetPt(false), EMSCtrl(false), EMSValue(0.0), FlowRestrictionFlag(false), FlowLock(DataPlant::iFlowLock::Unlocked), + OutletNodeSetPt(false), EMSCtrl(false), EMSValue(0.0), FlowRestrictionFlag(false), FlowLock(DataPlant::FlowLock::Unlocked), TotalConnected(0), HasPressureComponents(false), HasParallelPressComps(false), PressureDrop(0.0), PressureEffectiveK(0.0), errCount_LoadWasntDist(0), errIndex_LoadWasntDist(0), errCount_LoadRemains(0), errIndex_LoadRemains(0), LoopSideInlet_TankTemp(0.0), LoopSideInlet_MdotCpDeltaT(0.0), LoopSideInlet_McpDTdt(0.0), LoopSideInlet_CapExcessStorageTime(0.0), diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index e43de71e586..c7bba70c4e3 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -183,7 +183,7 @@ void ManagePlantLoops(EnergyPlusData &state, int CurntMinPlantSubIterations; if (std::any_of(state.dataPlnt->PlantLoop.begin(), state.dataPlnt->PlantLoop.end(), [](DataPlant::PlantLoopData const &e) { - return (e.CommonPipeType == DataPlant::iCommonPipeType::Single) || (e.CommonPipeType == DataPlant::iCommonPipeType::TwoWay); + return (e.CommonPipeType == DataPlant::CommonPipeType::Single) || (e.CommonPipeType == DataPlant::CommonPipeType::TwoWay); })) { CurntMinPlantSubIterations = max(7, state.dataConvergeParams->MinPlantSubIterations); } else { @@ -502,27 +502,27 @@ void GetPlantLoopData(EnergyPlusData &state) // Load the load distribution scheme. LoadingScheme = Alpha(14); if (UtilityRoutines::SameString(LoadingScheme, "Optimal")) { - this_loop.LoadDistribution = DataPlant::iLoadingScheme::Optimal; + this_loop.LoadDistribution = DataPlant::LoadingScheme::Optimal; } else if (UtilityRoutines::SameString(LoadingScheme, "SequentialLoad")) { - this_loop.LoadDistribution = DataPlant::iLoadingScheme::Sequential; + this_loop.LoadDistribution = DataPlant::LoadingScheme::Sequential; } else if (UtilityRoutines::SameString(LoadingScheme, "UniformLoad")) { - this_loop.LoadDistribution = DataPlant::iLoadingScheme::Uniform; + this_loop.LoadDistribution = DataPlant::LoadingScheme::Uniform; } else if (UtilityRoutines::SameString(LoadingScheme, "UniformPLR")) { - this_loop.LoadDistribution = DataPlant::iLoadingScheme::UniformPLR; + this_loop.LoadDistribution = DataPlant::LoadingScheme::UniformPLR; } else if (UtilityRoutines::SameString(LoadingScheme, "SequentialUniformPLR")) { - this_loop.LoadDistribution = DataPlant::iLoadingScheme::SequentialUniformPLR; + this_loop.LoadDistribution = DataPlant::LoadingScheme::SequentialUniformPLR; } else { ShowWarningError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); ShowContinueError(state, "..." + state.dataIPShortCut->cAlphaFieldNames(14) + "=\"" + Alpha(14) + "\"."); ShowContinueError(state, "Will default to SequentialLoad."); // TODO rename point - this_loop.LoadDistribution = DataPlant::iLoadingScheme::Sequential; + this_loop.LoadDistribution = DataPlant::LoadingScheme::Sequential; } // 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")) { - this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; } else if (UtilityRoutines::SameString(Alpha(16), "DualSetpointDeadband")) { if (this_loop.FluidType == DataLoopNode::NodeFluidType::Steam) { ShowWarningError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); @@ -531,30 +531,30 @@ void GetPlantLoopData(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames(2) + "= Steam"); ShowContinueError(state, "Will reset " + state.dataIPShortCut->cAlphaFieldNames(16) + " = SingleSetPoint and simulation will continue."); - this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; } else { - this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand; + this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand; } } else if (UtilityRoutines::SameString(Alpha(16), "")) { - this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; } else { ShowWarningError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); ShowContinueError(state, "..." + state.dataIPShortCut->cAlphaFieldNames(16) + "=\"" + Alpha(16) + "\"."); ShowContinueError(state, "Will default to SingleSetPoint."); // TODO rename point - this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; } } else if (this_loop.TypeOfLoop == LoopType::Condenser) { - this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; } // 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")) { - this_loop.CommonPipeType = DataPlant::iCommonPipeType::Single; + this_loop.CommonPipeType = DataPlant::CommonPipeType::Single; } else if (UtilityRoutines::SameString(Alpha(17), "TwoWayCommonPipe")) { - this_loop.CommonPipeType = DataPlant::iCommonPipeType::TwoWay; + this_loop.CommonPipeType = DataPlant::CommonPipeType::TwoWay; } else if (UtilityRoutines::SameString(Alpha(17), "None") || state.dataIPShortCut->lAlphaFieldBlanks(17)) { - this_loop.CommonPipeType = DataPlant::iCommonPipeType::No; + this_loop.CommonPipeType = DataPlant::CommonPipeType::No; } else { ShowSevereError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); ShowContinueError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(17) + "=\"" + Alpha(17) + "\"."); @@ -562,10 +562,10 @@ void GetPlantLoopData(EnergyPlusData &state) ErrorsFound = true; } } else if (this_loop.TypeOfLoop == LoopType::Condenser) { - this_loop.CommonPipeType = DataPlant::iCommonPipeType::No; + this_loop.CommonPipeType = DataPlant::CommonPipeType::No; } - if (this_loop.CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { + if (this_loop.CommonPipeType == DataPlant::CommonPipeType::TwoWay) { if (this_demand_side.InletNodeSetPt && this_supply_side.InletNodeSetPt) { ShowSevereError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid condition."); ShowContinueError(state, @@ -595,30 +595,27 @@ void GetPlantLoopData(EnergyPlusData &state) if (NumAlphas >= PressSimAlphaIndex) { MatchedPressureString = false; - // Check all types - if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), format("{}", cPressureSimType(DataPlant::iPressSimType::NoPressure)))) { - this_loop.PressureSimType = DataPlant::iPressSimType::NoPressure; - MatchedPressureString = true; - } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), - format("{}", cPressureSimType(DataPlant::iPressSimType::PumpPowerCorrection)))) { - this_loop.PressureSimType = DataPlant::iPressSimType::PumpPowerCorrection; - MatchedPressureString = true; - } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), - format("{}", cPressureSimType(DataPlant::iPressSimType::FlowSimulation)))) { - this_loop.PressureSimType = DataPlant::iPressSimType::FlowSimulation; - MatchedPressureString = true; - } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), - format("{}", cPressureSimType(DataPlant::iPressSimType::FlowCorrection)))) { - this_loop.PressureSimType = DataPlant::iPressSimType::FlowCorrection; + this_loop.PressureSimType = static_cast( + getEnumerationValue(PressureSimTypeNamesUC, UtilityRoutines::MakeUPPERCase(Alpha(PressSimAlphaIndex)))); + switch (this_loop.PressureSimType) { + // Check all types + case DataPlant::PressSimType::NoPressure: + case DataPlant::PressSimType::FlowCorrection: + case DataPlant::PressSimType::PumpPowerCorrection: + case DataPlant::PressSimType::FlowSimulation: { MatchedPressureString = true; + break; + } + default: + break; } // If we found a match, check to make sure it is one of the valid // ones for this phase of pressure implementation if (MatchedPressureString) { - if ((this_loop.PressureSimType == DataPlant::iPressSimType::NoPressure) || - (this_loop.PressureSimType == DataPlant::iPressSimType::PumpPowerCorrection) || - (this_loop.PressureSimType == DataPlant::iPressSimType::FlowCorrection)) { + if ((this_loop.PressureSimType == DataPlant::PressSimType::NoPressure) || + (this_loop.PressureSimType == DataPlant::PressSimType::PumpPowerCorrection) || + (this_loop.PressureSimType == DataPlant::PressSimType::FlowCorrection)) { // We are OK here, move on } else { // We have an erroneous input, alert user @@ -626,9 +623,11 @@ void GetPlantLoopData(EnergyPlusData &state) ShowContinueError( state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(PressSimAlphaIndex) + "=\"" + Alpha(PressSimAlphaIndex) + "\"."); ShowContinueError(state, "Currently only options are: "); - ShowContinueError(state, " - " + format("{}", cPressureSimType(DataPlant::iPressSimType::NoPressure))); - ShowContinueError(state, " - " + format("{}", cPressureSimType(DataPlant::iPressSimType::PumpPowerCorrection))); - ShowContinueError(state, " - " + format("{}", cPressureSimType(DataPlant::iPressSimType::FlowCorrection))); + ShowContinueError(state, " - " + format("{}", PressureSimTypeNamesUC[static_cast(DataPlant::PressSimType::NoPressure)])); + ShowContinueError(state, + " - " + format("{}", PressureSimTypeNamesUC[static_cast(DataPlant::PressSimType::PumpPowerCorrection)])); + ShowContinueError(state, + " - " + format("{}", PressureSimTypeNamesUC[static_cast(DataPlant::PressSimType::FlowCorrection)])); ErrorsFound = true; } } @@ -636,7 +635,7 @@ void GetPlantLoopData(EnergyPlusData &state) // if we made it this far and didn't get a match, check for blank if (!MatchedPressureString) { if (Alpha(PressSimAlphaIndex).empty()) { - this_loop.PressureSimType = DataPlant::iPressSimType::NoPressure; + this_loop.PressureSimType = DataPlant::PressSimType::NoPressure; break; } } @@ -871,56 +870,52 @@ void GetPlantInput(EnergyPlusData &state) auto &this_comp_type(CompTypes(CompNum)); auto &this_comp(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; this_comp.TypeOf = this_comp_type; this_comp.location = EnergyPlus::PlantLocation(LoopNum, LoopSideNum, BranchNum, CompNum); - if (UtilityRoutines::SameString(this_comp_type, "Pipe:Adiabatic")) { - this_comp.TypeOf_Num = TypeOf_Pipe; - this_comp.CurOpSchemeType = NoControlOpSchemeType; - this_comp.compPtr = Pipes::LocalPipeData::factory(state, TypeOf_Pipe, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Pipe:Adiabatic:Steam")) { - this_comp.TypeOf_Num = TypeOf_PipeSteam; - this_comp.CurOpSchemeType = NoControlOpSchemeType; - this_comp.compPtr = Pipes::LocalPipeData::factory(state, TypeOf_PipeSteam, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Pipe:Outdoor")) { - this_comp.TypeOf_Num = TypeOf_PipeExterior; - this_comp.CurOpSchemeType = NoControlOpSchemeType; - this_comp.compPtr = PipeHeatTransfer::PipeHTData::factory(state, TypeOf_PipeExterior, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Pipe:Indoor")) { - this_comp.TypeOf_Num = TypeOf_PipeInterior; - this_comp.CurOpSchemeType = NoControlOpSchemeType; - this_comp.compPtr = PipeHeatTransfer::PipeHTData::factory(state, TypeOf_PipeInterior, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Pipe:Underground")) { - this_comp.TypeOf_Num = TypeOf_PipeUnderground; - this_comp.CurOpSchemeType = NoControlOpSchemeType; - this_comp.compPtr = PipeHeatTransfer::PipeHTData::factory(state, TypeOf_PipeUnderground, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "PipingSystem:Underground:PipeCircuit")) { - this_comp.TypeOf_Num = TypeOf_PipingSystemPipeCircuit; - this_comp.CurOpSchemeType = NoControlOpSchemeType; - this_comp.compPtr = PlantPipingSystemsManager::Circuit::factory(state, TypeOf_PipingSystemPipeCircuit, CompNames(CompNum)); - } else if (has_prefixi(this_comp_type, "Pump") || has_prefixi(this_comp_type, "HeaderedPumps")) { - if (has_prefixi(this_comp_type, "Pump:VariableSpeed:Condensate")) { - this_comp.TypeOf_Num = TypeOf_PumpCondensate; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (has_prefixi(this_comp_type, "Pump:ConstantSpeed")) { - this_comp.TypeOf_Num = TypeOf_PumpConstantSpeed; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (has_prefixi(this_comp_type, "Pump:VariableSpeed")) { - this_comp.TypeOf_Num = TypeOf_PumpVariableSpeed; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (has_prefixi(this_comp_type, "HeaderedPumps:ConstantSpeed")) { - this_comp.TypeOf_Num = TypeOf_PumpBankConstantSpeed; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (has_prefixi(this_comp_type, "HeaderedPumps:VariableSpeed")) { - this_comp.TypeOf_Num = TypeOf_PumpBankVariableSpeed; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else { - // discover unsupported equipment on branches. - ShowSevereError(state, "GetPlantInput: trying to process a pump type that is not supported, dev note"); - ShowContinueError(state, "Component Type =" + this_comp_type); - } - this_comp.CurOpSchemeType = PumpOpSchemeType; + this_comp.Type = + static_cast(getEnumerationValue(PlantEquipTypeNamesUC, UtilityRoutines::MakeUPPERCase(this_comp_type))); + + switch (this_comp.Type) { + case (PlantEquipmentType::Pipe): { + this_comp.CurOpSchemeType = OpScheme::NoControl; + this_comp.compPtr = Pipes::LocalPipeData::factory(state, PlantEquipmentType::Pipe, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PipeSteam): { + this_comp.CurOpSchemeType = OpScheme::NoControl; + this_comp.compPtr = Pipes::LocalPipeData::factory(state, PlantEquipmentType::PipeSteam, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PipeExterior): { + this_comp.CurOpSchemeType = OpScheme::NoControl; + this_comp.compPtr = PipeHeatTransfer::PipeHTData::factory(state, PlantEquipmentType::PipeExterior, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PipeInterior): { + this_comp.CurOpSchemeType = OpScheme::NoControl; + this_comp.compPtr = PipeHeatTransfer::PipeHTData::factory(state, PlantEquipmentType::PipeInterior, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PipeUnderground): { + this_comp.CurOpSchemeType = OpScheme::NoControl; + this_comp.compPtr = PipeHeatTransfer::PipeHTData::factory(state, PlantEquipmentType::PipeUnderground, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PipingSystemPipeCircuit): { + this_comp.CurOpSchemeType = OpScheme::NoControl; + this_comp.compPtr = + PlantPipingSystemsManager::Circuit::factory(state, PlantEquipmentType::PipingSystemPipeCircuit, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PumpCondensate): + case (PlantEquipmentType::PumpConstantSpeed): + case (PlantEquipmentType::PumpVariableSpeed): + case (PlantEquipmentType::PumpBankConstantSpeed): + case (PlantEquipmentType::PumpBankVariableSpeed): { + this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; + this_comp.CurOpSchemeType = OpScheme::Pump; if (BranchNum == 1 || BranchNum == state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches) { ASeriesBranchHasPump = true; } else { @@ -934,461 +929,434 @@ void GetPlantInput(EnergyPlusData &state) state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).BranchPumpsExist = AParallelBranchHasPump; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Pumps.push_back(p); state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalPumps++; - } else if (UtilityRoutines::SameString(this_comp_type, "WaterHeater:Mixed")) { - this_comp.TypeOf_Num = TypeOf_WtrHeaterMixed; - if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; - } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; - } - this_comp.compPtr = WaterThermalTanks::WaterThermalTankData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "WaterHeater:Stratified")) { - this_comp.TypeOf_Num = TypeOf_WtrHeaterStratified; + break; + } + case (PlantEquipmentType::WtrHeaterMixed): + case (PlantEquipmentType::WtrHeaterStratified): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = WaterThermalTanks::WaterThermalTankData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "ChillerHeater:Absorption:Directfired")) { - this_comp.TypeOf_Num = TypeOf_Chiller_DFAbsorption; + break; + } + case (PlantEquipmentType::Chiller_DFAbsorption): { this_comp.compPtr = ChillerGasAbsorption::GasAbsorberSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "ChillerHeater:Absorption:DoubleEffect")) { - this_comp.TypeOf_Num = TypeOf_Chiller_ExhFiredAbsorption; + break; + } + case (PlantEquipmentType::Chiller_ExhFiredAbsorption): { this_comp.compPtr = ChillerExhaustAbsorption::ExhaustAbsorberSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "ThermalStorage:ChilledWater:Mixed")) { - this_comp.TypeOf_Num = TypeOf_ChilledWaterTankMixed; - if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; - } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; - } - this_comp.compPtr = WaterThermalTanks::WaterThermalTankData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "ThermalStorage:ChilledWater:Stratified")) { - this_comp.TypeOf_Num = TypeOf_ChilledWaterTankStratified; + break; + } + case (PlantEquipmentType::ChilledWaterTankMixed): + case (PlantEquipmentType::ChilledWaterTankStratified): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = WaterThermalTanks::WaterThermalTankData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "WaterUse:Connections")) { - this_comp.TypeOf_Num = TypeOf_WaterUseConnection; - this_comp.CurOpSchemeType = DemandOpSchemeType; + break; + } + case (PlantEquipmentType::WaterUseConnection): { + this_comp.CurOpSchemeType = OpScheme::Demand; this_comp.compPtr = WaterUse::WaterConnectionsType::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Cooling:Water")) { - this_comp.TypeOf_Num = TypeOf_CoilWaterCooling; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Cooling:Water:DetailedGeometry")) { - this_comp.TypeOf_Num = TypeOf_CoilWaterDetailedFlatCooling; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Heating:Water")) { - this_comp.TypeOf_Num = TypeOf_CoilWaterSimpleHeating; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Heating:Steam")) { - this_comp.TypeOf_Num = TypeOf_CoilSteamAirHeating; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "SolarCollector:FlatPlate:Water")) { - this_comp.TypeOf_Num = TypeOf_SolarCollectorFlatPlate; - if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; - } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UncontrolledOpSchemeType; - } - this_comp.compPtr = SolarCollectors::CollectorData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "SolarCollector:IntegralCollectorStorage")) { - this_comp.TypeOf_Num = TypeOf_SolarCollectorICS; + break; + } + case (PlantEquipmentType::SolarCollectorFlatPlate): + case (PlantEquipmentType::SolarCollectorICS): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UncontrolledOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Uncontrolled; } this_comp.compPtr = SolarCollectors::CollectorData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "LoadProfile:Plant")) { - this_comp.TypeOf_Num = TypeOf_PlantLoadProfile; - this_comp.CurOpSchemeType = DemandOpSchemeType; + break; + } + case (PlantEquipmentType::PlantLoadProfile): { + this_comp.CurOpSchemeType = OpScheme::Demand; this_comp.compPtr = PlantLoadProfile::PlantProfileData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "GroundHeatExchanger:System")) { - this_comp.TypeOf_Num = TypeOf_GrndHtExchgSystem; - this_comp.CurOpSchemeType = UncontrolledOpSchemeType; - this_comp.compPtr = GroundHeatExchangers::GLHEBase::factory(state, TypeOf_GrndHtExchgSystem, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "GroundHeatExchanger:Surface")) { - this_comp.TypeOf_Num = TypeOf_GrndHtExchgSurface; - this_comp.CurOpSchemeType = UncontrolledOpSchemeType; - this_comp.compPtr = - SurfaceGroundHeatExchanger::SurfaceGroundHeatExchangerData::factory(state, TypeOf_GrndHtExchgSurface, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "GroundHeatExchanger:Pond")) { - this_comp.TypeOf_Num = TypeOf_GrndHtExchgPond; - this_comp.CurOpSchemeType = UncontrolledOpSchemeType; + break; + } + case (PlantEquipmentType::GrndHtExchgSystem): { + this_comp.CurOpSchemeType = OpScheme::Uncontrolled; + this_comp.compPtr = GroundHeatExchangers::GLHEBase::factory(state, PlantEquipmentType::GrndHtExchgSystem, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::GrndHtExchgSurface): { + this_comp.CurOpSchemeType = OpScheme::Uncontrolled; + this_comp.compPtr = SurfaceGroundHeatExchanger::SurfaceGroundHeatExchangerData::factory( + state, PlantEquipmentType::GrndHtExchgSurface, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::GrndHtExchgPond): { + this_comp.CurOpSchemeType = OpScheme::Uncontrolled; this_comp.compPtr = PondGroundHeatExchanger::PondGroundHeatExchangerData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "GroundHeatExchanger:Slinky")) { - this_comp.TypeOf_Num = TypeOf_GrndHtExchgSlinky; - this_comp.CurOpSchemeType = UncontrolledOpSchemeType; - this_comp.compPtr = GroundHeatExchangers::GLHEBase::factory(state, TypeOf_GrndHtExchgSlinky, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:Electric:EIR")) { - this_comp.TypeOf_Num = TypeOf_Chiller_ElectricEIR; + break; + } + case (PlantEquipmentType::GrndHtExchgSlinky): { + this_comp.CurOpSchemeType = OpScheme::Uncontrolled; + this_comp.compPtr = GroundHeatExchangers::GLHEBase::factory(state, PlantEquipmentType::GrndHtExchgSlinky, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::Chiller_ElectricEIR): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = ChillerElectricEIR::ElectricEIRChillerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:Electric:ReformulatedEIR")) { - this_comp.TypeOf_Num = TypeOf_Chiller_ElectricReformEIR; + break; + } + case (PlantEquipmentType::Chiller_ElectricReformEIR): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = ChillerReformulatedEIR::ReformulatedEIRChillerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:Electric")) { - this_comp.TypeOf_Num = TypeOf_Chiller_Electric; + break; + } + case (PlantEquipmentType::Chiller_Electric): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = PlantChillers::ElectricChillerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:EngineDriven")) { - this_comp.TypeOf_Num = TypeOf_Chiller_EngineDriven; + break; + } + case (PlantEquipmentType::Chiller_EngineDriven): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = PlantChillers::EngineDrivenChillerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:CombustionTurbine")) { - this_comp.TypeOf_Num = TypeOf_Chiller_CombTurbine; + break; + } + case (PlantEquipmentType::Chiller_CombTurbine): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = PlantChillers::GTChillerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:ConstantCOP")) { - this_comp.TypeOf_Num = TypeOf_Chiller_ConstCOP; + break; + } + case (PlantEquipmentType::Chiller_ConstCOP): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = PlantChillers::ConstCOPChillerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Boiler:HotWater")) { - this_comp.TypeOf_Num = TypeOf_Boiler_Simple; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + break; + } + case (PlantEquipmentType::Boiler_Simple): { + this_comp.CurOpSchemeType = OpScheme::Unassigned; this_comp.compPtr = Boilers::BoilerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Boiler:Steam")) { - this_comp.TypeOf_Num = TypeOf_Boiler_Steam; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + break; + } + case (PlantEquipmentType::Boiler_Steam): { + this_comp.CurOpSchemeType = OpScheme::Unassigned; this_comp.compPtr = BoilerSteam::BoilerSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:Absorption:Indirect")) { - this_comp.TypeOf_Num = TypeOf_Chiller_Indirect_Absorption; + break; + } + case (PlantEquipmentType::Chiller_Indirect_Absorption): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = ChillerIndirectAbsorption::IndirectAbsorberSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:Absorption")) { - this_comp.TypeOf_Num = TypeOf_Chiller_Absorption; + break; + } + case (PlantEquipmentType::Chiller_Absorption): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = ChillerAbsorption::BLASTAbsorberSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "CoolingTower:SingleSpeed")) { - this_comp.TypeOf_Num = TypeOf_CoolingTower_SingleSpd; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; - this_comp.compPtr = CondenserLoopTowers::CoolingTower::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "CoolingTower:TwoSpeed")) { - this_comp.TypeOf_Num = TypeOf_CoolingTower_TwoSpd; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; - this_comp.compPtr = CondenserLoopTowers::CoolingTower::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "CoolingTower:VariableSpeed")) { - this_comp.TypeOf_Num = TypeOf_CoolingTower_VarSpd; + break; + } + case (PlantEquipmentType::CoolingTower_SingleSpd): + case (PlantEquipmentType::CoolingTower_TwoSpd): { + this_comp.CurOpSchemeType = OpScheme::Unassigned; this_comp.compPtr = CondenserLoopTowers::CoolingTower::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "CoolingTower:VariableSpeed:Merkel")) { - this_comp.TypeOf_Num = TypeOf_CoolingTower_VarSpdMerkel; + break; + } + case (PlantEquipmentType::CoolingTower_VarSpd): + case (PlantEquipmentType::CoolingTower_VarSpdMerkel): { this_comp.compPtr = CondenserLoopTowers::CoolingTower::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Generator:FuelCell:ExhaustGasToWaterHeatExchanger")) { - this_comp.TypeOf_Num = TypeOf_Generator_FCExhaust; + break; + } + case (PlantEquipmentType::Generator_FCExhaust): { this_comp.compPtr = FuelCellElectricGenerator::FCDataStruct::factory_exhaust(state, CompNames(CompNum)); if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "WaterHeater:HeatPump:PumpedCondenser")) { - this_comp.TypeOf_Num = TypeOf_HeatPumpWtrHeaterPumped; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = WaterThermalTanks::HeatPumpWaterHeaterData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "WaterHeater:HeatPump:WrappedCondenser")) { - this_comp.TypeOf_Num = TypeOf_HeatPumpWtrHeaterWrapped; - this_comp.CurOpSchemeType = DemandOpSchemeType; + break; + } + case (PlantEquipmentType::HeatPumpWtrHeaterPumped): + case (PlantEquipmentType::HeatPumpWtrHeaterWrapped): { + this_comp.CurOpSchemeType = OpScheme::Demand; this_comp.compPtr = WaterThermalTanks::HeatPumpWaterHeaterData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "HeatPump:WatertoWater:EquationFit:Cooling")) { - this_comp.compPtr = HeatPumpWaterToWaterSimple::GshpSpecs::factory(state, TypeOf_HPWaterEFCooling, CompNames(CompNum)); - this_comp.TypeOf_Num = TypeOf_HPWaterEFCooling; + break; + } + case (PlantEquipmentType::HPWaterEFCooling): { + this_comp.compPtr = + HeatPumpWaterToWaterSimple::GshpSpecs::factory(state, PlantEquipmentType::HPWaterEFCooling, CompNames(CompNum)); if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "HeatPump:WatertoWater:EquationFit:Heating")) { - this_comp.compPtr = HeatPumpWaterToWaterSimple::GshpSpecs::factory(state, TypeOf_HPWaterEFHeating, CompNames(CompNum)); - this_comp.TypeOf_Num = TypeOf_HPWaterEFHeating; + break; + } + case (PlantEquipmentType::HPWaterEFHeating): { + this_comp.compPtr = + HeatPumpWaterToWaterSimple::GshpSpecs::factory(state, PlantEquipmentType::HPWaterEFHeating, CompNames(CompNum)); if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "HeatPump:WaterToWater:ParameterEstimation:Heating")) { + break; + } + case (PlantEquipmentType::HPWaterPEHeating): { this_comp.compPtr = HeatPumpWaterToWaterHEATING::GshpPeHeatingSpecs::factory(state, CompNames(CompNum)); - this_comp.TypeOf_Num = TypeOf_HPWaterPEHeating; if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "HeatPump:WaterToWater:ParameterEstimation:Cooling")) { + break; + } + case (PlantEquipmentType::HPWaterPECooling): { this_comp.compPtr = HeatPumpWaterToWaterCOOLING::GshpPeCoolingSpecs::factory(state, CompNames(CompNum)); - this_comp.TypeOf_Num = TypeOf_HPWaterPECooling; if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "HeatPump:PlantLoop:EIR:Heating")) { + break; + } + case (PlantEquipmentType::HeatPumpEIRHeating): { this_comp.compPtr = - EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::factory(state, TypeOf_HeatPumpEIRHeating, CompNames(CompNum)); - this_comp.TypeOf_Num = TypeOf_HeatPumpEIRHeating; + EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::factory(state, PlantEquipmentType::HeatPumpEIRHeating, CompNames(CompNum)); if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "HeatPump:PlantLoop:EIR:Cooling")) { + break; + } + case (PlantEquipmentType::HeatPumpEIRCooling): { this_comp.compPtr = - EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::factory(state, TypeOf_HeatPumpEIRCooling, CompNames(CompNum)); - this_comp.TypeOf_Num = TypeOf_HeatPumpEIRCooling; + EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::factory(state, PlantEquipmentType::HeatPumpEIRCooling, CompNames(CompNum)); if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "AirConditioner:VariableRefrigerantFlow")) { - this_comp.TypeOf_Num = TypeOf_HeatPumpVRF; + break; + } + case (PlantEquipmentType::HeatPumpVRF): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = HVACVariableRefrigerantFlow::VRFCondenserEquipment::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "DistrictCooling")) { - this_comp.TypeOf_Num = TypeOf_PurchChilledWater; + break; + } + case (PlantEquipmentType::PurchChilledWater): { + this_comp.compPtr = + OutsideEnergySources::OutsideEnergySourceSpecs::factory(state, PlantEquipmentType::PurchChilledWater, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PurchHotWater): { this_comp.compPtr = - OutsideEnergySources::OutsideEnergySourceSpecs::factory(state, TypeOf_PurchChilledWater, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "DistrictHeating")) { - this_comp.TypeOf_Num = TypeOf_PurchHotWater; - this_comp.compPtr = OutsideEnergySources::OutsideEnergySourceSpecs::factory(state, TypeOf_PurchHotWater, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "ThermalStorage:Ice:Simple")) { - this_comp.TypeOf_Num = TypeOf_TS_IceSimple; + OutsideEnergySources::OutsideEnergySourceSpecs::factory(state, PlantEquipmentType::PurchHotWater, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::TS_IceSimple): { this_comp.compPtr = IceThermalStorage::SimpleIceStorageData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "ThermalStorage:Ice:Detailed")) { - this_comp.TypeOf_Num = TypeOf_TS_IceDetailed; + break; + } + case (PlantEquipmentType::TS_IceDetailed): { this_comp.compPtr = IceThermalStorage::DetailedIceStorageData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "TemperingValve")) { + break; + } + case (PlantEquipmentType::ValveTempering): { this_comp.compPtr = PlantValves::TemperValveData::factory(state, CompNames(CompNum)); - this_comp.TypeOf_Num = TypeOf_ValveTempering; - } else if (UtilityRoutines::SameString(this_comp_type, "HeatExchanger:FluidToFluid")) { - this_comp.TypeOf_Num = TypeOf_FluidToFluidPlantHtExchg; + break; + } + case (PlantEquipmentType::FluidToFluidPlantHtExchg): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = FreeRejectionOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::FreeRejection; } this_comp.compPtr = PlantHeatExchangerFluidToFluid::HeatExchangerStruct::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Generator:MicroTurbine")) { - this_comp.TypeOf_Num = TypeOf_Generator_MicroTurbine; + break; + } + case (PlantEquipmentType::Generator_MicroTurbine): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = MicroturbineElectricGenerator::MTGeneratorSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Generator:InternalCombustionEngine")) { - this_comp.TypeOf_Num = TypeOf_Generator_ICEngine; + break; + } + case (PlantEquipmentType::Generator_ICEngine): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = ICEngineElectricGenerator::ICEngineGeneratorSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Generator:CombustionTurbine")) { - this_comp.TypeOf_Num = TypeOf_Generator_CTurbine; + break; + } + case (PlantEquipmentType::Generator_CTurbine): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = CTElectricGenerator::CTGeneratorData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Generator:MicroCHP")) { - this_comp.TypeOf_Num = TypeOf_Generator_MicroCHP; + break; + } + case (PlantEquipmentType::Generator_MicroCHP): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = MicroCHPElectricGenerator::MicroCHPDataStruct::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Generator:FuelCell:StackCooler")) { - this_comp.TypeOf_Num = TypeOf_Generator_FCStackCooler; + break; + } + case (PlantEquipmentType::Generator_FCStackCooler): { this_comp.compPtr = FuelCellElectricGenerator::FCDataStruct::factory(state, CompNames(CompNum)); if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } - } else if (UtilityRoutines::SameString(this_comp_type, "FluidCooler:SingleSpeed")) { - this_comp.TypeOf_Num = TypeOf_FluidCooler_SingleSpd; - this_comp.compPtr = FluidCoolers::FluidCoolerspecs::factory(state, TypeOf_FluidCooler_SingleSpd, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "FluidCooler:TwoSpeed")) { - this_comp.TypeOf_Num = TypeOf_FluidCooler_TwoSpd; - this_comp.compPtr = FluidCoolers::FluidCoolerspecs::factory(state, TypeOf_FluidCooler_TwoSpd, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "EvaporativeFluidCooler:SingleSpeed")) { - this_comp.TypeOf_Num = TypeOf_EvapFluidCooler_SingleSpd; + break; + } + case (PlantEquipmentType::FluidCooler_SingleSpd): { this_comp.compPtr = - EvaporativeFluidCoolers::EvapFluidCoolerSpecs::factory(state, TypeOf_EvapFluidCooler_SingleSpd, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "EvaporativeFluidCooler:TwoSpeed")) { - this_comp.TypeOf_Num = TypeOf_EvapFluidCooler_TwoSpd; + FluidCoolers::FluidCoolerspecs::factory(state, PlantEquipmentType::FluidCooler_SingleSpd, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::FluidCooler_TwoSpd): { this_comp.compPtr = - EvaporativeFluidCoolers::EvapFluidCoolerSpecs::factory(state, TypeOf_EvapFluidCooler_TwoSpd, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "SolarCollector:FlatPlate:PhotovoltaicThermal")) { - this_comp.TypeOf_Num = TypeOf_PVTSolarCollectorFlatPlate; + FluidCoolers::FluidCoolerspecs::factory(state, PlantEquipmentType::FluidCooler_TwoSpd, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::EvapFluidCooler_SingleSpd): { + this_comp.compPtr = EvaporativeFluidCoolers::EvapFluidCoolerSpecs::factory( + state, PlantEquipmentType::EvapFluidCooler_SingleSpd, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::EvapFluidCooler_TwoSpd): { + this_comp.compPtr = EvaporativeFluidCoolers::EvapFluidCoolerSpecs::factory( + state, PlantEquipmentType::EvapFluidCooler_TwoSpd, CompNames(CompNum)); + break; + } + case (PlantEquipmentType::PVTSolarCollectorFlatPlate): { if (LoopSideNum == DemandSide) { - this_comp.CurOpSchemeType = DemandOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Demand; } else if (LoopSideNum == SupplySide) { - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + this_comp.CurOpSchemeType = OpScheme::Unassigned; } this_comp.compPtr = PhotovoltaicThermalCollectors::PVTCollectorStruct::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "CentralHeatPumpSystem")) { - this_comp.TypeOf_Num = TypeOf_CentralGroundSourceHeatPump; + break; + } + case (PlantEquipmentType::CentralGroundSourceHeatPump): { this_comp.compPtr = PlantCentralGSHP::WrapperSpecs::factory(state, CompNames(CompNum)); // now deal with demand components of the ZoneHVAC type served by ControlCompOutput - } else if (UtilityRoutines::SameString(this_comp_type, "ZoneHVAC:Baseboard:RadiantConvective:Water")) { - this_comp.TypeOf_Num = TypeOf_Baseboard_Rad_Conv_Water; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "ZoneHVAC:Baseboard:Convective:Water")) { - this_comp.TypeOf_Num = TypeOf_Baseboard_Conv_Water; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "ZoneHVAC:Baseboard:RadiantConvective:Steam")) { - this_comp.TypeOf_Num = TypeOf_Baseboard_Rad_Conv_Steam; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "ZoneHVAC:CoolingPanel:RadiantConvective:Water")) { - this_comp.TypeOf_Num = TypeOf_CoolingPanel_Simple; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "ZoneHVAC:LowTemperatureRadiant:VariableFlow")) { - this_comp.TypeOf_Num = TypeOf_LowTempRadiant_VarFlow; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "ZoneHVAC:LowTemperatureRadiant:ConstantFlow")) { - this_comp.TypeOf_Num = TypeOf_LowTempRadiant_ConstFlow; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "AirTerminal:SingleDuct:ConstantVolume:CooledBeam")) { - this_comp.TypeOf_Num = TypeOf_CooledBeamAirTerminal; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "AirTerminal:SingleDuct:ConstantVolume:FourPipeBeam")) { - this_comp.TypeOf_Num = TypeOf_FourPipeBeamAirTerminal; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed")) { - this_comp.TypeOf_Num = TypeOf_MultiSpeedHeatPumpRecovery; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "AirLoopHVAC:UnitarySystem")) { - this_comp.TypeOf_Num = TypeOf_UnitarySysRecovery; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Heating:WaterToAirHeatPump:EquationFit")) { - this_comp.TypeOf_Num = TypeOf_CoilWAHPHeatingEquationFit; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Cooling:WaterToAirHeatPump:EquationFit")) { - this_comp.TypeOf_Num = TypeOf_CoilWAHPCoolingEquationFit; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit")) { - this_comp.TypeOf_Num = TypeOf_CoilVSWAHPHeatingEquationFit; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit")) { - this_comp.TypeOf_Num = TypeOf_CoilVSWAHPCoolingEquationFit; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Heating:WaterToAirHeatPump:ParameterEstimation")) { - this_comp.TypeOf_Num = TypeOf_CoilWAHPHeatingParamEst; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Cooling:WaterToAirHeatPump:ParameterEstimation")) { - this_comp.TypeOf_Num = TypeOf_CoilWAHPCoolingParamEst; - this_comp.CurOpSchemeType = DemandOpSchemeType; + break; + } + case (PlantEquipmentType::PackagedTESCoolingCoil): + case (PlantEquipmentType::SwimmingPool_Indoor): + case (PlantEquipmentType::CoilWaterCooling): + case (PlantEquipmentType::CoilWaterDetailedFlatCooling): + case (PlantEquipmentType::CoilWaterSimpleHeating): + case (PlantEquipmentType::CoilSteamAirHeating): + case (PlantEquipmentType::Baseboard_Rad_Conv_Water): + case (PlantEquipmentType::Baseboard_Conv_Water): + case (PlantEquipmentType::Baseboard_Rad_Conv_Steam): + case (PlantEquipmentType::CoolingPanel_Simple): + case (PlantEquipmentType::LowTempRadiant_VarFlow): + case (PlantEquipmentType::LowTempRadiant_ConstFlow): + case (PlantEquipmentType::CooledBeamAirTerminal): + case (PlantEquipmentType::FourPipeBeamAirTerminal): + case (PlantEquipmentType::MultiSpeedHeatPumpRecovery): + case (PlantEquipmentType::UnitarySysRecovery): + case (PlantEquipmentType::CoilWAHPHeatingEquationFit): + case (PlantEquipmentType::CoilWAHPCoolingEquationFit): + case (PlantEquipmentType::CoilVSWAHPHeatingEquationFit): + case (PlantEquipmentType::CoilVSWAHPCoolingEquationFit): + case (PlantEquipmentType::CoilWAHPHeatingParamEst): + case (PlantEquipmentType::CoilWAHPCoolingParamEst): { + this_comp.CurOpSchemeType = OpScheme::Demand; this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "Refrigeration:Condenser:WaterCooled")) { - this_comp.TypeOf_Num = TypeOf_RefrigSystemWaterCondenser; - this_comp.CurOpSchemeType = DemandOpSchemeType; + break; + } + case (PlantEquipmentType::RefrigSystemWaterCondenser): { + this_comp.CurOpSchemeType = OpScheme::Demand; this_comp.compPtr = RefrigeratedCase::RefrigCondenserData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Refrigeration:CompressorRack")) { - this_comp.TypeOf_Num = TypeOf_RefrigerationWaterCoolRack; - this_comp.CurOpSchemeType = DemandOpSchemeType; + break; + } + case (PlantEquipmentType::RefrigerationWaterCoolRack): { + this_comp.CurOpSchemeType = OpScheme::Demand; this_comp.compPtr = RefrigeratedCase::RefrigRackData::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "PlantComponent:UserDefined")) { - this_comp.TypeOf_Num = TypeOf_PlantComponentUserDefined; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + break; + } + case (PlantEquipmentType::PlantComponentUserDefined): { + this_comp.CurOpSchemeType = OpScheme::Unassigned; this_comp.compPtr = UserDefinedComponents::UserPlantComponentStruct::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:UserDefined")) { - this_comp.TypeOf_Num = TypeOf_CoilUserDefined; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "ZoneHVAC:ForcedAir:UserDefined")) { - this_comp.TypeOf_Num = TypeOf_ZoneHVACAirUserDefined; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "AirTerminal:SingleDuct:UserDefined")) { - this_comp.TypeOf_Num = TypeOf_AirTerminalUserDefined; - this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; + break; + } + case (PlantEquipmentType::CoilUserDefined): + case (PlantEquipmentType::ZoneHVACAirUserDefined): + case (PlantEquipmentType::AirTerminalUserDefined): { + this_comp.CurOpSchemeType = OpScheme::Unassigned; this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "PlantComponent:TemperatureSource")) { - this_comp.TypeOf_Num = TypeOf_WaterSource; - this_comp.CurOpSchemeType = UncontrolledOpSchemeType; + break; + } + case (PlantEquipmentType::WaterSource): { + this_comp.CurOpSchemeType = OpScheme::Uncontrolled; this_comp.compPtr = PlantComponentTemperatureSources::WaterSourceSpecs::factory(state, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "GroundHeatExchanger:HorizontalTrench")) { - this_comp.TypeOf_Num = TypeOf_GrndHtExchgHorizTrench; - this_comp.CurOpSchemeType = TypeOf_GrndHtExchgHorizTrench; - this_comp.compPtr = PlantPipingSystemsManager::Circuit::factory(state, TypeOf_GrndHtExchgHorizTrench, CompNames(CompNum)); - } else if (UtilityRoutines::SameString(this_comp_type, "Coil:Cooling:DX:SingleSpeed:ThermalStorage")) { - this_comp.TypeOf_Num = TypeOf_PackagedTESCoolingCoil; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else if (UtilityRoutines::SameString(this_comp_type, "SwimmingPool:Indoor")) { - this_comp.TypeOf_Num = TypeOf_SwimmingPool_Indoor; - this_comp.CurOpSchemeType = DemandOpSchemeType; - this_comp.compPtr = &state.dataPlantMgr->dummyPlantComponent; - } else { - // discover unsupported equipment on branches. - ShowSevereError(state, "GetPlantInput: Branch=\"" + BranchNames(BranchNum) + "\", invalid component on branch."); - ShowContinueError(state, "...invalid component type=\"" + this_comp_type + "\", name=\"" + CompNames(CompNum) + "\"."); - // ErrorsFound=.TRUE. + break; + } + case (PlantEquipmentType::GrndHtExchgHorizTrench): { + this_comp.CurOpSchemeType = OpScheme::Uncontrolled; + this_comp.compPtr = + PlantPipingSystemsManager::Circuit::factory(state, PlantEquipmentType::GrndHtExchgHorizTrench, CompNames(CompNum)); + break; + } + default: { + if (has_prefixi(this_comp_type, "Pump") || has_prefixi(this_comp_type, "HeaderedPumps")) { + // discover unsupported equipment on branches. + ShowSevereError(state, "GetPlantInput: trying to process a pump type that is not supported, dev note"); + ShowContinueError(state, "Component Type =" + this_comp_type); + } else { + // discover unsupported equipment on branches. + ShowSevereError(state, "GetPlantInput: Branch=\"" + BranchNames(BranchNum) + "\", invalid component on branch."); + ShowContinueError(state, "...invalid component type=\"" + this_comp_type + "\", name=\"" + CompNames(CompNum) + "\"."); + // ErrorsFound=.TRUE. + } + } } if (!this_comp.compPtr) ShowFatalError(state, format(" Plant component \"{}\" was not assigned a pointer.", this_comp_type)); @@ -1624,12 +1592,12 @@ void GetPlantInput(EnergyPlusData &state) // a nice little spot to report out bad pump/common-pipe configurations bool const ThisSideHasPumps = (plantLoop.LoopSide(1).TotalPumps > 0); bool const OtherSideHasPumps = (plantLoop.LoopSide(2).TotalPumps > 0); - if ((plantLoop.CommonPipeType != DataPlant::iCommonPipeType::No) && (!ThisSideHasPumps || !OtherSideHasPumps)) { + if ((plantLoop.CommonPipeType != DataPlant::CommonPipeType::No) && (!ThisSideHasPumps || !OtherSideHasPumps)) { ShowSevereError(state, "Input Error: Common Pipe configurations must have pumps on both sides of loop"); ShowContinueError(state, "Occurs on plant loop name =\"" + plantLoop.Name + "\""); ShowContinueError(state, "Make sure both demand and supply sides have a pump"); ErrorsFound = true; - } else if ((plantLoop.CommonPipeType == DataPlant::iCommonPipeType::No) && ThisSideHasPumps && OtherSideHasPumps) { + } else if ((plantLoop.CommonPipeType == DataPlant::CommonPipeType::No) && ThisSideHasPumps && OtherSideHasPumps) { ShowSevereError(state, "Input Error: Pumps on both loop sides must utilize a common pipe"); ShowContinueError(state, "Occurs on plant loop name =\"" + plantLoop.Name + "\""); ShowContinueError(state, "Add common pipe or remove one loop side pump"); @@ -1874,7 +1842,6 @@ void SetupReports(EnergyPlusData &state) // It was created during the splitting of supply and demand side functions. // Using/Aliasing - using DataPlant::DemandOpSchemeType; using DataPlant::DemandSide; using DataPlant::SupplySide; @@ -2043,7 +2010,7 @@ void SetupReports(EnergyPlusData &state) for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).TotalComponents; ++CompNum) { if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType != - DemandOpSchemeType) { + OpScheme::Demand) { SetupOutputVariable(state, "Plant Component Distributed Demand Rate", OutputProcessor::Unit::W, @@ -2176,7 +2143,7 @@ void InitializeLoops(EnergyPlusData &state, bool const FirstHVACIteration) // tr //***************************************************************** if (!state.dataPlnt->PlantFirstSizeCompleted) { - SetAllFlowLocks(state, DataPlant::iFlowLock::Unlocked); + SetAllFlowLocks(state, DataPlant::FlowLock::Unlocked); FinishSizingFlag = false; state.dataPlnt->PlantFirstSizesOkayToFinalize = false; // set global flag for when it ready to store final sizes state.dataPlnt->PlantFirstSizesOkayToReport = false; @@ -2328,7 +2295,7 @@ void InitializeLoops(EnergyPlusData &state, bool const FirstHVACIteration) // tr for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { // check if setpoints being placed on node properly - if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if (state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "Plant Loop: missing high temperature setpoint for dual setpoint deadband demand scheme"); @@ -2466,10 +2433,10 @@ void ReInitPlantLoopsAtFirstHVACIteration(EnergyPlusData &state) { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { LoopSetPointTemp = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { // Get the range of setpoints LoopSetPointTemperatureHi = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; LoopSetPointTemperatureLo = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; @@ -2477,7 +2444,7 @@ void ReInitPlantLoopsAtFirstHVACIteration(EnergyPlusData &state) } } - if ((state.dataPlnt->PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (LoopSideNum == DemandSide) && + if ((state.dataPlnt->PlantLoop(LoopNum).CommonPipeType == DataPlant::CommonPipeType::TwoWay) && (LoopSideNum == DemandSide) && (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt)) { // get a second setpoint for secondaryLoop // if the plant loop is two common pipe configured for temperature control on secondary side inlet, then // we want to initialize the demand side of the loop using that setpoint @@ -2506,7 +2473,7 @@ void ReInitPlantLoopsAtFirstHVACIteration(EnergyPlusData &state) e.PumpHeatToFluid = 0.0; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowRequest = 0.0; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TimeElapsed = 0.0; - state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::FlowLock::Unlocked; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.TemperatureHistory = 0.0; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.MassFlowRateHistory = 0.0; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).OutletNode.TemperatureHistory = 0.0; @@ -2641,7 +2608,7 @@ void ReInitPlantLoopsAtFirstHVACIteration(EnergyPlusData &state) state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; // Update supply side hi-lo setpoints for dual SP control - if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { LoopSetPointTempHi = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; LoopSetPointTempLo = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; LoopSetPointTempHi = min(LoopMaxTemp, LoopSetPointTempHi); @@ -2653,7 +2620,7 @@ void ReInitPlantLoopsAtFirstHVACIteration(EnergyPlusData &state) } // update demand side loop setpoint in plant data structure - if (state.dataPlnt->PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { // get a second setpoint for secondaryLoop + if (state.dataPlnt->PlantLoop(LoopNum).CommonPipeType == DataPlant::CommonPipeType::TwoWay) { // get a second setpoint for secondaryLoop // if the plant loop is two common pipe configured for temperature control on secondary side inlet, then // we want to initialize the demand side of the loop using that setpoint if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { @@ -2679,7 +2646,7 @@ void ReInitPlantLoopsAtFirstHVACIteration(EnergyPlusData &state) } } else { // no secondary loop, so use supply side loop SP on demand side too. state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; - if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointHi = LoopSetPointTempHi; state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointLo = LoopSetPointTempLo; } @@ -2856,26 +2823,25 @@ void CheckPlantOnAbort(EnergyPlusData &state) for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).TotalComponents; ++CompNum) { ShouldBeACTIVE = false; { - auto const SELECT_CASE_var( - state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Comp(CompNum).TypeOf_Num); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Comp(CompNum).Type); - if (SELECT_CASE_var == TypeOf_WtrHeaterMixed) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterMixed) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterStratified) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_WaterUseConnection) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WaterUseConnection) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_CoilWaterCooling) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWaterCooling) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_CoilWaterDetailedFlatCooling) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_CoilWaterSimpleHeating) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_CoilSteamAirHeating) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilSteamAirHeating) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_SolarCollectorFlatPlate) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::SolarCollectorFlatPlate) { ShouldBeACTIVE = true; - } else if (SELECT_CASE_var == TypeOf_PlantLoadProfile) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PlantLoadProfile) { ShouldBeACTIVE = true; } else { // not a demand side component that we know needs to be active, do nothing @@ -3585,21 +3551,21 @@ void SetupBranchControlTypes(EnergyPlusData &state) auto &this_component(state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp(CompCtr)); { - auto const SELECT_CASE_var(this_component.TypeOf_Num); + auto const SELECT_CASE_var(this_component.Type); - if (SELECT_CASE_var == TypeOf_Other) { // = -1 + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Invalid) { // = -1 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Unknown; this_component.FlowPriority = DataPlant::LoopFlowStatus::Unknown; this_component.HowLoadServed = DataPlant::HowMet::Unknown; - } else if (SELECT_CASE_var == TypeOf_Boiler_Simple) { // = 1 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Boiler_Simple) { // = 1 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapHiOutLimit; - } else if (SELECT_CASE_var == TypeOf_Boiler_Steam) { // = 2 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Boiler_Steam) { // = 2 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_Chiller_Absorption) { // = 3 ! older BLAST absorption chiller + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_Absorption) { // = 3 ! older BLAST absorption chiller this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3608,7 +3574,8 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_Indirect_Absorption) { // = 4 ! revised absorption chiller + } else if (SELECT_CASE_var == + DataPlant::PlantEquipmentType::Chiller_Indirect_Absorption) { // = 4 ! revised absorption chiller this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3617,7 +3584,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_CombTurbine) { // = 5 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_CombTurbine) { // = 5 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3626,7 +3593,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_ConstCOP) { // = 6 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ConstCOP) { // = 6 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { @@ -3636,7 +3603,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; } - } else if (SELECT_CASE_var == TypeOf_Chiller_DFAbsorption) { // = 7 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_DFAbsorption) { // = 7 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3645,7 +3612,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_ExhFiredAbsorption) { // = 76 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ExhFiredAbsorption) { // = 76 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3654,7 +3621,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_Electric) { // = 8 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_Electric) { // = 8 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3663,7 +3630,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_ElectricEIR) { // = 9 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricEIR) { // = 9 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3672,7 +3639,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_ElectricReformEIR) { // = 10 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR) { // = 10 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3681,7 +3648,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_Chiller_EngineDriven) { // = 11 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_EngineDriven) { // = 11 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; if (LoopSideCtr == DemandSide) { @@ -3691,33 +3658,33 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; } - } else if (SELECT_CASE_var == TypeOf_CoolingTower_SingleSpd) { // = 12 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoolingTower_SingleSpd) { // = 12 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_CoolingTower_TwoSpd) { // = 13 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoolingTower_TwoSpd) { // = 13 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_CoolingTower_VarSpd) { // = 14 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoolingTower_VarSpd) { // = 14 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_CoolingTower_VarSpdMerkel) { // = 89 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoolingTower_VarSpdMerkel) { // = 89 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_Generator_FCExhaust) { // = 15 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Generator_FCExhaust) { // = 15 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_HeatPumpWtrHeaterPumped || - SELECT_CASE_var == TypeOf_HeatPumpWtrHeaterWrapped) { // = 16, 92 + } else if (SELECT_CASE_var == PlantEquipmentType::HeatPumpWtrHeaterPumped || + SELECT_CASE_var == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) { // = 16, 92 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_HPWaterEFCooling) { // = 17 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::HPWaterEFCooling) { // = 17 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3727,7 +3694,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; } - } else if (SELECT_CASE_var == TypeOf_HPWaterEFHeating) { // = 18 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::HPWaterEFHeating) { // = 18 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3736,7 +3703,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; } - } else if (SELECT_CASE_var == TypeOf_HPWaterPECooling) { // = 19 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::HPWaterPECooling) { // = 19 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3745,7 +3712,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; } - } else if (SELECT_CASE_var == TypeOf_HPWaterPEHeating) { // = 20 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::HPWaterPEHeating) { // = 20 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3754,7 +3721,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; } - } else if (SELECT_CASE_var == TypeOf_Pipe) { // = 21 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Pipe) { // = 21 this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; if (BranchIsInSplitterMixer) { @@ -3768,7 +3735,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) } else { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Passive; } - } else if (SELECT_CASE_var == TypeOf_PipeSteam) { // = 22 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeSteam) { // = 22 this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; if (BranchIsInSplitterMixer) { @@ -3782,7 +3749,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) } else { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Passive; } - } else if (SELECT_CASE_var == TypeOf_PipeExterior) { // = 23 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeExterior) { // = 23 this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; if (BranchIsInSplitterMixer) { @@ -3796,7 +3763,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) } else { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Passive; } - } else if (SELECT_CASE_var == TypeOf_PipeInterior) { // = 24 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeInterior) { // = 24 this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; if (BranchIsInSplitterMixer) { @@ -3810,7 +3777,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) } else { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Passive; } - } else if (SELECT_CASE_var == TypeOf_PipeUnderground) { // = 25 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeUnderground) { // = 25 this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; if (BranchIsInSplitterMixer) { @@ -3824,27 +3791,27 @@ void SetupBranchControlTypes(EnergyPlusData &state) } else { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Passive; } - } else if (SELECT_CASE_var == TypeOf_PurchChilledWater) { // = 26 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PurchChilledWater) { // = 26 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; - } else if (SELECT_CASE_var == TypeOf_PurchHotWater) { // = 27 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PurchHotWater) { // = 27 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapHiOutLimit; - } else if (SELECT_CASE_var == TypeOf_TS_IceDetailed) { // = 28 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::TS_IceDetailed) { // = 28 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_TS_IceSimple) { // = 29 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::TS_IceSimple) { // = 29 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_ValveTempering) { // = 30 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::ValveTempering) { // = 30 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_WtrHeaterMixed) { // = 31 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterMixed) { // = 31 if (LoopSideCtr == DemandSide) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3854,7 +3821,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; } - } else if (SELECT_CASE_var == TypeOf_WtrHeaterStratified) { // = 32 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterStratified) { // = 32 if (LoopSideCtr == DemandSide) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3864,103 +3831,107 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; } - } else if (SELECT_CASE_var == TypeOf_PumpVariableSpeed) { // = 33 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PumpVariableSpeed) { // = 33 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_PumpConstantSpeed) { // = 34 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PumpConstantSpeed) { // = 34 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_PumpCondensate) { // = 35 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PumpCondensate) { // = 35 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_PumpBankVariableSpeed) { // = 36 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PumpBankVariableSpeed) { // = 36 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_PumpBankConstantSpeed) { // = 37 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PumpBankConstantSpeed) { // = 37 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_WaterUseConnection) { // = 38 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WaterUseConnection) { // = 38 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilWaterCooling) { // = 39 ! demand side component + } else if (SELECT_CASE_var == + DataPlant::PlantEquipmentType::CoilWaterCooling) { // = 39 ! demand side component this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilWaterDetailedFlatCooling) { // = 40 ! demand side component + } else if (SELECT_CASE_var == + DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { // = 40 ! demand side component this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilWaterSimpleHeating) { // = 41 ! demand side component + } else if (SELECT_CASE_var == + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { // = 41 ! demand side component this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilSteamAirHeating) { // = 42 ! demand side component + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilSteamAirHeating) { // = 42 ! demand side component this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_SolarCollectorFlatPlate) { // = 43 ! demand side component + } else if (SELECT_CASE_var == + DataPlant::PlantEquipmentType::SolarCollectorFlatPlate) { // = 43 ! demand side component this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_PlantLoadProfile) { // = 44 ! demand side component + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PlantLoadProfile) { // = 44 ! demand side component this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_GrndHtExchgSystem) { // = 45 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::GrndHtExchgSystem) { // = 45 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_GrndHtExchgSurface) { // = 46 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::GrndHtExchgSurface) { // = 46 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_GrndHtExchgPond) { // = 47 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::GrndHtExchgPond) { // = 47 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_Generator_MicroTurbine) { // = 48 !newer FSEC turbine + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Generator_MicroTurbine) { // = 48 !newer FSEC turbine this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_Generator_ICEngine) { // = 49 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Generator_ICEngine) { // = 49 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_Generator_CTurbine) { // = 50 !older BLAST turbine + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Generator_CTurbine) { // = 50 !older BLAST turbine this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_Generator_MicroCHP) { // = 51 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Generator_MicroCHP) { // = 51 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_Generator_FCStackCooler) { // = 52 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Generator_FCStackCooler) { // = 52 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; - } else if (SELECT_CASE_var == TypeOf_FluidCooler_SingleSpd) { // = 53 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::FluidCooler_SingleSpd) { // = 53 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_FluidCooler_TwoSpd) { // = 54 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::FluidCooler_TwoSpd) { // = 54 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_EvapFluidCooler_SingleSpd) { // = 55 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd) { // = 55 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_EvapFluidCooler_TwoSpd) { // = 56 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd) { // = 56 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_ChilledWaterTankMixed) { // = 57 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::ChilledWaterTankMixed) { // = 57 if (LoopSideCtr == DemandSide) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3970,7 +3941,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; } - } else if (SELECT_CASE_var == TypeOf_ChilledWaterTankStratified) { // = 58 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::ChilledWaterTankStratified) { // = 58 if (LoopSideCtr == DemandSide) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -3980,108 +3951,109 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; } - } else if (SELECT_CASE_var == TypeOf_PVTSolarCollectorFlatPlate) { // = 59 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PVTSolarCollectorFlatPlate) { // = 59 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; // next batch for ZoneHVAC - } else if (SELECT_CASE_var == TypeOf_Baseboard_Conv_Water) { // = 60 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Baseboard_Conv_Water) { // = 60 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_Baseboard_Rad_Conv_Steam) { // = 61 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Steam) { // = 61 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_Baseboard_Rad_Conv_Water) { // = 62 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Water) { // = 62 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoolingPanel_Simple) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoolingPanel_Simple) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_LowTempRadiant_VarFlow) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::LowTempRadiant_VarFlow) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_LowTempRadiant_ConstFlow) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::LowTempRadiant_ConstFlow) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CooledBeamAirTerminal) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CooledBeamAirTerminal) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_FourPipeBeamAirTerminal) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::FourPipeBeamAirTerminal) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilWAHPHeatingEquationFit) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilWAHPCoolingEquationFit) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilVSWAHPHeatingEquationFit) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilVSWAHPHeatingEquationFit) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilVSWAHPCoolingEquationFit) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilVSWAHPCoolingEquationFit) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilWAHPHeatingParamEst) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWAHPHeatingParamEst) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_CoilWAHPCoolingParamEst) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWAHPCoolingParamEst) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_RefrigSystemWaterCondenser) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::RefrigSystemWaterCondenser) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_RefrigerationWaterCoolRack) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::RefrigerationWaterCoolRack) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_MultiSpeedHeatPumpRecovery) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::MultiSpeedHeatPumpRecovery) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_UnitarySysRecovery) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::UnitarySysRecovery) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_PipingSystemPipeCircuit) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipingSystemPipeCircuit) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_SolarCollectorICS) { // = 75 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::SolarCollectorICS) { // = 75 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_PlantComponentUserDefined) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PlantComponentUserDefined) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::Unknown; this_component.HowLoadServed = DataPlant::HowMet::Unknown; - } else if (SELECT_CASE_var == TypeOf_CoilUserDefined) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilUserDefined) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::Unknown; this_component.HowLoadServed = DataPlant::HowMet::Unknown; - } else if (SELECT_CASE_var == TypeOf_ZoneHVACAirUserDefined) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::ZoneHVACAirUserDefined) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::Unknown; this_component.HowLoadServed = DataPlant::HowMet::Unknown; - } else if (SELECT_CASE_var == TypeOf_AirTerminalUserDefined) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::AirTerminalUserDefined) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::Unknown; this_component.HowLoadServed = DataPlant::HowMet::Unknown; - } else if (SELECT_CASE_var == TypeOf_HeatPumpVRF) { // = 82 ! AirConditioner:VariableRefrigerantFlow + } else if (SELECT_CASE_var == + DataPlant::PlantEquipmentType::HeatPumpVRF) { // = 82 ! AirConditioner:VariableRefrigerantFlow this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { @@ -4091,15 +4063,16 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; } - } else if (SELECT_CASE_var == TypeOf_WaterSource) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WaterSource) { this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCapLowOutLimit; - } else if (SELECT_CASE_var == TypeOf_GrndHtExchgHorizTrench) { // = 83 GroundHeatExchanger:HorizontalTrench + } else if (SELECT_CASE_var == + DataPlant::PlantEquipmentType::GrndHtExchgHorizTrench) { // = 83 GroundHeatExchanger:HorizontalTrench this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_FluidToFluidPlantHtExchg) { // = 84 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg) { // = 84 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -4108,7 +4081,7 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; } - } else if (SELECT_CASE_var == TypeOf_CentralGroundSourceHeatPump) { // 86 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump) { // 86 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; @@ -4117,19 +4090,20 @@ void SetupBranchControlTypes(EnergyPlusData &state) this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyIfLoopOn; this_component.HowLoadServed = DataPlant::HowMet::ByNominalCap; } - } else if (SELECT_CASE_var == TypeOf_PackagedTESCoolingCoil) { // 88 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::PackagedTESCoolingCoil) { // 88 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_SwimmingPool_Indoor) { // 90 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::SwimmingPool_Indoor) { // 90 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; this_component.HowLoadServed = DataPlant::HowMet::NoneDemand; - } else if (SELECT_CASE_var == TypeOf_GrndHtExchgSlinky) { // = 91 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::GrndHtExchgSlinky) { // = 91 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; this_component.FlowPriority = DataPlant::LoopFlowStatus::TakesWhatGets; this_component.HowLoadServed = DataPlant::HowMet::PassiveCap; - } else if (SELECT_CASE_var == TypeOf_HeatPumpEIRCooling || SELECT_CASE_var == TypeOf_HeatPumpEIRHeating) { // 95, 96 + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::HeatPumpEIRCooling || + SELECT_CASE_var == PlantEquipmentType::HeatPumpEIRHeating) { // 95, 96 this_component.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::Active; if (LoopSideCtr == DemandSide) { this_component.FlowPriority = DataPlant::LoopFlowStatus::NeedyAndTurnsLoopOn; diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 397bf5f25f1..5aa513c8f37 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -164,7 +164,7 @@ void WrapperSpecs::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, calledFromLocation.loopNum, this->GLHELoopSideNum, - DataPlant::TypeOf_CentralGroundSourceHeatPump, + DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump, this->GLHEInletNodeNum, this->GLHEOutletNodeNum, this->Report.GLHERate, @@ -1544,7 +1544,7 @@ void WrapperSpecs::initialize(EnergyPlusData &state, bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_CentralGroundSourceHeatPump, + DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -1558,7 +1558,7 @@ void WrapperSpecs::initialize(EnergyPlusData &state, PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_CentralGroundSourceHeatPump, + DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump, this->HWLoopNum, this->HWLoopSideNum, this->HWBranchNum, @@ -1572,7 +1572,7 @@ void WrapperSpecs::initialize(EnergyPlusData &state, PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_CentralGroundSourceHeatPump, + DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump, this->GLHELoopNum, this->GLHELoopSideNum, this->GLHEBranchNum, @@ -1589,7 +1589,7 @@ void WrapperSpecs::initialize(EnergyPlusData &state, this->CWLoopSideNum, this->GLHELoopNum, this->GLHELoopSideNum, - DataPlant::TypeOf_CentralGroundSourceHeatPump, + DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump, true); PlantUtilities::InterConnectTwoPlantLoopSides(state, @@ -1597,11 +1597,16 @@ void WrapperSpecs::initialize(EnergyPlusData &state, this->HWLoopSideNum, this->GLHELoopNum, this->GLHELoopSideNum, - DataPlant::TypeOf_CentralGroundSourceHeatPump, + DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump, true); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_CentralGroundSourceHeatPump, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->HWLoopNum, + this->HWLoopSideNum, + DataPlant::PlantEquipmentType::CentralGroundSourceHeatPump, + true); if (this->VariableFlowCH) { // Reset flow priority @@ -2860,7 +2865,7 @@ void WrapperSpecs::CalcWrapperModel(EnergyPlusData &state, Real64 &MyLoad, int c CurCoolingLoad = std::abs(MyLoad); this->WrapperCoolingLoad = CurCoolingLoad; // Set actual mass flow rate at the nodes when it's locked - if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { CHWInletMassFlowRate = state.dataLoopNodes->Node(this->CHWInletNodeNum).MassFlowRate; } if (CHWInletMassFlowRate == 0.0) GLHEInletMassFlowRate = 0.0; @@ -2874,7 +2879,7 @@ void WrapperSpecs::CalcWrapperModel(EnergyPlusData &state, Real64 &MyLoad, int c CurHeatingLoad = MyLoad; this->WrapperHeatingLoad = CurHeatingLoad; // Set actual mass flow rate at the nodes when it's locked - if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { HWInletMassFlowRate = state.dataLoopNodes->Node(this->HWInletNodeNum).MassFlowRate; } if (HWInletMassFlowRate == 0.0) GLHEInletMassFlowRate = 0.0; diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index a7809cb5c65..801eafb14ad 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -214,19 +214,21 @@ namespace PlantChillers { auto &thisChiller = state.dataPlantChillers->ElectricChiller(ChillerNum); thisChiller.Name = state.dataIPShortCut->cAlphaArgs(1); - thisChiller.plantTypeOfNum = DataPlant::TypeOf_Chiller_Electric; - - if (state.dataIPShortCut->cAlphaArgs(2) == "AIRCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::AirCooled; - } else if (state.dataIPShortCut->cAlphaArgs(2) == "WATERCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; - } else if (state.dataIPShortCut->cAlphaArgs(2) == "EVAPORATIVELYCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::EvapCooled; - } else { + thisChiller.ChillerType = DataPlant::PlantEquipmentType::Chiller_Electric; + + thisChiller.CondenserType = static_cast( + getEnumerationValue(DataPlant::CondenserTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)))); + switch (thisChiller.CondenserType) { + case DataPlant::CondenserType::AirCooled: + case DataPlant::CondenserType::WaterCooled: + case DataPlant::CondenserType::EvapCooled: + break; + default: { ShowSevereError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + '=' + state.dataIPShortCut->cAlphaArgs(2)); ShowContinueError(state, "Entered in " + state.dataIPShortCut->cCurrentModuleObject + '=' + state.dataIPShortCut->cAlphaArgs(1)); ErrorsFound = true; } + } thisChiller.NomCap = state.dataIPShortCut->rNumericArgs(1); if (thisChiller.NomCap == DataSizing::AutoSize) { @@ -814,7 +816,7 @@ namespace PlantChillers { PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, - this->plantTypeOfNum, + this->ChillerType, this->CondInletNodeNum, this->CondOutletNodeNum, this->QCondenser, @@ -826,7 +828,7 @@ namespace PlantChillers { PlantUtilities::UpdateComponentHeatRecoverySide(state, this->HRLoopNum, this->HRLoopSideNum, - this->plantTypeOfNum, + this->ChillerType, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, this->QHeatRecovery, @@ -938,9 +940,9 @@ namespace PlantChillers { Real64 THeatRecSetPoint(0.0); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } } @@ -991,10 +993,10 @@ namespace PlantChillers { // could be removed with transition, testing , model change, period of being obsolete. { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } @@ -1395,7 +1397,7 @@ namespace PlantChillers { if (MyLoad >= 0.0 || !RunFlag) { // call for zero flow before leaving if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { this->EvapMassFlowRate = state.dataLoopNodes->Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -1457,7 +1459,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } @@ -1593,12 +1595,12 @@ namespace PlantChillers { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { this->PossibleSubcooling = !(state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType); + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased); this->QEvaporator = AvailChillerCap * OperPartLoadRat; Real64 FRAC; if (OperPartLoadRat < this->MinPartLoadRat) { @@ -1638,10 +1640,10 @@ namespace PlantChillers { Real64 EvapDeltaTemp(0.0); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } @@ -1665,9 +1667,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -1740,26 +1742,26 @@ namespace PlantChillers { Real64 TempEvapOutSetPoint(0.0); // C - evaporator outlet temperature setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { TempEvapOutSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -1993,9 +1995,9 @@ namespace PlantChillers { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = state.dataLoopNodes->Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } } @@ -2102,7 +2104,7 @@ namespace PlantChillers { this->setupOutputVariables(state); PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -2116,7 +2118,7 @@ namespace PlantChillers { if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -2128,12 +2130,12 @@ namespace PlantChillers { this->CondInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->ChillerType, true); } if (this->HeatRecActive) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, @@ -2145,13 +2147,13 @@ namespace PlantChillers { this->HeatRecInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->ChillerType, true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); + state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->ChillerType, false); } if (errFlag) { @@ -2208,10 +2210,10 @@ namespace PlantChillers { this->ModulatedFlowSetToLoop = true; { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } @@ -2250,7 +2252,7 @@ namespace PlantChillers { PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, - this->plantTypeOfNum, + this->ChillerType, this->CondInletNodeNum, this->CondOutletNodeNum, this->QCondenser, @@ -2262,7 +2264,7 @@ namespace PlantChillers { PlantUtilities::UpdateComponentHeatRecoverySide(state, this->HRLoopNum, this->HRLoopSideNum, - this->plantTypeOfNum, + this->ChillerType, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, this->QTotalHeatRecovered, @@ -2330,7 +2332,7 @@ namespace PlantChillers { auto &thisChiller = state.dataPlantChillers->EngineDrivenChiller(ChillerNum); thisChiller.Name = state.dataIPShortCut->cAlphaArgs(1); - thisChiller.plantTypeOfNum = DataPlant::TypeOf_Chiller_EngineDriven; + thisChiller.ChillerType = DataPlant::PlantEquipmentType::Chiller_EngineDriven; thisChiller.NomCap = state.dataIPShortCut->rNumericArgs(1); if (thisChiller.NomCap == DataSizing::AutoSize) { @@ -3568,7 +3570,7 @@ namespace PlantChillers { // If Chiller load is 0 or chiller is not running then leave the subroutine. if (MyLoad >= 0.0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { this->EvapMassFlowRate = state.dataLoopNodes->Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -3667,7 +3669,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } @@ -3744,7 +3746,7 @@ namespace PlantChillers { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = AvailChillerCap * OperPartLoadRat; Real64 FRAC; @@ -3784,10 +3786,10 @@ namespace PlantChillers { Real64 EvapDeltaTemp(0.0); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } @@ -3810,9 +3812,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -3889,26 +3891,26 @@ namespace PlantChillers { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { TempEvapOutSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -4271,7 +4273,7 @@ namespace PlantChillers { this->setupOutputVariables(state); PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -4285,7 +4287,7 @@ namespace PlantChillers { if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -4297,12 +4299,12 @@ namespace PlantChillers { this->CondInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->ChillerType, true); } if (this->HeatRecActive) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, @@ -4314,13 +4316,13 @@ namespace PlantChillers { this->HeatRecInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->ChillerType, true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); + state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->ChillerType, false); } if (errFlag) { ShowFatalError(state, "InitEngineDrivenChiller: Program terminated due to previous condition(s)."); @@ -4412,7 +4414,7 @@ namespace PlantChillers { PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, - this->plantTypeOfNum, + this->ChillerType, this->CondInletNodeNum, this->CondOutletNodeNum, this->QCondenser, @@ -4424,7 +4426,7 @@ namespace PlantChillers { PlantUtilities::UpdateComponentHeatRecoverySide(state, this->HRLoopNum, this->HRLoopSideNum, - this->plantTypeOfNum, + this->ChillerType, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, this->HeatRecLubeRate, @@ -4493,7 +4495,7 @@ namespace PlantChillers { auto &thisChiller = state.dataPlantChillers->GTChiller(ChillerNum); thisChiller.Name = state.dataIPShortCut->cAlphaArgs(1); - thisChiller.plantTypeOfNum = DataPlant::TypeOf_Chiller_CombTurbine; + thisChiller.ChillerType = DataPlant::PlantEquipmentType::Chiller_CombTurbine; thisChiller.NomCap = state.dataIPShortCut->rNumericArgs(1); @@ -5680,7 +5682,7 @@ namespace PlantChillers { // flow resolver will not shut down the branch if (MyLoad >= 0.0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { this->EvapMassFlowRate = state.dataLoopNodes->Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -5778,7 +5780,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; @@ -5848,7 +5850,7 @@ namespace PlantChillers { RoutineName); // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = AvailChillerCap * OperPartLoadRat; Real64 FRAC; @@ -5884,10 +5886,10 @@ namespace PlantChillers { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } @@ -5910,9 +5912,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -5978,26 +5980,26 @@ namespace PlantChillers { } else { // No subcooling in this case.No recalculation required.Still need to check chiller low temp limit { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { TempEvapOutSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -6346,7 +6348,7 @@ namespace PlantChillers { this->setupOutputVariables(state); PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -6360,7 +6362,7 @@ namespace PlantChillers { if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -6372,12 +6374,12 @@ namespace PlantChillers { this->CondInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->ChillerType, true); } if (this->HeatRecActive) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->HRLoopNum, this->HRLoopSideNum, this->HRBranchNum, @@ -6389,13 +6391,13 @@ namespace PlantChillers { this->HeatRecInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->ChillerType, true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); + state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->ChillerType, false); } if (errFlag) { ShowFatalError(state, "InitGTChiller: Program terminated due to previous condition(s)."); @@ -6488,7 +6490,7 @@ namespace PlantChillers { PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, - this->plantTypeOfNum, + this->ChillerType, this->CondInletNodeNum, this->CondOutletNodeNum, this->QCondenser, @@ -6561,7 +6563,7 @@ namespace PlantChillers { auto &thisChiller = state.dataPlantChillers->ConstCOPChiller(ChillerNum); thisChiller.Name = state.dataIPShortCut->cAlphaArgs(1); - thisChiller.plantTypeOfNum = DataPlant::TypeOf_Chiller_ConstCOP; + thisChiller.ChillerType = DataPlant::PlantEquipmentType::Chiller_ConstCOP; thisChiller.NomCap = state.dataIPShortCut->rNumericArgs(1); if (thisChiller.NomCap == DataSizing::AutoSize) { thisChiller.NomCapWasAutoSized = true; @@ -7376,25 +7378,25 @@ namespace PlantChillers { { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; } else { TempEvapOutSetPoint = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) - .CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + .CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) || (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } else { @@ -7426,7 +7428,7 @@ namespace PlantChillers { // if the component control is SERIESACTIVE we set the component flow to inlet flow so that // flow resolver will not shut down the branch if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Locked) { this->EvapMassFlowRate = state.dataLoopNodes->Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -7557,7 +7559,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; @@ -7572,7 +7574,7 @@ namespace PlantChillers { state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); this->Power = std::abs(MyLoad) / COP; @@ -7605,10 +7607,10 @@ namespace PlantChillers { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = std::abs(state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint); - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = std::abs(state.dataLoopNodes->Node(this->EvapInletNodeNum).Temp - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi); } @@ -7631,9 +7633,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -7885,7 +7887,7 @@ namespace PlantChillers { this->setupOutputVariables(state); PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, @@ -7899,7 +7901,7 @@ namespace PlantChillers { if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->plantTypeOfNum, + this->ChillerType, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, @@ -7911,7 +7913,7 @@ namespace PlantChillers { this->CondInletNodeNum, _); PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->ChillerType, true); } if (errFlag) { diff --git a/src/EnergyPlus/PlantChillers.hh b/src/EnergyPlus/PlantChillers.hh index f7322c6bc78..96edaca3b7b 100644 --- a/src/EnergyPlus/PlantChillers.hh +++ b/src/EnergyPlus/PlantChillers.hh @@ -145,7 +145,7 @@ namespace PlantChillers { Real64 CondInletTemp; Real64 EvapInletTemp; Real64 BasinHeaterConsumption; // Basin heater energy consumption (J) - int plantTypeOfNum; + DataPlant::PlantEquipmentType ChillerType; // Default Constructor BaseChillerSpecs() @@ -170,7 +170,7 @@ namespace PlantChillers { HeatRecOutletTemp(0.0), // C - Heat Rec outlet temperature, water side AvgCondSinkTemp(0.0), // condenser temperature value for use in curves [C] BasinHeaterPower(0.0), // Basin heater power (W) - Power(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), BasinHeaterConsumption(0.0), plantTypeOfNum(0) + Power(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), BasinHeaterConsumption(0.0), ChillerType(DataPlant::PlantEquipmentType::Invalid) { } diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index b9642451911..5a3046c8ffa 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -438,7 +438,7 @@ namespace PlantComponentTemperatureSources { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_WaterSource, + DataPlant::PlantEquipmentType::WaterSource, this->Location.loopNum, this->Location.loopSideNum, this->Location.branchNum, diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index d7d93efbeff..f84d1df6a72 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -143,7 +143,6 @@ void ManagePlantLoadDistribution(EnergyPlusData &state, int ListPtr; // !set by PL()%LoopSide()%Branch()%Comp()%OpScheme(CurCompLevelOpNum)%EquipList(CurListNum)ListPtr // used to locate data in PL()%OpScheme(CurSchemePtr)%EquipList(ListPtr) // Local values from the PlantLoop()%OpScheme() data structure - int CurSchemeType; // identifier set in PlantData Real64 RangeVariable(0.0); // holds the 'loop demand', wetbulb temp, etc. Real64 TestRangeVariable; // abs of RangeVariable for logic tests etc. Real64 RangeHiLimit; // upper limit of the range variable @@ -151,7 +150,6 @@ void ManagePlantLoadDistribution(EnergyPlusData &state, // Local values from the PlantLoop()%LoopSide()%Branch()%Comp() data structure int NumEquipLists; // number of equipment lists // Error control flags - bool foundlist; // equipment list found int NumCompsOnList; int CompIndex; int EquipBranchNum; @@ -184,18 +182,24 @@ void ManagePlantLoadDistribution(EnergyPlusData &state, // set local variables from data structure NumEquipLists = this_component.OpScheme(CurCompLevelOpNum).NumEquipLists; CurSchemePtr = this_component.OpScheme(CurCompLevelOpNum).OpSchemePtr; - CurSchemeType = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).OpSchemeType; + DataPlant::OpScheme CurSchemeType = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).Type; // another reference auto &this_op_scheme(state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr)); // Load the 'range variable' according to the type of control scheme specified - if ((CurSchemeType == UncontrolledOpSchemeType) || (CurSchemeType == CompSetPtBasedSchemeType)) { + switch (CurSchemeType) { + case (OpScheme::Uncontrolled): + case (OpScheme::CompSetPtBased): { // No RangeVariable specified for these types - } else if (CurSchemeType == EMSOpSchemeType) { + break; + } + case (OpScheme::EMS): { InitLoadDistribution(state, FirstHVACIteration); // No RangeVariable specified for these types - } else if (CurSchemeType == HeatingRBOpSchemeType) { + break; + } + case (OpScheme::HeatingRB): { // For zero demand, we need to clean things out before we leave if (LoopDemand < SmallLoad) { InitLoadDistribution(state, FirstHVACIteration); @@ -204,7 +208,9 @@ void ManagePlantLoadDistribution(EnergyPlusData &state, return; } RangeVariable = LoopDemand; - } else if (CurSchemeType == CoolingRBOpSchemeType) { + break; + } + case (OpScheme::CoolingRB): { // For zero demand, we need to clean things out before we leave if (LoopDemand > (-1.0 * SmallLoad)) { InitLoadDistribution(state, FirstHVACIteration); @@ -213,38 +219,57 @@ void ManagePlantLoadDistribution(EnergyPlusData &state, return; } RangeVariable = LoopDemand; - } else if (CurSchemeType == DryBulbRBOpSchemeType) { + break; + } + case (OpScheme::DryBulbRB): { RangeVariable = state.dataEnvrn->OutDryBulbTemp; - } else if (CurSchemeType == WetBulbRBOpSchemeType) { + break; + } + case (OpScheme::WetBulbRB): { RangeVariable = state.dataEnvrn->OutWetBulbTemp; - } else if (CurSchemeType == RelHumRBOpSchemeType) { + break; + } + case (OpScheme::RelHumRB): { RangeVariable = state.dataEnvrn->OutRelHum; - } else if (CurSchemeType == DewPointRBOpSchemeType) { + break; + } + case (OpScheme::DewPointRB): { RangeVariable = state.dataEnvrn->OutDewPointTemp; - } else if ((CurSchemeType == DryBulbTDBOpSchemeType) || (CurSchemeType == WetBulbTDBOpSchemeType) || (CurSchemeType == DewPointTDBOpSchemeType)) { + break; + } + case (OpScheme::DryBulbTDB): + case (OpScheme::WetBulbTDB): + case (OpScheme::DewPointTDB): { RangeVariable = FindRangeVariable(state, LoopNum, CurSchemePtr, CurSchemeType); - } else { + break; + } + default: { // No controls specified. This is a fatal error ShowFatalError(state, "Invalid Operation Scheme Type Requested=" + state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).TypeOf + ", in ManagePlantLoadDistribution"); } + } - // Find the proper list within the specified scheme - foundlist = false; - if (CurSchemeType == UncontrolledOpSchemeType) { + switch (CurSchemeType) { + case (OpScheme::Uncontrolled): { //!***what else do we do with 'uncontrolled' equipment? // There's an equipment list...but I think the idea is to just // Set one component to run in an 'uncontrolled' way (whatever that means!) - - } else if (CurSchemeType == CompSetPtBasedSchemeType) { + break; + } + case (OpScheme::CompSetPtBased): { // check for EMS Control TurnOnPlantLoopPipes(state, LoopNum, LoopSideNum); FindCompSPLoad(state, LoopNum, LoopSideNum, BranchNum, CompNum, CurCompLevelOpNum); - } else if (CurSchemeType == EMSOpSchemeType) { + break; + } + case (OpScheme::EMS): { TurnOnPlantLoopPipes(state, LoopNum, LoopSideNum); DistributeUserDefinedPlantLoad(state, LoopNum, LoopSideNum, BranchNum, CompNum, CurCompLevelOpNum, CurSchemePtr, LoopDemand, RemLoopDemand); - } else { // it's a range based control type with multiple equipment lists + break; + } + default: { // it's a range based control type with multiple equipment lists CurListNum = 0; for (ListNum = 1; ListNum <= NumEquipLists; ++ListNum) { // setpointers to 'PlantLoop()%OpScheme()...'structure @@ -289,6 +314,7 @@ void ManagePlantLoadDistribution(EnergyPlusData &state, } } // End of range based schemes + } } // Beginning of GetInput subroutines for the Module @@ -392,33 +418,33 @@ void GetPlantOperationInput(EnergyPlusData &state, bool &GetInputOK) auto const plantLoopOperation(state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).TypeOf); if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:COOLINGLOAD") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = CoolingRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::CoolingRB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:HEATINGLOAD") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = HeatingRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::HeatingRB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:COMPONENTSETPOINT") { //* Temp Based Control - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = CompSetPtBasedSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::CompSetPtBased; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:THERMALENERGYSTORAGE") { //* Simple TES Control - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = - CompSetPtBasedSchemeType; // set this to component based as it will be converted to this + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = + OpScheme::CompSetPtBased; // set this to component based as it will be converted to this } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:USERDEFINED") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = EMSOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::EMS; state.dataPlnt->AnyEMSPlantOpSchemesInModel = true; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDRYBULB") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DryBulbRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::DryBulbRB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORWETBULB") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = WetBulbRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::WetBulbRB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDEWPOINT") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DewPointRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::DewPointRB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORRELATIVEHUMIDITY") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = RelHumRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::RelHumRB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDRYBULBDIFFERENCE") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DryBulbTDBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::DryBulbTDB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORWETBULBDIFFERENCE") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = WetBulbTDBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::WetBulbTDB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDEWPOINTDIFFERENCE") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DewPointTDBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::DewPointTDB; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:UNCONTROLLED") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = UncontrolledOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Type = OpScheme::Uncontrolled; } else { // invalid op scheme type for plant loop ShowSevereError(state, std::string{RoutineName} + "Invalid " + state.dataIPShortCut->cAlphaFieldNames(Num * 3 - 1) + '=' + @@ -1311,7 +1337,7 @@ void FindCompSPInput(EnergyPlusData &state, Real64 OffPeakCHWTemp; int CompNumA; int CompNumN; - iCtrlType CompOpType; // 1=cooling, 2=dual(or other) + CtrlType CompOpType; // 1=cooling, 2=dual(or other) SchemeNameFound = true; @@ -1425,7 +1451,7 @@ void FindCompSPInput(EnergyPlusData &state, { auto const controlType(state.dataIPShortCut->cAlphaArgs(CompNumA + 1)); if (controlType == "COOLING") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::CoolingOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType = CtrlType::CoolingOp; } else if (controlType == "HEATING") { if (CurrentModuleObject == "PlantEquipmentOperation:ThermalEnergyStorage") { ShowSevereError(state, @@ -1433,9 +1459,9 @@ void FindCompSPInput(EnergyPlusData &state, state.dataIPShortCut->cAlphaArgs(1) + " in thermal energy storage control"); ErrorsFound = true; } - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::HeatingOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType = CtrlType::HeatingOp; } else if (controlType == "DUAL") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::DualOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType = CtrlType::DualOp; } } @@ -1461,19 +1487,19 @@ void FindCompSPInput(EnergyPlusData &state, "Equipment Operation Mode can only be 'DUAL' for " + state.dataIPShortCut->cAlphaArgs(CompNumA - 3) + " objects."); - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::DualOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType = CtrlType::DualOp; } // This block forces CompOpType to be either Cooling if explicitly provided, all other cases = Dual - switch (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum) { - case iCtrlType::DualOp: - CompOpType = iCtrlType::CoolingOp; + switch (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType) { + case CtrlType::DualOp: + CompOpType = CtrlType::CoolingOp; break; - case iCtrlType::CoolingOp: - CompOpType = iCtrlType::HeatingOp; + case CtrlType::CoolingOp: + CompOpType = CtrlType::HeatingOp; break; - case iCtrlType::HeatingOp: - CompOpType = iCtrlType::CoolingOp; + case CtrlType::HeatingOp: + CompOpType = CtrlType::CoolingOp; break; default: assert(false); @@ -1494,7 +1520,7 @@ void FindCompSPInput(EnergyPlusData &state, // check that setpoint node has valid setpoint managers or EMS { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { if (state.dataLoopNodes ->Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum) .TempSetPoint == SensedNodeFlagValue) { @@ -1544,9 +1570,8 @@ void FindCompSPInput(EnergyPlusData &state, } } } - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == - iCtrlType::CoolingOp) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType == CtrlType::CoolingOp) { if (state.dataLoopNodes ->Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum) .TempSetPointHi == SensedNodeFlagValue) { @@ -1600,8 +1625,8 @@ void FindCompSPInput(EnergyPlusData &state, } } } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == - iCtrlType::HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType == + CtrlType::HeatingOp) { if (state.dataLoopNodes ->Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum) .TempSetPointLo == SensedNodeFlagValue) { @@ -1659,8 +1684,8 @@ void FindCompSPInput(EnergyPlusData &state, } } } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == - iCtrlType::DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType == + CtrlType::DualOp) { if ((state.dataLoopNodes ->Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum) .TempSetPointHi == SensedNodeFlagValue) || @@ -1913,13 +1938,12 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) int Index; int OpSchemePtr; int thisSchemeNum; - int SchemeType; bool FoundScheme; bool FoundSchemeMatch; // LOGICAL, SAVE :: FirstHVACInitsDone = .FALSE. // LOGICAL, SAVE :: MyEnvrnFlag = .TRUE. - int ThisTypeOfNum; + DataPlant::PlantEquipmentType Type; int CompOpNum; int OldNumOpSchemes; int NewNumEquipLists; @@ -1960,11 +1984,12 @@ 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)); - ThisTypeOfNum = UtilityRoutines::FindItem(this_equip.TypeOf, SimPlantEquipTypes, NumSimPlantEquipTypes); + Type = static_cast( + getEnumerationValue(PlantEquipTypeNamesUC, UtilityRoutines::MakeUPPERCase(this_equip.TypeOf))); errFlag1 = false; PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, - ThisTypeOfNum, + Type, DummyLoopNum, LoopSideNum, BranchNum, @@ -1989,27 +2014,29 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) this_equip.BranchNumPtr = BranchNum; this_equip.CompNumPtr = CompNum; - if (ValidLoopEquipTypes(ThisTypeOfNum) == LoopType::Plant && this_plant_loop.TypeOfLoop == LoopType::Condenser) { + if (ValidLoopEquipTypes[static_cast(Type)] == LoopType::Plant && this_plant_loop.TypeOfLoop == LoopType::Condenser) { ShowSevereError(state, "InitLoadDistribution: CondenserLoop=\"" + this_plant_loop.Name + "\", Operation Scheme=\"" + this_plant_loop.OperationScheme + "\","); ShowContinueError(state, "Scheme type=" + this_op_scheme.TypeOf + ", Name=\"" + this_op_scheme.Name + "\" includes equipment that is not valid on a Condenser Loop"); - ShowContinueError( - state, "Component " + ccSimPlantEquipTypes(ThisTypeOfNum) + " not allowed as supply equipment on this type of loop."); + ShowContinueError(state, + format("Component {} not allowed as supply equipment on this type of loop.", + PlantEquipTypeNames[static_cast(Type)])); ShowContinueError(state, "Component name = " + this_equip.Name); errFlag2 = true; } - if (ValidLoopEquipTypes(ThisTypeOfNum) == LoopType::Condenser && this_plant_loop.TypeOfLoop == LoopType::Plant) { + if (ValidLoopEquipTypes[static_cast(Type)] == LoopType::Condenser && this_plant_loop.TypeOfLoop == LoopType::Plant) { ShowSevereError(state, "InitLoadDistribution: PlantLoop=\"" + this_plant_loop.Name + "\", Operation Scheme=\"" + this_plant_loop.OperationScheme + "\","); ShowContinueError(state, "Scheme type=" + this_op_scheme.TypeOf + ", Name=\"" + this_op_scheme.Name + "\" includes equipment that is not valid on a Plant Loop"); - ShowContinueError( - state, "Component " + ccSimPlantEquipTypes(ThisTypeOfNum) + " not allowed as supply equipment on this type of loop."); + ShowContinueError(state, + format("Component {} not allowed as supply equipment on this type of loop.", + PlantEquipTypeNames[static_cast(Type)])); ShowContinueError(state, "Component name = " + this_equip.Name); errFlag2 = true; } @@ -2102,10 +2129,11 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) ShowContinueError(state, "Component name = " + this_component.Name); errFlag2 = true; } + DataPlant::OpScheme SchemeType{}; if (Index == 1) { - SchemeType = this_plant_loop.OpScheme(OpSchemePtr).OpSchemeType; + SchemeType = this_plant_loop.OpScheme(OpSchemePtr).Type; } else { - if (SchemeType != this_plant_loop.OpScheme(OpSchemePtr).OpSchemeType) { + if (SchemeType != this_plant_loop.OpScheme(OpSchemePtr).Type) { // CALL FATAL ERROR 'component may not be specified on two types of operation schemes // Cannot different op schemes be in effect at different times? // I thought this would be allowed?? @@ -2124,7 +2152,7 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); // skip non-load based op schemes - if ((this_op_scheme.OpSchemeType != HeatingRBOpSchemeType) && (this_op_scheme.OpSchemeType != CoolingRBOpSchemeType)) continue; + if ((this_op_scheme.Type != OpScheme::HeatingRB) && (this_op_scheme.Type != OpScheme::CoolingRB)) continue; HighestRange = 0.0; for (int ListNum = 1, ListNum_end = this_op_scheme.NumEquipLists; ListNum <= ListNum_end; ++ListNum) { HighestRange = max(HighestRange, this_op_scheme.EquipList(ListNum).RangeUpperLimit); @@ -2145,7 +2173,7 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); - if (this_op_scheme.OpSchemeType == EMSOpSchemeType) { + if (this_op_scheme.Type == OpScheme::EMS) { if (state.dataGlobal->BeginEnvrnFlag && this_op_scheme.MyEnvrnFlag) { if (this_op_scheme.ErlInitProgramMngr > 0) { bool anyEMSRan; @@ -2177,9 +2205,9 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) this_component.MyLoad = 0.0; this_component.EMSLoadOverrideOn = false; // Zero out the old curOpSchemePtr so that we don't get 'carry-over' when we update schedules - if (this_component.CurOpSchemeType != DemandOpSchemeType && this_component.CurOpSchemeType != PumpOpSchemeType && - this_component.CurOpSchemeType != WSEconOpSchemeType && this_component.CurOpSchemeType != NoControlOpSchemeType) { - this_component.CurOpSchemeType = NoControlOpSchemeType; + if (this_component.CurOpSchemeType != OpScheme::Demand && this_component.CurOpSchemeType != OpScheme::Pump && + this_component.CurOpSchemeType != OpScheme::WSEcon && this_component.CurOpSchemeType != OpScheme::NoControl) { + this_component.CurOpSchemeType = OpScheme::NoControl; } this_component.CurCompLevelOpNum = 0; } @@ -2214,8 +2242,8 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) // then set up a reference to the component on the plant data structure auto &this_loop_component(state.dataPlnt->PlantLoop(LoopPtr).LoopSide(LoopSidePtr).Branch(BranchPtr).Comp(CompPtr)); - if (this_loop_component.CurOpSchemeType != PumpOpSchemeType) { - this_loop_component.CurOpSchemeType = this_op_scheme.OpSchemeType; + if (this_loop_component.CurOpSchemeType != OpScheme::Pump) { + this_loop_component.CurOpSchemeType = this_op_scheme.Type; } else { ShowSevereError(state, "Invalid [pump] component found on equipment list. Pumps are not allowed on equipment lists."); @@ -2340,7 +2368,7 @@ void DistributePlantLoad(EnergyPlusData &state, // OPTIMAL DISTRIBUTION SCHEME switch (this_loop.LoadDistribution) { - case DataPlant::iLoadingScheme::Optimal: + case DataPlant::LoadingScheme::Optimal: // step 1: load all machines to optimal PLR numAvail = 0; for (CompIndex = 1; CompIndex <= NumCompsOnList; ++CompIndex) { @@ -2423,7 +2451,7 @@ void DistributePlantLoad(EnergyPlusData &state, break; // SEQUENTIALLOAD DISTRIBUTION SCHEME - case DataPlant::iLoadingScheme::Sequential: + case DataPlant::LoadingScheme::Sequential: // step 1: Load machines in list order for (CompIndex = 1; CompIndex <= NumCompsOnList; ++CompIndex) { @@ -2458,7 +2486,7 @@ void DistributePlantLoad(EnergyPlusData &state, break; // UNIFORMLOAD DISTRIBUTION SCHEME - case DataPlant::iLoadingScheme::Uniform: + case DataPlant::LoadingScheme::Uniform: // step 1: distribute load equally to all available machines numAvail = 0; @@ -2526,7 +2554,7 @@ void DistributePlantLoad(EnergyPlusData &state, break; // UNIFORMPLR LOAD DISTRIBUTION SCHEME - case DataPlant::iLoadingScheme::UniformPLR: + case DataPlant::LoadingScheme::UniformPLR: // Get total plant capacity and remove last component from list if load is less // than plant capacity at min PLR PlantCapacity = 0.0; @@ -2630,7 +2658,7 @@ void DistributePlantLoad(EnergyPlusData &state, break; // SEQUENTIALUNIFORMPLR LOAD DISTRIBUTION SCHEME - case DataPlant::iLoadingScheme::SequentialUniformPLR: + case DataPlant::LoadingScheme::SequentialUniformPLR: PlantCapacity = 0.0; PlantPLR = 0.0; @@ -2845,11 +2873,11 @@ void AdjustChangeInLoadByHowServed(EnergyPlusData &state, TinLowLimit = this_component.FreeCoolCntrlMinCntrlTemp; { auto const SELECT_CASE_var1(this_component.FreeCoolCntrlMode); - if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::WetBulb) { + if (SELECT_CASE_var1 == DataPlant::FreeCoolControlMode::WetBulb) { Tsensor = state.dataEnvrn->OutWetBulbTemp; - } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::DryBulb) { + } else if (SELECT_CASE_var1 == DataPlant::FreeCoolControlMode::DryBulb) { Tsensor = state.dataEnvrn->OutDryBulbTemp; - } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::Loop) { + } else if (SELECT_CASE_var1 == DataPlant::FreeCoolControlMode::Loop) { ControlNodeNum = this_component.FreeCoolCntrlNodeNum; if (ControlNodeNum > 0) { Tsensor = state.dataLoopNodes->Node(ControlNodeNum).TempLastTimestep; // use lagged value for stability @@ -2874,11 +2902,11 @@ void AdjustChangeInLoadByHowServed(EnergyPlusData &state, TinLowLimit = this_component.FreeCoolCntrlMinCntrlTemp; { auto const SELECT_CASE_var1(this_component.FreeCoolCntrlMode); - if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::WetBulb) { + if (SELECT_CASE_var1 == DataPlant::FreeCoolControlMode::WetBulb) { Tsensor = state.dataEnvrn->OutWetBulbTemp; - } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::DryBulb) { + } else if (SELECT_CASE_var1 == DataPlant::FreeCoolControlMode::DryBulb) { Tsensor = state.dataEnvrn->OutDryBulbTemp; - } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::Loop) { + } else if (SELECT_CASE_var1 == DataPlant::FreeCoolControlMode::Loop) { ControlNodeNum = this_component.FreeCoolCntrlNodeNum; if (ControlNodeNum > 0) { Tsensor = state.dataLoopNodes->Node(ControlNodeNum).TempLastTimestep; // use lagged value for stability @@ -3011,15 +3039,14 @@ void FindCompSPLoad(EnergyPlusData &state, { auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { TempSetPt = state.dataLoopNodes->Node(SetPtNode).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::CoolingOp) { + } else if (SELECT_CASE_var == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlType == CtrlType::CoolingOp) { TempSetPt = state.dataLoopNodes->Node(SetPtNode).TempSetPointHi; - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == - iCtrlType::HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlType == CtrlType::HeatingOp) { TempSetPt = state.dataLoopNodes->Node(SetPtNode).TempSetPointLo; - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlType == CtrlType::DualOp) { CurrentDemandForCoolingOp = DemandMdot * CurSpecHeat * (state.dataLoopNodes->Node(SetPtNode).TempSetPointHi - TempIn); CurrentDemandForHeatingOp = DemandMdot * CurSpecHeat * (state.dataLoopNodes->Node(SetPtNode).TempSetPointLo - TempIn); if ((CurrentDemandForCoolingOp < 0.0) && (CurrentDemandForHeatingOp <= 0.0)) { // cooling @@ -3049,7 +3076,7 @@ void FindCompSPLoad(EnergyPlusData &state, this_component.EquipDemand = CompDemand; // set MyLoad and runflag - if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::CoolingOp) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlType == CtrlType::CoolingOp) { if (CompDemand < (-LoopDemandTol)) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -3057,7 +3084,7 @@ void FindCompSPLoad(EnergyPlusData &state, this_component.ON = false; this_component.MyLoad = 0.0; } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlType == CtrlType::HeatingOp) { if (CompDemand > LoopDemandTol) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -3065,7 +3092,7 @@ void FindCompSPLoad(EnergyPlusData &state, this_component.ON = false; this_component.MyLoad = 0.0; } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlType == CtrlType::DualOp) { if (CompDemand > LoopDemandTol || CompDemand < (-LoopDemandTol)) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -3173,9 +3200,9 @@ void DistributeUserDefinedPlantLoad(EnergyPlusData &state, //******************************** Real64 FindRangeVariable(EnergyPlusData &state, - int const LoopNum, // PlantLoop data structure loop counter - int const CurSchemePtr, // set by PL()%LoopSide()%Branch()%Comp()%OpScheme()%OpSchemePtr - int const CurSchemeType // identifier set in PlantData + int const LoopNum, // PlantLoop data structure loop counter + int const CurSchemePtr, // set by PL()%LoopSide()%Branch()%Comp()%OpScheme()%OpSchemePtr + DataPlant::OpScheme CurSchemeType // identifier set in PlantData ) { @@ -3206,20 +3233,29 @@ Real64 FindRangeVariable(EnergyPlusData &state, int ReferenceNodeNum; Real64 NodeTemperature; - if (CurSchemeType == DryBulbTDBOpSchemeType) { // drybulb temp based controls + switch (CurSchemeType) { + case (OpScheme::DryBulbTDB): { // drybulb temp based controls ReferenceNodeNum = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; NodeTemperature = state.dataLoopNodes->Node(ReferenceNodeNum).Temp; FindRangeVariable = NodeTemperature - state.dataEnvrn->OutDryBulbTemp; - } else if (CurSchemeType == WetBulbTDBOpSchemeType) { // wetbulb temp based controls + break; + } + case (OpScheme::WetBulbTDB): { // wetbulb temp based controls ReferenceNodeNum = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; NodeTemperature = state.dataLoopNodes->Node(ReferenceNodeNum).Temp; FindRangeVariable = NodeTemperature - state.dataEnvrn->OutWetBulbTemp; - } else if (CurSchemeType == DewPointTDBOpSchemeType) { // dewpoint temp based controls + break; + } + case (OpScheme::DewPointTDB): { // dewpoint temp based controls ReferenceNodeNum = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; NodeTemperature = state.dataLoopNodes->Node(ReferenceNodeNum).Temp; FindRangeVariable = NodeTemperature - state.dataEnvrn->OutDewPointTemp; - } else { + break; + } + default: { assert(false); + break; + } } // OperationScheme return FindRangeVariable; @@ -3265,9 +3301,10 @@ void TurnOnPlantLoopPipes(EnergyPlusData &state, int const LoopNum, int const Lo for (MachineOnLoopNum = 1; MachineOnLoopNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnLoopNum) { { - auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnLoopNum).TypeOf_Num); - if ((SELECT_CASE_var == TypeOf_Pipe) || (SELECT_CASE_var == TypeOf_PipeInterior) || (SELECT_CASE_var == TypeOf_PipeExterior) || - (SELECT_CASE_var == TypeOf_PipeUnderground)) { + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnLoopNum).Type); + if ((SELECT_CASE_var == DataPlant::PlantEquipmentType::Pipe) || (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeInterior) || + (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeExterior) || + (SELECT_CASE_var == DataPlant::PlantEquipmentType::PipeUnderground)) { state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnLoopNum).ON = true; } else { // Don't do anything @@ -3312,7 +3349,8 @@ void TurnOffLoopEquipment(EnergyPlusData &state, int const LoopNum) for (MachineOnBranch = 1; MachineOnBranch <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnBranch) { // Sankar Non Integrated Economizer - if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).isPump()) { + if (!DataPlant::PlantEquipmentTypeIsPump[static_cast( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).Type)]) { state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).ON = false; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).MyLoad = 0.0; } @@ -3354,7 +3392,8 @@ void TurnOffLoopSideEquipment(EnergyPlusData &state, int const LoopNum, int cons for (MachineOnBranch = 1; MachineOnBranch <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnBranch) { // Sankar Non Integrated Economizer - if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).isPump()) { + if (!DataPlant::PlantEquipmentTypeIsPump[static_cast( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).Type)]) { state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).ON = false; state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).MyLoad = 0.0; } @@ -3454,9 +3493,9 @@ void SetupPlantEMSActuators(EnergyPlusData &state) state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideValue); } for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).TotalComponents; ++CompNum) { - ActuatorName = - "Plant Component " + - ccSimPlantEquipTypes(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).TypeOf_Num); + ActuatorName = format("Plant Component {}", + PlantEquipTypeNames[static_cast( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).Type)]); UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).Name; ActuatorType = "On/Off Supervisory"; SetupEMSActuator(state, @@ -3563,9 +3602,10 @@ void ActivateEMSControls( // Check lower/upper temperature limit for chillers { - auto const SELECT_CASE_var(this_comp.TypeOf_Num); - if ((SELECT_CASE_var == TypeOf_Chiller_ElectricEIR) || (SELECT_CASE_var == TypeOf_Chiller_Electric) || - (SELECT_CASE_var == TypeOf_Chiller_ElectricReformEIR)) { + auto const SELECT_CASE_var(this_comp.Type); + if ((SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricEIR) || + (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_Electric) || + (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR)) { //- Retrieve data from the plant loop data structure CurMassFlowRate = state.dataLoopNodes->Node(this_comp.NodeNumIn).MassFlowRate; diff --git a/src/EnergyPlus/PlantCondLoopOperation.hh b/src/EnergyPlus/PlantCondLoopOperation.hh index ae6e9d2327f..647cdc3febb 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.hh +++ b/src/EnergyPlus/PlantCondLoopOperation.hh @@ -157,9 +157,9 @@ namespace PlantCondLoopOperation { Real64 &RemLoopDemand); Real64 FindRangeVariable(EnergyPlusData &state, - int const LoopNum, // PlantLoop data structure loop counter - int const CurSchemePtr, // set by PL()%LoopSide()%Branch()%Comp()%OpScheme()%OpSchemePtr - int const CurSchemeType // identifier set in PlantData + int const LoopNum, // PlantLoop data structure loop counter + int const CurSchemePtr, // set by PL()%LoopSide()%Branch()%Comp()%OpScheme()%OpSchemePtr + DataPlant::OpScheme CurSchemeType // identifier set in PlantData ); void TurnOnPlantLoopPipes(EnergyPlusData &state, int const LoopNum, int const LoopSideNum); diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index 825711672b2..3ee7d51c3d2 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -857,11 +857,11 @@ void HeatExchangerStruct::size(EnergyPlusData &state) } else { // don't rely on sizing, use loop setpoints // loop supply side - if (state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { state.dataLoopNodes->Node(this->SupplySideLoop.inletNodeNum).Temp = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; } else if (state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == - DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { state.dataLoopNodes->Node(this->SupplySideLoop.inletNodeNum).Temp = (state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / @@ -873,11 +873,11 @@ void HeatExchangerStruct::size(EnergyPlusData &state) state.dataLoopNodes->Node(this->DemandSideLoop.inletNodeNum).Temp = state.dataSize->PlantSizData(PltSizNumDmdSide).ExitTemp; } else { // don't rely on sizing, use loop setpoints // loop demand side - if (state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { state.dataLoopNodes->Node(this->DemandSideLoop.inletNodeNum).Temp = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; } else if (state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == - DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { state.dataLoopNodes->Node(this->DemandSideLoop.inletNodeNum).Temp = (state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / @@ -2266,7 +2266,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_FluidToFluidPlantHtExchg, + DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg, this->DemandSideLoop.loopNum, this->DemandSideLoop.loopSideNum, this->DemandSideLoop.branchNum, @@ -2282,7 +2282,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) ShowSevereError(state, format("{} Invalid connections for {} name = \"{}\"", RoutineName, - DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg), + DataPlant::PlantEquipTypeNames[static_cast(DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg)], this->Name)); ShowContinueError(state, "The \"Loop Demand Side\" connections are not on the Demand Side of a plant loop"); errFlag = true; @@ -2290,7 +2290,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_FluidToFluidPlantHtExchg, + DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg, this->SupplySideLoop.loopNum, this->SupplySideLoop.loopSideNum, this->SupplySideLoop.branchNum, @@ -2306,7 +2306,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) ShowSevereError(state, format("{} Invalid connections for {} name = \"{}\"", RoutineName, - DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg), + DataPlant::PlantEquipTypeNames[static_cast(DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg)], this->Name)); ShowContinueError(state, "The \"Loop Supply Side\" connections are not on the Supply Side of a plant loop"); errFlag = true; @@ -2317,7 +2317,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) ShowSevereError(state, format("{} Invalid connections for {} name = \"{}\"", RoutineName, - DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg), + DataPlant::PlantEquipTypeNames[static_cast(DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg)], this->Name)); ShowContinueError(state, R"(The "Loop Supply Side" and "Loop Demand Side" need to be on different loops.)"); errFlag = true; @@ -2328,7 +2328,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) this->SupplySideLoop.loopSideNum, this->DemandSideLoop.loopNum, this->DemandSideLoop.loopSideNum, - DataPlant::TypeOf_FluidToFluidPlantHtExchg, + DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg, true); } @@ -2374,13 +2374,13 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) auto const SELECT_CASE_var(this->ControlSignalTemp); if (SELECT_CASE_var == iCtrlTemp::WetBulbTemperature) { state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::iFreeCoolControlMode::WetBulb; + DataPlant::FreeCoolControlMode::WetBulb; } else if (SELECT_CASE_var == iCtrlTemp::DryBulbTemperature) { state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::iFreeCoolControlMode::DryBulb; + DataPlant::FreeCoolControlMode::DryBulb; } else if (SELECT_CASE_var == iCtrlTemp::LoopTemperature) { state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::iFreeCoolControlMode::Loop; + DataPlant::FreeCoolControlMode::Loop; state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlNodeNum = this->OtherCompDemandSideLoop.inletNodeNum; } @@ -2390,7 +2390,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) if (this->OtherCompSupplySideLoop.inletNodeNum > 0) { PlantUtilities::ScanPlantLoopsForObject(state, this->ComponentUserName, - this->ComponentTypeOfNum, + this->ComponentType, this->OtherCompSupplySideLoop.loopNum, this->OtherCompSupplySideLoop.loopSideNum, this->OtherCompSupplySideLoop.branchNum, @@ -2405,7 +2405,7 @@ void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) if (this->OtherCompDemandSideLoop.inletNodeNum > 0) { PlantUtilities::ScanPlantLoopsForObject(state, this->ComponentUserName, - this->ComponentTypeOfNum, + this->ComponentType, this->OtherCompDemandSideLoop.loopNum, this->OtherCompDemandSideLoop.loopSideNum, this->OtherCompDemandSideLoop.branchNum, diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh index 2cc27dbd3c7..9229fbac3f2 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh @@ -163,7 +163,7 @@ namespace PlantHeatExchangerFluidToFluid { PlantConnectionStruct SupplySideLoop; std::string HeatTransferMeteringEndUse; std::string ComponentUserName; // user name for control-associated component - int ComponentTypeOfNum; + DataPlant::PlantEquipmentType ComponentType; PlantLocatorStruct OtherCompSupplySideLoop; PlantLocatorStruct OtherCompDemandSideLoop; Real64 SizingFactor; @@ -183,9 +183,10 @@ namespace PlantHeatExchangerFluidToFluid { HeatExchangerStruct() : AvailSchedNum(0), HeatExchangeModelType(iFluidHXType::Unassigned), UA(0.0), UAWasAutoSized(false), ControlMode(iCtrlType::Unassigned), SetPointNodeNum(0), TempControlTol(0.0), ControlSignalTemp(iCtrlTemp::Unassigned), MinOperationTemp(-99999.0), - MaxOperationTemp(99999.0), ComponentTypeOfNum(0), SizingFactor(1.0), HeatTransferRate(0.0), HeatTransferEnergy(0.0), Effectiveness(0.0), - OperationStatus(0.0), DmdSideModulatSolvNoConvergeErrorCount(0), DmdSideModulatSolvNoConvergeErrorIndex(0), - DmdSideModulatSolvFailErrorCount(0), DmdSideModulatSolvFailErrorIndex(0), MyOneTimeFlag(true), MyFlag(true), MyEnvrnFlag(true) + MaxOperationTemp(99999.0), ComponentType(DataPlant::PlantEquipmentType::Invalid), SizingFactor(1.0), HeatTransferRate(0.0), + HeatTransferEnergy(0.0), Effectiveness(0.0), OperationStatus(0.0), DmdSideModulatSolvNoConvergeErrorCount(0), + DmdSideModulatSolvNoConvergeErrorIndex(0), DmdSideModulatSolvFailErrorCount(0), DmdSideModulatSolvFailErrorIndex(0), + MyOneTimeFlag(true), MyFlag(true), MyEnvrnFlag(true) { } diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index 65d213ede61..2919fe65308 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -87,7 +87,7 @@ namespace EnergyPlus::PlantLoadProfile { // manager (see NonZoneEquipmentManager.cc). // Using/Aliasing -using DataPlant::TypeOf_PlantLoadProfile; + using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; @@ -301,7 +301,7 @@ void PlantProfileData::oneTimeInit_new(EnergyPlusData &state) if (allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject( - state, this->Name, this->TypeNum, this->WLoopNum, this->WLoopSideNum, this->WLoopBranchNum, this->WLoopCompNum, errFlag, _, _, _, _, _); + state, this->Name, this->Type, this->WLoopNum, this->WLoopSideNum, this->WLoopBranchNum, this->WLoopCompNum, errFlag, _, _, _, _, _); if (errFlag) { ShowFatalError(state, "InitPlantProfile: Program terminated for previous conditions."); } @@ -360,7 +360,8 @@ void GetPlantProfileInput(EnergyPlusData &state) UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); state.dataPlantLoadProfile->PlantProfile(ProfileNum).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataPlantLoadProfile->PlantProfile(ProfileNum).TypeNum = TypeOf_PlantLoadProfile; // parameter assigned in DataPlant + state.dataPlantLoadProfile->PlantProfile(ProfileNum).Type = + DataPlant::PlantEquipmentType::PlantLoadProfile; // parameter assigned in DataPlant state.dataPlantLoadProfile->PlantProfile(ProfileNum).InletNode = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), diff --git a/src/EnergyPlus/PlantLoadProfile.hh b/src/EnergyPlus/PlantLoadProfile.hh index 5a13b17feb6..cd538a2c96d 100644 --- a/src/EnergyPlus/PlantLoadProfile.hh +++ b/src/EnergyPlus/PlantLoadProfile.hh @@ -55,6 +55,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -69,14 +70,14 @@ namespace PlantLoadProfile { virtual ~PlantProfileData() = default; // Members - std::string Name; // Name of Plant Load Profile object - int TypeNum; // Plant Side Connection: 'TypeOf_Num' assigned in DataPlant - int WLoopNum; // water plant loop index number - int WLoopSideNum; // water plant loop side index - int WLoopBranchNum; // water plant loop branch index - int WLoopCompNum; // water plant loop component index - bool Init; // Flag for initialization: TRUE means do the init - bool InitSizing; // Flag for initialization of plant sizing + std::string Name; // Name of Plant Load Profile object + DataPlant::PlantEquipmentType Type; // Plant Side Connection: 'Type' assigned in DataPlant + int WLoopNum; // water plant loop index number + int WLoopSideNum; // water plant loop side index + int WLoopBranchNum; // water plant loop branch index + int WLoopCompNum; // water plant loop component index + bool Init; // Flag for initialization: TRUE means do the init + bool InitSizing; // Flag for initialization of plant sizing int InletNode; Real64 InletTemp; // Inlet temperature (C) int OutletNode; @@ -98,10 +99,10 @@ namespace PlantLoadProfile { // Default Constructor PlantProfileData() - : TypeNum(0), WLoopNum(0), WLoopSideNum(0), WLoopBranchNum(0), WLoopCompNum(0), Init(true), InitSizing(true), InletNode(0), - InletTemp(0.0), OutletNode(0), OutletTemp(0.0), LoadSchedule(0), EMSOverridePower(false), EMSPowerValue(0.0), PeakVolFlowRate(0.0), - FlowRateFracSchedule(0), VolFlowRate(0.0), MassFlowRate(0.0), EMSOverrideMassFlow(false), EMSMassFlowValue(0.0), Power(0.0), - Energy(0.0), HeatingEnergy(0.0), CoolingEnergy(0.0) + : Type(DataPlant::PlantEquipmentType::Invalid), WLoopNum(0), WLoopSideNum(0), WLoopBranchNum(0), WLoopCompNum(0), Init(true), + InitSizing(true), InletNode(0), InletTemp(0.0), OutletNode(0), OutletTemp(0.0), LoadSchedule(0), EMSOverridePower(false), + EMSPowerValue(0.0), PeakVolFlowRate(0.0), FlowRateFracSchedule(0), VolFlowRate(0.0), MassFlowRate(0.0), EMSOverrideMassFlow(false), + EMSMassFlowValue(0.0), Power(0.0), Energy(0.0), HeatingEnergy(0.0), CoolingEnergy(0.0) { } diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 75abf2d0a49..cb0b60e16d9 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -91,7 +91,7 @@ void EIRPlantLoopHeatPump::simulate( PlantUtilities::UpdateChillerComponentCondenserSide(state, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, - this->plantTypeOfNum, + this->EIRHPType, this->sourceSideNodes.inlet, this->sourceSideNodes.outlet, this->sourceSideHeatTransfer, @@ -122,15 +122,15 @@ Real64 EIRPlantLoopHeatPump::getLoadSideOutletSetPointTemp(EnergyPlusData &state auto &thisLoadLoopSide = thisLoadPlantLoop.LoopSide(this->loadSideLocation.loopSideNum); auto &thisLoadBranch = thisLoadLoopSide.Branch(this->loadSideLocation.branchNum); auto &thisLoadComp = thisLoadBranch.Comp(this->loadSideLocation.compNum); - if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - if (thisLoadComp.CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { + if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::SingleSetPoint) { + if (thisLoadComp.CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) { // there will be a valid set-point on outlet return state.dataLoopNodes->Node(this->loadSideNodes.outlet).TempSetPoint; } else { // use plant loop overall set-point return state.dataLoopNodes->Node(thisLoadPlantLoop.TempSetPointNodeNum).TempSetPoint; } - } else if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (thisLoadComp.CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { + } else if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand) { + if (thisLoadComp.CurOpSchemeType == DataPlant::OpScheme::CompSetPtBased) { // there will be a valid set-point on outlet return state.dataLoopNodes->Node(this->loadSideNodes.outlet).TempSetPointHi; } else { // use plant loop overall set-point @@ -186,7 +186,7 @@ void EIRPlantLoopHeatPump::setOperatingFlowRatesWSHP(EnergyPlusData &state) this->condMassFlowRateTriggerIndex, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->sourceSideMassFlowRate); // Set flows if the heat pump is running } else { // the heat pump must run @@ -239,7 +239,7 @@ void EIRPlantLoopHeatPump::setOperatingFlowRatesWSHP(EnergyPlusData &state) this->condMassFlowRateTriggerIndex, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, this->sourceSideMassFlowRate); } } @@ -294,8 +294,8 @@ void EIRPlantLoopHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad) // ideally the plant is going to ensure that we don't have a runflag=true when the load is invalid, but // I'm not sure we can count on that so we will do one check here to make sure we don't calculate things badly - if ((this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRCooling && currentLoad >= 0.0) || - (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating && currentLoad <= 0.0)) { + if ((this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRCooling && currentLoad >= 0.0) || + (this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRHeating && currentLoad <= 0.0)) { this->resetReportingVariables(); return; } @@ -439,9 +439,9 @@ void EIRPlantLoopHeatPump::sizeLoadSide(EnergyPlusData &state) Real64 tmpCapacity = this->referenceCapacity; Real64 tmpLoadVolFlow = this->loadSideDesignVolFlowRate; - std::string const typeName = DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum); + std::string_view const typeName = DataPlant::PlantEquipTypeNames[static_cast(this->EIRHPType)]; Real64 loadSideInitTemp = DataGlobalConstants::CWInitConvTemp; - if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { + if (this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRHeating) { loadSideInitTemp = DataGlobalConstants::HWInitConvTemp; } @@ -620,9 +620,9 @@ void EIRPlantLoopHeatPump::sizeSrcSideWSHP(EnergyPlusData &state) Real64 tmpLoadVolFlow = this->loadSideDesignVolFlowRate; Real64 tmpSourceVolFlow; - std::string const typeName = DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum); + std::string_view const typeName = DataPlant::PlantEquipTypeNames[static_cast(this->EIRHPType)]; Real64 sourceSideInitTemp = DataGlobalConstants::HWInitConvTemp; - if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { + if (this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRHeating) { sourceSideInitTemp = DataGlobalConstants::CWInitConvTemp; } @@ -726,13 +726,11 @@ void EIRPlantLoopHeatPump::sizeSrcSideASHP(EnergyPlusData &state) Real64 tmpLoadVolFlow = this->loadSideDesignVolFlowRate; Real64 tmpSourceVolFlow = 0.0; - std::string const typeName = DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum); - // will leave like this for now // need to update these to better values later Real64 sourceSideInitTemp = 20; Real64 sourceSideHumRat = 0.0; - if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { + if (this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRHeating) { // same here; update later sourceSideInitTemp = 20; } @@ -780,7 +778,7 @@ void EIRPlantLoopHeatPump::sizeSrcSideASHP(EnergyPlusData &state) } } -PlantComponent *EIRPlantLoopHeatPump::factory(EnergyPlusData &state, int hp_type_of_num, const std::string &hp_name) +PlantComponent *EIRPlantLoopHeatPump::factory(EnergyPlusData &state, DataPlant::PlantEquipmentType hp_type_of_num, const std::string &hp_name) { if (state.dataEIRPlantLoopHeatPump->getInputsPLHP) { EIRPlantLoopHeatPump::processInputForEIRPLHP(state); @@ -789,7 +787,7 @@ PlantComponent *EIRPlantLoopHeatPump::factory(EnergyPlusData &state, int hp_type } for (auto &plhp : state.dataEIRPlantLoopHeatPump->heatPumps) { - if (plhp.name == UtilityRoutines::MakeUPPERCase(hp_name) && plhp.plantTypeOfNum == hp_type_of_num) { + if (plhp.name == UtilityRoutines::MakeUPPERCase(hp_name) && plhp.EIRHPType == hp_type_of_num) { return &plhp; } } @@ -803,10 +801,10 @@ void EIRPlantLoopHeatPump::pairUpCompanionCoils(EnergyPlusData &state) for (auto &thisHP : state.dataEIRPlantLoopHeatPump->heatPumps) { if (!thisHP.companionCoilName.empty()) { auto thisCoilName = UtilityRoutines::MakeUPPERCase(thisHP.name); - auto &thisCoilType = thisHP.plantTypeOfNum; + auto &thisCoilType = thisHP.EIRHPType; auto targetCompanionName = UtilityRoutines::MakeUPPERCase(thisHP.companionCoilName); for (auto &potentialCompanionCoil : state.dataEIRPlantLoopHeatPump->heatPumps) { - auto &potentialCompanionType = potentialCompanionCoil.plantTypeOfNum; + auto &potentialCompanionType = potentialCompanionCoil.EIRHPType; auto potentialCompanionName = UtilityRoutines::MakeUPPERCase(potentialCompanionCoil.name); if (potentialCompanionName == thisCoilName) { // skip the current coil @@ -837,32 +835,28 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) struct ClassType { - std::string thisType; - int thisTypeNum; + DataPlant::PlantEquipmentType thisType; std::string nodesType; std::function calcLoadOutletTemp; std::function calcQsource; std::function calcSourceOutletTemp; - ClassType(std::string _thisType, - int _thisTypeNum, + ClassType(DataPlant::PlantEquipmentType _thisType, std::string _nodesType, std::function _tLoadOutFunc, std::function _qSrcFunc, std::function _tSrcOutFunc) - : thisType(std::move(_thisType)), thisTypeNum(_thisTypeNum), nodesType(std::move(_nodesType)), - calcLoadOutletTemp(std::move(_tLoadOutFunc)), calcQsource(std::move(_qSrcFunc)), calcSourceOutletTemp(std::move(_tSrcOutFunc)) + : thisType(_thisType), nodesType(std::move(_nodesType)), calcLoadOutletTemp(std::move(_tLoadOutFunc)), calcQsource(std::move(_qSrcFunc)), + calcSourceOutletTemp(std::move(_tSrcOutFunc)) { } }; - std::vector classesToInput = {ClassType{"HeatPump:PlantLoop:EIR:Cooling", - DataPlant::TypeOf_HeatPumpEIRCooling, + std::vector classesToInput = {ClassType{DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "Chilled Water Nodes", EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::subtract, EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::add, EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::add}, - ClassType{"HeatPump:PlantLoop:EIR:Heating", - DataPlant::TypeOf_HeatPumpEIRHeating, + ClassType{DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "Hot Water Nodes", EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::add, EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::subtract, @@ -871,7 +865,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) bool errorsFound = false; auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; for (auto &classToInput : classesToInput) { - cCurrentModuleObject = classToInput.thisType; + cCurrentModuleObject = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; int numPLHP = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); if (numPLHP > 0) { auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); @@ -890,7 +884,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) state.dataInputProcessing->inputProcessor->markObjectAsUsed(cCurrentModuleObject, thisObjectName); EIRPlantLoopHeatPump thisPLHP; - thisPLHP.plantTypeOfNum = classToInput.thisTypeNum; + thisPLHP.EIRHPType = classToInput.thisType; thisPLHP.name = UtilityRoutines::MakeUPPERCase(thisObjectName); std::string loadSideInletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("load_side_inlet_node_name").get()); std::string loadSideOutletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("load_side_outlet_node_name").get()); @@ -1162,7 +1156,7 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) OutputProcessor::SOVTimeStepType::System, OutputProcessor::SOVStoreType::Average, this->name); - if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRCooling) { // energy from HeatPump:PlantLoop:EIR:Cooling object + if (this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRCooling) { // energy from HeatPump:PlantLoop:EIR:Cooling object SetupOutputVariable(state, "Heat Pump Electricity Energy", OutputProcessor::Unit::J, @@ -1175,7 +1169,7 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) "Cooling", "Heat Pump", "Plant"); - } else if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { // energy from HeatPump:PlantLoop:EIR:Heating object + } else if (this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRHeating) { // energy from HeatPump:PlantLoop:EIR:Heating object SetupOutputVariable(state, "Heat Pump Electricity Energy", OutputProcessor::Unit::J, @@ -1208,7 +1202,7 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) bool thisErrFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->name, - this->plantTypeOfNum, + this->EIRHPType, this->loadSideLocation.loopNum, this->loadSideLocation.loopSideNum, this->loadSideLocation.branchNum, @@ -1222,14 +1216,18 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) if (thisErrFlag) { ShowSevereError(state, - routineName + ": Plant topology problem for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); + format("{}: Plant topology problem for {} name = \"{}\"", + routineName, + DataPlant::PlantEquipTypeNames[static_cast(this->EIRHPType)], + this->name)); ShowContinueError(state, "Could not locate component's load side connections on a plant loop"); errFlag = true; } else if (this->loadSideLocation.loopSideNum != DataPlant::SupplySide) { // only check if !thisErrFlag ShowSevereError(state, - routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); + format("{}: Invalid connections for {} name = \"{}\"", + routineName, + DataPlant::PlantEquipTypeNames[static_cast(this->EIRHPType)], + this->name)); ShowContinueError(state, "The load side connections are not on the Supply Side of a plant loop"); errFlag = true; } @@ -1238,7 +1236,7 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) if (this->waterSource) { PlantUtilities::ScanPlantLoopsForObject(state, this->name, - this->plantTypeOfNum, + this->EIRHPType, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, this->sourceSideLocation.branchNum, @@ -1252,14 +1250,18 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) if (thisErrFlag) { ShowSevereError(state, - routineName + ": Plant topology problem for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); + format("{}: Plant topology problem for {} name = \"{}\"", + routineName, + DataPlant::PlantEquipTypeNames[static_cast(this->EIRHPType)], + this->name)); ShowContinueError(state, "Could not locate component's source side connections on a plant loop"); errFlag = true; } else if (this->sourceSideLocation.loopSideNum != DataPlant::DemandSide) { // only check if !thisErrFlag ShowSevereError(state, - routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); + format("{}: Invalid connections for {} name = \"{}\"", + routineName, + DataPlant::PlantEquipTypeNames[static_cast(this->EIRHPType)], + this->name)); ShowContinueError(state, "The source side connections are not on the Demand Side of a plant loop"); errFlag = true; } @@ -1267,8 +1269,10 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) // make sure it is not the same loop on both sides. if (this->loadSideLocation.loopNum == this->sourceSideLocation.loopNum) { // user is being too tricky, don't allow ShowSevereError(state, - routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); + format("{}: Invalid connections for {} name = \"{}\"", + routineName, + DataPlant::PlantEquipTypeNames[static_cast(this->EIRHPType)], + this->name)); ShowContinueError(state, "The load and source sides need to be on different loops."); errFlag = true; } else { @@ -1278,7 +1282,7 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) this->loadSideLocation.loopSideNum, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, - this->plantTypeOfNum, + this->EIRHPType, true); } } else if (this->airSource) { diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.hh b/src/EnergyPlus/PlantLoopHeatPumpEIR.hh index 3573b099329..b8875e795a7 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.hh +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.hh @@ -81,7 +81,7 @@ namespace EIRPlantLoopHeatPumps { // fixed configuration parameters std::string name; - int plantTypeOfNum = -1; + DataPlant::PlantEquipmentType EIRHPType = DataPlant::PlantEquipmentType::Invalid; std::string companionCoilName; EIRPlantLoopHeatPump *companionHeatPumpCoil = nullptr; Real64 sizingFactor = 1.0; @@ -171,7 +171,7 @@ namespace EIRPlantLoopHeatPumps { void resetReportingVariables(); - static PlantComponent *factory(EnergyPlusData &state, int hp_type_of_num, const std::string &hp_name); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType hp_type_of_num, const std::string &hp_name); static void pairUpCompanionCoils(EnergyPlusData &state); diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index c70f22b24e4..ab28eed37e4 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -138,7 +138,7 @@ namespace PlantPipingSystemsManager { state.dataGlobal->AnyBasementsInModel = (numBasementsCheck > 0); } - PlantComponent *Circuit::factory(EnergyPlusData &state, [[maybe_unused]] int objectType, std::string objectName) + PlantComponent *Circuit::factory(EnergyPlusData &state, [[maybe_unused]] DataPlant::PlantEquipmentType objectType, std::string objectName) { // Process the input data for circuits if it hasn't been done already if (state.dataPlantPipingSysMgr->GetInputFlag) { @@ -2106,11 +2106,11 @@ namespace PlantPipingSystemsManager { // Do any one-time initializations if (thisCircuit->NeedToFindOnPlantLoop) { - int TypeToLookFor; + DataPlant::PlantEquipmentType TypeToLookFor; if (thisCircuit->IsActuallyPartOfAHorizontalTrench) { - TypeToLookFor = DataPlant::TypeOf_GrndHtExchgHorizTrench; + TypeToLookFor = DataPlant::PlantEquipmentType::GrndHtExchgHorizTrench; } else { - TypeToLookFor = DataPlant::TypeOf_PipingSystemPipeCircuit; + TypeToLookFor = DataPlant::PlantEquipmentType::PipingSystemPipeCircuit; } bool errFlag = false; diff --git a/src/EnergyPlus/PlantPipingSystemsManager.hh b/src/EnergyPlus/PlantPipingSystemsManager.hh index b98cbaa5f49..08ee11b58a4 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.hh +++ b/src/EnergyPlus/PlantPipingSystemsManager.hh @@ -64,6 +64,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -692,7 +693,7 @@ namespace PlantPipingSystemsManager { void initInOutCells(CartesianCell const &in, CartesianCell const &out); - static PlantComponent *factory(EnergyPlusData &state, int, std::string objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType, std::string objectName); void simulate([[maybe_unused]] EnergyPlusData &state, const PlantLocation &calledFromLocation, diff --git a/src/EnergyPlus/PlantPressureSystem.cc b/src/EnergyPlus/PlantPressureSystem.cc index a8ff9883289..8b28fd3916f 100644 --- a/src/EnergyPlus/PlantPressureSystem.cc +++ b/src/EnergyPlus/PlantPressureSystem.cc @@ -97,11 +97,11 @@ namespace EnergyPlus::PlantPressureSystem { using namespace DataBranchAirLoopPlant; void SimPressureDropSystem(EnergyPlusData &state, - int const LoopNum, // Plant Loop to update pressure information - bool const FirstHVACIteration, // System flag - DataPlant::iPressureCall const CallType, // Enumerated call type - Optional_int_const LoopSideNum, // Loop side num for specific branch simulation - Optional_int_const BranchNum // Branch num for specific branch simulation + int const LoopNum, // Plant Loop to update pressure information + bool const FirstHVACIteration, // System flag + DataPlant::PressureCall const CallType, // Enumerated call type + Optional_int_const LoopSideNum, // Loop side num for specific branch simulation + Optional_int_const BranchNum // Branch num for specific branch simulation ) { @@ -121,18 +121,18 @@ void SimPressureDropSystem(EnergyPlusData &state, // Using/Aliasing // Exit out of any calculation routines if we don't do pressure simulation for this loop - if ((state.dataPlnt->PlantLoop(LoopNum).PressureSimType == DataPlant::iPressSimType::NoPressure) && - ((CallType == DataPlant::iPressureCall::Calc) || (CallType == DataPlant::iPressureCall::Update))) + if ((state.dataPlnt->PlantLoop(LoopNum).PressureSimType == DataPlant::PressSimType::NoPressure) && + ((CallType == DataPlant::PressureCall::Calc) || (CallType == DataPlant::PressureCall::Update))) return; // Pass to another routine based on calling flag { auto const SELECT_CASE_var(CallType); - if (SELECT_CASE_var == DataPlant::iPressureCall::Init) { + if (SELECT_CASE_var == DataPlant::PressureCall::Init) { InitPressureDrop(state, LoopNum, FirstHVACIteration); - } else if (SELECT_CASE_var == DataPlant::iPressureCall::Calc) { + } else if (SELECT_CASE_var == DataPlant::PressureCall::Calc) { BranchPressureDrop(state, LoopNum, LoopSideNum, BranchNum); // Autodesk:OPTIONAL LoopSideNum, BranchNum used without PRESENT check - } else if (SELECT_CASE_var == DataPlant::iPressureCall::Update) { + } else if (SELECT_CASE_var == DataPlant::PressureCall::Update) { UpdatePressureDrop(state, LoopNum); } else { // Calling routines should only use the three possible keywords here @@ -292,13 +292,13 @@ void InitPressureDrop(EnergyPlusData &state, int const LoopNum, bool const First if (ErrorsFound) ShowFatalError(state, "Preceding errors cause program termination"); // Also issue one time warning if there is a mismatch between plant loop simulation type and whether objects were entered - if (loop.HasPressureComponents && (loop.PressureSimType == DataPlant::iPressSimType::NoPressure)) { + if (loop.HasPressureComponents && (loop.PressureSimType == DataPlant::PressSimType::NoPressure)) { // Then we found pressure components on the branches, but the plant loop said it didn't want to do pressure simulation ShowWarningError(state, "Error for pressure simulation on plant loop: " + loop.Name); ShowContinueError(state, "Plant loop contains pressure simulation components on the branches,"); ShowContinueError(state, " yet in the PlantLoop object, there is no pressure simulation specified."); ShowContinueError(state, "Simulation continues, ignoring pressure simulation data."); - } else if ((!loop.HasPressureComponents) && (loop.PressureSimType != DataPlant::iPressSimType::NoPressure)) { + } else if ((!loop.HasPressureComponents) && (loop.PressureSimType != DataPlant::PressSimType::NoPressure)) { // Then we don't have any pressure components on the branches, yet the plant loop wants to do some sort of pressure simulation ShowWarningError(state, "Error for pressure simulation on plant loop: " + loop.Name); ShowContinueError(state, "Plant loop is requesting a pressure simulation,"); @@ -339,7 +339,7 @@ void InitPressureDrop(EnergyPlusData &state, int const LoopNum, bool const First // Before we leave, override any settings in case we are doing common pipe simulation if (loop.HasPressureComponents) { // We need to make sure we aren't doing an invalid configuration here - if (loop.CommonPipeType != DataPlant::iCommonPipeType::No) { + if (loop.CommonPipeType != DataPlant::CommonPipeType::No) { // There is a common pipe! if (!state.dataPlantPressureSys->CommonPipeErrorEncountered) { ShowSevereError(state, "Invalid pressure simulation configuration for Plant Loop=" + loop.Name); @@ -672,7 +672,8 @@ void DistributePressureOnBranch( } // If the last component on the branch is the pump, then check if a pressure drop is detected and set the flag and leave - if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).isPump()) { + if (DataPlant::PlantEquipmentTypeIsPump[static_cast( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).Type)]) { PumpFound = true; if (TempBranchPressureDrop != 0.0) { ShowSevereError(state, "Error in plant pressure simulation for plant loop: " + state.dataPlnt->PlantLoop(LoopNum).Name); @@ -708,7 +709,8 @@ void DistributePressureOnBranch( for (CompNum = NumCompsOnBranch - 1; CompNum >= 1; --CompNum) { // If this component is a pump, stop passing pressure upstream, and set flag to true for calling routine - if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).isPump()) { + if (DataPlant::PlantEquipmentTypeIsPump[static_cast( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).Type)]) { PumpFound = true; break; } diff --git a/src/EnergyPlus/PlantPressureSystem.hh b/src/EnergyPlus/PlantPressureSystem.hh index e955ceaa0d4..6a2336d3a21 100644 --- a/src/EnergyPlus/PlantPressureSystem.hh +++ b/src/EnergyPlus/PlantPressureSystem.hh @@ -65,7 +65,7 @@ namespace PlantPressureSystem { void SimPressureDropSystem(EnergyPlusData &state, int LoopNum, // Plant Loop to update pressure information bool FirstHVACIteration, // System flag - DataPlant::iPressureCall CallType, // Enumerated call type + DataPlant::PressureCall CallType, // Enumerated call type Optional_int_const LoopSideNum = _, // Loop side num for specific branch simulation Optional_int_const BranchNum = _ // Branch num for specific branch simulation ); diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index f554f2a8241..8972ab148dc 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -101,7 +101,6 @@ void InitComponentNodes(EnergyPlusData &state, // reset inlet node if more restrictive // Using/Aliasing - using DataPlant::DemandOpSchemeType; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 tmpMinCompMdot; // local value @@ -162,7 +161,7 @@ void SetComponentFlowRate(EnergyPlusData &state, auto &loop_side(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum)); auto &comp(loop_side.Branch(BranchIndex).Comp(CompIndex)); - if (comp.CurOpSchemeType == DataPlant::DemandOpSchemeType) { + if (comp.CurOpSchemeType == DataPlant::OpScheme::Demand) { // store flow request on inlet node state.dataLoopNodes->Node(InletNode).MassFlowRateRequest = CompFlow; state.dataLoopNodes->Node(OutletNode).MassFlowRateMinAvail = @@ -196,7 +195,7 @@ void SetComponentFlowRate(EnergyPlusData &state, } // Set loop flow rate - if (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked) { + if (loop_side.FlowLock == DataPlant::FlowLock::Unlocked) { if (state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop state.dataLoopNodes->Node(OutletNode).MassFlowRate = CompFlow; state.dataLoopNodes->Node(InletNode).MassFlowRate = state.dataLoopNodes->Node(OutletNode).MassFlowRate; @@ -279,14 +278,14 @@ void SetComponentFlowRate(EnergyPlusData &state, state.dataLoopNodes->Node(InletNode).MassFlowRate = state.dataLoopNodes->Node(OutletNode).MassFlowRate; } } - } else if (loop_side.FlowLock == DataPlant::iFlowLock::Locked) { + } else if (loop_side.FlowLock == DataPlant::FlowLock::Locked) { state.dataLoopNodes->Node(OutletNode).MassFlowRate = state.dataLoopNodes->Node(InletNode).MassFlowRate; CompFlow = state.dataLoopNodes->Node(OutletNode).MassFlowRate; } else { ShowFatalError(state, "SetComponentFlowRate: Flow lock out of range"); // DEBUG error...should never get here LCOV_EXCL_LINE } - if (comp.CurOpSchemeType == DataPlant::DemandOpSchemeType) { + if (comp.CurOpSchemeType == DataPlant::OpScheme::Demand) { if ((MdotOldRequest > 0.0) && (CompFlow > 0.0)) { // sure that not coming back from a no flow reset if (std::abs(MdotOldRequest - state.dataLoopNodes->Node(InletNode).MassFlowRateRequest) > DataBranchAirLoopPlant::MassFlowTolerance) { // demand comp changed its flow request @@ -336,7 +335,7 @@ void SetActuatedBranchFlowRate(EnergyPlusData &state, if (LoopNum > 0 && LoopSideNum > 0 && (!ResetMode)) { if ((MdotOldRequest > 0.0) && (CompFlow > 0.0)) { // sure that not coming back from a no flow reset if ((std::abs(MdotOldRequest - a_node.MassFlowRateRequest) > DataBranchAirLoopPlant::MassFlowTolerance) && - (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked)) { + (loop_side.FlowLock == DataPlant::FlowLock::Unlocked)) { loop_side.SimLoopSideNeeded = true; } } @@ -345,7 +344,7 @@ void SetActuatedBranchFlowRate(EnergyPlusData &state, if (LoopNum > 0 && LoopSideNum > 0) { auto const &branch(loop_side.Branch(BranchNum)); - if (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked) { + if (loop_side.FlowLock == DataPlant::FlowLock::Unlocked) { if (state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop a_node.MassFlowRate = CompFlow; } else { // bound the flow by Min/Max available across entire branch @@ -382,7 +381,7 @@ void SetActuatedBranchFlowRate(EnergyPlusData &state, } } - } else if (loop_side.FlowLock == DataPlant::iFlowLock::Locked) { + } else if (loop_side.FlowLock == DataPlant::FlowLock::Locked) { CompFlow = a_node.MassFlowRate; // do not change requested flow rate either @@ -442,9 +441,6 @@ Real64 RegulateCondenserCompFlowReqOp( // If not then we will have no choice but to leave the flow request alone (uncontrolled operation?) // Using/Aliasing - using DataPlant::CompSetPtBasedSchemeType; - using DataPlant::CoolingRBOpSchemeType; - using DataPlant::HeatingRBOpSchemeType; // Return value Real64 FlowVal; @@ -455,28 +451,29 @@ Real64 RegulateCondenserCompFlowReqOp( // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 CompCurLoad; bool CompRunFlag; - int CompOpScheme; CompCurLoad = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).MyLoad; CompRunFlag = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).ON; - CompOpScheme = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType; + auto CompOpScheme = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType; if (CompRunFlag) { - { - auto const SELECT_CASE_var(CompOpScheme); - - if ((SELECT_CASE_var == HeatingRBOpSchemeType) || (SELECT_CASE_var == CoolingRBOpSchemeType) || - (SELECT_CASE_var == CompSetPtBasedSchemeType)) { // These provide meaningful MyLoad values - if (std::abs(CompCurLoad) > ZeroLoad) { - FlowVal = TentativeFlowRequest; - } else { // no load - FlowVal = 0.0; - } + switch (CompOpScheme) { - } else { // Types that don't provide meaningful MyLoad values + case (DataPlant::OpScheme::HeatingRB): + case (DataPlant::OpScheme::CoolingRB): + case (DataPlant::OpScheme::CompSetPtBased): { // These provide meaningful MyLoad values + if (std::abs(CompCurLoad) > ZeroLoad) { FlowVal = TentativeFlowRequest; + } else { // no load + FlowVal = 0.0; } + break; + } + default: { // Types that don't provide meaningful MyLoad values + FlowVal = TentativeFlowRequest; + break; + } } } else { // runflag OFF @@ -830,7 +827,7 @@ void CheckForRunawayPlantTemps(EnergyPlusData &state, int const LoopNum, int con } } -void SetAllFlowLocks(EnergyPlusData &state, DataPlant::iFlowLock const Value) +void SetAllFlowLocks(EnergyPlusData &state, DataPlant::FlowLock const Value) { // SUBROUTINE INFORMATION: @@ -874,15 +871,15 @@ void ResetAllPlantInterConnectFlags(EnergyPlusData &state) } void PullCompInterconnectTrigger(EnergyPlusData &state, - int const LoopNum, // component's loop index - int const LoopSide, // component's loop side number - int const BranchNum, // Component's branch number - int const CompNum, // Component's comp number - int &UniqueCriteriaCheckIndex, // An integer given to this particular check - int const ConnectedLoopNum, // Component's interconnected loop number - int const ConnectedLoopSide, // Component's interconnected loop side number - DataPlant::iCriteriaType const CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes - Real64 const CriteriaValue // The value of the criteria check to evaluate + int const LoopNum, // component's loop index + int const LoopSide, // component's loop side number + int const BranchNum, // Component's branch number + int const CompNum, // Component's comp number + int &UniqueCriteriaCheckIndex, // An integer given to this particular check + int const ConnectedLoopNum, // Component's interconnected loop number + int const ConnectedLoopSide, // Component's interconnected loop side number + DataPlant::CriteriaType const CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes + Real64 const CriteriaValue // The value of the criteria check to evaluate ) { @@ -953,17 +950,17 @@ void PullCompInterconnectTrigger(EnergyPlusData &state, // Initialize, then check if we are out of range { auto const SELECT_CASE_var(CriteriaType); - if (SELECT_CASE_var == DataPlant::iCriteriaType::MassFlowRate) { + if (SELECT_CASE_var == DataPlant::CriteriaType::MassFlowRate) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_MassFlowRate) { state.dataPlnt->PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } - } else if (SELECT_CASE_var == DataPlant::iCriteriaType::Temperature) { + } else if (SELECT_CASE_var == DataPlant::CriteriaType::Temperature) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_Temperature) { state.dataPlnt->PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } - } else if (SELECT_CASE_var == DataPlant::iCriteriaType::HeatTransferRate) { + } else if (SELECT_CASE_var == DataPlant::CriteriaType::HeatTransferRate) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_HeatTransferRate) { state.dataPlnt->PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } @@ -980,15 +977,15 @@ void PullCompInterconnectTrigger(EnergyPlusData &state, } void UpdateChillerComponentCondenserSide(EnergyPlusData &state, - int const LoopNum, // component's loop index - int const LoopSide, // component's loop side number - [[maybe_unused]] int const TypeOfNum, // Component's type index - int const InletNodeNum, // Component's inlet node pointer - int const OutletNodeNum, // Component's outlet node pointer - Real64 const ModelCondenserHeatRate, // model's heat rejection rate at condenser (W) - Real64 const ModelInletTemp, // model's inlet temperature (C) - Real64 const ModelOutletTemp, // model's outlet temperature (C) - Real64 const ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) + int const LoopNum, // component's loop index + int const LoopSide, // component's loop side number + [[maybe_unused]] DataPlant::PlantEquipmentType Type, // Component's type index + int const InletNodeNum, // Component's inlet node pointer + int const OutletNodeNum, // Component's outlet node pointer + Real64 const ModelCondenserHeatRate, // model's heat rejection rate at condenser (W) + Real64 const ModelInletTemp, // model's inlet temperature (C) + Real64 const ModelOutletTemp, // model's outlet temperature (C) + Real64 const ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) bool const FirstHVACIteration) { @@ -1067,15 +1064,15 @@ void UpdateChillerComponentCondenserSide(EnergyPlusData &state, } void UpdateComponentHeatRecoverySide(EnergyPlusData &state, - int const LoopNum, // component's loop index - int const LoopSide, // component's loop side number - [[maybe_unused]] int const TypeOfNum, // Component's type index - int const InletNodeNum, // Component's inlet node pointer - int const OutletNodeNum, // Component's outlet node pointer - Real64 const ModelRecoveryHeatRate, // model's heat rejection rate at recovery (W) - Real64 const ModelInletTemp, // model's inlet temperature (C) - Real64 const ModelOutletTemp, // model's outlet temperature (C) - Real64 const ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) + int const LoopNum, // component's loop index + int const LoopSide, // component's loop side number + [[maybe_unused]] DataPlant::PlantEquipmentType Type, // Component's type index + int const InletNodeNum, // Component's inlet node pointer + int const OutletNodeNum, // Component's outlet node pointer + Real64 const ModelRecoveryHeatRate, // model's heat rejection rate at recovery (W) + Real64 const ModelInletTemp, // model's inlet temperature (C) + Real64 const ModelOutletTemp, // model's outlet temperature (C) + Real64 const ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) bool const FirstHVACIteration) { @@ -1155,7 +1152,7 @@ void UpdateComponentHeatRecoverySide(EnergyPlusData &state, void UpdateAbsorberChillerComponentGeneratorSide(EnergyPlusData &state, int const LoopNum, // component's loop index int const LoopSide, // component's loop side number - [[maybe_unused]] int const TypeOfNum, // Component's type index + [[maybe_unused]] DataPlant::PlantEquipmentType const Type, // Component's type index int const InletNodeNum, // Component's inlet node pointer [[maybe_unused]] int const OutletNodeNum, // Component's outlet node pointer [[maybe_unused]] DataLoopNode::NodeFluidType const HeatSourceType, // Type of fluid in Generator loop @@ -1220,7 +1217,7 @@ void InterConnectTwoPlantLoopSides(EnergyPlusData &state, int const Loop1LoopSideNum, int const Loop2Num, int const Loop2LoopSideNum, - int const PlantComponentTypeOfNum, + DataPlant::PlantEquipmentType ComponentType, bool const Loop1DemandsOnLoop2) { @@ -1255,7 +1252,7 @@ void InterConnectTwoPlantLoopSides(EnergyPlusData &state, } connected_1(TotalConnected).LoopNum = Loop2Num; connected_1(TotalConnected).LoopSideNum = Loop2LoopSideNum; - connected_1(TotalConnected).ConnectorTypeOf_Num = PlantComponentTypeOfNum; + connected_1(TotalConnected).ConnectorTypeOf_Num = static_cast(ComponentType); connected_1(TotalConnected).LoopDemandsOnRemote = Loop1DemandsOnLoop2; auto &loop_side_2(state.dataPlnt->PlantLoop(Loop2Num).LoopSide(Loop2LoopSideNum)); @@ -1269,7 +1266,7 @@ void InterConnectTwoPlantLoopSides(EnergyPlusData &state, } connected_2(TotalConnected).LoopNum = Loop1Num; connected_2(TotalConnected).LoopSideNum = Loop1LoopSideNum; - connected_2(TotalConnected).ConnectorTypeOf_Num = PlantComponentTypeOfNum; + connected_2(TotalConnected).ConnectorTypeOf_Num = static_cast(ComponentType); connected_2(TotalConnected).LoopDemandsOnRemote = Loop2DemandsOnLoop1; } @@ -1468,7 +1465,7 @@ void SafeCopyPlantNode(EnergyPlusData &state, // Only pass pressure if we aren't doing a pressure simulation if (present(LoopNum)) { switch (state.dataPlnt->PlantLoop(LoopNum).PressureSimType) { - case DataPlant::iPressSimType::NoPressure: + case DataPlant::PressSimType::NoPressure: state.dataLoopNodes->Node(OutletNodeNum).Press = state.dataLoopNodes->Node(InletNodeNum).Press; default: // Don't do anything @@ -1636,7 +1633,7 @@ void LogPlantConvergencePoints(EnergyPlusData &state, bool const FirstHVACIterat void ScanPlantLoopsForObject(EnergyPlusData &state, std::string_view CompName, - int const CompType, + DataPlant::PlantEquipmentType CompType, int &LoopNum, int &LoopSideNum, int &BranchNum, @@ -1696,7 +1693,7 @@ void ScanPlantLoopsForObject(EnergyPlusData &state, auto &this_branch(this_loop_side.Branch(BranchCtr)); for (CompCtr = 1; CompCtr <= this_branch.TotalComponents; ++CompCtr) { auto &this_component(this_branch.Comp(CompCtr)); - if (this_component.TypeOf_Num == CompType) { + if (this_component.Type == CompType) { if (UtilityRoutines::SameString(CompName, this_component.Name)) { FoundCompName = true; if (present(InletNodeNumber)) { @@ -1733,16 +1730,19 @@ void ScanPlantLoopsForObject(EnergyPlusData &state, } if (!FoundComponent) { - if (CompType >= 1 && CompType <= DataPlant::NumSimPlantEquipTypes) { + if (CompType != DataPlant::PlantEquipmentType::Invalid && CompType != DataPlant::PlantEquipmentType::Num) { if (!present(SingleLoopSearch)) { ShowSevereError(state, - "Plant Component " + DataPlant::ccSimPlantEquipTypes(CompType) + " called \"" + std::string{CompName} + - "\" was not found on any plant loops."); - AuditBranches(state, true, DataPlant::ccSimPlantEquipTypes(CompType), CompName); + format("Plant Component {} called \"{}\" was not found on any plant loops.", + DataPlant::PlantEquipTypeNames[static_cast(CompType)], + std::string{CompName})); + AuditBranches(state, true, DataPlant::PlantEquipTypeNames[static_cast(CompType)], CompName); } else { ShowSevereError(state, - "Plant Component " + DataPlant::ccSimPlantEquipTypes(CompType) + " called \"" + std::string{CompName} + - "\" was not found on plant loop=\"" + state.dataPlnt->PlantLoop(SingleLoopSearch).Name + "\"."); + format("Plant Component {} called \"{}\" was not found on plant loop=\"{}\".", + DataPlant::PlantEquipTypeNames[static_cast(CompType)], + std::string{CompName}, + state.dataPlnt->PlantLoop(SingleLoopSearch).Name)); } if (present(InletNodeNumber)) { if (FoundCompName) { @@ -1757,7 +1757,7 @@ void ScanPlantLoopsForObject(EnergyPlusData &state, errFlag = true; } else { ShowSevereError(state, format("ScanPlantLoopsForObject: Invalid CompType passed [{}], Name={}", CompType, CompName)); - ShowContinueError(state, format("Valid CompTypes are in the range [1 - {}].", DataPlant::NumSimPlantEquipTypes)); + ShowContinueError(state, format("Valid CompTypes are in the range [0 - {}].", static_cast(DataPlant::PlantEquipmentType::Num))); ShowFatalError(state, "Previous error causes program termination"); } } diff --git a/src/EnergyPlus/PlantUtilities.hh b/src/EnergyPlus/PlantUtilities.hh index 8d3689ba90d..679232edb56 100644 --- a/src/EnergyPlus/PlantUtilities.hh +++ b/src/EnergyPlus/PlantUtilities.hh @@ -103,50 +103,50 @@ namespace PlantUtilities { void CheckForRunawayPlantTemps(EnergyPlusData &state, int LoopNum, int LoopSideNum); - void SetAllFlowLocks(EnergyPlusData &state, DataPlant::iFlowLock Value); + void SetAllFlowLocks(EnergyPlusData &state, DataPlant::FlowLock Value); void ResetAllPlantInterConnectFlags(EnergyPlusData &state); void PullCompInterconnectTrigger(EnergyPlusData &state, - int LoopNum, // component's loop index - int LoopSide, // component's loop side number - int BranchNum, // Component's branch number - int CompNum, // Component's comp number - int &UniqueCriteriaCheckIndex, // An integer given to this particular check - int ConnectedLoopNum, // Component's interconnected loop number - int ConnectedLoopSide, // Component's interconnected loop side number - DataPlant::iCriteriaType CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes - Real64 CriteriaValue // The value of the criteria check to evaluate + int LoopNum, // component's loop index + int LoopSide, // component's loop side number + int BranchNum, // Component's branch number + int CompNum, // Component's comp number + int &UniqueCriteriaCheckIndex, // An integer given to this particular check + int ConnectedLoopNum, // Component's interconnected loop number + int ConnectedLoopSide, // Component's interconnected loop side number + DataPlant::CriteriaType CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes + Real64 CriteriaValue // The value of the criteria check to evaluate ); void UpdateChillerComponentCondenserSide(EnergyPlusData &state, - int LoopNum, // component's loop index - int LoopSide, // component's loop side number - int TypeOfNum, // Component's type index - int InletNodeNum, // Component's inlet node pointer - int OutletNodeNum, // Component's outlet node pointer - Real64 ModelCondenserHeatRate, // model's heat rejection rate at condenser (W) - Real64 ModelInletTemp, // model's inlet temperature (C) - Real64 ModelOutletTemp, // model's outlet temperature (C) - Real64 ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) + int LoopNum, // component's loop index + int LoopSide, // component's loop side number + DataPlant::PlantEquipmentType Type, // Component's type index + int InletNodeNum, // Component's inlet node pointer + int OutletNodeNum, // Component's outlet node pointer + Real64 ModelCondenserHeatRate, // model's heat rejection rate at condenser (W) + Real64 ModelInletTemp, // model's inlet temperature (C) + Real64 ModelOutletTemp, // model's outlet temperature (C) + Real64 ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) bool FirstHVACIteration); void UpdateComponentHeatRecoverySide(EnergyPlusData &state, - int LoopNum, // component's loop index - int LoopSide, // component's loop side number - int TypeOfNum, // Component's type index - int InletNodeNum, // Component's inlet node pointer - int OutletNodeNum, // Component's outlet node pointer - Real64 ModelRecoveryHeatRate, // model's heat rejection rate at recovery (W) - Real64 ModelInletTemp, // model's inlet temperature (C) - Real64 ModelOutletTemp, // model's outlet temperature (C) - Real64 ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) + int LoopNum, // component's loop index + int LoopSide, // component's loop side number + DataPlant::PlantEquipmentType Type, // Component's type index + int InletNodeNum, // Component's inlet node pointer + int OutletNodeNum, // Component's outlet node pointer + Real64 ModelRecoveryHeatRate, // model's heat rejection rate at recovery (W) + Real64 ModelInletTemp, // model's inlet temperature (C) + Real64 ModelOutletTemp, // model's outlet temperature (C) + Real64 ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) bool FirstHVACIteration); void UpdateAbsorberChillerComponentGeneratorSide(EnergyPlusData &state, int LoopNum, // component's loop index int LoopSide, // component's loop side number - int TypeOfNum, // Component's type index + DataPlant::PlantEquipmentType Type, // Component's type index int InletNodeNum, // Component's inlet node pointer int OutletNodeNum, // Component's outlet node pointer DataLoopNode::NodeFluidType HeatSourceType, // Type of fluid in Generator loop @@ -159,7 +159,7 @@ namespace PlantUtilities { int Loop1LoopSideNum, int Loop2Num, int Loop2LoopSideNum, - int PlantComponentTypeOfNum, + DataPlant::PlantEquipmentType ComponentType, bool Loop1DemandsOnLoop2); void ShiftPlantLoopSideCallingOrder(EnergyPlusData &state, int OldIndex, int NewIndex); @@ -188,7 +188,7 @@ namespace PlantUtilities { void ScanPlantLoopsForObject(EnergyPlusData &state, std::string_view CompName, - int CompType, + DataPlant::PlantEquipmentType CompType, int &LoopNum, int &LoopSideNum, int &BranchNum, diff --git a/src/EnergyPlus/PlantValves.cc b/src/EnergyPlus/PlantValves.cc index 8dd323e2e55..8862ffc773a 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -285,7 +285,7 @@ namespace PlantValves { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_ValveTempering, + DataPlant::PlantEquipmentType::ValveTempering, this->LoopNum, this->LoopSideNum, this->BranchNum, @@ -317,7 +317,8 @@ namespace PlantValves { branchCtr++; for (auto &thisComp : thisBranch.Comp) { - if ((thisComp.TypeOf_Num == DataPlant::TypeOf_ValveTempering) && (thisComp.Name == this->Name)) { // we found it. + if ((thisComp.Type == DataPlant::PlantEquipmentType::ValveTempering) && + (thisComp.Name == this->Name)) { // we found it. // is branch control type 'Active' if (thisBranch.ControlType == DataBranchAirLoopPlant::ControlTypeEnum::Active) IsBranchActive = true; @@ -356,7 +357,7 @@ namespace PlantValves { for (auto &thisInnerBranch : thisLoopSide.Branch) { if (thisInnerBranch.NodeNumOut == this->PltPumpOutletNodeNum) { for (auto &thisInnerComp : thisInnerBranch.Comp) { - if (thisInnerComp.isPump()) { + if (DataPlant::PlantEquipmentTypeIsPump[static_cast(thisInnerComp.Type)]) { PumpOutNodeOkay = true; } } @@ -476,7 +477,7 @@ namespace PlantValves { if (state.dataGlobal->KickOffSimulation) return; - if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) { Tin = this->InletTemp; Tset = this->SetPointTemp; Ts2 = this->Stream2SourceTemp; @@ -491,7 +492,7 @@ namespace PlantValves { } } } else if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == - DataPlant::iFlowLock::Locked) { // don't recalc diversion, just reuse current flows + DataPlant::FlowLock::Locked) { // don't recalc diversion, just reuse current flows if (this->MixedMassFlowRate > 0.0) { this->FlowDivFract = state.dataLoopNodes->Node(this->PltOutletNodeNum).MassFlowRate / this->MixedMassFlowRate; } else { diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index 0874b38ae26..0912c74548e 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -890,7 +890,7 @@ void PondGroundHeatExchangerData::oneTimeInit(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_GrndHtExchgPond, + DataPlant::PlantEquipmentType::GrndHtExchgPond, this->LoopNum, this->LoopSideNum, this->BranchNum, diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index e38e74e2032..4153cc3d612 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -235,8 +235,7 @@ void GetPIUs(EnergyPlusData &state) // Using/Aliasing using BranchNodeConnections::SetUpCompSets; using BranchNodeConnections::TestCompSet; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using FluidProperties::FindRefrigerant; using NodeInputManager::GetOnlySingleNode; using SteamCoils::GetCoilSteamInletNode; @@ -317,15 +316,19 @@ void GetPIUs(EnergyPlusData &state) state.dataPowerInductionUnits->PIU(PIUNum).MaxPriAirVolFlow = state.dataIPShortCut->rNumericArgs(2); state.dataPowerInductionUnits->PIU(PIUNum).MinPriAirFlowFrac = state.dataIPShortCut->rNumericArgs(3); - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType = state.dataIPShortCut->cAlphaArgs(9); // type (key) of heating coil - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:WATER")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::SimpleHeating; - state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:FUEL")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::Gas; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:STEAM")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::SteamAirHeating; - state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantTypeNum = TypeOf_CoilSteamAirHeating; + state.dataPowerInductionUnits->PIU(PIUNum).HCoilType = + static_cast(getEnumerationValue(HCoilNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(9)))); + switch (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType) { + case (iHCoilType::SimpleHeating): { + state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + break; + } + case (iHCoilType::Electric): + case (iHCoilType::Gas): { + break; + } + case (iHCoilType::SteamAirHeating): { + state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; state.dataPowerInductionUnits->PIU(PIUNum).HCoil_FluidIndex = FindRefrigerant(state, "Steam"); if (state.dataPowerInductionUnits->PIU(PIUNum).HCoil_FluidIndex == 0) { ShowSevereError(state, std::string{RoutineName} + "Steam Properties for " + state.dataIPShortCut->cAlphaArgs(1) + " not found."); @@ -333,13 +336,14 @@ void GetPIUs(EnergyPlusData &state) ErrorsFound = true; SteamMessageNeeded = false; } - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:ELECTRIC")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::Electric; - } else { + break; + } + default: { ShowSevereError(state, "Illegal " + state.dataIPShortCut->cAlphaFieldNames(9) + " = " + state.dataIPShortCut->cAlphaArgs(9)); ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + state.dataPowerInductionUnits->PIU(PIUNum).Name); ErrorsFound = true; } + } state.dataPowerInductionUnits->PIU(PIUNum).PriAirInNode = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(3), @@ -386,11 +390,11 @@ void GetPIUs(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames(6)); // The reheat coil control node is necessary for hot water reheat, but not necessary for // electric or gas reheat. - if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num == iHCoilType::SimpleHeating) { + if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType == iHCoilType::SimpleHeating) { state.dataPowerInductionUnits->PIU(PIUNum).HotControlNode = GetCoilWaterInletNode(state, state.dataIPShortCut->cAlphaArgs(9), state.dataIPShortCut->cAlphaArgs(10), ErrorsFound); } - if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num == iHCoilType::SteamAirHeating) { + if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType == iHCoilType::SteamAirHeating) { state.dataPowerInductionUnits->PIU(PIUNum).HotControlNode = GetCoilSteamInletNode(state, state.dataIPShortCut->cAlphaArgs(9), state.dataIPShortCut->cAlphaArgs(10), ErrorsFound); } @@ -423,7 +427,7 @@ void GetPIUs(EnergyPlusData &state) state.dataPowerInductionUnits->PIU(PIUNum).HCoil = state.dataIPShortCut->cAlphaArgs(10); // name of heating coil object ValidateComponent(state, - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType, + HCoilNamesUC[static_cast(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType)], state.dataPowerInductionUnits->PIU(PIUNum).HCoil, IsNotOK, cCurrentModuleObject + " - Heating Coil"); @@ -555,15 +559,14 @@ void GetPIUs(EnergyPlusData &state) state.dataPowerInductionUnits->PIU(PIUNum).MaxSecAirVolFlow = state.dataIPShortCut->rNumericArgs(2); state.dataPowerInductionUnits->PIU(PIUNum).MinPriAirFlowFrac = state.dataIPShortCut->rNumericArgs(3); state.dataPowerInductionUnits->PIU(PIUNum).FanOnFlowFrac = state.dataIPShortCut->rNumericArgs(4); - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType = state.dataIPShortCut->cAlphaArgs(9); // type (key) of heating coil if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:WATER")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::SimpleHeating; - state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; + state.dataPowerInductionUnits->PIU(PIUNum).HCoilType = iHCoilType::SimpleHeating; + state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:FUEL")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::Gas; + state.dataPowerInductionUnits->PIU(PIUNum).HCoilType = iHCoilType::Gas; } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:STEAM")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::SteamAirHeating; - state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantTypeNum = TypeOf_CoilSteamAirHeating; + state.dataPowerInductionUnits->PIU(PIUNum).HCoilType = iHCoilType::SteamAirHeating; + state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; state.dataPowerInductionUnits->PIU(PIUNum).HCoil_FluidIndex = FindRefrigerant(state, "Steam"); if (state.dataPowerInductionUnits->PIU(PIUNum).HCoil_FluidIndex == 0) { ShowSevereError(state, std::string{RoutineName} + "Steam Properties for " + state.dataIPShortCut->cAlphaArgs(1) + " not found."); @@ -572,7 +575,7 @@ void GetPIUs(EnergyPlusData &state) SteamMessageNeeded = false; } } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(9), "COIL:HEATING:ELECTRIC")) { - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = iHCoilType::Electric; + state.dataPowerInductionUnits->PIU(PIUNum).HCoilType = iHCoilType::Electric; } else { ShowSevereError(state, "Illegal " + state.dataIPShortCut->cAlphaFieldNames(9) + " = " + state.dataIPShortCut->cAlphaArgs(9)); ShowContinueError(state, "Occurs in " + cCurrentModuleObject + " = " + state.dataPowerInductionUnits->PIU(PIUNum).Name); @@ -624,7 +627,7 @@ void GetPIUs(EnergyPlusData &state) state.dataIPShortCut->cAlphaFieldNames(6)); // The reheat coil control node is necessary for hot water reheat, but not necessary for // electric or gas reheat. - // IF (PIU(PIUNum)%HCoilType_Num .EQ. HCoilType_Gas .OR. PIU(PIUNum)%HCoilType_Num .EQ. HCoilType_Electric) THEN + // IF (PIU(PIUNum)%HCoilType .EQ. HCoilType_Gas .OR. PIU(PIUNum)%HCoilType .EQ. HCoilType_Electric) THEN // IF(state.dataIPShortCut->cAlphaArgs(11) /= '') THEN // CALL ShowWarningError(state, 'In '//TRIM(cCurrentModuleObject)//' = ' // TRIM(PIU(PIUNum)%Name) & // // ' the '//TRIM(cAlphaFieldNames(11))//' is not needed and will be ignored.') @@ -640,11 +643,11 @@ void GetPIUs(EnergyPlusData &state) // GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(11),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), & // DataLoopNode::NodeFluidType::Water,DataLoopNode::NodeConnectionType::Actuator,1,ObjectIsParent) // END IF - if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num == iHCoilType::SimpleHeating) { + if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType == iHCoilType::SimpleHeating) { state.dataPowerInductionUnits->PIU(PIUNum).HotControlNode = GetCoilWaterInletNode(state, state.dataIPShortCut->cAlphaArgs(9), state.dataIPShortCut->cAlphaArgs(10), ErrorsFound); } - if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num == iHCoilType::SteamAirHeating) { + if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType == iHCoilType::SteamAirHeating) { state.dataPowerInductionUnits->PIU(PIUNum).HotControlNode = GetCoilSteamInletNode(state, state.dataIPShortCut->cAlphaArgs(9), state.dataIPShortCut->cAlphaArgs(10), ErrorsFound); } @@ -675,7 +678,7 @@ void GetPIUs(EnergyPlusData &state) } state.dataPowerInductionUnits->PIU(PIUNum).HCoil = state.dataIPShortCut->cAlphaArgs(10); // name of heating coil object ValidateComponent(state, - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType, + HCoilNamesUC[static_cast(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType)], state.dataPowerInductionUnits->PIU(PIUNum).HCoil, IsNotOK, cCurrentModuleObject + " - Heating Coil"); @@ -834,8 +837,7 @@ void InitPIU(EnergyPlusData &state, // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataZoneEquipment::CheckZoneEquipmentList; using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; @@ -869,12 +871,12 @@ void InitPIU(EnergyPlusData &state, } if (MyPlantScanFlag(PIUNum) && allocated(state.dataPlnt->PlantLoop)) { - if ((state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || - (state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { + if ((state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || + (state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantType == DataPlant::PlantEquipmentType::CoilSteamAirHeating)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataPowerInductionUnits->PIU(PIUNum).HCoil, - state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantTypeNum, + state.dataPowerInductionUnits->PIU(PIUNum).HCoil_PlantType, state.dataPowerInductionUnits->PIU(PIUNum).HWLoopNum, state.dataPowerInductionUnits->PIU(PIUNum).HWLoopSide, state.dataPowerInductionUnits->PIU(PIUNum).HWBranchNum, @@ -977,8 +979,8 @@ void InitPIU(EnergyPlusData &state, state.dataLoopNodes->Node(OutletNode).MassFlowRateMax = state.dataPowerInductionUnits->PIU(PIUNum).MaxPriAirMassFlow; } - if (((state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num == iHCoilType::SimpleHeating) || - (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num == iHCoilType::SteamAirHeating)) && + if (((state.dataPowerInductionUnits->PIU(PIUNum).HCoilType == iHCoilType::SimpleHeating) || + (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType == iHCoilType::SteamAirHeating)) && !MyPlantScanFlag(PIUNum)) { InitComponentNodes(state, state.dataPowerInductionUnits->PIU(PIUNum).MinHotWaterFlow, @@ -1509,7 +1511,8 @@ void SizePIU(EnergyPlusData &state, int const PIUNum) } } else { CheckZoneSizing(state, state.dataPowerInductionUnits->PIU(PIUNum).UnitType, state.dataPowerInductionUnits->PIU(PIUNum).Name); - if (UtilityRoutines::SameString(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType, "Coil:Heating:Water")) { + if (UtilityRoutines::SameString(HCoilNamesUC[static_cast(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType)], + "Coil:Heating:Water")) { CoilWaterInletNode = GetCoilWaterInletNode(state, "Coil:Heating:Water", state.dataPowerInductionUnits->PIU(PIUNum).HCoil, ErrorsFound); @@ -1621,7 +1624,8 @@ void SizePIU(EnergyPlusData &state, int const PIUNum) state.dataPowerInductionUnits->PIU(PIUNum).MaxVolHotWaterFlow); } } else { - if (UtilityRoutines::SameString(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType, "Coil:Heating:Steam")) { + if (UtilityRoutines::SameString(HCoilNames[static_cast(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType)], + "Coil:Heating:Steam")) { CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", state.dataPowerInductionUnits->PIU(PIUNum).HCoil, ErrorsFound); @@ -1713,9 +1717,9 @@ void SizePIU(EnergyPlusData &state, int const PIUNum) TermUnitSizing(CurTermUnitSizingNum).MaxSTVolFlow = state.dataPowerInductionUnits->PIU(PIUNum).MaxVolHotSteamFlow; TermUnitSizing(CurTermUnitSizingNum).DesHeatingLoad = DesCoilLoad; // coil report TermUnitSizing(CurTermUnitSizingNum).InducesPlenumAir = state.dataPowerInductionUnits->PIU(PIUNum).InducesPlenumAir; - if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num == iHCoilType::SimpleHeating) { + if (state.dataPowerInductionUnits->PIU(PIUNum).HCoilType == iHCoilType::SimpleHeating) { SetCoilDesFlow(state, - state.dataPowerInductionUnits->PIU(PIUNum).HCoilType, + HCoilNamesUC[static_cast(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType)], state.dataPowerInductionUnits->PIU(PIUNum).HCoil, TermUnitSizing(CurTermUnitSizingNum).AirVolFlow, ErrorsFound); @@ -1948,7 +1952,7 @@ void CalcSeriesPIU(EnergyPlusData &state, // fire the heating coil { - auto const SELECT_CASE_var(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num); + auto const SELECT_CASE_var(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType); if (SELECT_CASE_var == iHCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING if (!HCoilOn) { @@ -2266,7 +2270,7 @@ void CalcParallelPIU(EnergyPlusData &state, } // fire the heating coil { - auto const SELECT_CASE_var(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num); + auto const SELECT_CASE_var(state.dataPowerInductionUnits->PIU(PIUNum).HCoilType); if (SELECT_CASE_var == iHCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING if (!HCoilOn) { diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index 2307e7c6fc7..414a0a4f551 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -56,6 +56,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -71,13 +72,20 @@ namespace PoweredInductionUnits { // coil types in this module enum class iHCoilType { - Unassigned, + Unassigned = -1, Gas, Electric, SimpleHeating, SteamAirHeating, + Num }; + constexpr std::array(iHCoilType::Num)> HCoilNamesUC{ + "COIL:HEATING:FUEL", "COIL:HEATING:ELECTRIC", "COIL:HEATING:WATER", "COIL:HEATING:STEAM"}; + + constexpr std::array(iHCoilType::Num)> HCoilNames{ + "Coil:Heating:Fuel", "Coil:Heating:Electric", "Coil:Heating:Water", "Coil:Heating:Steam"}; + struct PowIndUnitData { // Members @@ -104,15 +112,14 @@ namespace PoweredInductionUnits { int HCoilInAirNode; // unit mixed air node number int ControlCompTypeNum; int CompErrIndex; - std::string MixerName; // name of air mixer component - int Mixer_Num; // index for type of mixer - std::string FanName; // name of fan component - int Fan_Num; // index for fan type - int Fan_Index; // store index for this fan - int FanAvailSchedPtr; // index to fan availability schedule - std::string HCoilType; // type of heating coil component - iHCoilType HCoilType_Num; // index for heating coil type - int HCoil_PlantTypeNum; + std::string MixerName; // name of air mixer component + int Mixer_Num; // index for type of mixer + std::string FanName; // name of fan component + int Fan_Num; // index for fan type + int Fan_Index; // store index for this fan + int FanAvailSchedPtr; // index to fan availability schedule + iHCoilType HCoilType; // index for heating coil type + DataPlant::PlantEquipmentType HCoil_PlantType; std::string HCoil; // name of heating coil component int HCoil_Index; // index to this heating coil int HCoil_FluidIndex; @@ -149,10 +156,10 @@ namespace PoweredInductionUnits { MaxPriAirVolFlow(0.0), MaxPriAirMassFlow(0.0), MinPriAirFlowFrac(0.0), MinPriAirMassFlow(0.0), PriDamperPosition(0.0), MaxSecAirVolFlow(0.0), MaxSecAirMassFlow(0.0), FanOnFlowFrac(0.0), FanOnAirMassFlow(0.0), PriAirInNode(0), SecAirInNode(0), OutAirNode(0), HCoilInAirNode(0), ControlCompTypeNum(0), CompErrIndex(0), Mixer_Num(0), Fan_Num(0), Fan_Index(0), FanAvailSchedPtr(0), - HCoilType_Num(iHCoilType::Unassigned), HCoil_PlantTypeNum(0), HCoil_Index(0), HCoil_FluidIndex(0), MaxVolHotWaterFlow(0.0), - MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinHotSteamFlow(0.0), - MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), HWLoopNum(0), - HWLoopSide(0), HWBranchNum(0), HWCompNum(0), ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), + HCoilType(iHCoilType::Unassigned), HCoil_PlantType(DataPlant::PlantEquipmentType::Invalid), HCoil_Index(0), HCoil_FluidIndex(0), + MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), + MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), + HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0), ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), SensCoolEnergy(0.0), CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), OutdoorAirFlowRate(0.0) { } diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 606c8ba61ca..92da6af62c6 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -188,7 +188,7 @@ void SimPumps(EnergyPlusData &state, InitializePumps(state, PumpNum); // If all we need is to set outlet min/max avail, then just do it and get out. Also, we only do min/max avail on flow query - if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(state.dataPumps->PumpEquip(PumpNum).LoopSideNum).FlowLock == DataPlant::iFlowLock::PumpQuery) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(state.dataPumps->PumpEquip(PumpNum).LoopSideNum).FlowLock == DataPlant::FlowLock::PumpQuery) { SetupPumpMinMaxFlows(state, LoopNum, PumpNum); return; } @@ -227,11 +227,6 @@ void GetPumpInput(EnergyPlusData &state) using BranchNodeConnections::TestCompSet; using CurveManager::GetCurveIndex; using CurveManager::GetCurveMinMaxValues; - using DataPlant::TypeOf_PumpBankConstantSpeed; - using DataPlant::TypeOf_PumpBankVariableSpeed; - using DataPlant::TypeOf_PumpCondensate; - using DataPlant::TypeOf_PumpConstantSpeed; - using DataPlant::TypeOf_PumpVariableSpeed; using DataSizing::AutoSize; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; @@ -310,7 +305,7 @@ void GetPumpInput(EnergyPlusData &state) ErrorsFound); state.dataPumps->PumpEquip(PumpNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataPumps->PumpEquip(PumpNum).pumpType = PumpType::VarSpeed; //'Pump:VariableSpeed' - state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = TypeOf_PumpVariableSpeed; + state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = DataPlant::PlantEquipmentType::PumpVariableSpeed; state.dataPumps->PumpEquip(PumpNum).InletNodeNum = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), @@ -561,7 +556,7 @@ void GetPumpInput(EnergyPlusData &state) ErrorsFound); state.dataPumps->PumpEquip(PumpNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataPumps->PumpEquip(PumpNum).pumpType = PumpType::ConSpeed; //'Pump:ConstantSpeed' - state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = TypeOf_PumpConstantSpeed; + state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = DataPlant::PlantEquipmentType::PumpConstantSpeed; state.dataPumps->PumpEquip(PumpNum).InletNodeNum = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), @@ -734,7 +729,7 @@ void GetPumpInput(EnergyPlusData &state) ErrorsFound); state.dataPumps->PumpEquip(PumpNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataPumps->PumpEquip(PumpNum).pumpType = PumpType::Cond; //'Pump:VariableSpeed:Condensate' - state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = TypeOf_PumpCondensate; + state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = DataPlant::PlantEquipmentType::PumpCondensate; state.dataPumps->PumpEquip(PumpNum).InletNodeNum = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), @@ -875,7 +870,7 @@ void GetPumpInput(EnergyPlusData &state) ErrorsFound); state.dataPumps->PumpEquip(PumpNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataPumps->PumpEquip(PumpNum).pumpType = PumpType::Bank_VarSpeed; //'HeaderedPumps:VariableSpeed' - state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = TypeOf_PumpBankVariableSpeed; + state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = DataPlant::PlantEquipmentType::PumpBankVariableSpeed; state.dataPumps->PumpEquip(PumpNum).InletNodeNum = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), @@ -1035,7 +1030,7 @@ void GetPumpInput(EnergyPlusData &state) ErrorsFound); state.dataPumps->PumpEquip(PumpNum).Name = state.dataIPShortCut->cAlphaArgs(1); state.dataPumps->PumpEquip(PumpNum).pumpType = PumpType::Bank_ConSpeed; //'HeaderedPumps:ConstantSpeed' - state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = TypeOf_PumpBankConstantSpeed; + state.dataPumps->PumpEquip(PumpNum).TypeOf_Num = DataPlant::PlantEquipmentType::PumpBankConstantSpeed; state.dataPumps->PumpEquip(PumpNum).InletNodeNum = GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(2), @@ -1783,7 +1778,7 @@ void SetupPumpMinMaxFlows(EnergyPlusData &state, int const LoopNum, int const Pu // Resolve the new mass flow rate based on current pressure characteristics if (state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureSimType == - DataPlant::iPressSimType::FlowCorrection && + DataPlant::PressSimType::FlowCorrection && state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { state.dataPumps->PumpMassFlowRate = @@ -1804,7 +1799,7 @@ void SetupPumpMinMaxFlows(EnergyPlusData &state, int const LoopNum, int const Pu if (state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureSimType == - DataPlant::iPressSimType::FlowCorrection && + DataPlant::PressSimType::FlowCorrection && state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { GetRequiredMassFlowRate(state, @@ -1834,7 +1829,7 @@ void SetupPumpMinMaxFlows(EnergyPlusData &state, int const LoopNum, int const Pu if (state.dataPumps->PumpEquip(PumpNum).LoopNum > 0) { if (state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureSimType == - DataPlant::iPressSimType::FlowCorrection && + DataPlant::PressSimType::FlowCorrection && state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { state.dataPumps->PumpMassFlowRate = ResolveLoopFlowVsPressure(state, @@ -2530,7 +2525,7 @@ void GetRequiredMassFlowRate(EnergyPlusData &state, // Calculate maximum and minimum mass flow rate associated with maximun and minimum RPM if (state.dataPumps->PumpEquip(PumpNum).LoopNum > 0) { if (state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && + state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::PressSimType::FlowCorrection && state.dataPlnt->PlantLoop(state.dataPumps->PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { state.dataPumps->PumpEquip(PumpNum).PumpMassFlowRateMaxRPM = ResolveLoopFlowVsPressure(state, diff --git a/src/EnergyPlus/Pumps.hh b/src/EnergyPlus/Pumps.hh index 219af4a42b1..f527fd38601 100644 --- a/src/EnergyPlus/Pumps.hh +++ b/src/EnergyPlus/Pumps.hh @@ -147,7 +147,7 @@ namespace Pumps { std::string PressureCurve_Name; // - placeholder for pump curve name PumpType pumpType; // pump type enumerator, based on local parameter values, used to identify // index in the cPumpTypes string array to do error reporting - int TypeOf_Num; // pump type of number in reference to the dataplant values + DataPlant::PlantEquipmentType TypeOf_Num; // pump type of number in reference to the dataplant values int LoopNum; // loop where pump is located int LoopSideNum; // LoopSide index on loop where pump is located int BranchNum; // branch index on LoopSide where pump is located @@ -208,8 +208,8 @@ namespace Pumps { // Default Constructor PumpSpecs() - : pumpType(PumpType::Unassigned), TypeOf_Num(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), - PumpControl(PumpControlType::Unassigned), PumpScheduleIndex(0), InletNodeNum(0), OutletNodeNum(0), + : pumpType(PumpType::Unassigned), TypeOf_Num(DataPlant::PlantEquipmentType::Invalid), LoopNum(0), LoopSideNum(0), BranchNum(0), + CompNum(0), PumpControl(PumpControlType::Unassigned), PumpScheduleIndex(0), InletNodeNum(0), OutletNodeNum(0), SequencingScheme(PumpBankControlSeq::Unassigned), FluidIndex(0), NumPumpsInBank(0), PowerErrIndex1(0), PowerErrIndex2(0), MinVolFlowRateFrac(0.0), NomVolFlowRate(0.0), NomVolFlowRateWasAutoSized(false), MassFlowRateMax(0.0), EMSMassFlowOverrideOn(false), EMSMassFlowValue(0.0), NomSteamVolFlowRate(0.0), NomSteamVolFlowRateWasAutoSized(false), MinVolFlowRate(0.0), diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index 305dda34db8..5035e128058 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -9807,7 +9807,7 @@ void InitRefrigerationPlantConnections(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, Condenser(RefCondLoop).Name, - DataPlant::TypeOf_RefrigSystemWaterCondenser, + DataPlant::PlantEquipmentType::RefrigSystemWaterCondenser, Condenser(RefCondLoop).PlantLoopNum, Condenser(RefCondLoop).PlantLoopSideNum, Condenser(RefCondLoop).PlantBranchNum, @@ -9841,7 +9841,7 @@ void InitRefrigerationPlantConnections(EnergyPlusData &state) bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, RefrigRack(RefCompRackLoop).Name, - DataPlant::TypeOf_RefrigerationWaterCoolRack, + DataPlant::PlantEquipmentType::RefrigerationWaterCoolRack, RefrigRack(RefCompRackLoop).PlantLoopNum, RefrigRack(RefCompRackLoop).PlantLoopSideNum, RefrigRack(RefCompRackLoop).PlantBranchNum, diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index 791605b8312..0c161861a69 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -97,7 +97,8 @@ public: // data std::string userNameforHVACsystem; // this coil is an HVAC system named by the user. int zoneHVACTypeNum; // store type num if zoneHVAC int zoneHVACIndex; // store component index for zone HVAC - int typeof_Coil; // type of coil, e.g., TypeOf_CoilWaterSimpleHeating, TypeOf_CoilWaterDetailedFlatCooling, TypeOf_CoilWaterCooling + int typeof_Coil; // type of coil, e.g., PlantEquipmentType::CoilWaterSimpleHeating, PlantEquipmentType::CoilWaterDetailedFlatCooling, + // PlantEquipmentType::CoilWaterCooling int coilSizingMethodConcurrence; // 1 = noncoincident, 2 = coincident std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 61cc9402e78..ec406d673d1 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1681,7 +1681,8 @@ namespace RoomAirModelManager { state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HasIntGainsAssigned = true; int numGainsFound = 0; for (gainsLoop = 1; gainsLoop <= numInputGains; ++gainsLoop) { - TypeNum = getEnumerationValue(DataHeatBalance::IntGainTypeNamesUC, state.dataIPShortCut->cAlphaArgs(gainsLoop * 2)); + TypeNum = getEnumerationValue(DataHeatBalance::IntGainTypeNamesUC, + UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(gainsLoop * 2))); if (TypeNum >= 0) { state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Type = static_cast(TypeNum); diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 47de4c3f8ef..486d7068163 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -4771,9 +4771,9 @@ void InitSetPointManagers(EnergyPlusData &state) CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; ++CompNum) { // Check if cooling tower is single speed and generate and error - state.dataSetPointManager->InitSetPointManagerTypeOf_Num = - state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; - if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_CoolingTower_SingleSpd) { + state.dataSetPointManager->InitType = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Type; + if (state.dataSetPointManager->InitType == PlantEquipmentType::CoolingTower_SingleSpd) { ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).Name + "\", invalid tower found"); @@ -4791,20 +4791,22 @@ void InitSetPointManagers(EnergyPlusData &state) for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).TotalComponents; ++CompNum) { - state.dataSetPointManager->InitSetPointManagerTypeOf_Num = - state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; - if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_Absorption || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_Indirect_Absorption || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_CombTurbine || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_ConstCOP || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_Electric || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_ElectricEIR || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_DFAbsorption || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_ElectricReformEIR || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_EngineDriven) { + state.dataSetPointManager->InitType = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Type; + switch (state.dataSetPointManager->InitType) { + + case PlantEquipmentType::Chiller_Absorption: + case PlantEquipmentType::Chiller_Indirect_Absorption: + case PlantEquipmentType::Chiller_CombTurbine: + case PlantEquipmentType::Chiller_ConstCOP: + case PlantEquipmentType::Chiller_Electric: + case PlantEquipmentType::Chiller_ElectricEIR: + case PlantEquipmentType::Chiller_DFAbsorption: + case PlantEquipmentType::Chiller_ElectricReformEIR: + case PlantEquipmentType::Chiller_EngineDriven: { // Scan the supply side to find the chiller index and branch index on plantloop - state.dataSetPointManager->InitSetPointManagerTypeNum = - state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + state.dataSetPointManager->ChillerType = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Type; for (LoopNum2 = 1; LoopNum2 <= state.dataHVACGlobal->NumCondLoops + state.dataHVACGlobal->NumPlantLoops; ++LoopNum2) { for (BranchNumPlantSide = 1; @@ -4819,7 +4821,7 @@ void InitSetPointManagers(EnergyPlusData &state) .LoopSide(SupplySide) .Branch(BranchNumPlantSide) .Comp(CompNumPlantSide) - .TypeOf_Num == state.dataSetPointManager->InitSetPointManagerTypeNum) { + .Type == state.dataSetPointManager->ChillerType) { state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).LoopIndexPlantSide = LoopNum2; state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).ChillerIndexPlantSide = CompNumPlantSide; @@ -4829,11 +4831,14 @@ void InitSetPointManagers(EnergyPlusData &state) } } } - state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).TypeNum = - state.dataSetPointManager->InitSetPointManagerTypeNum; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).Type = state.dataSetPointManager->ChillerType; state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).LoopIndexDemandSide = LoopNum; state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).ChillerIndexDemandSide = CompNum; state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).BranchIndexDemandSide = BranchNum; + } break; + + default: + break; } } } @@ -4858,9 +4863,9 @@ void InitSetPointManagers(EnergyPlusData &state) CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; ++CompNum) { // Check if cooling tower is single speed and generate and error - state.dataSetPointManager->InitSetPointManagerTypeOf_Num = - state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; - if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_CoolingTower_SingleSpd) { + state.dataSetPointManager->InitType = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Type; + if (state.dataSetPointManager->InitType == PlantEquipmentType::CoolingTower_SingleSpd) { ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Name + @@ -4871,15 +4876,15 @@ void InitSetPointManagers(EnergyPlusData &state) state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Name); ShowContinueError(state, "SingleSpeed cooling towers cannot be used with this setpoint manager on each loop"); ErrorsFound = true; - } else if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_CoolingTower_TwoSpd || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_CoolingTower_VarSpd) { + } else if (state.dataSetPointManager->InitType == PlantEquipmentType::CoolingTower_TwoSpd || + state.dataSetPointManager->InitType == PlantEquipmentType::CoolingTower_VarSpd) { state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondTowerBranchNum.push_back(BranchNum); state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).TowerNum.push_back(CompNum); state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).numTowers++; } // Scan the pump on the condenser water loop - if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_PumpVariableSpeed || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_PumpConstantSpeed) { + if (state.dataSetPointManager->InitType == PlantEquipmentType::PumpVariableSpeed || + state.dataSetPointManager->InitType == PlantEquipmentType::PumpConstantSpeed) { state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondPumpNum = CompNum; state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondPumpBranchNum = BranchNum; } @@ -4890,20 +4895,23 @@ void InitSetPointManagers(EnergyPlusData &state) for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).TotalComponents; ++CompNum) { - state.dataSetPointManager->InitSetPointManagerTypeOf_Num = - state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; - if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_Absorption || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_Indirect_Absorption || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_CombTurbine || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_ConstCOP || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_Electric || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_ElectricEIR || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_DFAbsorption || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_ElectricReformEIR || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == TypeOf_Chiller_EngineDriven) { + state.dataSetPointManager->InitType = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Type; + + switch (state.dataSetPointManager->InitType) { + + case PlantEquipmentType::Chiller_Absorption: + case PlantEquipmentType::Chiller_Indirect_Absorption: + case PlantEquipmentType::Chiller_CombTurbine: + case PlantEquipmentType::Chiller_ConstCOP: + case PlantEquipmentType::Chiller_Electric: + case PlantEquipmentType::Chiller_ElectricEIR: + case PlantEquipmentType::Chiller_DFAbsorption: + case PlantEquipmentType::Chiller_ElectricReformEIR: + case PlantEquipmentType::Chiller_EngineDriven: { // Scan the supply side to find the chiller index and branch index on plantloop - state.dataSetPointManager->InitSetPointManagerTypeNum = - state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + state.dataSetPointManager->ChillerType = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Type; for (LoopNum2 = 1; LoopNum2 <= state.dataHVACGlobal->NumCondLoops + state.dataHVACGlobal->NumPlantLoops; ++LoopNum2) { for (BranchNumPlantSide = 1; @@ -4914,13 +4922,12 @@ void InitSetPointManagers(EnergyPlusData &state) .Branch(BranchNumPlantSide) .TotalComponents; ++CompNumPlantSide) { - state.dataSetPointManager->InitSetPointManagerTypeOf_Num = state.dataPlnt->PlantLoop(LoopNum2) - .LoopSide(SupplySide) - .Branch(BranchNumPlantSide) - .Comp(CompNumPlantSide) - .TypeOf_Num; - if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == - state.dataSetPointManager->InitSetPointManagerTypeNum) { + state.dataSetPointManager->InitType = state.dataPlnt->PlantLoop(LoopNum2) + .LoopSide(SupplySide) + .Branch(BranchNumPlantSide) + .Comp(CompNumPlantSide) + .Type; + if (state.dataSetPointManager->InitType == state.dataSetPointManager->ChillerType) { ++state.dataSetPointManager->InitSetPointManagerNumChiller; state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).LoopIndexPlantSide = LoopNum2; state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ChillerIndexPlantSide = @@ -4936,16 +4943,13 @@ void InitSetPointManagers(EnergyPlusData &state) .Branch(BranchNum2) .TotalComponents; ++CompNum2) { - state.dataSetPointManager->InitSetPointManagerTypeOf_Num = - state.dataPlnt->PlantLoop(LoopNum2) - .LoopSide(SupplySide) - .Branch(BranchNum2) - .Comp(CompNum2) - .TypeOf_Num; - if (state.dataSetPointManager->InitSetPointManagerTypeOf_Num == - TypeOf_PumpVariableSpeed || - state.dataSetPointManager->InitSetPointManagerTypeOf_Num == - TypeOf_PumpConstantSpeed) { + state.dataSetPointManager->InitType = state.dataPlnt->PlantLoop(LoopNum2) + .LoopSide(SupplySide) + .Branch(BranchNum2) + .Comp(CompNum2) + .Type; + if (state.dataSetPointManager->InitType == PlantEquipmentType::PumpVariableSpeed || + state.dataSetPointManager->InitType == PlantEquipmentType::PumpConstantSpeed) { state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ChilledPumpNum = CompNum2; state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum) @@ -4969,9 +4973,12 @@ void InitSetPointManagers(EnergyPlusData &state) state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Name); ErrorsFound = true; } - state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).TypeNum = - state.dataSetPointManager->InitSetPointManagerTypeNum; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Type = state.dataSetPointManager->ChillerType; state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondLoopNum = LoopNum; + } break; + + default: + break; } } } @@ -5712,8 +5719,8 @@ void DefineScheduledTESSetPointManager::calculate(EnergyPlusData &state) CurSchValCharge = GetCurrentScheduleValue(state, this->SchedPtrCharge); // CtrlType bug - // if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller - if (this->CompOpType == DataPlant::iCtrlType::HeatingOp) { // this is some sort of chiller + // if (this->CompOpType == DataPlant::CtrlType::CoolingOp) { // this is some sort of chiller + if (this->CompOpType == DataPlant::CtrlType::HeatingOp) { // this is some sort of chiller if (CurSchValOnPeak >= OnVal) { this->SetPt = this->NonChargeCHWTemp; } else if (CurSchValCharge < OnVal) { @@ -5722,8 +5729,8 @@ void DefineScheduledTESSetPointManager::calculate(EnergyPlusData &state) this->SetPt = this->ChargeCHWTemp; } // CtrlType Bug - // } else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system - } else if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of ice storage system + // } else if (this->CompOpType == DataPlant::CtrlType::DualOp) { // this is some sort of ice storage system + } else if (this->CompOpType == DataPlant::CtrlType::CoolingOp) { // this is some sort of ice storage system this->SetPt = this->NonChargeCHWTemp; } } @@ -7430,7 +7437,7 @@ void DefineCondEntSetPointManager::calculate(EnergyPlusData &state) int BranchIndexDemandSide(0); int LoopIndexPlantSide(0); int LoopIndexDemandSide(0); - int TypeNum(0); + DataPlant::PlantEquipmentType Type(DataPlant::PlantEquipmentType::Invalid); // Get from tower design values NormDsnCondFlow = 5.38e-8; // m3/s per watt (typically 3 gpm/ton)=(Volume of condenser fluid)/(ton of heat rejection) @@ -7443,7 +7450,7 @@ void DefineCondEntSetPointManager::calculate(EnergyPlusData &state) LoopIndexPlantSide = this->LoopIndexPlantSide; ChillerIndexPlantSide = this->ChillerIndexPlantSide; BranchIndexPlantSide = this->BranchIndexPlantSide; - TypeNum = this->TypeNum; + Type = this->Type; LoopIndexDemandSide = this->LoopIndexDemandSide; ChillerIndexDemandSide = this->ChillerIndexDemandSide; BranchIndexDemandSide = this->BranchIndexDemandSide; @@ -7452,8 +7459,9 @@ void DefineCondEntSetPointManager::calculate(EnergyPlusData &state) CurLoad = std::abs(state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).MyLoad); if (CurLoad > 0) { - if (TypeNum == TypeOf_Chiller_Absorption || TypeNum == TypeOf_Chiller_CombTurbine || TypeNum == TypeOf_Chiller_Electric || - TypeNum == TypeOf_Chiller_ElectricReformEIR || TypeNum == TypeOf_Chiller_EngineDriven) { + if (Type == PlantEquipmentType::Chiller_Absorption || Type == PlantEquipmentType::Chiller_CombTurbine || + Type == PlantEquipmentType::Chiller_Electric || Type == PlantEquipmentType::Chiller_ElectricReformEIR || + Type == PlantEquipmentType::Chiller_EngineDriven) { TempDesCondIn = state.dataPlnt->PlantLoop(LoopIndexPlantSide) .LoopSide(SupplySide) .Branch(BranchIndexPlantSide) @@ -7481,7 +7489,7 @@ void DefineCondEntSetPointManager::calculate(EnergyPlusData &state) state.dataSetPointManager->DCESPMDesignClgCapacity_Watts = state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).MaxLoad; state.dataSetPointManager->DCESPMCurrentLoad_Watts = state.dataPlnt->PlantLoop(LoopIndexPlantSide).CoolingDemand; - } else if (TypeNum == TypeOf_Chiller_Indirect_Absorption || TypeNum == TypeOf_Chiller_DFAbsorption) { + } else if (Type == PlantEquipmentType::Chiller_Indirect_Absorption || Type == PlantEquipmentType::Chiller_DFAbsorption) { TempDesCondIn = state.dataPlnt->PlantLoop(LoopIndexPlantSide) .LoopSide(SupplySide) .Branch(BranchIndexPlantSide) @@ -7651,9 +7659,9 @@ void DefineIdealCondEntSetPointManager::calculate(EnergyPlusData &state) if (CurLoad > 0) { // Calculate the minimum condenser inlet temperature boundary for set point - if (this->TypeNum == TypeOf_Chiller_Absorption || this->TypeNum == TypeOf_Chiller_CombTurbine || - this->TypeNum == TypeOf_Chiller_Electric || this->TypeNum == TypeOf_Chiller_ElectricReformEIR || - this->TypeNum == TypeOf_Chiller_EngineDriven) { + if (this->Type == PlantEquipmentType::Chiller_Absorption || this->Type == PlantEquipmentType::Chiller_CombTurbine || + this->Type == PlantEquipmentType::Chiller_Electric || this->Type == PlantEquipmentType::Chiller_ElectricReformEIR || + this->Type == PlantEquipmentType::Chiller_EngineDriven) { EvapOutletTemp = state.dataLoopNodes ->Node(state.dataPlnt->PlantLoop(this->LoopIndexPlantSide) .LoopSide(SupplySide) @@ -9109,7 +9117,7 @@ void SetUpNewScheduledTESSetPtMgr(EnergyPlusData &state, int const SchedPtrCharge, Real64 NonChargeCHWTemp, Real64 ChargeCHWTemp, - DataPlant::iCtrlType const &CompOpType, + DataPlant::CtrlType const &CompOpType, int const ControlNodeNum) { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/SetPointManager.hh b/src/EnergyPlus/SetPointManager.hh index 6d71f974ce5..b04cd067103 100644 --- a/src/EnergyPlus/SetPointManager.hh +++ b/src/EnergyPlus/SetPointManager.hh @@ -799,21 +799,21 @@ namespace SetPointManager { Real64 MaxCondEntTemp; // maximum condenser entering water temp int NumCtrlNodes; // number of nodes whose temperature is being set std::string CtrlNodeListName; - Array1D_int CtrlNodes; // nodes where temperature is being set - Real64 SetPt; // the temperature set point [C] - int ChillerIndexPlantSide; // plant side chiller index - int ChillerIndexDemandSide; // demand side chiller index - int BranchIndexPlantSide; // plant side branch index - int BranchIndexDemandSide; // demand side branch index - int LoopIndexPlantSide; // plant side loop index - int LoopIndexDemandSide; // deand side loop index - int TypeNum; // chiller type number + Array1D_int CtrlNodes; // nodes where temperature is being set + Real64 SetPt; // the temperature set point [C] + int ChillerIndexPlantSide; // plant side chiller index + int ChillerIndexDemandSide; // demand side chiller index + int BranchIndexPlantSide; // plant side branch index + int BranchIndexDemandSide; // demand side branch index + int LoopIndexPlantSide; // plant side loop index + int LoopIndexDemandSide; // deand side loop index + DataPlant::PlantEquipmentType Type; // chiller type number // Default Constructor DefineCondEntSetPointManager() : CondEntTempSchedPtr(0), TowerDsnInletAirWetBulb(0.0), MinTwrWbCurve(0), MinOaWbCurve(0), OptCondEntCurve(0), MinimumLiftTD(0.0), MaxCondEntTemp(0.0), NumCtrlNodes(0), SetPt(0.0), ChillerIndexPlantSide(0), ChillerIndexDemandSide(0), BranchIndexPlantSide(0), - BranchIndexDemandSide(0), LoopIndexPlantSide(0), LoopIndexDemandSide(0), TypeNum(0) + BranchIndexDemandSide(0), LoopIndexPlantSide(0), LoopIndexDemandSide(0), Type(DataPlant::PlantEquipmentType::Invalid) { } @@ -841,7 +841,7 @@ namespace SetPointManager { Array1D_int ClTowerVarIndex; // report variable index OutputProcessor::VariableType CndPumpVarType; // report variable type int CndPumpVarIndex; // report variable index - int TypeNum; // chiller type number + DataPlant::PlantEquipmentType Type; // chiller type number Array1D_int TowerNum; // cooling tower number int CondLoopNum; // condenser loop number Array1D_int CondTowerBranchNum; // condenser branch number @@ -857,8 +857,8 @@ namespace SetPointManager { : MinimumLiftTD(0.0), MaxCondEntTemp(0.0), NumCtrlNodes(0), SetPt(0.0), ChillerIndexPlantSide(0), BranchIndexPlantSide(0), LoopIndexPlantSide(0), ChllrVarType(OutputProcessor::VariableType::NotFound), ChllrVarIndex(0), ChlPumpVarType(OutputProcessor::VariableType::NotFound), ChlPumpVarIndex(0), CndPumpVarType(OutputProcessor::VariableType::NotFound), - CndPumpVarIndex(0), TypeNum(0), CondLoopNum(0), numTowers(0), CondPumpNum(0), CondPumpBranchNum(0), ChilledPumpNum(0), - ChilledPumpBranchNum(0), SetupIdealCondEntSetPtVars(true) + CndPumpVarIndex(0), Type(DataPlant::PlantEquipmentType::Invalid), CondLoopNum(0), numTowers(0), CondPumpNum(0), CondPumpBranchNum(0), + ChilledPumpNum(0), ChilledPumpBranchNum(0), SetupIdealCondEntSetPtVars(true) { } @@ -979,12 +979,12 @@ namespace SetPointManager { int CtrlNodeNum; Real64 NonChargeCHWTemp; Real64 ChargeCHWTemp; - DataPlant::iCtrlType CompOpType; + DataPlant::CtrlType CompOpType; Real64 SetPt; // Default Constructor DefineScheduledTESSetPointManager() - : SchedPtr(0), SchedPtrCharge(0), CtrlNodeNum(0), NonChargeCHWTemp(0.0), ChargeCHWTemp(0.0), CompOpType(DataPlant::iCtrlType::Unassigned), + : SchedPtr(0), SchedPtrCharge(0), CtrlNodeNum(0), NonChargeCHWTemp(0.0), ChargeCHWTemp(0.0), CompOpType(DataPlant::CtrlType::Unassigned), SetPt(0.0) { } @@ -1028,7 +1028,7 @@ namespace SetPointManager { int SchedPtrCharge, Real64 NonChargeCHWTemp, Real64 ChargeCHWTemp, - DataPlant::iCtrlType const &CompOpType, + DataPlant::CtrlType const &CompOpType, int ControlNodeNum); bool GetCoilFreezingCheckFlag(EnergyPlusData &state, int MixedAirSPMNum); @@ -1077,9 +1077,9 @@ struct SetPointManagerData : BaseGlobalStruct int GetSetPointManagerInputMaxNumAlphas = 0; // argument for call to GetObjectDefMaxArgs int GetSetPointManagerInputMaxNumNumbers = 0; // argument for call to GetObjectDefMaxArgs - int InitSetPointManagerTypeNum = 0; + DataPlant::PlantEquipmentType ChillerType = DataPlant::PlantEquipmentType::Invalid; int InitSetPointManagerNumChiller = 0; - int InitSetPointManagerTypeOf_Num = 0; + DataPlant::PlantEquipmentType InitType = DataPlant::PlantEquipmentType::Invalid; bool ManagerOn = false; bool GetInputFlag = true; // First time, input is "gotten" @@ -1209,9 +1209,9 @@ struct SetPointManagerData : BaseGlobalStruct GetSetPointManagerInputMaxNumAlphas = 0; // argument for call to GetObjectDefMaxArgs GetSetPointManagerInputMaxNumNumbers = 0; // argument for call to GetObjectDefMaxArgs - InitSetPointManagerTypeNum = 0; + ChillerType = DataPlant::PlantEquipmentType::Invalid; InitSetPointManagerNumChiller = 0; - InitSetPointManagerTypeOf_Num = 0; + InitType = DataPlant::PlantEquipmentType::Invalid; ManagerOn = false; GetInputFlag = true; // First time, input is "gotten" diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index d2123f988f9..4b770c9e111 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -250,8 +250,7 @@ void GetSysInput(EnergyPlusData &state) using Fans::GetFanInletNode; using Fans::GetFanOutletNode; using namespace DataHeatBalance; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + // SUBROUTINE PARAMETER DEFINITIONS: static constexpr std::string_view RoutineName("GetSysInput: "); // include trailing blank @@ -391,11 +390,13 @@ void GetSysInput(EnergyPlusData &state) } else if (UtilityRoutines::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 = TypeOf_CoilWaterSimpleHeating; + 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")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = + DataPlant::PlantEquipmentType::CoilSteamAirHeating; } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp.empty()) { ShowSevereError( state, "Illegal " + cAlphaFields(8) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); @@ -797,11 +798,13 @@ void GetSysInput(EnergyPlusData &state) } else if (UtilityRoutines::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 = TypeOf_CoilWaterSimpleHeating; + 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")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = + DataPlant::PlantEquipmentType::CoilSteamAirHeating; } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp.empty()) { ShowSevereError( state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); @@ -1108,11 +1111,13 @@ void GetSysInput(EnergyPlusData &state) } else if (UtilityRoutines::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 = TypeOf_CoilWaterSimpleHeating; + 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")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = + DataPlant::PlantEquipmentType::CoilSteamAirHeating; } else { ShowSevereError( state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); @@ -2054,11 +2059,13 @@ void GetSysInput(EnergyPlusData &state) } else if (UtilityRoutines::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 = TypeOf_CoilWaterSimpleHeating; + 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")) { state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_Num = HeatingCoilType::SteamAirHeating; - state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp_PlantType = + DataPlant::PlantEquipmentType::CoilSteamAirHeating; } else if (!state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp.empty()) { ShowSevereError( state, "Illegal " + cAlphaFields(7) + " = " + state.dataSingleDuct->sd_airterminal(state.dataSingleDuct->SysNumGSI).ReheatComp + '.'); @@ -2483,8 +2490,7 @@ void SingleDuctAirTerminal::InitSys(EnergyPlusData &state, bool const FirstHVACI // Uses the status flags to trigger events. // Using/Aliasing - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataZoneEquipment::CheckZoneEquipmentList; using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; @@ -2523,7 +2529,8 @@ void SingleDuctAirTerminal::InitSys(EnergyPlusData &state, bool const FirstHVACI } if (this->PlantLoopScanFlag && allocated(state.dataPlnt->PlantLoop)) { - if ((this->ReheatComp_PlantType == TypeOf_CoilWaterSimpleHeating) || (this->ReheatComp_PlantType == TypeOf_CoilSteamAirHeating)) { + if ((this->ReheatComp_PlantType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || + (this->ReheatComp_PlantType == DataPlant::PlantEquipmentType::CoilSteamAirHeating)) { // setup plant topology indices for plant fed heating coils errFlag = false; ScanPlantLoopsForObject(state, diff --git a/src/EnergyPlus/SingleDuct.hh b/src/EnergyPlus/SingleDuct.hh index 02007b72f02..75b4fe4ac5d 100644 --- a/src/EnergyPlus/SingleDuct.hh +++ b/src/EnergyPlus/SingleDuct.hh @@ -58,6 +58,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -120,20 +121,20 @@ namespace SingleDuct { struct SingleDuctAirTerminal { // Members - int SysNum; // index to single duct air terminal unit - std::string SysName; // Name of the Sys - std::string SysType; // Type of Sys ie. VAV, Mixing, Inducing, etc. - enum SysType SysType_Num; // Numeric Equivalent for System type - std::string Schedule; // Sys Operation Schedule - int SchedPtr; // Pointer to the correct schedule - std::string ReheatComp; // Type of the Reheat Coil Object - HeatingCoilType ReheatComp_Num; // Numeric Equivalent in this module for Coil type - int ReheatComp_Index; // Returned Index number from other routines - std::string ReheatName; // name of reheat coil - int ReheatComp_PlantType; // typeOf_ number for plant type of heating coil - std::string FanType; // Type of the Fan Object - int Fan_Num; // Numeric Equivalent in this module for fan type - int Fan_Index; // Returned Index number from other routines + int SysNum; // index to single duct air terminal unit + std::string SysName; // Name of the Sys + std::string SysType; // Type of Sys ie. VAV, Mixing, Inducing, etc. + enum SysType SysType_Num; // Numeric Equivalent for System type + std::string Schedule; // Sys Operation Schedule + int SchedPtr; // Pointer to the correct schedule + std::string ReheatComp; // Type of the Reheat Coil Object + HeatingCoilType ReheatComp_Num; // Numeric Equivalent in this module for Coil type + int ReheatComp_Index; // Returned Index number from other routines + std::string ReheatName; // name of reheat coil + DataPlant::PlantEquipmentType ReheatComp_PlantType; // typeOf_ number for plant type of heating coil + std::string FanType; // Type of the Fan Object + int Fan_Num; // Numeric Equivalent in this module for fan type + int Fan_Index; // Returned Index number from other routines int ControlCompTypeNum; int CompErrIndex; std::string FanName; // name of fan @@ -218,15 +219,15 @@ namespace SingleDuct { // Default Constructor SingleDuctAirTerminal() : SysNum(-1), SysType_Num(SysType::Unknown), SchedPtr(0), ReheatComp_Num(HeatingCoilType::None), ReheatComp_Index(0), - ReheatComp_PlantType(0), Fan_Num(0), Fan_Index(0), ControlCompTypeNum(0), CompErrIndex(0), MaxAirVolFlowRate(0.0), - AirMassFlowRateMax(0.0), MaxHeatAirVolFlowRate(0.0), HeatAirMassFlowRateMax(0.0), ZoneMinAirFracMethod(MinFlowFraction::Constant), - ZoneMinAirFracDes(0.0), ZoneMinAirFrac(0.0), ZoneMinAirFracReport(0.0), ZoneFixedMinAir(0.0), ZoneMinAirFracSchPtr(0), - ConstantMinAirFracSetByUser(false), FixedMinAirSetByUser(false), DesignMinAirFrac(0.0), DesignFixedMinAir(0.0), InletNodeNum(0), - OutletNodeNum(0), ReheatControlNode(0), ReheatCoilOutletNode(0), ReheatCoilMaxCapacity(0.0), ReheatAirOutletNode(0), - MaxReheatWaterVolFlow(0.0), MaxReheatSteamVolFlow(0.0), MaxReheatWaterFlow(0.0), MaxReheatSteamFlow(0.0), MinReheatWaterVolFlow(0.0), - MinReheatSteamVolFlow(0.0), MinReheatWaterFlow(0.0), MinReheatSteamFlow(0.0), ControllerOffset(0.0), MaxReheatTemp(0.0), - MaxReheatTempSetByUser(false), DamperHeatingAction(Action::HeatingActionNotUsed), DamperPosition(0.0), ADUNum(0), FluidIndex(0), - ErrCount1(0), ErrCount1c(0), ErrCount2(0), ZoneFloorArea(0.0), CtrlZoneNum(0), CtrlZoneInNodeIndex(0), ActualZoneNum(0), + ReheatComp_PlantType(DataPlant::PlantEquipmentType::Invalid), Fan_Num(0), Fan_Index(0), ControlCompTypeNum(0), CompErrIndex(0), + MaxAirVolFlowRate(0.0), AirMassFlowRateMax(0.0), MaxHeatAirVolFlowRate(0.0), HeatAirMassFlowRateMax(0.0), + ZoneMinAirFracMethod(MinFlowFraction::Constant), ZoneMinAirFracDes(0.0), ZoneMinAirFrac(0.0), ZoneMinAirFracReport(0.0), + ZoneFixedMinAir(0.0), ZoneMinAirFracSchPtr(0), ConstantMinAirFracSetByUser(false), FixedMinAirSetByUser(false), DesignMinAirFrac(0.0), + DesignFixedMinAir(0.0), InletNodeNum(0), OutletNodeNum(0), ReheatControlNode(0), ReheatCoilOutletNode(0), ReheatCoilMaxCapacity(0.0), + ReheatAirOutletNode(0), MaxReheatWaterVolFlow(0.0), MaxReheatSteamVolFlow(0.0), MaxReheatWaterFlow(0.0), MaxReheatSteamFlow(0.0), + MinReheatWaterVolFlow(0.0), MinReheatSteamVolFlow(0.0), MinReheatWaterFlow(0.0), MinReheatSteamFlow(0.0), ControllerOffset(0.0), + MaxReheatTemp(0.0), MaxReheatTempSetByUser(false), DamperHeatingAction(Action::HeatingActionNotUsed), DamperPosition(0.0), ADUNum(0), + FluidIndex(0), ErrCount1(0), ErrCount1c(0), ErrCount2(0), ZoneFloorArea(0.0), CtrlZoneNum(0), CtrlZoneInNodeIndex(0), ActualZoneNum(0), MaxAirVolFlowRateDuringReheat(0.0), MaxAirVolFractionDuringReheat(0.0), AirMassFlowDuringReheatMax(0.0), ZoneOutdoorAirMethod(0), OutdoorAirFlowRate(0.0), NoOAFlowInputFromUser(true), OARequirementsPtr(0), AirLoopNum(0), HWLoopNum(0), HWLoopSide(0), HWBranchIndex(0), HWCompIndex(0), SecInNode(0), IterationLimit(0), IterationFailed(0), OAPerPersonMode(0), EMSOverrideAirFlow(false), diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index ae407bd6ed4..610cf80136b 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -304,8 +304,8 @@ namespace SolarCollectors { GlobalNames::VerifyUniqueInterObjectName( state, state.dataSolarCollectors->UniqueCollectorNames, state.dataIPShortCut->cAlphaArgs(1), CurrentModuleObject, ErrorsFound); state.dataSolarCollectors->Collector(CollectorNum).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataSolarCollectors->Collector(CollectorNum).TypeNum = - DataPlant::TypeOf_SolarCollectorFlatPlate; // parameter assigned in DataPlant + state.dataSolarCollectors->Collector(CollectorNum).Type = + DataPlant::PlantEquipmentType::SolarCollectorFlatPlate; // parameter assigned in DataPlant // Get parameters object int ParametersNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSolarCollectors->Parameters); @@ -547,7 +547,8 @@ namespace SolarCollectors { state.dataIPShortCut->cAlphaFieldNames(1), ErrorsFound); state.dataSolarCollectors->Collector(CollectorNum).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataSolarCollectors->Collector(CollectorNum).TypeNum = DataPlant::TypeOf_SolarCollectorICS; // parameter assigned in DataPlant + state.dataSolarCollectors->Collector(CollectorNum).Type = + DataPlant::PlantEquipmentType::SolarCollectorICS; // parameter assigned in DataPlant state.dataSolarCollectors->Collector(CollectorNum).InitICS = true; @@ -717,7 +718,7 @@ namespace SolarCollectors { void CollectorData::setupOutputVars(EnergyPlusData &state) { - if (this->TypeNum == DataPlant::TypeOf_SolarCollectorFlatPlate) { + if (this->Type == DataPlant::PlantEquipmentType::SolarCollectorFlatPlate) { // Setup report variables SetupOutputVariable(state, "Solar Collector Incident Angle Modifier", @@ -771,7 +772,7 @@ namespace SolarCollectors { "HeatProduced", _, "Plant"); - } else if (this->TypeNum == DataPlant::TypeOf_SolarCollectorICS) { + } else if (this->Type == DataPlant::PlantEquipmentType::SolarCollectorICS) { SetupOutputVariable(state, "Solar Collector Transmittance Absorptance Product", @@ -887,11 +888,11 @@ namespace SolarCollectors { this->initialize(state); { - auto const SELECT_CASE_var(this->TypeNum); + auto const SELECT_CASE_var(this->Type); // Select and CALL models based on collector type - if (SELECT_CASE_var == DataPlant::TypeOf_SolarCollectorFlatPlate) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::SolarCollectorFlatPlate) { this->CalcSolarCollector(state); - } else if (SELECT_CASE_var == DataPlant::TypeOf_SolarCollectorICS) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::SolarCollectorICS) { this->CalcICSSolarCollector(state); } else { assert(false); // LCOV_EXCL_LINE @@ -1253,15 +1254,17 @@ namespace SolarCollectors { if (qEquation < 0.0) { if (this->ErrIndex == 0) { ShowSevereMessage(state, - "CalcSolarCollector: " + DataPlant::ccSimPlantEquipTypes(this->TypeNum) + "=\"" + this->Name + - "\", possible bad input coefficients."); + format("CalcSolarCollector: {}=\"{}\", possible bad input coefficients.", + DataPlant::PlantEquipTypeNames[static_cast(this->Type)], + this->Name)); ShowContinueError(state, "...coefficients cause negative quadratic equation part in calculating temperature of stagnant fluid."); ShowContinueError(state, "...examine input coefficients for accuracy. Calculation will be treated as linear."); } ShowRecurringSevereErrorAtEnd(state, - "CalcSolarCollector: " + DataPlant::ccSimPlantEquipTypes(this->TypeNum) + "=\"" + this->Name + - "\", coefficient error continues.", + format("CalcSolarCollector: {}=\"{}\", coefficient error continues.", + DataPlant::PlantEquipTypeNames[static_cast(this->Type)], + this->Name), this->ErrIndex, qEquation, qEquation); @@ -1280,12 +1283,14 @@ namespace SolarCollectors { if (Iteration > 100) { if (this->IterErrIndex == 0) { ShowWarningMessage(state, - "CalcSolarCollector: " + DataPlant::ccSimPlantEquipTypes(this->TypeNum) + "=\"" + this->Name + - "\": Solution did not converge."); + format("CalcSolarCollector: {}=\"{}\": Solution did not converge.", + DataPlant::PlantEquipTypeNames[static_cast(this->Type)], + this->Name)); } ShowRecurringWarningErrorAtEnd(state, - "CalcSolarCollector: " + DataPlant::ccSimPlantEquipTypes(this->TypeNum) + "=\"" + this->Name + - "\", solution not converge error continues.", + format("CalcSolarCollector: {}=\"{}\", solution not converge error continues.", + DataPlant::PlantEquipTypeNames[static_cast(this->Type)], + this->Name), this->IterErrIndex); break; } else { @@ -2199,7 +2204,7 @@ namespace SolarCollectors { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->TypeNum, + this->Type, this->WLoopNum, this->WLoopSideNum, this->WLoopBranchNum, diff --git a/src/EnergyPlus/SolarCollectors.hh b/src/EnergyPlus/SolarCollectors.hh index 9449031a28e..d1861833d0b 100644 --- a/src/EnergyPlus/SolarCollectors.hh +++ b/src/EnergyPlus/SolarCollectors.hh @@ -126,29 +126,29 @@ namespace SolarCollectors { struct CollectorData : PlantComponent { // Members - std::string Name; // Name of solar collector - std::string BCType; // Boundary condition Type - std::string OSCMName; // OtherSideConditionsModel - int VentCavIndex; // index of ventilated cavity object - TankTypeEnum ICSType_Num; // ICS collector type number - int TypeNum; // Plant Side Connection: 'TypeOf_Num' assigned in DataPlant - int WLoopNum; // Water plant loop index number - int WLoopSideNum; // Water plant loop side index - int WLoopBranchNum; // Water plant loop branch index - int WLoopCompNum; // Water plant loop component index - bool Init; // Flag for initialization: TRUE means do the init - bool InitSizing; // Flag for initialization of plant sizing - int Parameters; // Parameters object number - int Surface; // Surface object number - int InletNode; // Inlet node - Real64 InletTemp; // Inlet temperature from plant (C) - int OutletNode; // Outlet node - Real64 OutletTemp; // Outlet temperature or stagnation temperature in the collector (C) - Real64 MassFlowRate; // Mass flow rate through the collector (kg/s) - Real64 MassFlowRateMax; // Maximum mass flow rate through the collector (kg/s) - Real64 VolFlowRateMax; // Maximum volumetric flow rate through the collector (m3/s) - int ErrIndex; // Error index for recurring error - int IterErrIndex; // Error index for recurring error (iteration - did not converge) + std::string Name; // Name of solar collector + std::string BCType; // Boundary condition Type + std::string OSCMName; // OtherSideConditionsModel + int VentCavIndex; // index of ventilated cavity object + TankTypeEnum ICSType_Num; // ICS collector type number + DataPlant::PlantEquipmentType Type; // Plant Side Connection: 'Type' assigned in DataPlant + int WLoopNum; // Water plant loop index number + int WLoopSideNum; // Water plant loop side index + int WLoopBranchNum; // Water plant loop branch index + int WLoopCompNum; // Water plant loop component index + bool Init; // Flag for initialization: TRUE means do the init + bool InitSizing; // Flag for initialization of plant sizing + int Parameters; // Parameters object number + int Surface; // Surface object number + int InletNode; // Inlet node + Real64 InletTemp; // Inlet temperature from plant (C) + int OutletNode; // Outlet node + Real64 OutletTemp; // Outlet temperature or stagnation temperature in the collector (C) + Real64 MassFlowRate; // Mass flow rate through the collector (kg/s) + Real64 MassFlowRateMax; // Maximum mass flow rate through the collector (kg/s) + Real64 VolFlowRateMax; // Maximum volumetric flow rate through the collector (m3/s) + int ErrIndex; // Error index for recurring error + int IterErrIndex; // Error index for recurring error (iteration - did not converge) // Report variables Real64 IncidentAngleModifier; // Net incident angle modifier Real64 Efficiency; // Thermal efficiency of solar energy conversion @@ -209,14 +209,15 @@ namespace SolarCollectors { // Default Constructor CollectorData() - : VentCavIndex(0), ICSType_Num(TankTypeEnum::ICSRectangularTank), TypeNum(0), WLoopNum(0), WLoopSideNum(0), WLoopBranchNum(0), - WLoopCompNum(0), Init(true), InitSizing(true), Parameters(0), Surface(0), InletNode(0), InletTemp(0.0), OutletNode(0), OutletTemp(0.0), - MassFlowRate(0.0), MassFlowRateMax(0.0), VolFlowRateMax(0.0), ErrIndex(0), IterErrIndex(0), IncidentAngleModifier(0.0), Efficiency(0.0), - Power(0.0), HeatGain(0.0), HeatLoss(0.0), Energy(0.0), HeatRate(0.0), HeatEnergy(0.0), StoredHeatRate(0.0), StoredHeatEnergy(0.0), - HeatGainRate(0.0), HeatGainEnergy(0.0), HeatLossRate(0.0), HeatLossEnergy(0.0), SkinHeatLossRate(0.0), CollHeatLossEnergy(0.0), - TauAlpha(0.0), UTopLoss(0.0), TempOfWater(0.0), TempOfAbsPlate(0.0), TempOfInnerCover(0.0), TempOfOuterCover(0.0), TauAlphaNormal(0.0), - TauAlphaSkyDiffuse(0.0), TauAlphaGndDiffuse(0.0), TauAlphaBeam(0.0), CoversAbsSkyDiffuse(2, 0.0), CoversAbsGndDiffuse(2, 0.0), - CoverAbs(2, 0.0), TimeElapsed(0.0), UbLoss(0.0), UsLoss(0.0), AreaRatio(0.0), RefSkyDiffInnerCover(0.0), RefGrnDiffInnerCover(0.0), + : VentCavIndex(0), ICSType_Num(TankTypeEnum::ICSRectangularTank), Type(DataPlant::PlantEquipmentType::Invalid), WLoopNum(0), + WLoopSideNum(0), WLoopBranchNum(0), WLoopCompNum(0), Init(true), InitSizing(true), Parameters(0), Surface(0), InletNode(0), + InletTemp(0.0), OutletNode(0), OutletTemp(0.0), MassFlowRate(0.0), MassFlowRateMax(0.0), VolFlowRateMax(0.0), ErrIndex(0), + IterErrIndex(0), IncidentAngleModifier(0.0), Efficiency(0.0), Power(0.0), HeatGain(0.0), HeatLoss(0.0), Energy(0.0), HeatRate(0.0), + HeatEnergy(0.0), StoredHeatRate(0.0), StoredHeatEnergy(0.0), HeatGainRate(0.0), HeatGainEnergy(0.0), HeatLossRate(0.0), + HeatLossEnergy(0.0), SkinHeatLossRate(0.0), CollHeatLossEnergy(0.0), TauAlpha(0.0), UTopLoss(0.0), TempOfWater(0.0), + TempOfAbsPlate(0.0), TempOfInnerCover(0.0), TempOfOuterCover(0.0), TauAlphaNormal(0.0), TauAlphaSkyDiffuse(0.0), + TauAlphaGndDiffuse(0.0), TauAlphaBeam(0.0), CoversAbsSkyDiffuse(2, 0.0), CoversAbsGndDiffuse(2, 0.0), CoverAbs(2, 0.0), + TimeElapsed(0.0), UbLoss(0.0), UsLoss(0.0), AreaRatio(0.0), RefSkyDiffInnerCover(0.0), RefGrnDiffInnerCover(0.0), RefDiffInnerCover(0.0), SavedTempOfWater(0.0), SavedTempOfAbsPlate(0.0), SavedTempOfInnerCover(0.0), SavedTempOfOuterCover(0.0), SavedTempCollectorOSCM(0.0), Length(1.0), TiltR2V(0.0), Tilt(0.0), CosTilt(0.0), SinTilt(0.0), SideArea(0.0), Area(0.0), Volume(0.0), OSCM_ON(false), InitICS(false), SetLoopIndexFlag(true), SetDiffRadFlag(true) diff --git a/src/EnergyPlus/StandardRatings.cc b/src/EnergyPlus/StandardRatings.cc index b73908889eb..fa4323c1015 100644 --- a/src/EnergyPlus/StandardRatings.cc +++ b/src/EnergyPlus/StandardRatings.cc @@ -211,7 +211,7 @@ namespace StandardRatings { void CalcChillerIPLV(EnergyPlusData &state, std::string const &ChillerName, // Name of Chiller for which IPLV is calculated - int const ChillerType, // Type of Chiller - EIR or Reformulated EIR + DataPlant::PlantEquipmentType ChillerType, // Type of Chiller - EIR or Reformulated EIR Real64 const RefCap, // Reference capacity of chiller [W] Real64 const RefCOP, // Reference coefficient of performance [W/W] DataPlant::CondenserType const CondenserType, // Type of Condenser - Air Cooled, Water Cooled or Evap Cooled @@ -253,8 +253,7 @@ namespace StandardRatings { using namespace OutputReportPredefined; using CurveManager::CurveValue; using CurveManager::GetCurveName; - using DataPlant::TypeOf_Chiller_ElectricEIR; - using DataPlant::TypeOf_Chiller_ElectricReformEIR; + using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -366,7 +365,7 @@ namespace StandardRatings { { auto const SELECT_CASE_var(ChillerType); - if (SELECT_CASE_var == TypeOf_Chiller_ElectricEIR) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricEIR) { if (RedCapNum == 1.0) { // Get curve modifier values at rated conditions (load = 100%) ChillerCapFT_rated = CurveValue(state, CapFTempCurveIndex, EvapOutletTemp, CondenserInletTemp); @@ -391,7 +390,7 @@ namespace StandardRatings { PartLoadRatio = MinUnloadRat; } - } else if (SELECT_CASE_var == TypeOf_Chiller_ElectricReformEIR) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR) { Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(CondLoopNum).FluidName, EnteringWaterTempReduced, @@ -478,10 +477,10 @@ namespace StandardRatings { } else { { auto const SELECT_CASE_var(ChillerType); - if (SELECT_CASE_var == TypeOf_Chiller_ElectricEIR) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricEIR) { ShowWarningError(state, "Chiller:Electric:EIR = " + ChillerName + ": Integrated Part Load Value (IPLV) cannot be calculated."); - } else if (SELECT_CASE_var == TypeOf_Chiller_ElectricReformEIR) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR) { ShowWarningError(state, "Chiller:Electric:ReformulatedEIR = " + ChillerName + @@ -611,10 +610,10 @@ namespace StandardRatings { } void ReportChillerIPLV(EnergyPlusData &state, - std::string const &ChillerName, // Name of Chiller for which IPLV is calculated - int const ChillerType, // Type of Chiller - EIR or Reformulated EIR - Real64 const IPLVValueSI, // IPLV value in SI units {W/W} - Real64 const IPLVValueIP // IPLV value in IP units {Btu/W-h} + std::string const &ChillerName, // Name of Chiller for which IPLV is calculated + DataPlant::PlantEquipmentType ChillerType, // Type of Chiller - EIR or Reformulated EIR + Real64 const IPLVValueSI, // IPLV value in SI units {W/W} + Real64 const IPLVValueIP // IPLV value in IP units {Btu/W-h} ) { @@ -630,8 +629,6 @@ namespace StandardRatings { // Using/Aliasing using namespace OutputReportPredefined; - using DataPlant::TypeOf_Chiller_ElectricEIR; - using DataPlant::TypeOf_Chiller_ElectricReformEIR; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: auto &StandardRatingsMyOneTimeFlag = state.dataHVACGlobal->StandardRatingsMyOneTimeFlag; @@ -648,12 +645,12 @@ namespace StandardRatings { { static constexpr std::string_view Format_991(" Chiller Standard Rating Information, {}, {}, {:.2R}, {:.2R}\n"); auto const SELECT_CASE_var(ChillerType); - if (SELECT_CASE_var == TypeOf_Chiller_ElectricEIR) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricEIR) { print(state.files.eio, Format_991, "Chiller:Electric:EIR", ChillerName, IPLVValueSI, IPLVValueIP); PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, ChillerName, "Chiller:Electric:EIR"); - } else if (SELECT_CASE_var == TypeOf_Chiller_ElectricReformEIR) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR) { print(state.files.eio, Format_991, "Chiller:Electric:ReformulatedEIR", ChillerName, IPLVValueSI, IPLVValueIP); PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, ChillerName, "Chiller:Electric:ReformulatedEIR"); @@ -667,7 +664,7 @@ namespace StandardRatings { void CheckCurveLimitsForIPLV(EnergyPlusData &state, std::string const &ChillerName, // Name of Chiller - int const ChillerType, // Type of Chiller - EIR or ReformulatedEIR + DataPlant::PlantEquipmentType ChillerType, // Type of Chiller - EIR or ReformulatedEIR DataPlant::CondenserType const CondenserType, // Type of Condenser - Air Cooled, Water Cooled or Evap Cooled int const CapFTempCurveIndex, // Index for the total cooling capacity modifier curve int const EIRFTempCurveIndex // Index for the energy input ratio modifier curve @@ -687,8 +684,6 @@ namespace StandardRatings { // Using/Aliasing using CurveManager::GetCurveMinMaxValues; using CurveManager::GetCurveName; - using DataPlant::TypeOf_Chiller_ElectricEIR; - using DataPlant::TypeOf_Chiller_ElectricReformEIR; // Following parameters are taken from AHRI 551/591,2011 Table 3 Real64 const HighEWTemp(30.0); // Entering water temp in degrees C at full load capacity (85F) @@ -751,12 +746,12 @@ namespace StandardRatings { { auto const SELECT_CASE_var(ChillerType); - if (SELECT_CASE_var == TypeOf_Chiller_ElectricEIR) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricEIR) { ShowWarningError(state, "Chiller:Electric:EIR = " + ChillerName + ": Integrated Part Load Value (IPLV) calculated is not at the AHRI test condition."); - } else if (SELECT_CASE_var == TypeOf_Chiller_ElectricReformEIR) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Chiller_ElectricReformEIR) { ShowWarningError(state, "Chiller:Electric:ReformulatedEIR = " + ChillerName + diff --git a/src/EnergyPlus/StandardRatings.hh b/src/EnergyPlus/StandardRatings.hh index f4cc4caf7d8..0dca47793d3 100644 --- a/src/EnergyPlus/StandardRatings.hh +++ b/src/EnergyPlus/StandardRatings.hh @@ -157,7 +157,7 @@ namespace StandardRatings { void CalcChillerIPLV(EnergyPlusData &state, std::string const &ChillerName, // Name of Chiller for which IPLV is calculated - int const ChillerType, // Type of Chiller - EIR or Reformulated EIR + DataPlant::PlantEquipmentType ChillerType, // Type of Chiller - EIR or Reformulated EIR Real64 const RefCap, // Reference capacity of chiller [W] Real64 const RefCOP, // Reference coefficient of performance [W/W] DataPlant::CondenserType const CondenserType, // Type of Condenser - Air Cooled, Water Cooled or Evap Cooled @@ -177,15 +177,15 @@ namespace StandardRatings { ); void ReportChillerIPLV(EnergyPlusData &state, - std::string const &ChillerName, // Name of Chiller for which IPLV is calculated - int const ChillerType, // Type of Chiller - EIR or Reformulated EIR - Real64 const IPLVValueSI, // IPLV value in SI units {W/W} - Real64 const IPLVValueIP // IPLV value in IP units {Btu/W-h} + std::string const &ChillerName, // Name of Chiller for which IPLV is calculated + DataPlant::PlantEquipmentType ChillerType, // Type of Chiller - EIR or Reformulated EIR + Real64 const IPLVValueSI, // IPLV value in SI units {W/W} + Real64 const IPLVValueIP // IPLV value in IP units {Btu/W-h} ); void CheckCurveLimitsForIPLV(EnergyPlusData &state, std::string const &ChillerName, // Name of Chiller - int const ChillerType, // Type of Chiller - EIR or ReformulatedEIR + DataPlant::PlantEquipmentType ChillerType, // Type of Chiller - EIR or ReformulatedEIR DataPlant::CondenserType const CondenserType, // Type of Condenser - Air Cooled, Water Cooled or Evap Cooled int const CapFTempCurveIndex, // Index for the total cooling capacity modifier curve int const EIRFTempCurveIndex // Index for the energy input ratio modifier curve diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index 890492806ee..a8b0f561ccb 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -105,7 +105,7 @@ namespace SteamBaseboardRadiator { using DataHVACGlobals::SmallLoad; using DataLoopNode::ObjectIsNotParent; - using DataPlant::TypeOf_Baseboard_Rad_Conv_Steam; + using DataZoneEquipment::CheckZoneEquipmentList; static constexpr std::string_view fluidNameSteam("STEAM"); @@ -199,7 +199,7 @@ namespace SteamBaseboardRadiator { { auto const SELECT_CASE_var(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipType); - if (SELECT_CASE_var == TypeOf_Baseboard_Rad_Conv_Steam) { // 'ZoneHVAC:Baseboard:RadiantConvective:Steam' + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Steam) { // 'ZoneHVAC:Baseboard:RadiantConvective:Steam' ControlCompOutput(state, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID, state.dataSteamBaseboardRadiator->cCMO_BBRadiator_Steam, @@ -519,7 +519,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID = state.dataIPShortCut->cAlphaArgs(1); // Name of the baseboard state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipType = - TypeOf_Baseboard_Rad_Conv_Steam; //'ZoneHVAC:Baseboard:RadiantConvective:Steam' + DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Steam; //'ZoneHVAC:Baseboard:RadiantConvective:Steam' state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).designObjectName = state.dataIPShortCut->cAlphaArgs(2); // Name of the design object for this baseboard @@ -1655,12 +1655,12 @@ namespace SteamBaseboardRadiator { } void UpdateSteamBaseboardPlantConnection(EnergyPlusData &state, - int const BaseboardTypeNum, // type index - std::string const &BaseboardName, // component name - [[maybe_unused]] int const EquipFlowCtrl, // Flow control mode for the equipment - [[maybe_unused]] int const LoopNum, // Plant loop index for where called from - [[maybe_unused]] int const LoopSide, // Plant loop side index for where called from - int &CompIndex, // Chiller number pointer + DataPlant::PlantEquipmentType BaseboardType, // type index + std::string const &BaseboardName, // component name + [[maybe_unused]] int const EquipFlowCtrl, // Flow control mode for the equipment + [[maybe_unused]] int const LoopNum, // Plant loop index for where called from + [[maybe_unused]] int const LoopSide, // Plant loop side index for where called from + int &CompIndex, // Chiller number pointer [[maybe_unused]] bool const FirstHVACIteration, bool &InitLoopEquip // If not zero, calculate the max load for operating conditions ) @@ -1682,8 +1682,7 @@ namespace SteamBaseboardRadiator { // Based on UpdateBaseboardPlantConnection from Brent Griffith, Sept 2010 // Using/Aliasing - using DataPlant::ccSimPlantEquipTypes; - using DataPlant::TypeOf_Baseboard_Rad_Conv_Steam; + using DataPlant::PlantEquipTypeNames; using PlantUtilities::PullCompInterconnectTrigger; @@ -1718,13 +1717,13 @@ namespace SteamBaseboardRadiator { BaseboardName, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID)); } - if (BaseboardTypeNum != TypeOf_Baseboard_Rad_Conv_Steam) { + if (BaseboardType != DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Steam) { ShowFatalError(state, format("UpdateSteamBaseboardPlantConnection: Invalid CompIndex passed={}, baseboard name={}, stored baseboard " "Name for that index={}", BaseboardNum, BaseboardName, - ccSimPlantEquipTypes(BaseboardTypeNum))); + PlantEquipTypeNames[static_cast(BaseboardType)])); } } } @@ -1741,7 +1740,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BBLoadReSimIndex, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, - DataPlant::iCriteriaType::HeatTransferRate, + DataPlant::CriteriaType::HeatTransferRate, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).Power); PullCompInterconnectTrigger(state, @@ -1752,7 +1751,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BBLoadReSimIndex, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamMassFlowRate); PullCompInterconnectTrigger(state, @@ -1763,7 +1762,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BBLoadReSimIndex, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, - DataPlant::iCriteriaType::Temperature, + DataPlant::CriteriaType::Temperature, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamOutletTemp); } diff --git a/src/EnergyPlus/SteamBaseboardRadiator.hh b/src/EnergyPlus/SteamBaseboardRadiator.hh index ca707133ab2..66ca3cd78fb 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.hh +++ b/src/EnergyPlus/SteamBaseboardRadiator.hh @@ -67,7 +67,7 @@ namespace SteamBaseboardRadiator { { // Members std::string EquipID; - int EquipType; + DataPlant::PlantEquipmentType EquipType; std::string designObjectName; // Design Object int DesignObjectPtr; std::string Schedule; @@ -117,13 +117,13 @@ namespace SteamBaseboardRadiator { // Default Constructor SteamBaseboardParams() - : EquipType(0), DesignObjectPtr(0), ZonePtr(0), SchedPtr(0), SteamInletNode(0), SteamOutletNode(0), TotSurfToDistrib(0), FluidIndex(0), - ControlCompTypeNum(0), CompErrIndex(0), DegOfSubcooling(0.0), SteamMassFlowRate(0.0), SteamMassFlowRateMax(0.0), - SteamVolFlowRateMax(0.0), SteamOutletTemp(0.0), SteamInletTemp(0.0), SteamInletEnthalpy(0.0), SteamOutletEnthalpy(0.0), - SteamInletPress(0.0), SteamOutletPress(0.0), SteamInletQuality(0.0), SteamOutletQuality(0.0), FracRadiant(0.0), FracConvect(0.0), - FracDistribPerson(0.0), TotPower(0.0), Power(0.0), ConvPower(0.0), RadPower(0.0), TotEnergy(0.0), Energy(0.0), ConvEnergy(0.0), - RadEnergy(0.0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), BBLoadReSimIndex(0), BBMassFlowReSimIndex(0), - BBInletTempFlowReSimIndex(0), ScaledHeatingCapacity(0.0) + : EquipType(DataPlant::PlantEquipmentType::Invalid), DesignObjectPtr(0), ZonePtr(0), SchedPtr(0), SteamInletNode(0), SteamOutletNode(0), + TotSurfToDistrib(0), FluidIndex(0), ControlCompTypeNum(0), CompErrIndex(0), DegOfSubcooling(0.0), SteamMassFlowRate(0.0), + SteamMassFlowRateMax(0.0), SteamVolFlowRateMax(0.0), SteamOutletTemp(0.0), SteamInletTemp(0.0), SteamInletEnthalpy(0.0), + SteamOutletEnthalpy(0.0), SteamInletPress(0.0), SteamOutletPress(0.0), SteamInletQuality(0.0), SteamOutletQuality(0.0), + FracRadiant(0.0), FracConvect(0.0), FracDistribPerson(0.0), TotPower(0.0), Power(0.0), ConvPower(0.0), RadPower(0.0), TotEnergy(0.0), + Energy(0.0), ConvEnergy(0.0), RadEnergy(0.0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), BBLoadReSimIndex(0), + BBMassFlowReSimIndex(0), BBInletTempFlowReSimIndex(0), ScaledHeatingCapacity(0.0) { } }; @@ -194,12 +194,12 @@ namespace SteamBaseboardRadiator { Real64 SumHATsurf(EnergyPlusData &state, int const ZoneNum); // Zone number void UpdateSteamBaseboardPlantConnection(EnergyPlusData &state, - int const BaseboardTypeNum, // type index - std::string const &BaseboardName, // component name - int const EquipFlowCtrl, // Flow control mode for the equipment - int const LoopNum, // Plant loop index for where called from - int const LoopSide, // Plant loop side index for where called from - int &CompIndex, // Chiller number pointer + DataPlant::PlantEquipmentType BaseboardType, // type index + std::string const &BaseboardName, // component name + int const EquipFlowCtrl, // Flow control mode for the equipment + int const LoopNum, // Plant loop index for where called from + int const LoopSide, // Plant loop side index for where called from + int &CompIndex, // Chiller number pointer bool const FirstHVACIteration, bool &InitLoopEquip // If not zero, calculate the max load for operating conditions ); diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 4e7f28f54f8..ba7681d251c 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -99,7 +99,7 @@ namespace SteamCoils { using namespace DataHVACGlobals; using namespace Psychrometrics; using namespace FluidProperties; - using DataPlant::TypeOf_CoilSteamAirHeating; + using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::ScanPlantLoopsForObject; using namespace ScheduleManager; @@ -295,7 +295,7 @@ namespace SteamCoils { state.dataSteamCoils->SteamCoil(CoilNum).SteamCoilTypeA = "Heating"; state.dataSteamCoils->SteamCoil(CoilNum).SteamCoilType_Num = state.dataSteamCoils->SteamCoil_AirHeating; - state.dataSteamCoils->SteamCoil(CoilNum).Coil_PlantTypeNum = TypeOf_CoilSteamAirHeating; + state.dataSteamCoils->SteamCoil(CoilNum).CoilType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; state.dataSteamCoils->SteamCoil(CoilNum).MaxSteamVolFlowRate = NumArray(1); state.dataSteamCoils->SteamCoil(CoilNum).DegOfSubcooling = NumArray(2); state.dataSteamCoils->SteamCoil(CoilNum).LoopSubcoolReturn = NumArray(3); @@ -521,7 +521,7 @@ namespace SteamCoils { errFlag = false; ScanPlantLoopsForObject(state, state.dataSteamCoils->SteamCoil(CoilNum).Name, - state.dataSteamCoils->SteamCoil(CoilNum).Coil_PlantTypeNum, + state.dataSteamCoils->SteamCoil(CoilNum).CoilType, state.dataSteamCoils->SteamCoil(CoilNum).LoopNum, state.dataSteamCoils->SteamCoil(CoilNum).LoopSide, state.dataSteamCoils->SteamCoil(CoilNum).BranchNum, @@ -1587,7 +1587,7 @@ namespace SteamCoils { // Utility subroutines for the SteamCoil Module int GetSteamCoilIndex(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -1620,7 +1620,7 @@ namespace SteamCoils { } if (IndexNum == 0) { - ShowSevereError(state, "GetSteamCoilIndex: Could not find CoilType=\"" + CoilType + "\" with Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetSteamCoilIndex: Could not find CoilType=\"{}\" with Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; } @@ -2019,7 +2019,7 @@ namespace SteamCoils { } int GetCoilSteamOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) diff --git a/src/EnergyPlus/SteamCoils.hh b/src/EnergyPlus/SteamCoils.hh index bbe7e580b64..f4a3c630e81 100644 --- a/src/EnergyPlus/SteamCoils.hh +++ b/src/EnergyPlus/SteamCoils.hh @@ -107,27 +107,27 @@ namespace SteamCoils { Real64 OutletSteamQuality; // Quality of steam at outlet Real64 DegOfSubcooling; Real64 LoopSubcoolReturn; - int AirInletNodeNum; // Inlet node number at air side - int AirOutletNodeNum; // Outlet node number at air side - int SteamInletNodeNum; // SteamInletNodeNum - int SteamOutletNodeNum; // SteamOutletNodeNum - int TempSetPointNodeNum; // If applicable : node number that the temp setpoint exists. - int TypeOfCoil; // Control of Coil , temperature or Zone load - int FluidIndex; // Fluid index for FluidProperties (Steam) - int LoopNum; // index for plant loop with steam coil - int LoopSide; // index for plant loop side for steam coil - int BranchNum; // index for plant branch for steam coil - int CompNum; // index for plant component for steam coil - int Coil_PlantTypeNum; // plant level index for coil type - Real64 OperatingCapacity; // capacity of steam coil at operating conditions (W) - bool DesiccantRegenerationCoil; // true if it is a regeneration air heating coil defined in Desiccant Dehumidifier system - int DesiccantDehumNum; // index to desiccant dehumidifier object - bool FaultyCoilSATFlag; // True if the coil has SAT sensor fault - int FaultyCoilSATIndex; // Index of the fault object corresponding to the coil - Real64 FaultyCoilSATOffset; // Coil SAT sensor offset - bool reportCoilFinalSizes; // one time report of sizes to coil selection report - Real64 DesCoilCapacity; // store design load - Real64 DesAirVolFlow; // store design air flow + int AirInletNodeNum; // Inlet node number at air side + int AirOutletNodeNum; // Outlet node number at air side + int SteamInletNodeNum; // SteamInletNodeNum + int SteamOutletNodeNum; // SteamOutletNodeNum + int TempSetPointNodeNum; // If applicable : node number that the temp setpoint exists. + int TypeOfCoil; // Control of Coil , temperature or Zone load + int FluidIndex; // Fluid index for FluidProperties (Steam) + int LoopNum; // index for plant loop with steam coil + int LoopSide; // index for plant loop side for steam coil + int BranchNum; // index for plant branch for steam coil + int CompNum; // index for plant component for steam coil + DataPlant::PlantEquipmentType CoilType; // plant level index for coil type + Real64 OperatingCapacity; // capacity of steam coil at operating conditions (W) + bool DesiccantRegenerationCoil; // true if it is a regeneration air heating coil defined in Desiccant Dehumidifier system + int DesiccantDehumNum; // index to desiccant dehumidifier object + bool FaultyCoilSATFlag; // True if the coil has SAT sensor fault + int FaultyCoilSATIndex; // Index of the fault object corresponding to the coil + Real64 FaultyCoilSATOffset; // Coil SAT sensor offset + bool reportCoilFinalSizes; // one time report of sizes to coil selection report + Real64 DesCoilCapacity; // store design load + Real64 DesAirVolFlow; // store design air flow // Default Constructor SteamCoilEquipConditions() @@ -139,9 +139,9 @@ namespace SteamCoils { InletSteamMassFlowRate(0.0), OutletSteamMassFlowRate(0.0), MaxSteamVolFlowRate(0.0), MaxSteamMassFlowRate(0.0), InletSteamEnthalpy(0.0), OutletWaterEnthalpy(0.0), InletSteamPress(0.0), InletSteamQuality(0.0), OutletSteamQuality(0.0), DegOfSubcooling(0.0), LoopSubcoolReturn(0.0), AirInletNodeNum(0), AirOutletNodeNum(0), SteamInletNodeNum(0), SteamOutletNodeNum(0), TempSetPointNodeNum(0), - TypeOfCoil(0), FluidIndex(0), LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0), Coil_PlantTypeNum(0), OperatingCapacity(0.0), - DesiccantRegenerationCoil(false), DesiccantDehumNum(0), FaultyCoilSATFlag(false), FaultyCoilSATIndex(0), FaultyCoilSATOffset(0.0), - reportCoilFinalSizes(true), DesCoilCapacity(0.0), DesAirVolFlow(0.0) + TypeOfCoil(0), FluidIndex(0), LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0), CoilType(DataPlant::PlantEquipmentType::Invalid), + OperatingCapacity(0.0), DesiccantRegenerationCoil(false), DesiccantDehumNum(0), FaultyCoilSATFlag(false), FaultyCoilSATIndex(0), + FaultyCoilSATOffset(0.0), reportCoilFinalSizes(true), DesCoilCapacity(0.0), DesAirVolFlow(0.0) { } }; @@ -174,7 +174,7 @@ namespace SteamCoils { void ReportSteamCoil(EnergyPlusData &state, int const CoilNum); int GetSteamCoilIndex(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -229,7 +229,7 @@ namespace SteamCoils { ); int GetCoilSteamOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index bda5cd13567..401da2cfc17 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -132,8 +132,9 @@ namespace SurfaceGroundHeatExchanger { int const SurfCond_Ground(1); int const SurfCond_Exposed(2); - PlantComponent * - SurfaceGroundHeatExchangerData::factory(EnergyPlusData &state, [[maybe_unused]] int const objectType, std::string const objectName) + PlantComponent *SurfaceGroundHeatExchangerData::factory(EnergyPlusData &state, + [[maybe_unused]] DataPlant::PlantEquipmentType objectType, + std::string const objectName) { if (state.dataSurfaceGroundHeatExchangers->GetInputFlag) { GetSurfaceGroundHeatExchanger(state); @@ -1427,7 +1428,7 @@ namespace SurfaceGroundHeatExchanger { } void SurfaceGroundHeatExchangerData::oneTimeInit_new(EnergyPlusData &state) { - using DataPlant::TypeOf_GrndHtExchgSurface; + using FluidProperties::GetDensityGlycol; using PlantUtilities::InitComponentNodes; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -1441,8 +1442,19 @@ namespace SurfaceGroundHeatExchanger { // Locate the hx on the plant loops for later usage errFlag = false; - ScanPlantLoopsForObject( - state, this->Name, TypeOf_GrndHtExchgSurface, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, errFlag, _, _, _, _, _); + ScanPlantLoopsForObject(state, + this->Name, + DataPlant::PlantEquipmentType::GrndHtExchgSurface, + this->LoopNum, + this->LoopSideNum, + this->BranchNum, + this->CompNum, + errFlag, + _, + _, + _, + _, + _); if (errFlag) { ShowFatalError(state, "InitSurfaceGroundHeatExchanger: Program terminated due to previous condition(s)."); diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.hh b/src/EnergyPlus/SurfaceGroundHeatExchanger.hh index d1b9aeede27..e9c35b1d077 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.hh +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.hh @@ -181,7 +181,7 @@ namespace SurfaceGroundHeatExchanger { Real64 &CurLoad, bool RunFlag) override; - static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string objectName); + static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string objectName); void InitSurfaceGroundHeatExchanger(EnergyPlusData &state); diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index b53e82aa269..5267dcbc8c7 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -823,7 +823,7 @@ void SwimmingPoolData::initSwimmingPoolPlantLoopIndex(EnergyPlusData &state) if (this->WaterInletNode > 0) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_SwimmingPool_Indoor, + DataPlant::PlantEquipmentType::SwimmingPool_Indoor, this->HWLoopNum, this->HWLoopSide, this->HWBranchNum, diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 43ba8a9a82a..a432c7c77ac 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -225,8 +225,7 @@ namespace UnitHeater { using DataHVACGlobals::FanType_SimpleConstVolume; using DataHVACGlobals::FanType_SimpleOnOff; using DataHVACGlobals::FanType_SimpleVAV; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataSizing::AutoSize; using Fans::GetFanAvailSchPtr; using Fans::GetFanIndex; @@ -459,23 +458,25 @@ namespace UnitHeater { // Heating coil information: { - auto const SELECT_CASE_var(Alphas(7)); - if (SELECT_CASE_var == "COIL:HEATING:WATER") { - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType = state.dataUnitHeaters->WaterHeatingCoil; - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; - } else if (SELECT_CASE_var == "COIL:HEATING:STEAM") { - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType = state.dataUnitHeaters->SteamCoil; - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_PlantTypeNum = TypeOf_CoilSteamAirHeating; - } else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC") { - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType = state.dataUnitHeaters->ElectricCoil; - } else if (SELECT_CASE_var == "COIL:HEATING:FUEL") { - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType = state.dataUnitHeaters->GasCoil; - } else { + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type = + static_cast(getEnumerationValue(HCoilTypeNamesUC, UtilityRoutines::MakeUPPERCase(Alphas(7)))); + switch (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type) { + case HCoilType::WaterHeatingCoil: + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + break; + case HCoilType::SteamCoil: + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; + break; + case HCoilType::Electric: + case HCoilType::Gas: + break; + default: { ShowSevereError(state, "Illegal " + cAlphaFields(7) + " = " + Alphas(7)); ShowContinueError(state, "Occurs in " + CurrentModuleObject + '=' + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name); ErrorsFound = true; errFlag = true; } + } } if (!errFlag) { state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilTypeCh = Alphas(7); @@ -488,11 +489,11 @@ namespace UnitHeater { } else { // The heating coil control node is necessary for hot water and steam coils, but not necessary for an // electric or gas coil. - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil || - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->SteamCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::WaterHeatingCoil || + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::SteamCoil) { // mine the hot water or steam node from the coil object errFlag = false; - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::WaterHeatingCoil) { state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotControlNode = GetCoilWaterInletNode(state, "Coil:Heating:Water", state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, errFlag); } else { // its a steam coil @@ -748,8 +749,7 @@ namespace UnitHeater { auto &ZoneComp = state.dataHVACGlobal->ZoneComp; auto &ZoneCompTurnFansOff = state.dataHVACGlobal->ZoneCompTurnFansOff; auto &ZoneCompTurnFansOn = state.dataHVACGlobal->ZoneCompTurnFansOn; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::UnitHeater_Num; using FluidProperties::GetDensityGlycol; @@ -798,12 +798,12 @@ namespace UnitHeater { } if (state.dataUnitHeaters->MyPlantScanFlag(UnitHeatNum) && allocated(state.dataPlnt->PlantLoop)) { - if ((state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || - (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { + if ((state.dataUnitHeaters->UnitHeat(UnitHeatNum).HeatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || + (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HeatingCoilType == DataPlant::PlantEquipmentType::CoilSteamAirHeating)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_PlantTypeNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HeatingCoilType, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, @@ -867,7 +867,7 @@ namespace UnitHeater { state.dataLoopNodes->Node(InNode).MassFlowRateMax = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxAirMassFlow; state.dataLoopNodes->Node(InNode).MassFlowRateMin = 0.0; - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::WaterHeatingCoil) { rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, @@ -886,7 +886,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); } - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->SteamCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::SteamCoil) { TempSteamIn = 100.00; SteamDensity = GetSatDensityRefrig( state, fluidNameSteam, TempSteamIn, 1.0, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_FluidIndex, RoutineName); @@ -1155,7 +1155,7 @@ namespace UnitHeater { IsAutoSize = true; } - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::WaterHeatingCoil) { if (CurZoneEqNum > 0) { if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // Simulation continue @@ -1310,7 +1310,7 @@ namespace UnitHeater { IsAutoSize = true; } - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->SteamCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::SteamCoil) { if (CurZoneEqNum > 0) { if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // Simulation continue @@ -1549,7 +1549,7 @@ namespace UnitHeater { // OR child fan in not available OR child fan not being cycled ON by sys avail manager // OR child fan being forced OFF by sys avail manager state.dataUnitHeaters->HCoilOn = false; - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::WaterHeatingCoil) { mdot = 0.0; // try to turn off SetComponentFlowRate(state, @@ -1561,7 +1561,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); } - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->SteamCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::SteamCoil) { mdot = 0.0; // try to turn off SetComponentFlowRate(state, @@ -1582,7 +1582,7 @@ namespace UnitHeater { // Case 2: NO LOAD OR COOLING/ON-OFF FAN CONTROL-->turn everything off // because there is no load on the unit heater state.dataUnitHeaters->HCoilOn = false; - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::WaterHeatingCoil) { mdot = 0.0; // try to turn off SetComponentFlowRate(state, @@ -1594,7 +1594,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); } - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->SteamCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::SteamCoil) { mdot = 0.0; // try to turn off SetComponentFlowRate(state, @@ -1615,7 +1615,7 @@ namespace UnitHeater { // so there is really nothing else left to do except call the components. state.dataUnitHeaters->HCoilOn = false; - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::WaterHeatingCoil) { mdot = 0.0; // try to turn off if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum > 0) { @@ -1629,7 +1629,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); } } - if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->SteamCoil) { + if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type == HCoilType::SteamCoil) { mdot = 0.0; // try to turn off if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum > 0) { SetComponentFlowRate(state, @@ -1648,47 +1648,51 @@ namespace UnitHeater { } else { // Case 4: HEATING-->unit is available and there is a heating load - { - auto const SELECT_CASE_var(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType); + switch (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type) { - if (SELECT_CASE_var == state.dataUnitHeaters->WaterHeatingCoil) { + case HCoilType::WaterHeatingCoil: { - // On the first HVAC iteration the system values are given to the controller, but after that - // the demand limits are in place and there needs to be feedback to the Zone Equipment - if (FirstHVACIteration) { - MaxWaterFlow = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxHotWaterFlow; - MinWaterFlow = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MinHotWaterFlow; - } else { - MaxWaterFlow = state.dataLoopNodes->Node(ControlNode).MassFlowRateMaxAvail; - MinWaterFlow = state.dataLoopNodes->Node(ControlNode).MassFlowRateMinAvail; - } - // control water flow to obtain output matching QZnReq - ControlCompOutput(state, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name, - state.dataUnitHeaters->cMO_UnitHeater, - UnitHeatNum, - FirstHVACIteration, - state.dataUnitHeaters->QZnReq, - ControlNode, - MaxWaterFlow, - MinWaterFlow, - ControlOffset, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).ControlCompTypeNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).CompErrIndex, - _, - _, - _, - _, - _, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum); - - } else if ((SELECT_CASE_var == state.dataUnitHeaters->ElectricCoil) || (SELECT_CASE_var == state.dataUnitHeaters->GasCoil) || - (SELECT_CASE_var == state.dataUnitHeaters->SteamCoil)) { - state.dataUnitHeaters->HCoilOn = true; - CalcUnitHeaterComponents(state, UnitHeatNum, FirstHVACIteration, QUnitOut); + // On the first HVAC iteration the system values are given to the controller, but after that + // the demand limits are in place and there needs to be feedback to the Zone Equipment + if (FirstHVACIteration) { + MaxWaterFlow = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxHotWaterFlow; + MinWaterFlow = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MinHotWaterFlow; + } else { + MaxWaterFlow = state.dataLoopNodes->Node(ControlNode).MassFlowRateMaxAvail; + MinWaterFlow = state.dataLoopNodes->Node(ControlNode).MassFlowRateMinAvail; } + // control water flow to obtain output matching QZnReq + ControlCompOutput(state, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).Name, + state.dataUnitHeaters->cMO_UnitHeater, + UnitHeatNum, + FirstHVACIteration, + state.dataUnitHeaters->QZnReq, + ControlNode, + MaxWaterFlow, + MinWaterFlow, + ControlOffset, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).ControlCompTypeNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).CompErrIndex, + _, + _, + _, + _, + _, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum); + break; + } + case HCoilType::Electric: + case HCoilType::Gas: + case HCoilType::SteamCoil: { + state.dataUnitHeaters->HCoilOn = true; + CalcUnitHeaterComponents(state, UnitHeatNum, FirstHVACIteration, QUnitOut); + break; + } + default: + break; } } QUnitOut = state.dataLoopNodes->Node(OutletNode).MassFlowRate * @@ -1841,53 +1845,59 @@ namespace UnitHeater { state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); } - { - auto const SELECT_CASE_var(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType); - - if (SELECT_CASE_var == state.dataUnitHeaters->WaterHeatingCoil) { + switch (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type) { - SimulateWaterCoilComponents(state, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, - FirstHVACIteration, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index); - } else if (SELECT_CASE_var == state.dataUnitHeaters->SteamCoil) { + case HCoilType::WaterHeatingCoil: { - if (!state.dataUnitHeaters->HCoilOn) { - QCoilReq = 0.0; - } else { - HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); - QCoilReq = state.dataUnitHeaters->QZnReq - - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * - (state.dataLoopNodes->Node(HCoilInAirNode).Temp - - state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); - } - if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SimulateSteamCoilComponents(state, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, - FirstHVACIteration, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, - QCoilReq); + SimulateWaterCoilComponents(state, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, + FirstHVACIteration, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index); + break; + } + case HCoilType::SteamCoil: { - } else if ((SELECT_CASE_var == state.dataUnitHeaters->ElectricCoil) || (SELECT_CASE_var == state.dataUnitHeaters->GasCoil)) { + if (!state.dataUnitHeaters->HCoilOn) { + QCoilReq = 0.0; + } else { + HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; + CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); + QCoilReq = + state.dataUnitHeaters->QZnReq - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * + (state.dataLoopNodes->Node(HCoilInAirNode).Temp - + state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); + } + if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool + SimulateSteamCoilComponents(state, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, + FirstHVACIteration, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, + QCoilReq); + break; + } + case HCoilType::Electric: + case HCoilType::Gas: { - if (!state.dataUnitHeaters->HCoilOn) { - QCoilReq = 0.0; - } else { - HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); - QCoilReq = state.dataUnitHeaters->QZnReq - - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * - (state.dataLoopNodes->Node(HCoilInAirNode).Temp - - state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); - } - if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SimulateHeatingCoilComponents(state, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, - FirstHVACIteration, - QCoilReq, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index); + if (!state.dataUnitHeaters->HCoilOn) { + QCoilReq = 0.0; + } else { + HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; + CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); + QCoilReq = + state.dataUnitHeaters->QZnReq - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * + (state.dataLoopNodes->Node(HCoilInAirNode).Temp - + state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); } + if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool + SimulateHeatingCoilComponents(state, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, + FirstHVACIteration, + QCoilReq, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index); + break; + } + default: + break; } AirMassFlow = state.dataLoopNodes->Node(OutletNode).MassFlowRate; @@ -1915,92 +1925,99 @@ namespace UnitHeater { state.dataHVACFan->fanObjs[state.dataUnitHeaters->UnitHeat(UnitHeatNum).Fan_Index]->simulate( state, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff, _); } - { - auto const SELECT_CASE_var(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType); + switch (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type) { - if (SELECT_CASE_var == state.dataUnitHeaters->WaterHeatingCoil) { + case HCoilType::WaterHeatingCoil: { - if (!state.dataUnitHeaters->HCoilOn) { - mdot = 0.0; - QCoilReq = 0.0; - } else { - HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); - QCoilReq = state.dataUnitHeaters->QZnReq - - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * - (state.dataLoopNodes->Node(HCoilInAirNode).Temp - - state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); - mdot = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxHotWaterFlow * PartLoadFrac; - } - if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SetComponentFlowRate(state, - mdot, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotControlNode, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotCoilOutNodeNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); - SimulateWaterCoilComponents(state, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, - FirstHVACIteration, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, - QCoilReq, - FanOpMode, - PartLoadFrac); - } else if (SELECT_CASE_var == state.dataUnitHeaters->SteamCoil) { - if (!state.dataUnitHeaters->HCoilOn) { - mdot = 0.0; - QCoilReq = 0.0; - } else { - HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); - QCoilReq = state.dataUnitHeaters->QZnReq - - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * - (state.dataLoopNodes->Node(HCoilInAirNode).Temp - - state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); - mdot = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxHotSteamFlow * PartLoadFrac; - } - if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SetComponentFlowRate(state, - mdot, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotControlNode, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotCoilOutNodeNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); - SimulateSteamCoilComponents(state, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, - FirstHVACIteration, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, - QCoilReq, - _, - FanOpMode, - PartLoadFrac); - } else if ((SELECT_CASE_var == state.dataUnitHeaters->ElectricCoil) || (SELECT_CASE_var == state.dataUnitHeaters->GasCoil)) { - - if (!state.dataUnitHeaters->HCoilOn) { - QCoilReq = 0.0; - } else { - HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); - QCoilReq = state.dataUnitHeaters->QZnReq - - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * - (state.dataLoopNodes->Node(HCoilInAirNode).Temp - - state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); - } - if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SimulateHeatingCoilComponents(state, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, - FirstHVACIteration, - QCoilReq, - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, - _, - _, - FanOpMode, - PartLoadFrac); + if (!state.dataUnitHeaters->HCoilOn) { + mdot = 0.0; + QCoilReq = 0.0; + } else { + HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; + CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); + QCoilReq = + state.dataUnitHeaters->QZnReq - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * + (state.dataLoopNodes->Node(HCoilInAirNode).Temp - + state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); + mdot = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxHotWaterFlow * PartLoadFrac; + } + if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool + SetComponentFlowRate(state, + mdot, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotControlNode, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotCoilOutNodeNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); + SimulateWaterCoilComponents(state, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, + FirstHVACIteration, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, + QCoilReq, + FanOpMode, + PartLoadFrac); + break; + } + case HCoilType::SteamCoil: { + if (!state.dataUnitHeaters->HCoilOn) { + mdot = 0.0; + QCoilReq = 0.0; + } else { + HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; + CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); + QCoilReq = + state.dataUnitHeaters->QZnReq - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * + (state.dataLoopNodes->Node(HCoilInAirNode).Temp - + state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); + mdot = state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxHotSteamFlow * PartLoadFrac; } + if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool + SetComponentFlowRate(state, + mdot, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotControlNode, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotCoilOutNodeNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum); + SimulateSteamCoilComponents(state, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, + FirstHVACIteration, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, + QCoilReq, + _, + FanOpMode, + PartLoadFrac); + break; + } + case HCoilType::Electric: + case HCoilType::Gas: { + + if (!state.dataUnitHeaters->HCoilOn) { + QCoilReq = 0.0; + } else { + HCoilInAirNode = state.dataUnitHeaters->UnitHeat(UnitHeatNum).FanOutletNode; + CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).HumRat); + QCoilReq = + state.dataUnitHeaters->QZnReq - state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * + (state.dataLoopNodes->Node(HCoilInAirNode).Temp - + state.dataLoopNodes->Node(state.dataUnitHeaters->UnitHeat(UnitHeatNum).AirInNode).Temp); + } + if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool + SimulateHeatingCoilComponents(state, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilName, + FirstHVACIteration, + QCoilReq, + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_Index, + _, + _, + FanOpMode, + PartLoadFrac); + break; + } + default: + break; } state.dataLoopNodes->Node(OutletNode).MassFlowRate = state.dataLoopNodes->Node(InletNode).MassFlowRate; // maintain continuity through unit heater diff --git a/src/EnergyPlus/UnitHeater.hh b/src/EnergyPlus/UnitHeater.hh index 061987096a8..840abfcde32 100644 --- a/src/EnergyPlus/UnitHeater.hh +++ b/src/EnergyPlus/UnitHeater.hh @@ -64,6 +64,23 @@ struct EnergyPlusData; namespace UnitHeater { + enum class HCoilType + { + Unassigned = -1, + Electric, + Gas, + WaterHeatingCoil, + SteamCoil, + Num + }; + + constexpr std::array(HCoilType::Num)> HCoilTypeNamesUC{ + "COIL:HEATING:ELECTRIC", + "COIL:HEATING:FUEL", + "COIL:HEATING:WATER", + "COIL:HEATING:STEAM", + }; + struct UnitHeaterData { // Members @@ -87,11 +104,11 @@ namespace UnitHeater { int FanOutletNode; // outlet node number for fan exit // (assumes fan is upstream of heating coil) int OpMode; // mode of operation; 1=cycling fan, cycling coil, 2=continuous fan, cycling coil - std::string HCoilType; // type of heating coil (water, gas, electric, etc.) + HCoilType Type; // type of heating coil (water, gas, electric, etc.) std::string HCoilTypeCh; // actual object name std::string HCoilName; // name of heating coil int HCoil_Index; - int HCoil_PlantTypeNum; + DataPlant::PlantEquipmentType HeatingCoilType; int HCoil_FluidIndex; Real64 MaxVolHotWaterFlow; // m3/s Real64 MaxVolHotSteamFlow; // m3/s @@ -125,12 +142,12 @@ namespace UnitHeater { // Default Constructor UnitHeaterData() : SchedPtr(0), AirInNode(0), AirOutNode(0), FanType_Num(0), Fan_Index(0), FanSchedPtr(0), FanAvailSchedPtr(0), ControlCompTypeNum(0), - CompErrIndex(0), MaxAirVolFlow(0.0), MaxAirMassFlow(0.0), FanOutletNode(0), OpMode(0), HCoil_Index(0), HCoil_PlantTypeNum(0), - HCoil_FluidIndex(0), MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), - MinVolHotWaterFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), MinHotSteamFlow(0.0), HotControlNode(0), HotControlOffset(0.0), - HotCoilOutNodeNum(0), HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0), PartLoadFrac(0.0), HeatPower(0.0), HeatEnergy(0.0), - ElecPower(0.0), ElecEnergy(0.0), AvailStatus(0), FanOffNoHeating(false), FanPartLoadRatio(0.0), ZonePtr(0), HVACSizingIndex(0), - FirstPass(true) + CompErrIndex(0), MaxAirVolFlow(0.0), MaxAirMassFlow(0.0), FanOutletNode(0), OpMode(0), HCoil_Index(0), + HeatingCoilType(DataPlant::PlantEquipmentType::Invalid), HCoil_FluidIndex(0), MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), + MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), + MinHotSteamFlow(0.0), HotControlNode(0), HotControlOffset(0.0), HotCoilOutNodeNum(0), HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), + HWCompNum(0), PartLoadFrac(0.0), HeatPower(0.0), HeatEnergy(0.0), ElecPower(0.0), ElecEnergy(0.0), AvailStatus(0), + FanOffNoHeating(false), FanPartLoadRatio(0.0), ZonePtr(0), HVACSizingIndex(0), FirstPass(true) { } }; @@ -203,10 +220,6 @@ struct UnitHeatersData : BaseGlobalStruct std::string const cMO_UnitHeater = "ZoneHVAC:UnitHeater"; // Character parameters for outside air control types: - std::string const ElectricCoil = "ElectricCoil"; - std::string const GasCoil = "GasCoil"; - std::string const WaterHeatingCoil = "WaterHeatingCoil"; - std::string const SteamCoil = "SteamCoil"; bool HCoilOn; // TRUE if the heating coil (gas or electric especially) should be running int NumOfUnitHeats; // Number of unit heaters in the input file diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 8b13f040db9..40e2b24aad2 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -80,7 +80,6 @@ #include #include #include -#include #include #include #include @@ -246,10 +245,6 @@ namespace UnitVentilator { using Fans::GetFanVolFlow; using HVACHXAssistedCoolingCoil::GetHXCoilTypeAndName; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataSizing::AutoSize; using SingleDuct::GetATMixer; @@ -810,10 +805,10 @@ namespace UnitVentilator { auto const SELECT_CASE_var(cHeatingCoilType); if (SELECT_CASE_var == "COIL:HEATING:WATER") { state.dataUnitVentilators->UnitVent(UnitVentNum).HCoilType = state.dataUnitVentilators->Heating_WaterCoilType; - state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; + state.dataUnitVentilators->UnitVent(UnitVentNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; } else if (SELECT_CASE_var == "COIL:HEATING:STEAM") { state.dataUnitVentilators->UnitVent(UnitVentNum).HCoilType = state.dataUnitVentilators->Heating_SteamCoilType; - state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_PlantTypeNum = TypeOf_CoilSteamAirHeating; + state.dataUnitVentilators->UnitVent(UnitVentNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; } else if (SELECT_CASE_var == "COIL:HEATING:ELECTRIC") { state.dataUnitVentilators->UnitVent(UnitVentNum).HCoilType = state.dataUnitVentilators->Heating_ElectricCoilType; } else if (SELECT_CASE_var == "COIL:HEATING:FUEL") { @@ -924,11 +919,12 @@ namespace UnitVentilator { auto const SELECT_CASE_var(cCoolingCoilType); if (SELECT_CASE_var == "COIL:COOLING:WATER") { state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilType = state.dataUnitVentilators->Cooling_CoilWaterCooling; - state.dataUnitVentilators->UnitVent(UnitVentNum).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; + state.dataUnitVentilators->UnitVent(UnitVentNum).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPlantName = Alphas(18); } else if (SELECT_CASE_var == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilType = state.dataUnitVentilators->Cooling_CoilDetailedCooling; - state.dataUnitVentilators->UnitVent(UnitVentNum).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; + state.dataUnitVentilators->UnitVent(UnitVentNum).CoolingCoilType = + DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPlantName = Alphas(18); } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED") { state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilType = state.dataUnitVentilators->Cooling_CoilHXAssisted; @@ -939,10 +935,11 @@ namespace UnitVentilator { state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPlantType, state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPlantName); if (UtilityRoutines::SameString(state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPlantType, "Coil:Cooling:Water")) { - state.dataUnitVentilators->UnitVent(UnitVentNum).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; + state.dataUnitVentilators->UnitVent(UnitVentNum).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; } else if (UtilityRoutines::SameString(state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { - state.dataUnitVentilators->UnitVent(UnitVentNum).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; + state.dataUnitVentilators->UnitVent(UnitVentNum).CoolingCoilType = + DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } else { ShowSevereError(state, std::string{RoutineName} + CurrentModuleObject + "=\"" + @@ -1445,10 +1442,7 @@ namespace UnitVentilator { auto &ZoneComp = state.dataHVACGlobal->ZoneComp; auto &ZoneCompTurnFansOff = state.dataHVACGlobal->ZoneCompTurnFansOff; auto &ZoneCompTurnFansOn = state.dataHVACGlobal->ZoneCompTurnFansOn; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::UnitVentilator_Num; using FluidProperties::GetDensityGlycol; @@ -1498,12 +1492,12 @@ namespace UnitVentilator { } if (state.dataUnitVentilators->MyPlantScanFlag(UnitVentNum) && allocated(state.dataPlnt->PlantLoop)) { - if ((state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || - (state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { + if ((state.dataUnitVentilators->UnitVent(UnitVentNum).HeatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || + (state.dataUnitVentilators->UnitVent(UnitVentNum).HeatingCoilType == DataPlant::PlantEquipmentType::CoilSteamAirHeating)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataUnitVentilators->UnitVent(UnitVentNum).HCoilName, - state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_PlantTypeNum, + state.dataUnitVentilators->UnitVent(UnitVentNum).HeatingCoilType, state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum, state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopSide, state.dataUnitVentilators->UnitVent(UnitVentNum).HWBranchNum, @@ -1527,12 +1521,12 @@ namespace UnitVentilator { .Comp(state.dataUnitVentilators->UnitVent(UnitVentNum).HWCompNum) .NodeNumOut; } - if ((state.dataUnitVentilators->UnitVent(UnitVentNum).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || - (state.dataUnitVentilators->UnitVent(UnitVentNum).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { + if ((state.dataUnitVentilators->UnitVent(UnitVentNum).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || + (state.dataUnitVentilators->UnitVent(UnitVentNum).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPlantName, - state.dataUnitVentilators->UnitVent(UnitVentNum).CCoil_PlantTypeNum, + state.dataUnitVentilators->UnitVent(UnitVentNum).CoolingCoilType, state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum, state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopSide, state.dataUnitVentilators->UnitVent(UnitVentNum).CWBranchNum, @@ -2991,7 +2985,7 @@ namespace UnitVentilator { state.dataUnitVentilators->UnitVent(UnitVentNum).HCoilSchedValue, state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_Index); } else { - // CALL ShowFatalError(state, 'Illegal coil type='//TRIM(UnitVent(UnitVentNum)%HCoilType)) + // CALL ShowFatalError(state, 'Illegal coil type='//TRIM(UnitVent(UnitVentNum)%Type)) } } @@ -3051,7 +3045,7 @@ namespace UnitVentilator { state.dataUnitVentilators->UnitVent(UnitVentNum).HCoilSchedValue, state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_Index); } else { - // CALL ShowFatalError(state, 'Illegal coil type='//TRIM(UnitVent(UnitVentNum)%HCoilType)) + // CALL ShowFatalError(state, 'Illegal coil type='//TRIM(UnitVent(UnitVentNum)%Type)) } } diff --git a/src/EnergyPlus/UnitVentilator.hh b/src/EnergyPlus/UnitVentilator.hh index 7c65bdf4279..32a3ea0db90 100644 --- a/src/EnergyPlus/UnitVentilator.hh +++ b/src/EnergyPlus/UnitVentilator.hh @@ -57,6 +57,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -108,7 +109,7 @@ namespace UnitVentilator { std::string HCoilName; // name of heating coil std::string HCoilTypeCh; // type of heating coil character string (same as type on idf file). int HCoil_Index; - int HCoil_PlantTypeNum; + DataPlant::PlantEquipmentType HeatingCoilType; int HCoil_FluidIndex; std::string HCoilSchedName; // availability schedule for the heating coil int HCoilSchedPtr; // index to schedule @@ -134,7 +135,7 @@ namespace UnitVentilator { int CCoil_Index; std::string CCoilPlantName; // name of cooling coil for plant std::string CCoilPlantType; // type of cooling coil for plant - int CCoil_PlantTypeNum; + DataPlant::PlantEquipmentType CoolingCoilType; int CCoilType; // type of cooling coil: // 'Coil:Cooling:Water:DetailedGeometry' or // 'CoilSystem:Cooling:Water:HeatExchangerAssisted' @@ -182,11 +183,12 @@ namespace UnitVentilator { : SchedPtr(0), AirInNode(0), AirOutNode(0), FanOutletNode(0), FanType_Num(0), Fan_Index(0), FanSchedPtr(0), FanAvailSchedPtr(0), OpMode(0), ControlCompTypeNum(0), CompErrIndex(0), MaxAirVolFlow(0.0), MaxAirMassFlow(0.0), OAControlType(0), MinOASchedPtr(0), MaxOASchedPtr(0), TempSchedPtr(0), OutsideAirNode(0), AirReliefNode(0), OAMixerOutNode(0), OutAirVolFlow(0.0), OutAirMassFlow(0.0), - MinOutAirVolFlow(0.0), MinOutAirMassFlow(0.0), CoilOption(0), HCoilPresent(false), HCoilType(0), HCoil_Index(0), HCoil_PlantTypeNum(0), - HCoil_FluidIndex(0), HCoilSchedPtr(0), HCoilSchedValue(0.0), MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), - MaxHotSteamFlow(0.0), MinHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), - HotCoilOutNodeNum(0), HotControlOffset(0.0), HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0), CCoilPresent(false), - CCoil_Index(0), CCoil_PlantTypeNum(0), CCoilType(0), CCoilSchedPtr(0), CCoilSchedValue(0.0), MaxVolColdWaterFlow(0.0), + MinOutAirVolFlow(0.0), MinOutAirMassFlow(0.0), CoilOption(0), HCoilPresent(false), HCoilType(0), HCoil_Index(0), + HeatingCoilType(DataPlant::PlantEquipmentType::Invalid), HCoil_FluidIndex(0), HCoilSchedPtr(0), HCoilSchedValue(0.0), + MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinHotSteamFlow(0.0), + MinVolHotWaterFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), + HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0), CCoilPresent(false), CCoil_Index(0), + CoolingCoilType(DataPlant::PlantEquipmentType::Invalid), CCoilType(0), CCoilSchedPtr(0), CCoilSchedValue(0.0), MaxVolColdWaterFlow(0.0), MaxColdWaterFlow(0.0), MinVolColdWaterFlow(0.0), MinColdWaterFlow(0.0), ColdControlNode(0), ColdCoilOutNodeNum(0), ColdControlOffset(0.0), CWLoopNum(0), CWLoopSide(0), CWBranchNum(0), CWCompNum(0), HeatPower(0.0), HeatEnergy(0.0), TotCoolPower(0.0), TotCoolEnergy(0.0), SensCoolPower(0.0), SensCoolEnergy(0.0), ElecPower(0.0), ElecEnergy(0.0), AvailStatus(0), FanPartLoadRatio(0.0), diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 613448efa77..e4108bd3dc6 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -670,7 +670,7 @@ namespace UnitarySystems { state.dataUnitarySystems->initUnitarySystemsErrFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_UnitarySysRecovery, + DataPlant::PlantEquipmentType::UnitarySysRecovery, this->m_HRLoopNum, this->m_HRLoopSideNum, this->m_HRBranchNum, @@ -685,32 +685,32 @@ namespace UnitarySystems { ShowFatalError(state, "InitUnitarySystems: Program terminated for previous conditions."); } } - int TypeOfCoilWaterCooling = 0; + DataPlant::PlantEquipmentType TypeOfCoilWaterCooling{DataPlant::PlantEquipmentType::Invalid}; std::string CoolingCoilType = ""; std::string CoolingCoilName = ""; if (this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWater || this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWaterDetailed || this->m_CoolingCoilType_Num == DataHVACGlobals::CoilWater_CoolingHXAssisted) { if (this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWater) { - TypeOfCoilWaterCooling = DataPlant::TypeOf_CoilWaterCooling; + TypeOfCoilWaterCooling = DataPlant::PlantEquipmentType::CoilWaterCooling; CoolingCoilType = "Coil:Cooling:Water"; CoolingCoilName = this->m_CoolingCoilName; } else if (this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWaterDetailed) { - TypeOfCoilWaterCooling = DataPlant::TypeOf_CoilWaterDetailedFlatCooling; + TypeOfCoilWaterCooling = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; CoolingCoilType = "Coil:Cooling:Water:DetailedGeometry"; CoolingCoilName = this->m_CoolingCoilName; } else { - TypeOfCoilWaterCooling = + TypeOfCoilWaterCooling = static_cast( HVACHXAssistedCoolingCoil::GetCoilObjectTypeNum(state, DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, state.dataUnitarySystems->initUnitarySystemsErrFlag, - true); - if (TypeOfCoilWaterCooling == DataHVACGlobals::Coil_CoolingWater) { - TypeOfCoilWaterCooling = DataPlant::TypeOf_CoilWaterCooling; + true)); + if (TypeOfCoilWaterCooling == static_cast(DataHVACGlobals::Coil_CoolingWater)) { + TypeOfCoilWaterCooling = DataPlant::PlantEquipmentType::CoilWaterCooling; CoolingCoilType = "Coil:Cooling:Water"; - } else if (TypeOfCoilWaterCooling == DataHVACGlobals::Coil_CoolingWaterDetailed) { - TypeOfCoilWaterCooling = DataPlant::TypeOf_CoilWaterDetailedFlatCooling; + } else if (TypeOfCoilWaterCooling == static_cast(DataHVACGlobals::Coil_CoolingWaterDetailed)) { + TypeOfCoilWaterCooling = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; CoolingCoilType = "Coil:Cooling:Water:DetailedGeometry"; } CoolingCoilName = HVACHXAssistedCoolingCoil::GetHXDXCoilName(state, @@ -753,12 +753,12 @@ namespace UnitarySystems { .Comp(this->CoolCoilCompNum) .NodeNumOut; } - int TypeOfCoilWaterHeating = 0; + DataPlant::PlantEquipmentType TypeOfCoilWaterHeating = DataPlant::PlantEquipmentType::Invalid; std::string HeatingCoilType = ""; if (this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingWater || this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingSteam) { if (this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { - TypeOfCoilWaterHeating = DataPlant::TypeOf_CoilWaterSimpleHeating; + TypeOfCoilWaterHeating = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; HeatingCoilType = "Coil:Heating:Water"; WaterCoils::SetCoilDesFlow(state, DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num), @@ -766,7 +766,7 @@ namespace UnitarySystems { this->m_MaxHeatAirVolFlow, state.dataUnitarySystems->initUnitarySystemsErrorsFound); } else { - TypeOfCoilWaterHeating = DataPlant::TypeOf_CoilSteamAirHeating; + TypeOfCoilWaterHeating = DataPlant::PlantEquipmentType::CoilSteamAirHeating; HeatingCoilType = "Coil:Heating:Steam"; } state.dataUnitarySystems->initUnitarySystemsErrFlag = false; @@ -831,7 +831,7 @@ namespace UnitarySystems { state.dataUnitarySystems->initUnitarySystemsErrFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->m_SuppHeatCoilName, - DataPlant::TypeOf_CoilWaterSimpleHeating, + DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, this->m_SuppCoilLoopNum, this->m_SuppCoilLoopSide, this->m_SuppCoilBranchNum, @@ -876,7 +876,7 @@ namespace UnitarySystems { state.dataUnitarySystems->initUnitarySystemsErrFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->m_SuppHeatCoilName, - DataPlant::TypeOf_CoilSteamAirHeating, + DataPlant::PlantEquipmentType::CoilSteamAirHeating, this->m_SuppCoilLoopNum, this->m_SuppCoilLoopSide, this->m_SuppCoilBranchNum, diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index a3f797b5e93..9761f8b0856 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -641,7 +641,8 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed = - static_cast(getEnumerationValue(DataPlant::HowMetTypeNamesUC, cAlphaArgs(aArgCount + 2))); + static_cast( + getEnumerationValue(DataPlant::HowMetTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 2)))); if (state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed == DataPlant::HowMet::ByNominalCapLowOutLimit) { // actuator for low out limit @@ -667,8 +668,8 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).FlowPriority = - static_cast( - getEnumerationValue(DataPlant::LoopFlowStatusTypeNamesUC, cAlphaArgs(aArgCount + 3))); + static_cast(getEnumerationValue( + DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 3)))); } // find program manager for initial setup, begin environment and sizing of this plant connection @@ -2414,7 +2415,7 @@ namespace UserDefinedComponents { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_CoilUserDefined, + DataPlant::PlantEquipmentType::CoilUserDefined, this->Loop.LoopNum, this->Loop.LoopSideNum, this->Loop.BranchNum, @@ -2490,7 +2491,7 @@ namespace UserDefinedComponents { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_ZoneHVACAirUserDefined, + DataPlant::PlantEquipmentType::ZoneHVACAirUserDefined, this->Loop(loop).LoopNum, this->Loop(loop).LoopSideNum, this->Loop(loop).BranchNum, @@ -2581,7 +2582,7 @@ namespace UserDefinedComponents { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_AirTerminalUserDefined, + DataPlant::PlantEquipmentType::AirTerminalUserDefined, this->Loop(loop).LoopNum, this->Loop(loop).LoopSideNum, this->Loop(loop).BranchNum, @@ -2728,7 +2729,7 @@ namespace UserDefinedComponents { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_PlantComponentUserDefined, + DataPlant::PlantEquipmentType::PlantComponentUserDefined, this->Loop(ConnectionNum).LoopNum, this->Loop(ConnectionNum).LoopSideNum, this->Loop(ConnectionNum).BranchNum, diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index fd0915e35e8..b9a197d09df 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -594,7 +594,7 @@ namespace UtilityRoutines { constexpr int getEnumerationValue(const gsl::span sList, const std::string_view s) { for (unsigned int i = 0; i < sList.size(); ++i) { - if (UtilityRoutines::SameString(sList[i], s)) return i; + if (sList[i] == s) return i; } return -1; } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 16642830fcd..c296f2b8689 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -94,8 +94,7 @@ namespace VariableSpeedCoils { using namespace Psychrometrics; using namespace DataSizing; using namespace DataHVACGlobals; - using DataPlant::TypeOf_CoilVSWAHPCoolingEquationFit; - using DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; + using DXCoils::AdjustCBF; using DXCoils::CalcCBF; @@ -3814,17 +3813,17 @@ namespace VariableSpeedCoils { DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit)) { // fix coil type if (state.dataVariableSpeedCoils->MyPlantScanFlag(DXCoilNum) && allocated(state.dataPlnt->PlantLoop)) { // switch from coil type numbers in DataHVACGlobals, to coil type numbers in plant. - int plantTypeOfNum(0); + DataPlant::PlantEquipmentType CoilVSWAHPType(DataPlant::PlantEquipmentType::Invalid); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) { - plantTypeOfNum = DataPlant::TypeOf_CoilVSWAHPCoolingEquationFit; + CoilVSWAHPType = DataPlant::PlantEquipmentType::CoilVSWAHPCoolingEquationFit; } else if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit) { - plantTypeOfNum = DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; + CoilVSWAHPType = DataPlant::PlantEquipmentType::CoilVSWAHPHeatingEquationFit; } errFlag = false; ScanPlantLoopsForObject(state, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name, - plantTypeOfNum, + CoilVSWAHPType, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopSide, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).BranchNum, diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index e301bc9c0ff..a3384c9ca56 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -230,10 +230,7 @@ namespace VentilatedSlab { using ScheduleManager::GetScheduleIndex; using namespace DataLoopNode; using namespace DataSurfaceLists; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using FluidProperties::FindRefrigerant; using OutAirNodeManager::CheckAndAddAirNodeNumber; @@ -997,10 +994,10 @@ namespace VentilatedSlab { auto const SELECT_CASE_var(state.dataIPShortCut->cAlphaArgs(27)); if (SELECT_CASE_var == "COIL:HEATING:WATER") { state.dataVentilatedSlab->VentSlab(Item).HCoilType = state.dataVentilatedSlab->Heating_WaterCoilType; - state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum = TypeOf_CoilWaterSimpleHeating; + state.dataVentilatedSlab->VentSlab(Item).HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; } else if (SELECT_CASE_var == "COIL:HEATING:STEAM") { state.dataVentilatedSlab->VentSlab(Item).HCoilType = state.dataVentilatedSlab->Heating_SteamCoilType; - state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum = TypeOf_CoilSteamAirHeating; + state.dataVentilatedSlab->VentSlab(Item).HeatingCoilType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex = FindRefrigerant(state, "Steam"); if (state.dataVentilatedSlab->VentSlab(Item).HCoil_FluidIndex == 0) { ShowSevereError(state, @@ -1111,11 +1108,11 @@ namespace VentilatedSlab { auto const SELECT_CASE_var(state.dataIPShortCut->cAlphaArgs(30)); if (SELECT_CASE_var == "COIL:COOLING:WATER") { state.dataVentilatedSlab->VentSlab(Item).CCoilType = state.dataVentilatedSlab->Cooling_CoilWaterCooling; - state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; + state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName = state.dataIPShortCut->cAlphaArgs(31); } else if (SELECT_CASE_var == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { state.dataVentilatedSlab->VentSlab(Item).CCoilType = state.dataVentilatedSlab->Cooling_CoilDetailedCooling; - state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; + state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName = state.dataIPShortCut->cAlphaArgs(31); } else if (SELECT_CASE_var == "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED") { state.dataVentilatedSlab->VentSlab(Item).CCoilType = state.dataVentilatedSlab->Cooling_CoilHXAssisted; @@ -1126,10 +1123,11 @@ namespace VentilatedSlab { state.dataVentilatedSlab->VentSlab(Item).CCoilPlantType, state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName); if (UtilityRoutines::SameString(state.dataVentilatedSlab->VentSlab(Item).CCoilPlantType, "Coil:Cooling:Water")) { - state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterCooling; + state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; } else if (UtilityRoutines::SameString(state.dataVentilatedSlab->VentSlab(Item).CCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { - state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum = TypeOf_CoilWaterDetailedFlatCooling; + state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType = + DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; } else { ShowSevereError(state, "GetVentilatedSlabInput: " + CurrentModuleObject + "=\"" + @@ -1469,10 +1467,7 @@ namespace VentilatedSlab { // Using/Aliasing auto &ZoneComp = state.dataHVACGlobal->ZoneComp; - using DataPlant::TypeOf_CoilSteamAirHeating; - using DataPlant::TypeOf_CoilWaterCooling; - using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; - using DataPlant::TypeOf_CoilWaterSimpleHeating; + using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::VentilatedSlab_Num; using FluidProperties::GetDensityGlycol; @@ -1550,12 +1545,12 @@ namespace VentilatedSlab { } if (state.dataVentilatedSlab->MyPlantScanFlag(Item) && allocated(state.dataPlnt->PlantLoop)) { - if ((state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || - (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { + if ((state.dataVentilatedSlab->VentSlab(Item).HeatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || + (state.dataVentilatedSlab->VentSlab(Item).HeatingCoilType == DataPlant::PlantEquipmentType::CoilSteamAirHeating)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataVentilatedSlab->VentSlab(Item).HCoilName, - state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum, + state.dataVentilatedSlab->VentSlab(Item).HeatingCoilType, state.dataVentilatedSlab->VentSlab(Item).HWLoopNum, state.dataVentilatedSlab->VentSlab(Item).HWLoopSide, state.dataVentilatedSlab->VentSlab(Item).HWBranchNum, @@ -1579,12 +1574,12 @@ namespace VentilatedSlab { .Comp(state.dataVentilatedSlab->VentSlab(Item).HWCompNum) .NodeNumOut; } - if ((state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || - (state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { + if ((state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || + (state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataVentilatedSlab->VentSlab(Item).CCoilPlantName, - state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum, + state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType, state.dataVentilatedSlab->VentSlab(Item).CWLoopNum, state.dataVentilatedSlab->VentSlab(Item).CWLoopSide, state.dataVentilatedSlab->VentSlab(Item).CWBranchNum, @@ -1686,7 +1681,7 @@ namespace VentilatedSlab { if (state.dataVentilatedSlab->VentSlab(Item).HCoilPresent) { // Only initialize these if a heating coil is actually present - if (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating && + if (state.dataVentilatedSlab->VentSlab(Item).HeatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating && !state.dataVentilatedSlab->MyPlantScanFlag(Item)) { rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, @@ -1707,7 +1702,7 @@ namespace VentilatedSlab { state.dataVentilatedSlab->VentSlab(Item).HWBranchNum, state.dataVentilatedSlab->VentSlab(Item).HWCompNum); } - if (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating && + if (state.dataVentilatedSlab->VentSlab(Item).HeatingCoilType == DataPlant::PlantEquipmentType::CoilSteamAirHeating && !state.dataVentilatedSlab->MyPlantScanFlag(Item)) { TempSteamIn = 100.00; SteamDensity = GetSatDensityRefrig( @@ -1731,8 +1726,8 @@ namespace VentilatedSlab { if (state.dataVentilatedSlab->VentSlab(Item).CCoilPresent && !state.dataVentilatedSlab->MyPlantScanFlag(Item)) { // Only initialize these if a cooling coil is actually present - if ((state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || - (state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { + if ((state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || + (state.dataVentilatedSlab->VentSlab(Item).CoolingCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, diff --git a/src/EnergyPlus/VentilatedSlab.hh b/src/EnergyPlus/VentilatedSlab.hh index a55163d01b0..791358ee85f 100644 --- a/src/EnergyPlus/VentilatedSlab.hh +++ b/src/EnergyPlus/VentilatedSlab.hh @@ -55,6 +55,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -127,7 +128,7 @@ namespace VentilatedSlab { std::string HCoilName; // name of heating coil std::string HCoilTypeCh; // type of heating coil (character string) int HCoil_Index; - int HCoil_PlantTypeNum; + DataPlant::PlantEquipmentType HeatingCoilType; int HCoil_FluidIndex; std::string HCoilSchedName; // availability schedule for the heating coil int HCoilSchedPtr; // index to schedule @@ -165,7 +166,7 @@ namespace VentilatedSlab { int CCoil_Index; std::string CCoilPlantName; // name of cooling coil (child<=CoilSystem:Cooling:Water:HeatExchangerAssisted) std::string CCoilPlantType; // type of cooling coil (child<=CoilSystem:Cooling:Water:HeatExchangerAssisted) - int CCoil_PlantTypeNum; + DataPlant::PlantEquipmentType CoolingCoilType; int CCoilType; // type of cooling coil: // 'Coil:Cooling:Water:DetailedGeometry' or // 'CoilSystem:Cooling:Water:HeatExchangerAssisted' @@ -239,12 +240,13 @@ namespace VentilatedSlab { ReturnAirNode(0), RadInNode(0), ZoneAirInNode(0), FanOutletNode(0), MSlabInNode(0), MSlabOutNode(0), Fan_Index(0), FanType_Num(0), ControlCompTypeNum(0), CompErrIndex(0), MaxAirVolFlow(0.0), MaxAirMassFlow(0.0), OAControlType(0), MinOASchedPtr(0), MaxOASchedPtr(0), TempSchedPtr(0), OutsideAirNode(0), AirReliefNode(0), OAMixerOutNode(0), OutAirVolFlow(0.0), OutAirMassFlow(0.0), MinOutAirVolFlow(0.0), - MinOutAirMassFlow(0.0), SysConfg(0), CoilOption(0), HCoilPresent(false), HCoilType(0), HCoil_Index(0), HCoil_PlantTypeNum(0), - HCoil_FluidIndex(0), HCoilSchedPtr(0), HCoilSchedValue(0.0), MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), - MaxHotSteamFlow(0.0), MinHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), - HotCoilOutNodeNum(0), HotControlOffset(0.0), HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0), HotAirHiTempSchedPtr(0), - HotAirLoTempSchedPtr(0), HotCtrlHiTempSchedPtr(0), HotCtrlLoTempSchedPtr(0), CCoilPresent(false), CCoil_Index(0), CCoil_PlantTypeNum(0), - CCoilType(0), CCoilSchedPtr(0), CCoilSchedValue(0.0), MaxVolColdWaterFlow(0.0), MaxColdWaterFlow(0.0), MinVolColdWaterFlow(0.0), + MinOutAirMassFlow(0.0), SysConfg(0), CoilOption(0), HCoilPresent(false), HCoilType(0), HCoil_Index(0), + HeatingCoilType(DataPlant::PlantEquipmentType::Invalid), HCoil_FluidIndex(0), HCoilSchedPtr(0), HCoilSchedValue(0.0), + MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinHotSteamFlow(0.0), + MinVolHotWaterFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), + HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0), HotAirHiTempSchedPtr(0), HotAirLoTempSchedPtr(0), HotCtrlHiTempSchedPtr(0), + HotCtrlLoTempSchedPtr(0), CCoilPresent(false), CCoil_Index(0), CoolingCoilType(DataPlant::PlantEquipmentType::Invalid), CCoilType(0), + CCoilSchedPtr(0), CCoilSchedValue(0.0), MaxVolColdWaterFlow(0.0), MaxColdWaterFlow(0.0), MinVolColdWaterFlow(0.0), MinColdWaterFlow(0.0), ColdControlNode(0), ColdCoilOutNodeNum(0), ColdControlOffset(0.0), CWLoopNum(0), CWLoopSide(0), CWBranchNum(0), CWCompNum(0), ColdAirHiTempSchedPtr(0), ColdAirLoTempSchedPtr(0), ColdCtrlHiTempSchedPtr(0), ColdCtrlLoTempSchedPtr(0), CondErrIndex(0), EnrgyImbalErrIndex(0), RadSurfNum(0), MSlabIn(0), MSlabOut(0), DirectHeatLossPower(0.0), DirectHeatLossEnergy(0.0), diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index a5529cd3fd3..dad6b90cca3 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -121,9 +121,7 @@ namespace EnergyPlus::WaterCoils { using namespace DataLoopNode; using namespace DataHVACGlobals; -using DataPlant::TypeOf_CoilWaterCooling; -using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; -using DataPlant::TypeOf_CoilWaterSimpleHeating; + using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using Psychrometrics::PsyCpAirFnW; @@ -213,15 +211,15 @@ void SimulateWaterCoilComponents(EnergyPlusData &state, } // Calculate the Correct WaterCoil Model with the current CoilNum - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { CalcDetailFlatFinCoolingCoil(state, CoilNum, state.dataWaterCoils->SimCalc, OpMode, PartLoadFrac); if (present(QActual)) QActual = state.dataWaterCoils->WaterCoil(CoilNum).SenWaterCoolingCoilRate; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { CoolingCoil(state, CoilNum, FirstHVACIteration, state.dataWaterCoils->SimCalc, OpMode, PartLoadFrac); if (present(QActual)) QActual = state.dataWaterCoils->WaterCoil(CoilNum).SenWaterCoolingCoilRate; } - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { CalcSimpleHeatingCoil(state, CoilNum, OpMode, PartLoadFrac, state.dataWaterCoils->SimCalc); if (present(QActual)) QActual = state.dataWaterCoils->WaterCoil(CoilNum).TotWaterHeatingCoilRate; } @@ -359,10 +357,10 @@ void GetWaterCoilInput(EnergyPlusData &state) } state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilTypeA = "Heating"; - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; // 'Heating' + state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; // 'Heating' state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilModelA = "SIMPLE"; state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = iCoilModel::HeatingSimple; // 'SIMPLE' - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state.dataWaterCoils->WaterCoil(CoilNum).UACoil = NumArray(1); state.dataWaterCoils->WaterCoil(CoilNum).UACoilVariable = state.dataWaterCoils->WaterCoil(CoilNum).UACoil; @@ -543,10 +541,10 @@ void GetWaterCoilInput(EnergyPlusData &state) } state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilTypeA = "Cooling"; - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; // 'Cooling' + state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; // 'Cooling' state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilModelA = "DETAILED FLAT FIN"; state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = iCoilModel::CoolingDetailed; // 'DETAILED FLAT FIN' - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterDetailedFlatCooling; + state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = NumArray(1); if (state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate == AutoSize) @@ -768,10 +766,10 @@ void GetWaterCoilInput(EnergyPlusData &state) } state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilTypeA = "Cooling"; - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; // 'Cooling' + state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; // 'Cooling' state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilModelA = "Cooling"; state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = iCoilModel::CoolingSimple; // 'Cooling' - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = NumArray(1); // Liquid mass flow rate at Design kg/s if (state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate == AutoSize) @@ -1096,13 +1094,14 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA SimAirServingZones::CompType CoilTypeNum(SimAirServingZones::CompType::Unassigned); std::string CompType; std::string CompName = state.dataWaterCoils->WaterCoil(tempCoilNum).Name; - if (state.dataWaterCoils->WaterCoil(tempCoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + if (state.dataWaterCoils->WaterCoil(tempCoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { CoilTypeNum = SimAirServingZones::CompType::WaterCoil_Cooling; CompType = cAllCoilTypes(DataHVACGlobals::Coil_CoolingWater); - } else if (state.dataWaterCoils->WaterCoil(tempCoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling) { + } else if (state.dataWaterCoils->WaterCoil(tempCoilNum).WaterCoilType == + DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { CoilTypeNum = SimAirServingZones::CompType::WaterCoil_DetailedCool; CompType = cAllCoilTypes(DataHVACGlobals::Coil_CoolingWaterDetailed); - } else if (state.dataWaterCoils->WaterCoil(tempCoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + } else if (state.dataWaterCoils->WaterCoil(tempCoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { CoilTypeNum = SimAirServingZones::CompType::WaterCoil_SimpleHeat; CompType = cAllCoilTypes(DataHVACGlobals::Coil_HeatingWater); } @@ -1172,8 +1171,8 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->DesCpAir(CoilNum) = PsyCpAirFnW(0.0); state.dataWaterCoils->DesUARangeCheck(CoilNum) = (-1568.6 * state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat + 20.157); - if ((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) || - (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling)) { // 'Cooling' + if ((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || + (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { // 'Cooling' Node(WaterInletNode).Temp = 5.0; Cp = GetSpecificHeatGlycol(state, @@ -1188,7 +1187,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA Node(WaterInletNode).HumRat = 0.0; } - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { // 'Heating' + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { // 'Heating' Node(WaterInletNode).Temp = 60.0; Cp = GetSpecificHeatGlycol(state, @@ -1690,7 +1689,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA //@@@@ DESIGN CONDITION END HERE @@@@ // Calculate rated Total, latent, sensible capacity, SHR, effectiveness - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { state.dataWaterCoils->WaterCoil(CoilNum).InletAirTemp = 16.6; state.dataWaterCoils->WaterCoil(CoilNum).InletAirHumRat = PsyWFnTdbRhPb(state, 16.6, 0.5, state.dataEnvrn->StdBaroPress, RoutineName); state.dataWaterCoils->WaterCoil(CoilNum).InletWaterTemp = 82.2; @@ -1716,7 +1715,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->CapacitanceWater = state.dataWaterCoils->WaterCoil(CoilNum).InletWaterMassFlowRate * Cp; state.dataWaterCoils->CMin = min(CapacitanceAir, state.dataWaterCoils->CapacitanceWater); if (state.dataWaterCoils->CMin > 0.0) { - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { CoolingCoil(state, CoilNum, FirstHVACIteration, state.dataWaterCoils->DesignCalc, ContFanCycCoil, 1.0); state.dataWaterCoils->CoilEffectiveness = (state.dataWaterCoils->WaterCoil(CoilNum).InletAirTemp - state.dataWaterCoils->WaterCoil(CoilNum).OutletAirTemp) / @@ -1726,7 +1725,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->WaterCoil(CoilNum).SenWaterCoolingCoilRate; state.dataWaterCoils->RatedSHR = state.dataWaterCoils->WaterCoil(CoilNum).SenWaterCoolingCoilRate / state.dataWaterCoils->WaterCoil(CoilNum).TotWaterCoolingCoilRate; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { CalcDetailFlatFinCoolingCoil(state, CoilNum, state.dataWaterCoils->DesignCalc, ContFanCycCoil, 1.0); state.dataWaterCoils->CoilEffectiveness = (state.dataWaterCoils->WaterCoil(CoilNum).InletAirTemp - state.dataWaterCoils->WaterCoil(CoilNum).OutletAirTemp) / @@ -1736,7 +1735,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->WaterCoil(CoilNum).SenWaterCoolingCoilRate; state.dataWaterCoils->RatedSHR = state.dataWaterCoils->WaterCoil(CoilNum).SenWaterCoolingCoilRate / state.dataWaterCoils->WaterCoil(CoilNum).TotWaterCoolingCoilRate; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { CalcSimpleHeatingCoil(state, CoilNum, ContFanCycCoil, 1.0, state.dataWaterCoils->DesignCalc); state.dataWaterCoils->CoilEffectiveness = (state.dataWaterCoils->WaterCoil(CoilNum).OutletAirTemp - state.dataWaterCoils->WaterCoil(CoilNum).InletAirTemp) / @@ -1765,7 +1764,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->MyCoilReportFlag(CoilNum) = false; { auto const SELECT_CASE_var(state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType); - if (SELECT_CASE_var == DataPlant::TypeOf_CoilWaterSimpleHeating) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { if (state.dataWaterCoils->RptCoilHeaderFlag(1)) { print(state.files.eio, "{}", "! ,Component Type,Name,Nominal Total Capacity {W}\n"); state.dataWaterCoils->RptCoilHeaderFlag(1) = false; @@ -1804,7 +1803,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum, state.dataWaterCoils->WaterCoil(CoilNum).WaterOutletNodeNum, state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum); // coil report - } else if (SELECT_CASE_var == DataPlant::TypeOf_CoilWaterDetailedFlatCooling) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { if (state.dataWaterCoils->RptCoilHeaderFlag(2)) { print(state.files.eio, "{}\n", @@ -1869,7 +1868,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum, state.dataWaterCoils->WaterCoil(CoilNum).WaterOutletNodeNum, state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum); // Coil Report - } else if (SELECT_CASE_var == DataPlant::TypeOf_CoilWaterCooling) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::CoilWaterCooling) { if (state.dataWaterCoils->RptCoilHeaderFlag(2)) { print(state.files.eio, "{}\n", @@ -1978,13 +1977,13 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA std::string coilTypeName(" "); // calculate coil sim model at rating point, full load, continuous fan - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { CalcDetailFlatFinCoolingCoil(state, CoilNum, state.dataWaterCoils->SimCalc, ContFanCycCoil, 1.0); coilTypeName = "Coil:Cooling:Water:DetailedGeometry"; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { CoolingCoil(state, CoilNum, FirstHVACIteration, state.dataWaterCoils->SimCalc, ContFanCycCoil, 1.0); coilTypeName = "Coil:Cooling:Water"; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { CalcSimpleHeatingCoil(state, CoilNum, ContFanCycCoil, 1.0, state.dataWaterCoils->SimCalc); coilTypeName = "Coil:Heating:Water"; } @@ -1998,8 +1997,8 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA "InitWaterCoil"); // call set routine in coil report - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling || - state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling || + state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions( state, state.dataWaterCoils->WaterCoil(CoilNum).Name, @@ -2017,7 +2016,7 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA -999.0, -999.0, -999.0); // coil effectiveness - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions( state, state.dataWaterCoils->WaterCoil(CoilNum).Name, @@ -2082,7 +2081,7 @@ void CalcAdjustedCoilUA(EnergyPlusData &state, int const CoilNum) Real64 WaterConvSensitivity; // "s" in Wetter 1999, temperature sensitivity in water side convection // Coil:Heating:Water - if ((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) && + if ((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) && (!(state.dataWaterCoils->MyUAAndFlowCalcFlag(CoilNum)))) { // update Coil UA based on inlet mass flows and temps x_a = 1.0 + 4.769E-3 * (state.dataWaterCoils->WaterCoil(CoilNum).InletAirTemp - state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp); if (state.dataWaterCoils->WaterCoil(CoilNum).DesAirMassFlowRate > 0.0) { @@ -2153,7 +2152,7 @@ void CalcAdjustedCoilUA(EnergyPlusData &state, int const CoilNum) // Coil:Cooling:Water // update Coil UA based on inlet mass flows and temps - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling && + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling && (!state.dataWaterCoils->MyCoilDesignFlag(CoilNum))) { if (state.dataWaterCoils->WaterCoil(CoilNum).DesAirMassFlowRate > 0.0) { x_a = 1.0 + 4.769E-3 * (state.dataWaterCoils->WaterCoil(CoilNum).InletAirTemp - state.dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp); @@ -2321,8 +2320,8 @@ void SizeWaterCoil(EnergyPlusData &state, int const CoilNum) auto &OASysEqSizing(state.dataSize->OASysEqSizing); // cooling coils - if (((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) || - (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling)) && + if (((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || + (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) && state.dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize) { // find the appropriate Plant Sizing object PltSizCoolNum = PlantUtilities::MyPlantSizingIndex(state, @@ -2333,8 +2332,8 @@ void SizeWaterCoil(EnergyPlusData &state, int const CoilNum) LoopErrorsFound); } - if (((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) || - (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling))) { // 'Cooling' + if (((state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || + (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling))) { // 'Cooling' if (state.dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp) { state.dataSize->DataWaterCoilSizCoolDeltaT = state.dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp; @@ -2710,7 +2709,7 @@ void SizeWaterCoil(EnergyPlusData &state, int const CoilNum) } // end cooling coil IF // if this is a heating coil - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating && + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating && state.dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize) { // find the appropriate heating Plant Sizing object PltSizHeatNum = PlantUtilities::MyPlantSizingIndex(state, @@ -2721,7 +2720,7 @@ void SizeWaterCoil(EnergyPlusData &state, int const CoilNum) LoopErrorsFound); } - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { if (state.dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp) { // use water design deltaT specified in the heating water coils @@ -5127,7 +5126,7 @@ void ReportWaterCoil(EnergyPlusData &state, int const CoilNum) if (state.dataWaterCoils->WaterCoil(CoilNum).reportCoilFinalSizes) { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { std::string coilObjClassName; - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { coilObjClassName = "Coil:Heating:Water"; state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( state, @@ -5138,7 +5137,7 @@ void ReportWaterCoil(EnergyPlusData &state, int const CoilNum) state.dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate, state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); state.dataWaterCoils->WaterCoil(CoilNum).reportCoilFinalSizes = false; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { coilObjClassName = "Coil:Cooling:Water:DetailedGeometry"; state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( state, @@ -5149,7 +5148,7 @@ void ReportWaterCoil(EnergyPlusData &state, int const CoilNum) state.dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate, state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); state.dataWaterCoils->WaterCoil(CoilNum).reportCoilFinalSizes = false; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { coilObjClassName = "Coil:Cooling:Water"; state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( state, @@ -6030,7 +6029,7 @@ void CheckWaterCoilSchedule(EnergyPlusData &state, } Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -6072,7 +6071,7 @@ Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, } if (WhichCoil == 0) { - ShowSevereError(state, "GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ShowContinueError(state, "... Max Water Flow rate returned as -1000."); ErrorsFound = true; MaxWaterFlowRate = -1000.0; @@ -6082,7 +6081,7 @@ Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, } int GetCoilInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -6124,7 +6123,7 @@ int GetCoilInletNode(EnergyPlusData &state, } if (WhichCoil == 0) { - ShowSevereError(state, "GetCoilInletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilInletNode: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } @@ -6133,7 +6132,7 @@ int GetCoilInletNode(EnergyPlusData &state, } int GetCoilOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -6175,9 +6174,9 @@ int GetCoilOutletNode(EnergyPlusData &state, } if (WhichCoil == 0) { - ShowSevereError(state, - "GetCoilOutletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + - "\" when accessing coil outlet node number."); + ShowSevereError( + state, + format("GetCoilOutletNode: Could not find Coil, Type=\"{}\" Name=\"{}\" when accessing coil outlet node number.", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } @@ -6186,7 +6185,7 @@ int GetCoilOutletNode(EnergyPlusData &state, } int GetCoilWaterInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -6228,7 +6227,7 @@ int GetCoilWaterInletNode(EnergyPlusData &state, } if (WhichCoil == 0) { - ShowSevereError(state, "GetCoilWaterInletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilWaterInletNode: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } @@ -6237,7 +6236,7 @@ int GetCoilWaterInletNode(EnergyPlusData &state, } int GetCoilWaterOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -6279,7 +6278,7 @@ int GetCoilWaterOutletNode(EnergyPlusData &state, } if (WhichCoil == 0) { - ShowSevereError(state, "GetCoilWaterOutletNode: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilWaterOutletNode: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; NodeNumber = 0; } @@ -6288,7 +6287,7 @@ int GetCoilWaterOutletNode(EnergyPlusData &state, } void SetCoilDesFlow(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type Real64 const CoilDesFlow, // coil volumetric air flow rate [m3/s] bool &ErrorsFound // set to true if problem @@ -6324,7 +6323,7 @@ void SetCoilDesFlow(EnergyPlusData &state, // WaterCoil(WhichCoil).DesAirVolFlowRate = CoilDesFlow; } } else { - ShowSevereError(state, "GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"" + CoilType + "\" Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetCoilMaxWaterFlowRate: Could not find Coil, Type=\"{}\" Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; } } @@ -6376,9 +6375,9 @@ Real64 GetWaterCoilDesAirFlow(EnergyPlusData &state, } void CheckActuatorNode(EnergyPlusData &state, - int const ActuatorNodeNum, // input actuator node number - int &iNodeType, // Cooling or Heating or 0 - bool &NodeNotFound // true if matching water inlet node not found + int const ActuatorNodeNum, // input actuator node number + DataPlant::PlantEquipmentType &WaterCoilType, // Cooling or Heating or 0 + bool &NodeNotFound // true if matching water inlet node not found ) { @@ -6403,12 +6402,12 @@ void CheckActuatorNode(EnergyPlusData &state, } WhichCoil = 0; - iNodeType = 0; + WaterCoilType = DataPlant::PlantEquipmentType::Invalid; NodeNotFound = true; for (CoilNum = 1; CoilNum <= state.dataWaterCoils->NumWaterCoils; ++CoilNum) { if (state.dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum == ActuatorNodeNum) { WhichCoil = CoilNum; - iNodeType = state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; + WaterCoilType = state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; NodeNotFound = false; } } @@ -6464,11 +6463,11 @@ void CheckForSensorAndSetPointNode(EnergyPlusData &state, // a setpoint is also specified on the water coil outlet node if (!NodeNotFound) { if (WhichCoil > 0) { - if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterDetailedFlatCooling) { + if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { WaterCoilType = "Coil:Cooling:Water:DetailedGeometry"; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterCooling) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { WaterCoilType = "Coil:Cooling:Water"; - } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::TypeOf_CoilWaterSimpleHeating) { + } else if (state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { WaterCoilType = "Coil:Heating:Water"; } EMSSetPointErrorFlag = false; @@ -6731,7 +6730,7 @@ Real64 EstimateHEXSurfaceArea(EnergyPlusData &state, int const CoilNum) // coil } int GetWaterCoilIndex(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ) @@ -6769,7 +6768,7 @@ int GetWaterCoilIndex(EnergyPlusData &state, } if (IndexNum == 0) { - ShowSevereError(state, "GetWaterCoilIndex: Could not find CoilType=\"" + CoilType + "\" with Name=\"" + CoilName + "\""); + ShowSevereError(state, format("GetWaterCoilIndex: Could not find CoilType=\"{}\" with Name=\"{}\"", CoilType, CoilName)); ErrorsFound = true; } @@ -6830,7 +6829,7 @@ Real64 GetWaterCoilCapacity(EnergyPlusData &state, } void UpdateWaterToAirCoilPlantConnection(EnergyPlusData &state, - int const CoilTypeNum, + DataPlant::PlantEquipmentType const CoilType, std::string const &CoilName, [[maybe_unused]] int const EquipFlowCtrl, // Flow control mode for the equipment int const LoopNum, // Plant loop index for where called from @@ -6851,7 +6850,7 @@ void UpdateWaterToAirCoilPlantConnection(EnergyPlusData &state, // update sim routine called from plant // Using/Aliasing - using DataPlant::ccSimPlantEquipTypes; + using DataPlant::PlantEquipTypeNames; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6885,13 +6884,13 @@ void UpdateWaterToAirCoilPlantConnection(EnergyPlusData &state, CoilName, state.dataWaterCoils->WaterCoil(CoilNum).Name)); } - if (CoilTypeNum != state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType) { + if (CoilType != state.dataWaterCoils->WaterCoil(CoilNum).WaterCoilType) { ShowFatalError( state, format("UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed={}, Coil name={}, stored Coil Name for that index={}", CoilNum, CoilName, - ccSimPlantEquipTypes(CoilTypeNum))); + PlantEquipTypeNames[static_cast(CoilType)])); } } } diff --git a/src/EnergyPlus/WaterCoils.hh b/src/EnergyPlus/WaterCoils.hh index ead037e1152..e720c0d9f1d 100644 --- a/src/EnergyPlus/WaterCoils.hh +++ b/src/EnergyPlus/WaterCoils.hh @@ -83,34 +83,34 @@ namespace WaterCoils { struct WaterCoilEquipConditions { // Members - std::string Name; // Name of the WaterCoil - std::string WaterCoilTypeA; // Type of WaterCoil ie. Heating or Cooling - std::string WaterCoilModelA; // Type of WaterCoil ie. Simple, Detailed, etc. - int WaterCoilType; // Type of WaterCoil ie. Heating or Cooling - iCoilModel WaterCoilModel; // Type of WaterCoil ie. Simple, Detailed, etc. - std::string Schedule; // WaterCoil Operation Schedule - int SchedPtr; // Pointer to the correct schedule - bool RequestingAutoSize; // True if this coil has appropriate autosize fields - Real64 InletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated [kg/s] - Real64 OutletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated[kg/s] - Real64 InletAirTemp; // Inlet Air Temperature Operating Condition [C] - Real64 OutletAirTemp; // Outlet Air Temperature Operating Condition [C] - Real64 InletAirHumRat; // Inlet Air Humidity Ratio Operating Condition - Real64 OutletAirHumRat; // Outlet Air Humidity Ratio Calculated Condition - Real64 InletAirEnthalpy; // Inlet Air enthalpy [J/kg] - Real64 OutletAirEnthalpy; // Outlet Air enthalpy [J/kg] - Real64 TotWaterCoilLoad; // Total Load on the Coil [W] - Real64 SenWaterCoilLoad; // Sensible Load on the Coil [W] - Real64 TotWaterHeatingCoilEnergy; // Total Heating Coil energy of the Coil [J] - Real64 TotWaterCoolingCoilEnergy; // Total Cooling Coil energy of the Coil [J] - Real64 SenWaterCoolingCoilEnergy; // Sensible Cooling Coil energy of the Coil [J] - Real64 DesWaterHeatingCoilRate; // Design Heating Coil Rate used for sizing [W] - Real64 TotWaterHeatingCoilRate; // Total Heating Coil Rate on the Coil [W] - Real64 DesWaterCoolingCoilRate; // Design Cooling Coil Rate used for sizing [W] - Real64 TotWaterCoolingCoilRate; // Total Cooling Coil Rate on the Coil [W] - Real64 SenWaterCoolingCoilRate; // Sensible Cooling Coil Rate on the Coil [W] - Real64 UACoil; // WaterCoil UA Value - Real64 LeavingRelHum; // Simple Coil Latent Model requires User input for leaving RH + std::string Name; // Name of the WaterCoil + std::string WaterCoilTypeA; // Type of WaterCoil ie. Heating or Cooling + std::string WaterCoilModelA; // Type of WaterCoil ie. Simple, Detailed, etc. + DataPlant::PlantEquipmentType WaterCoilType; // Type of WaterCoil ie. Heating or Cooling + iCoilModel WaterCoilModel; // Type of WaterCoil ie. Simple, Detailed, etc. + std::string Schedule; // WaterCoil Operation Schedule + int SchedPtr; // Pointer to the correct schedule + bool RequestingAutoSize; // True if this coil has appropriate autosize fields + Real64 InletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated [kg/s] + Real64 OutletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated[kg/s] + Real64 InletAirTemp; // Inlet Air Temperature Operating Condition [C] + Real64 OutletAirTemp; // Outlet Air Temperature Operating Condition [C] + Real64 InletAirHumRat; // Inlet Air Humidity Ratio Operating Condition + Real64 OutletAirHumRat; // Outlet Air Humidity Ratio Calculated Condition + Real64 InletAirEnthalpy; // Inlet Air enthalpy [J/kg] + Real64 OutletAirEnthalpy; // Outlet Air enthalpy [J/kg] + Real64 TotWaterCoilLoad; // Total Load on the Coil [W] + Real64 SenWaterCoilLoad; // Sensible Load on the Coil [W] + Real64 TotWaterHeatingCoilEnergy; // Total Heating Coil energy of the Coil [J] + Real64 TotWaterCoolingCoilEnergy; // Total Cooling Coil energy of the Coil [J] + Real64 SenWaterCoolingCoilEnergy; // Sensible Cooling Coil energy of the Coil [J] + Real64 DesWaterHeatingCoilRate; // Design Heating Coil Rate used for sizing [W] + Real64 TotWaterHeatingCoilRate; // Total Heating Coil Rate on the Coil [W] + Real64 DesWaterCoolingCoilRate; // Design Cooling Coil Rate used for sizing [W] + Real64 TotWaterCoolingCoilRate; // Total Cooling Coil Rate on the Coil [W] + Real64 SenWaterCoolingCoilRate; // Sensible Cooling Coil Rate on the Coil [W] + Real64 UACoil; // WaterCoil UA Value + Real64 LeavingRelHum; // Simple Coil Latent Model requires User input for leaving RH Real64 DesiredOutletTemp; Real64 DesiredOutletHumRat; Real64 InletWaterTemp; // Inlet Water Temperature [C] @@ -224,29 +224,29 @@ namespace WaterCoils { // Default Constructor WaterCoilEquipConditions() - : WaterCoilType(0), WaterCoilModel(iCoilModel::Unassigned), SchedPtr(0), RequestingAutoSize(false), InletAirMassFlowRate(0.0), - OutletAirMassFlowRate(0.0), InletAirTemp(0.0), OutletAirTemp(0.0), InletAirHumRat(0.0), OutletAirHumRat(0.0), InletAirEnthalpy(0.0), - OutletAirEnthalpy(0.0), TotWaterCoilLoad(0.0), SenWaterCoilLoad(0.0), TotWaterHeatingCoilEnergy(0.0), TotWaterCoolingCoilEnergy(0.0), - SenWaterCoolingCoilEnergy(0.0), DesWaterHeatingCoilRate(0.0), TotWaterHeatingCoilRate(0.0), DesWaterCoolingCoilRate(0.0), - TotWaterCoolingCoilRate(0.0), SenWaterCoolingCoilRate(0.0), UACoil(0.0), LeavingRelHum(0.0), DesiredOutletTemp(0.0), - DesiredOutletHumRat(0.0), InletWaterTemp(0.0), OutletWaterTemp(0.0), InletWaterMassFlowRate(0.0), OutletWaterMassFlowRate(0.0), - MaxWaterVolFlowRate(0.0), MaxWaterMassFlowRate(0.0), InletWaterEnthalpy(0.0), OutletWaterEnthalpy(0.0), TubeOutsideSurfArea(0.0), - TotTubeInsideArea(0.0), FinSurfArea(0.0), MinAirFlowArea(0.0), CoilDepth(0.0), FinDiam(0.0), FinThickness(0.0), TubeInsideDiam(0.0), - TubeOutsideDiam(0.0), TubeThermConductivity(0.0), FinThermConductivity(0.0), FinSpacing(0.0), TubeDepthSpacing(0.0), NumOfTubeRows(0), - NumOfTubesPerRow(0), EffectiveFinDiam(0.0), TotCoilOutsideSurfArea(0.0), CoilEffectiveInsideDiam(0.0), GeometryCoef1(0.0), - GeometryCoef2(0.0), DryFinEfficncyCoef(5, 0.0), SatEnthlCurveConstCoef(0.0), SatEnthlCurveSlope(0.0), EnthVsTempCurveAppxSlope(0.0), - EnthVsTempCurveConst(0.0), MeanWaterTempSaved(0.0), InWaterTempSaved(0.0), OutWaterTempSaved(0.0), SurfAreaWetSaved(0.0), - SurfAreaWetFraction(0.0), DesInletWaterTemp(0.0), DesAirVolFlowRate(0.0), DesInletAirTemp(0.0), DesInletAirHumRat(0.0), - DesTotWaterCoilLoad(0.0), DesSenWaterCoilLoad(0.0), DesAirMassFlowRate(0.0), UACoilTotal(0.0), UACoilInternal(0.0), UACoilExternal(0.0), - UACoilInternalDes(0.0), UACoilExternalDes(0.0), DesOutletAirTemp(0.0), DesOutletAirHumRat(0.0), DesOutletWaterTemp(0.0), - HeatExchType(0), CoolingCoilAnalysisMode(0), UACoilInternalPerUnitArea(0.0), UAWetExtPerUnitArea(0.0), UADryExtPerUnitArea(0.0), - SurfAreaWetFractionSaved(0.0), UACoilVariable(0.0), RatioAirSideToWaterSideConvect(1.0), AirSideNominalConvect(0.0), - LiquidSideNominalConvect(0.0), Control(0), AirInletNodeNum(0), AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), - WaterLoopNum(0), WaterLoopSide(0), WaterLoopBranchNum(0), WaterLoopCompNum(0), CondensateCollectMode(1001), CondensateTankID(0), - CondensateTankSupplyARRID(0), CondensateVdot(0.0), CondensateVol(0.0), CoilPerfInpMeth(0), FaultyCoilFoulingFlag(false), - FaultyCoilFoulingIndex(0), FaultyCoilFoulingFactor(0.0), DesiccantRegenerationCoil(false), DesiccantDehumNum(0), - DesignWaterDeltaTemp(0.0), UseDesignWaterDeltaTemp(false), ControllerName(""), ControllerIndex(0), reportCoilFinalSizes(true), - AirLoopDOASFlag(false), heatRecoveryCoil(false) + : WaterCoilType(DataPlant::PlantEquipmentType::Invalid), WaterCoilModel(iCoilModel::Unassigned), SchedPtr(0), RequestingAutoSize(false), + InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), InletAirTemp(0.0), OutletAirTemp(0.0), InletAirHumRat(0.0), OutletAirHumRat(0.0), + InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), TotWaterCoilLoad(0.0), SenWaterCoilLoad(0.0), TotWaterHeatingCoilEnergy(0.0), + TotWaterCoolingCoilEnergy(0.0), SenWaterCoolingCoilEnergy(0.0), DesWaterHeatingCoilRate(0.0), TotWaterHeatingCoilRate(0.0), + DesWaterCoolingCoilRate(0.0), TotWaterCoolingCoilRate(0.0), SenWaterCoolingCoilRate(0.0), UACoil(0.0), LeavingRelHum(0.0), + DesiredOutletTemp(0.0), DesiredOutletHumRat(0.0), InletWaterTemp(0.0), OutletWaterTemp(0.0), InletWaterMassFlowRate(0.0), + OutletWaterMassFlowRate(0.0), MaxWaterVolFlowRate(0.0), MaxWaterMassFlowRate(0.0), InletWaterEnthalpy(0.0), OutletWaterEnthalpy(0.0), + TubeOutsideSurfArea(0.0), TotTubeInsideArea(0.0), FinSurfArea(0.0), MinAirFlowArea(0.0), CoilDepth(0.0), FinDiam(0.0), + FinThickness(0.0), TubeInsideDiam(0.0), TubeOutsideDiam(0.0), TubeThermConductivity(0.0), FinThermConductivity(0.0), FinSpacing(0.0), + TubeDepthSpacing(0.0), NumOfTubeRows(0), NumOfTubesPerRow(0), EffectiveFinDiam(0.0), TotCoilOutsideSurfArea(0.0), + CoilEffectiveInsideDiam(0.0), GeometryCoef1(0.0), GeometryCoef2(0.0), DryFinEfficncyCoef(5, 0.0), SatEnthlCurveConstCoef(0.0), + SatEnthlCurveSlope(0.0), EnthVsTempCurveAppxSlope(0.0), EnthVsTempCurveConst(0.0), MeanWaterTempSaved(0.0), InWaterTempSaved(0.0), + OutWaterTempSaved(0.0), SurfAreaWetSaved(0.0), SurfAreaWetFraction(0.0), DesInletWaterTemp(0.0), DesAirVolFlowRate(0.0), + DesInletAirTemp(0.0), DesInletAirHumRat(0.0), DesTotWaterCoilLoad(0.0), DesSenWaterCoilLoad(0.0), DesAirMassFlowRate(0.0), + UACoilTotal(0.0), UACoilInternal(0.0), UACoilExternal(0.0), UACoilInternalDes(0.0), UACoilExternalDes(0.0), DesOutletAirTemp(0.0), + DesOutletAirHumRat(0.0), DesOutletWaterTemp(0.0), HeatExchType(0), CoolingCoilAnalysisMode(0), UACoilInternalPerUnitArea(0.0), + UAWetExtPerUnitArea(0.0), UADryExtPerUnitArea(0.0), SurfAreaWetFractionSaved(0.0), UACoilVariable(0.0), + RatioAirSideToWaterSideConvect(1.0), AirSideNominalConvect(0.0), LiquidSideNominalConvect(0.0), Control(0), AirInletNodeNum(0), + AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), WaterLoopNum(0), WaterLoopSide(0), WaterLoopBranchNum(0), + WaterLoopCompNum(0), CondensateCollectMode(1001), CondensateTankID(0), CondensateTankSupplyARRID(0), CondensateVdot(0.0), + CondensateVol(0.0), CoilPerfInpMeth(0), FaultyCoilFoulingFlag(false), FaultyCoilFoulingIndex(0), FaultyCoilFoulingFactor(0.0), + DesiccantRegenerationCoil(false), DesiccantDehumNum(0), DesignWaterDeltaTemp(0.0), UseDesignWaterDeltaTemp(false), ControllerName(""), + ControllerIndex(0), reportCoilFinalSizes(true), AirLoopDOASFlag(false), heatRecoveryCoil(false) { } }; @@ -433,37 +433,37 @@ namespace WaterCoils { int &CompIndex); Real64 GetCoilMaxWaterFlowRate(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilWaterInletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); int GetCoilWaterOutletNode(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); void SetCoilDesFlow(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type Real64 const CoilDesFlow, // coil volumetric air flow rate [m3/s] bool &ErrorsFound // set to true if problem @@ -476,9 +476,9 @@ namespace WaterCoils { ); void CheckActuatorNode(EnergyPlusData &state, - int const ActuatorNodeNum, // input actuator node number - int &iNodeType, // Cooling or Heating or 0 - bool &NodeNotFound // true if matching water inlet node not found + int const ActuatorNodeNum, // input actuator node number + DataPlant::PlantEquipmentType &WaterCoilType, // Cooling or Heating or 0 + bool &NodeNotFound // true if matching water inlet node not found ); void CheckForSensorAndSetPointNode(EnergyPlusData &state, @@ -501,7 +501,7 @@ namespace WaterCoils { Real64 EstimateHEXSurfaceArea(EnergyPlusData &state, int const CoilNum); // coil number, [-] int GetWaterCoilIndex(EnergyPlusData &state, - std::string const &CoilType, // must match coil types in this module + std::string_view CoilType, // must match coil types in this module std::string const &CoilName, // must match coil names for the coil type bool &ErrorsFound // set to true if problem ); @@ -513,7 +513,7 @@ namespace WaterCoils { ); void UpdateWaterToAirCoilPlantConnection(EnergyPlusData &state, - int const CoilTypeNum, + DataPlant::PlantEquipmentType const CoilType, std::string const &CoilName, int const EquipFlowCtrl, // Flow control mode for the equipment int const LoopNum, // Plant loop index for where called from diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index f41ad095817..152023741b0 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -296,14 +296,16 @@ void WaterThermalTankData::simulate( if (this->UseSide.loopNum > 0 && this->UseSide.loopSideNum > 0 && !state.dataGlobal->KickOffSimulation) { this->UseCurrentFlowLock = state.dataPlnt->PlantLoop(this->UseSide.loopNum).LoopSide(this->UseSide.loopSideNum).FlowLock; } else { - this->UseCurrentFlowLock = DataPlant::iFlowLock::Locked; + this->UseCurrentFlowLock = DataPlant::FlowLock::Locked; } this->initialize(state, FirstHVACIteration); // Plant connected water heaters may have a desuperheater heating coil attached if (this->DesuperheaterNum == 0) { - if ((this->TypeNum == DataPlant::TypeOf_WtrHeaterMixed) || (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankMixed)) { + if ((this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) || + (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankMixed)) { this->CalcWaterThermalTankMixed(state); - } else if ((this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) || (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified)) { + } else if ((this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) || + (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankStratified)) { this->CalcWaterThermalTankStratified(state); } } else if (this->DesuperheaterNum > 0) { @@ -386,7 +388,7 @@ void HeatPumpWaterHeaterData::simulate( if (Tank.UseSide.loopNum > 0 && Tank.UseSide.loopSideNum > 0 && !state.dataGlobal->KickOffSimulation) { Tank.UseCurrentFlowLock = state.dataPlnt->PlantLoop(Tank.UseSide.loopNum).LoopSide(Tank.UseSide.loopSideNum).FlowLock; } else { - Tank.UseCurrentFlowLock = DataPlant::iFlowLock::Locked; + Tank.UseCurrentFlowLock = DataPlant::FlowLock::Locked; } Tank.initialize(state, FirstHVACIteration); @@ -400,7 +402,7 @@ void HeatPumpWaterHeaterData::simulate( if (this->bIsIHP) // pass the tank indexes to the IHP object { - state.dataIntegratedHP->IntegratedHeatPumps(this->DXCoilNum).WHtankType = this->TypeNum; + state.dataIntegratedHP->IntegratedHeatPumps(this->DXCoilNum).WHtankType = this->HPWHType; state.dataIntegratedHP->IntegratedHeatPumps(this->DXCoilNum).WHtankName = this->Name; state.dataIntegratedHP->IntegratedHeatPumps(this->DXCoilNum).WHtankID = this->WaterHeaterTankNum; IntegratedHeatPump::IHPOperationMode IHPMode = IntegratedHeatPump::GetCurWorkMode(state, this->DXCoilNum); @@ -638,16 +640,16 @@ void CalcWaterThermalTankZoneGains(EnergyPlusData &state) TankTemp = 20.0; } { - auto const SELECT_CASE_var(Tank.TypeNum); - if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterMixed) { + auto const SELECT_CASE_var(Tank.WaterThermalTankType); + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterMixed) { QLossToZone = max(Tank.OnCycLossCoeff * Tank.OnCycLossFracToZone, Tank.OffCycLossCoeff * Tank.OffCycLossFracToZone) * (TankTemp - state.dataHeatBalFanSys->MAT(Tank.AmbientTempZone)); - } else if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterStratified) { QLossToZone = max(Tank.Node(1).OnCycLossCoeff * Tank.SkinLossFracToZone, Tank.Node(1).OffCycLossCoeff * Tank.SkinLossFracToZone) * (TankTemp - state.dataHeatBalFanSys->MAT(Tank.AmbientTempZone)); - } else if (SELECT_CASE_var == DataPlant::TypeOf_ChilledWaterTankMixed) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::ChilledWaterTankMixed) { QLossToZone = Tank.OffCycLossCoeff * Tank.OffCycLossFracToZone * (TankTemp - state.dataHeatBalFanSys->MAT(Tank.AmbientTempZone)); - } else if (SELECT_CASE_var == DataPlant::TypeOf_ChilledWaterTankStratified) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::ChilledWaterTankStratified) { QLossToZone = Tank.Node(1).OffCycLossCoeff * Tank.SkinLossFracToZone * (TankTemp - state.dataHeatBalFanSys->MAT(Tank.AmbientTempZone)); } @@ -1162,7 +1164,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) if (HPWaterHeaterNum <= NumPumpedCondenser) { // Pumped Condenser state.dataIPShortCut->cCurrentModuleObject = cHPWHPumpedCondenser; - HPWH.TypeNum = DataPlant::TypeOf_HeatPumpWtrHeaterPumped; + HPWH.HPWHType = DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped; nNumPossibleAlphaArgs = 29; nNumPossibleNumericArgs = 9; // Actual index of Pumped type @@ -1170,7 +1172,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } else { // Wrapped Condenser state.dataIPShortCut->cCurrentModuleObject = cHPWHWrappedCondenser; - HPWH.TypeNum = DataPlant::TypeOf_HeatPumpWtrHeaterWrapped; + HPWH.HPWHType = DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped; nNumPossibleAlphaArgs = 27; nNumPossibleNumericArgs = 10; // Actual index of Wrapped type @@ -1260,7 +1262,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) ErrorsFound = true; } - if (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { // Condenser Inlet/Outlet Nodes HPWH.CondWaterInletNode = NodeInputManager::GetOnlySingleNode(state, @@ -1293,7 +1295,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) ErrorsFound = true; } - } else if (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) { + } else if (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) { // Wrapped Condenser Location HPWH.WrappedCondenserBottomLocation = hpwhNumeric[2 + nNumericOffset]; @@ -1510,7 +1512,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) // Make sure that the coil and tank are compatible. if (bIsVScoil) { - if (HPWH.TypeNum != DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (HPWH.HPWHType != DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { ShowSevereError(state, state.dataIPShortCut->cCurrentModuleObject + "=\"" + HPWH.Name + "\":"); ShowContinueError(state, "Coil:WaterHeating:AirToWaterHeatPump:VariableSpeed can only be used with a pumped condenser heat pump " @@ -1519,14 +1521,14 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) } } else { if (!((HPWH.DXCoilTypeNum == DataHVACGlobals::CoilDX_HeatPumpWaterHeaterPumped && - HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) || + HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) || (HPWH.DXCoilTypeNum == DataHVACGlobals::CoilDX_HeatPumpWaterHeaterWrapped && - HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped))) { + HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped))) { ShowSevereError(state, state.dataIPShortCut->cCurrentModuleObject + "=\"" + HPWH.Name + "\":"); std::string ExpectedCoilType; - if (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { ExpectedCoilType = DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilDX_HeatPumpWaterHeaterPumped); - } else if (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) { + } else if (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) { ExpectedCoilType = DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::CoilDX_HeatPumpWaterHeaterWrapped); } else { assert(0); @@ -2337,7 +2339,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.Name = state.dataIPShortCut->cAlphaArgs(1); Tank.Type = state.dataIPShortCut->cCurrentModuleObject; - Tank.TypeNum = DataPlant::TypeOf_WtrHeaterMixed; + Tank.WaterThermalTankType = DataPlant::PlantEquipmentType::WtrHeaterMixed; Tank.FluidIndex = Tank.waterIndex; // default to always on @@ -2797,7 +2799,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.Name = state.dataIPShortCut->cAlphaArgs(1); Tank.Type = state.dataIPShortCut->cCurrentModuleObject; - Tank.TypeNum = DataPlant::TypeOf_WtrHeaterStratified; + Tank.WaterThermalTankType = DataPlant::PlantEquipmentType::WtrHeaterStratified; Tank.FluidIndex = Tank.waterIndex; // default to always on @@ -3408,7 +3410,7 @@ bool getWaterTankMixedInput(EnergyPlusData &state) Tank.Name = state.dataIPShortCut->cAlphaArgs(1); Tank.Type = state.dataIPShortCut->cCurrentModuleObject; - Tank.TypeNum = DataPlant::TypeOf_ChilledWaterTankMixed; + Tank.WaterThermalTankType = DataPlant::PlantEquipmentType::ChilledWaterTankMixed; Tank.FluidIndex = Tank.waterIndex; Tank.IsChilledWaterTank = true; Tank.EndUseSubcategoryName = "Chilled Water Storage"; @@ -3699,7 +3701,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) Tank.Name = state.dataIPShortCut->cAlphaArgs(1); Tank.Type = state.dataIPShortCut->cCurrentModuleObject; - Tank.TypeNum = DataPlant::TypeOf_ChilledWaterTankStratified; + Tank.WaterThermalTankType = DataPlant::PlantEquipmentType::ChilledWaterTankStratified; Tank.FluidIndex = Tank.waterIndex; Tank.IsChilledWaterTank = true; Tank.EndUseSubcategoryName = "Chilled Water Storage"; @@ -4165,7 +4167,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) continue; Tank.DesuperheaterNum = DesuperheaterNum; DesuperHtr.WaterHeaterTankNum = WtrHtrNum; - DesuperHtr.TankTypeNum = Tank.TypeNum; + DesuperHtr.TankTypeNum = Tank.WaterThermalTankType; DesuperHtr.BackupElementCapacity = Tank.MaxCapacity; if (Tank.UseInletNode == 0 && Tank.UseOutletNode == 0) DesuperHtr.StandAlone = true; @@ -4236,10 +4238,11 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) HPWH.WHOffCycParaFracToTank = Tank.OffCycParaFracToTank; HPWH.WHPLFCurve = Tank.PLFCurve; - if (((Tank.TypeNum == DataPlant::TypeOf_WtrHeaterMixed) && (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterPumped)) || - (Tank.TypeNum == DataPlant::TypeOf_WtrHeaterStratified)) { + if (((Tank.WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) && + (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped)) || + (Tank.WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified)) { HPWH.TankType = Tank.Type; - HPWH.TankTypeNum = Tank.TypeNum; + HPWH.HPWHTankType = Tank.WaterThermalTankType; } else { ShowSevereError(state, state.dataIPShortCut->cCurrentModuleObject + " = " + HPWH.Name + ':'); ShowContinueError(state, "Invalid water heater tank type = " + Tank.Type); @@ -4264,7 +4267,8 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) state, HPWH.Type, HPWH.Name, HPWH.TankType, HPWH.TankName, HPWH.OutletNodeName1, HPWH.InletNodeName1, "HPWH To Tank"); // If WaterHeaterMixed: do not allow modulating control for HPWH's (i.e. modulating control usually used for tankless WH's) - if ((Tank.TypeNum == DataPlant::TypeOf_WtrHeaterMixed) && (Tank.ControlType == ControlTypeEnum::Modulate)) { + if ((Tank.WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) && + (Tank.ControlType == ControlTypeEnum::Modulate)) { ShowSevereError(state, state.dataIPShortCut->cCurrentModuleObject + " = " + HPWH.Name + ':'); ShowContinueError(state, "Heater Control Type for " + Tank.Type + " = " + Tank.Name + " must be CYCLE."); ErrorsFound = true; @@ -4293,7 +4297,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) } // Set up the source side nodes for wrapped condensers - if (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) { + if (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) { if (Tank.SourceInletNode > 0 || Tank.SourceOutletNode > 0) { ShowSevereError(state, Tank.Type + " = " + Tank.Name + " has a source inlet or outlet node specified,"); ShowContinueError( @@ -4375,7 +4379,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) } // verify wrapped condenser location - if (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) { + if (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) { // make sure the top of the condenser is not above the tank height. if (HPWH.WrappedCondenserTopLocation > Tank.Height) { ShowSevereError(state, state.dataIPShortCut->cCurrentModuleObject + " = " + HPWH.Name + ':'); @@ -4459,10 +4463,10 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) } // ALLOCATED } // InletAirConfiguration - if (Tank.TypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + if (Tank.WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { // Nodal heat distribution fraction for stratified tank wrapped condensers - if (HPWH.TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) { + if (HPWH.HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) { if (Tank.Shape == TankShapeEnum::HorizCylinder) { ShowWarningError(state, state.dataIPShortCut->cCurrentModuleObject + " = " + HPWH.Name + ":"); ShowContinueError(state, "A wrapped condenser HPWH model should not be used with a horizontal stratified tank."); @@ -4864,7 +4868,8 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) void WaterThermalTankData::setupOutputVars(EnergyPlusData &state) { - if ((this->TypeNum == DataPlant::TypeOf_ChilledWaterTankMixed) || (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified)) { + if ((this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankMixed) || + (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankStratified)) { this->setupChilledWaterTankOutputVars(state); } else { // moving setupWaterHeaterOutputVars to here causes big table diffs... @@ -4987,7 +4992,7 @@ void WaterThermalTankData::setupChilledWaterTankOutputVars(EnergyPlusData &state OutputProcessor::SOVStoreType::Summed, this->Name); - if (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankStratified) { for (int NodeNum = 1; NodeNum <= this->Nodes; ++NodeNum) { SetupOutputVariable(state, @@ -5010,7 +5015,7 @@ void WaterThermalTankData::setupChilledWaterTankOutputVars(EnergyPlusData &state } } - if (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankStratified) { for (int NodeNum = 1; NodeNum <= this->Nodes; ++NodeNum) { static constexpr std::string_view Format_724("Chilled Water Tank Stratified Node Information,{},{:.4T},{:.4T},{:.4T},{},{}\n"); @@ -5031,38 +5036,45 @@ void WaterThermalTankData::setupZoneInternalGains(EnergyPlusData &state) { // set up internal gains if tank is in a thermal zone if (this->AmbientTempZone > 0) { - { - auto const SELECT_CASE_var(this->TypeNum); - - if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterMixed) { - SetupZoneInternalGain(state, - this->AmbientTempZone, - "WaterHeater:Mixed", - this->Name, - DataHeatBalance::IntGainType::WaterHeaterMixed, - &this->AmbientZoneGain); - } else if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterStratified) { - SetupZoneInternalGain(state, - this->AmbientTempZone, - "WaterHeater:Stratified", - this->Name, - DataHeatBalance::IntGainType::WaterHeaterStratified, - &this->AmbientZoneGain); - } else if (SELECT_CASE_var == DataPlant::TypeOf_ChilledWaterTankMixed) { - SetupZoneInternalGain(state, - this->AmbientTempZone, - "ThermalStorage:ChilledWater:Mixed", - this->Name, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - &this->AmbientZoneGain); - } else if (SELECT_CASE_var == DataPlant::TypeOf_ChilledWaterTankStratified) { - SetupZoneInternalGain(state, - this->AmbientTempZone, - "ThermalStorage:ChilledWater:Stratified", - this->Name, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - &this->AmbientZoneGain); - } + switch (this->WaterThermalTankType) { + case (DataPlant::PlantEquipmentType::WtrHeaterMixed): { + SetupZoneInternalGain(state, + this->AmbientTempZone, + "WaterHeater:Mixed", + this->Name, + DataHeatBalance::IntGainType::WaterHeaterMixed, + &this->AmbientZoneGain); + break; + } + case (DataPlant::PlantEquipmentType::WtrHeaterStratified): { + SetupZoneInternalGain(state, + this->AmbientTempZone, + "WaterHeater:Stratified", + this->Name, + DataHeatBalance::IntGainType::WaterHeaterStratified, + &this->AmbientZoneGain); + break; + } + case (DataPlant::PlantEquipmentType::ChilledWaterTankMixed): { + SetupZoneInternalGain(state, + this->AmbientTempZone, + "ThermalStorage:ChilledWater:Mixed", + this->Name, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + &this->AmbientZoneGain); + break; + } + case (DataPlant::PlantEquipmentType::ChilledWaterTankStratified): { + SetupZoneInternalGain(state, + this->AmbientTempZone, + "ThermalStorage:ChilledWater:Stratified", + this->Name, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + &this->AmbientZoneGain); + break; + } + default: + break; } } } @@ -5565,7 +5577,7 @@ void WaterThermalTankData::setupWaterHeaterOutputVars(EnergyPlusData &state) // Setup report variables for WaterHeater:Stratified // CurrentModuleObject='WaterHeater:Stratified' - if (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { SetupOutputVariable(state, "Water Heater Heater 1 Heating Rate", @@ -5648,7 +5660,7 @@ void WaterThermalTankData::setupWaterHeaterOutputVars(EnergyPlusData &state) } } - if (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { for (int NodeNum = 1; NodeNum <= this->Nodes; ++NodeNum) { static constexpr std::string_view Format_723("Water Heater Stratified Node Information,{},{:.4T},{:.4T},{:.3T},{:.4T},{:.4T},{},{}\n"); @@ -5938,7 +5950,7 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->TypeNum, + this->WaterThermalTankType, this->UseSide.loopNum, this->UseSide.loopSideNum, this->UseSide.branchNum, @@ -5959,7 +5971,7 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).Name, - state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).TypeNum, + state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).HPWHType, this->UseSide.loopNum, this->UseSide.loopSideNum, this->UseSide.branchNum, @@ -5978,7 +5990,7 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - this->TypeNum, + this->WaterThermalTankType, this->SrcSide.loopNum, this->SrcSide.loopSideNum, this->SrcSide.branchNum, @@ -5990,8 +6002,13 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA this->SourceInletNode, _); if (this->UseInletNode > 0) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->UseSide.loopNum, this->UseSide.loopSideNum, this->SrcSide.loopNum, this->SrcSide.loopSideNum, this->TypeNum, true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->UseSide.loopNum, + this->UseSide.loopSideNum, + this->SrcSide.loopNum, + this->SrcSide.loopSideNum, + this->WaterThermalTankType, + true); } if (errFlag) { ShowFatalError(state, "InitWaterThermalTank: Program terminated due to previous condition(s)."); @@ -6070,7 +6087,8 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA // if stratified tank model, ensure that nominal change over rate is greater than one minute, avoid numerical problems. - if ((this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) || (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified)) { + if ((this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) || + (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankStratified)) { Real64 MaxSideVolFlow = max(this->UseDesignVolFlowRate, this->SourceDesignVolFlowRate); if (MaxSideVolFlow > 0.0) { // protect div by zero @@ -6420,7 +6438,7 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA } Real64 sensedTemp; - if (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankStratified) { int tmpNodeNum = this->HeaterNode1; sensedTemp = this->Node(tmpNodeNum).SavedTemp; } else { @@ -6592,7 +6610,7 @@ void WaterThermalTankData::initialize(EnergyPlusData &state, bool const FirstHVA if (OutletAirSplitterNode > 0) state.dataLoopNodes->Node(OutletAirSplitterNode).MassFlowRate = 0.0; // these are water nodes are not managed by plant. the HP connects // directly to the WH without using plant. - if (state.dataWaterThermalTanks->HPWaterHeater(HPNum).TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { state.dataLoopNodes->Node(HPWaterInletNode).MassFlowRate = 0.0; state.dataLoopNodes->Node(HPWaterOutletNode).MassFlowRate = 0.0; } @@ -7683,7 +7701,8 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) this->HeaterOn2 = this->SavedHeaterOn2; // Condenser configuration of heat pump water heater - const int HPWHCondenserConfig = this->HeatPumpNum > 0 ? state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).TypeNum : 0; + const DataPlant::PlantEquipmentType HPWHCondenserConfig = + this->HeatPumpNum > 0 ? state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).HPWHType : DataPlant::PlantEquipmentType::Invalid; // Heat rate from the heat pump (W) const Real64 Qheatpump = [&, this] { // BLB @@ -7965,7 +7984,7 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) B[i] += use_e_mdot_cp * this->UseInletTemp; // Source side heat transfer rate - if ((this->HeatPumpNum > 0) && (HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterPumped)) { + if ((this->HeatPumpNum > 0) && (HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped)) { // Pumped Condenser Heat Pump Water Heater if (tank_node.SourceMassFlowRate > 0.0) B[i] += Qheatpump; } else { @@ -7976,7 +7995,7 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) } // Wrapped condenser heat pump water heater - if ((this->HeatPumpNum > 0) && (HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped)) { + if ((this->HeatPumpNum > 0) && (HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped)) { B[i] += Qheatpump * tank_node.HPWHWrappedCondenserHeatingFrac; } @@ -8096,14 +8115,14 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) const Real64 Quse_node = node.UseMassFlowRate * Cp * (this->UseInletTemp - Tavg[i]); const Real64 Qsource_node = [&] { if (this->HeatPumpNum > 0) { - if (HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { if (node.SourceMassFlowRate > 0.0) { return Qheatpump; } else { return 0.0; } } else { - assert(HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped); + assert(HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped); return Qheatpump * node.HPWHWrappedCondenserHeatingFrac; } } else { @@ -8132,10 +8151,10 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) Euse += Quse * dt; const Real64 Qsource = [&] { if (this->HeatPumpNum > 0) { - if (HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { return Qheatpump; } else { - assert(HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped); + assert(HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped); return 0.0; } } else { @@ -8206,7 +8225,7 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) } } - if (HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) { + if (HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) { // If we have a wrapped condenser HPWH, set the source outlet to the weighted average of the node // temperatures the condenser sees Real64 WeightedAverageSourceOutletTemp(0.0); @@ -8220,7 +8239,7 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) // Output the average inlet temperature for the DataGlobals::TimeStep this->SourceInletTemp = SourceInletTempSum / SecInTimeStep; } - if (HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { // For pumped condensers, set the source inlet and outlets to match the delta T // across the water side of the DX coil. HeatPumpWaterHeaterData const &HeatPump = state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum); @@ -8240,7 +8259,7 @@ void WaterThermalTankData::CalcWaterThermalTankStratified(EnergyPlusData &state) this->LossRate = Eloss / SecInTimeStep; this->UseRate = Euse / SecInTimeStep; Real64 WrappedCondenserHeatPumpRate = 0.0; - if ((this->HeatPumpNum > 0) && (HPWHCondenserConfig == DataPlant::TypeOf_HeatPumpWtrHeaterPumped)) { + if ((this->HeatPumpNum > 0) && (HPWHCondenserConfig == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped)) { this->SourceRate = Qheatpump; } else { this->SourceRate = Esource / SecInTimeStep; @@ -8596,7 +8615,7 @@ void WaterThermalTankData::CalcDesuperheaterWaterHeater(EnergyPlusData &state, b } Real64 Acc; // Accuracy of result from RegulaFalsi - if (DesupHtr.TankTypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + if (DesupHtr.TankTypeNum == DataPlant::PlantEquipmentType::WtrHeaterStratified) { Acc = 0.001; } else { Acc = 0.00001; @@ -8615,7 +8634,7 @@ void WaterThermalTankData::CalcDesuperheaterWaterHeater(EnergyPlusData &state, b { auto const TankType(DesupHtr.TankTypeNum); - if (TankType == DataPlant::TypeOf_WtrHeaterMixed || TankType == DataPlant::TypeOf_WtrHeaterStratified) { + if (TankType == DataPlant::PlantEquipmentType::WtrHeaterMixed || TankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { DesupHtr.SaveWHMode = this->Mode; Real64 PreTankAvgTemp = this->TankTempAvg; @@ -8991,10 +9010,10 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c if (AvailSchedule == 0.0 || (HPSetPointTemp - DeadBandTempDiff) <= this->SetPointTemp || state.dataHVACGlobal->HPWHInletDBTemp < HeatPump.MinAirTempForHPOperation || state.dataHVACGlobal->HPWHInletDBTemp > HeatPump.MaxAirTempForHPOperation || HPSetPointTemp >= this->TankTempLimit || - (!HeatPump.AllowHeatingElementAndHeatPumpToRunAtSameTime && this->TypeNum == DataPlant::TypeOf_WtrHeaterMixed && + (!HeatPump.AllowHeatingElementAndHeatPumpToRunAtSameTime && this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed && this->SavedMode == state.dataWaterThermalTanks->heatMode) || - (!HeatPump.AllowHeatingElementAndHeatPumpToRunAtSameTime && this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified && - (this->SavedHeaterOn1 || this->SavedHeaterOn2))) { + (!HeatPump.AllowHeatingElementAndHeatPumpToRunAtSameTime && + this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified && (this->SavedHeaterOn1 || this->SavedHeaterOn2))) { // revert to float mode any time HPWH compressor is OFF HeatPump.Mode = state.dataWaterThermalTanks->floatMode; if (InletAirMixerNode > 0) { @@ -9226,11 +9245,11 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c // check to see if HP needs to operate // set the condenser inlet node temperature and full mass flow rate prior to calling the HPWH DX coil { - auto const SELECT_CASE_var1(HeatPump.TankTypeNum); - if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterMixed) { + auto const SELECT_CASE_var1(HeatPump.HPWHTankType); + if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterMixed) { state.dataLoopNodes->Node(HPWaterInletNode).Temp = savedTankTemp; state.dataLoopNodes->Node(HPWaterOutletNode).Temp = savedTankTemp; - } else if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterStratified) { state.dataLoopNodes->Node(HPWaterInletNode).Temp = this->SourceOutletTemp; state.dataLoopNodes->Node(HPWaterOutletNode).Temp = this->SourceInletTemp; } @@ -9270,16 +9289,13 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c state.dataWaterThermalTanks->hpPartLoadRatio = 1.0; } } else { // or use side nodes may meet set point without need for heat pump compressor operation - // check to see if HP needs to operate - { - auto const SELECT_CASE_var1(HeatPump.TankTypeNum); - if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterMixed) { - state.dataLoopNodes->Node(HPWaterInletNode).Temp = savedTankTemp; - state.dataLoopNodes->Node(HPWaterOutletNode).Temp = savedTankTemp; - } else if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterStratified) { - state.dataLoopNodes->Node(HPWaterInletNode).Temp = this->SourceOutletTemp; - state.dataLoopNodes->Node(HPWaterOutletNode).Temp = this->SourceInletTemp; - } + // check to see if HP needs to operate + if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) { + state.dataLoopNodes->Node(HPWaterInletNode).Temp = savedTankTemp; + state.dataLoopNodes->Node(HPWaterOutletNode).Temp = savedTankTemp; + } else if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { + state.dataLoopNodes->Node(HPWaterInletNode).Temp = this->SourceOutletTemp; + state.dataLoopNodes->Node(HPWaterOutletNode).Temp = this->SourceInletTemp; } // Check tank temperature by setting source inlet mass flow rate to zero. state.dataLoopNodes->Node(HPWaterInletNode).MassFlowRate = 0.0; @@ -9325,11 +9341,11 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c // set the condenser inlet node temperature and full mass flow rate prior to calling the HPWH DX coil { - auto const SELECT_CASE_var1(HeatPump.TankTypeNum); - if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterMixed) { + auto const SELECT_CASE_var1(HeatPump.HPWHTankType); + if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterMixed) { state.dataLoopNodes->Node(HPWaterInletNode).Temp = savedTankTemp; state.dataLoopNodes->Node(HPWaterOutletNode).Temp = savedTankTemp; - } else if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterStratified) { state.dataLoopNodes->Node(HPWaterInletNode).Temp = this->SourceOutletTemp; state.dataLoopNodes->Node(HPWaterOutletNode).Temp = this->SourceInletTemp; } @@ -9679,15 +9695,12 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c this->SourceInletTemp = state.dataLoopNodes->Node(HPWaterInletNode).Temp + CondenserDeltaT; // this CALL does not update node temps, must use WaterThermalTank variables // select tank type - { - auto const SELECT_CASE_var1(HeatPump.TankTypeNum); - if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterMixed) { - this->CalcWaterThermalTankMixed(state); - NewTankTemp = this->TankTemp; - } else if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterStratified) { - this->CalcWaterThermalTankStratified(state); - NewTankTemp = this->FindStratifiedTankSensedTemp(state); - } + if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) { + this->CalcWaterThermalTankMixed(state); + NewTankTemp = this->TankTemp; + } else if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { + this->CalcWaterThermalTankStratified(state); + NewTankTemp = this->FindStratifiedTankSensedTemp(state); } if (NewTankTemp > HPSetPointTemp) { @@ -9819,11 +9832,11 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c // this CALL does not update node temps, must use WaterThermalTank variables // select tank type { - auto const SELECT_CASE_var1(HeatPump.TankTypeNum); - if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterMixed) { + auto const SELECT_CASE_var1(HeatPump.HPWHTankType); + if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterMixed) { this->CalcWaterThermalTankMixed(state); NewTankTemp = this->TankTemp; - } else if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterStratified) { this->CalcWaterThermalTankStratified(state); NewTankTemp = this->FindStratifiedTankSensedTemp(state); } @@ -10124,9 +10137,9 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c } // Call the tank one more time with the final PLR - if (HeatPump.TankTypeNum == DataPlant::TypeOf_WtrHeaterMixed) { + if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) { this->CalcWaterThermalTankMixed(state); - } else if (HeatPump.TankTypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { this->CalcWaterThermalTankStratified(state); } else { assert(0); @@ -10152,10 +10165,10 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c HeatPump.OnCycParaFuelEnergy = HeatPump.OnCycParaFuelRate * state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; HeatPump.OffCycParaFuelRate = HeatPump.OffCycParaLoad * (1.0 - state.dataWaterThermalTanks->hpPartLoadRatio); HeatPump.OffCycParaFuelEnergy = HeatPump.OffCycParaFuelRate * state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; - if (HeatPump.TankTypeNum == DataPlant::TypeOf_WtrHeaterMixed) { + if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) { HeatPump.ControlTempAvg = this->TankTempAvg; HeatPump.ControlTempFinal = this->TankTemp; - } else if (HeatPump.TankTypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (HeatPump.HPWHTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { HeatPump.ControlTempAvg = this->FindStratifiedTankSensedTemp(state, true); HeatPump.ControlTempFinal = this->FindStratifiedTankSensedTemp(state); } else { @@ -10199,9 +10212,9 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c void WaterThermalTankData::CalcWaterThermalTank(EnergyPlusData &state) { - if (this->TypeNum == DataPlant::TypeOf_WtrHeaterMixed) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) { this->CalcWaterThermalTankMixed(state); - } else if (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { this->CalcWaterThermalTankStratified(state); } else { assert(false); @@ -10210,10 +10223,10 @@ void WaterThermalTankData::CalcWaterThermalTank(EnergyPlusData &state) Real64 WaterThermalTankData::GetHPWHSensedTankTemp(EnergyPlusData &state) { - if (this->TypeNum == DataPlant::TypeOf_WtrHeaterMixed) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) { return this->TankTemp; } else { - assert(this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified); + assert(this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified); return this->FindStratifiedTankSensedTemp(state); } } @@ -10398,11 +10411,11 @@ Real64 WaterThermalTankData::PLRResidualIterSpeed(EnergyPlusData &state, // select tank type Real64 NewTankTemp = 0.0; { - auto const SELECT_CASE_var1(state.dataWaterThermalTanks->HPWaterHeater(HPNum).TankTypeNum); - if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterMixed) { + auto const SELECT_CASE_var1(state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHTankType); + if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterMixed) { this->CalcWaterThermalTankMixed(state); NewTankTemp = this->TankTemp; - } else if (SELECT_CASE_var1 == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var1 == DataPlant::PlantEquipmentType::WtrHeaterStratified) { this->CalcWaterThermalTankStratified(state); NewTankTemp = this->FindStratifiedTankSensedTemp(state); } @@ -10474,12 +10487,12 @@ Real64 WaterThermalTankData::PLRResidualHPWH(EnergyPlusData &state, Real64 const bool const isVariableSpeed = (HeatPump.NumofSpeed > 0); this->Mode = int(Par(2)); // Apply the PLR - if (this->TypeNum == DataPlant::TypeOf_WtrHeaterMixed) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed) { // For a mixed tank, the PLR is applied to the source mass flow rate. this->SourceMassFlowRate = Par(5) * HPPartLoadRatio; this->CalcWaterThermalTankMixed(state); } else { - assert(this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified); + assert(this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified); // For a stratified tank, the PLR is applied to the Coil.TotalHeatingEnergyRate // whether that's a VarSpeedCoil or DXCoils::DXCoil. // Here we create a pointer to the TotalHeatingEnergyRate for the appropriate coil type. @@ -10563,13 +10576,13 @@ bool WaterThermalTankData::SourceHeatNeed(EnergyPlusData &state, Real64 const Ou NeedsHeatOrCool = true; } else if ((OutletTemp <= DeadBandTemp) && (OutletTemp > SetPointTemp_loc)) { // inside the deadband, use saved mode from water thermal tank calcs (modes only for mixed) - if (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankMixed) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankMixed) { if (this->SavedMode == state.dataWaterThermalTanks->coolMode) { NeedsHeatOrCool = true; } else if (this->SavedMode == state.dataWaterThermalTanks->floatMode) { NeedsHeatOrCool = false; } - } else if (this->TypeNum == DataPlant::TypeOf_ChilledWaterTankStratified) { + } else if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::ChilledWaterTankStratified) { NeedsHeatOrCool = true; } @@ -10618,7 +10631,7 @@ Real64 WaterThermalTankData::PlantMassFlowRatesFunc(EnergyPlusData &state, } else if (PlantLoopSide == DataPlant::SupplySide) { // If FlowLock is False (0), the tank sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used - if (this->UseCurrentFlowLock == DataPlant::iFlowLock::Unlocked) { + if (this->UseCurrentFlowLock == DataPlant::FlowLock::Unlocked) { CurrentMode = PassingFlowThru; if ((this->UseSideLoadRequested > 0.0) && (WaterThermalTankSide == SideEnum::Use)) { CurrentMode = MaybeRequestingFlow; @@ -11314,7 +11327,7 @@ void WaterThermalTankData::SizeTankForDemandSide(EnergyPlusData &state) if (this->MaxCapacityWasAutoSized) this->setBackupElementCapacity(state); // if stratified, might set height. - if ((this->VolumeWasAutoSized) && (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) && + if ((this->VolumeWasAutoSized) && (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) && state.dataPlnt->PlantFirstSizesOkayToFinalize) { // might set height if ((this->HeightWasAutoSized) && (!this->VolumeWasAutoSized)) { this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobalConstants::Pi, 0.3333333333333333); @@ -11447,7 +11460,7 @@ void WaterThermalTankData::SizeTankForSupplySide(EnergyPlusData &state) if (this->MaxCapacityWasAutoSized) this->setBackupElementCapacity(state); - if ((this->VolumeWasAutoSized) && (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) && + if ((this->VolumeWasAutoSized) && (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) && state.dataPlnt->PlantFirstSizesOkayToFinalize) { // might set height if ((this->HeightWasAutoSized) && (!this->VolumeWasAutoSized)) { this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobalConstants::Pi, 0.3333333333333333); @@ -12108,12 +12121,12 @@ void WaterThermalTankData::CalcStandardRatings(EnergyPlusData &state) if (this->HeatPumpNum == 0) { { - auto const SELECT_CASE_var(this->TypeNum); + auto const SELECT_CASE_var(this->WaterThermalTankType); - if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterMixed) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterMixed) { this->CalcWaterThermalTankMixed(state); - } else if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterStratified) { this->CalcWaterThermalTankStratified(state); } else { @@ -12132,7 +12145,7 @@ void WaterThermalTankData::CalcStandardRatings(EnergyPlusData &state) // ?? why is HPWH condenser inlet node temp reset inside the for loop? shouldn't it chnage with the tank temp throughout these // iterations? - if (state.dataWaterThermalTanks->HPWaterHeater(HPNum).TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterPumped) { + if (state.dataWaterThermalTanks->HPWaterHeater(HPNum).HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped) { // set the condenser inlet node mass flow rate and temperature state.dataLoopNodes->Node(state.dataWaterThermalTanks->HPWaterHeater(HPNum).CondWaterInletNode).MassFlowRate = MdotWater; state.dataLoopNodes->Node(state.dataWaterThermalTanks->HPWaterHeater(HPNum).CondWaterInletNode).Temp = this->TankTemp; @@ -12421,12 +12434,12 @@ void WaterThermalTankData::CalcStandardRatings(EnergyPlusData &state) this->PLFCurve = state.dataWaterThermalTanks->HPWaterHeater(HPNum).DXCoilPLFFPLR; { - auto const SELECT_CASE_var(this->TypeNum); + auto const SELECT_CASE_var(this->WaterThermalTankType); - if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterMixed) { + if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterMixed) { if (this->Efficiency > 0.0) this->CalcWaterThermalTankMixed(state); - } else if (SELECT_CASE_var == DataPlant::TypeOf_WtrHeaterStratified) { + } else if (SELECT_CASE_var == DataPlant::PlantEquipmentType::WtrHeaterStratified) { if (this->Efficiency > 0.0) this->CalcWaterThermalTankStratified(state); } else { @@ -12508,7 +12521,7 @@ void WaterThermalTankData::CalcStandardRatings(EnergyPlusData &state) // Write test results if (this->HeatPumpNum == 0) { Real64 MaxCapacity_loc; - if (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) { + if (this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterStratified) { if (this->ControlType == PriorityEnum::MasterSlave) { MaxCapacity_loc = max(this->MaxCapacity, this->MaxCapacity2); } else { // PrioritySimultaneous @@ -12615,7 +12628,7 @@ void WaterThermalTankData::setBackupElementCapacity(EnergyPlusData &state) // negative electric consumption. Using a test for any negative numbers here instead of just -99999 for safety. // Only reset the backup element capacity if a problem has been occured. if (this->HeatPumpNum > 0) { - if (state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).TypeNum == DataPlant::TypeOf_HeatPumpWtrHeaterWrapped) return; + if (state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).HPWHType == DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped) return; if (state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).BackupElementCapacity < 0.0) { state.dataWaterThermalTanks->HPWaterHeater(this->HeatPumpNum).BackupElementCapacity = this->MaxCapacity; } diff --git a/src/EnergyPlus/WaterThermalTanks.hh b/src/EnergyPlus/WaterThermalTanks.hh index 59a46e21ba0..579db27ad34 100644 --- a/src/EnergyPlus/WaterThermalTanks.hh +++ b/src/EnergyPlus/WaterThermalTanks.hh @@ -229,10 +229,10 @@ namespace WaterThermalTanks { // Members std::string Name; // Name of heat pump water heater std::string Type; // Type of water heater (HEAT PUMP:WATER HEATER) - int TypeNum; // integer parameter for heat pump water heater + DataPlant::PlantEquipmentType HPWHType; // integer parameter for heat pump water heater std::string TankName; // Name of tank associated with heat pump water heater std::string TankType; // Type of water heater (MIXED or STRATIFIED) used with heat pump - int TankTypeNum; // Parameter for tank type (MIXED or STRATIFIED) + DataPlant::PlantEquipmentType HPWHTankType; // Parameter for tank type (MIXED or STRATIFIED) bool StandAlone; // Flag for operation with no plant connections (no use nodes) int AvailSchedPtr; // Index to Availability Schedule curve index int SetPointTempSchedule; // Index to Setpoint Temperature Schedule curve @@ -360,10 +360,11 @@ namespace WaterThermalTanks { // Default Constructor HeatPumpWaterHeaterData() - : TypeNum(0), TankTypeNum(0), StandAlone(false), AvailSchedPtr(0), SetPointTempSchedule(0), DeadBandTempDiff(0.0), Capacity(0.0), - BackupElementCapacity(0.0), BackupElementEfficiency(0.0), WHOnCycParaLoad(0.0), WHOffCycParaLoad(0.0), WHOnCycParaFracToTank(0.0), - WHOffCycParaFracToTank(0.0), WHPLFCurve(0), OperatingAirFlowRate(0.0), OperatingAirMassFlowRate(0.0), OperatingWaterFlowRate(0.0), - COP(0.0), SHR(0.0), RatedInletDBTemp(0.0), RatedInletWBTemp(0.0), RatedInletWaterTemp(0.0), FoundTank(false), HeatPumpAirInletNode(0), + : HPWHType(DataPlant::PlantEquipmentType::Invalid), HPWHTankType(DataPlant::PlantEquipmentType::Invalid), StandAlone(false), + AvailSchedPtr(0), SetPointTempSchedule(0), DeadBandTempDiff(0.0), Capacity(0.0), BackupElementCapacity(0.0), + BackupElementEfficiency(0.0), WHOnCycParaLoad(0.0), WHOffCycParaLoad(0.0), WHOnCycParaFracToTank(0.0), WHOffCycParaFracToTank(0.0), + WHPLFCurve(0), OperatingAirFlowRate(0.0), OperatingAirMassFlowRate(0.0), OperatingWaterFlowRate(0.0), COP(0.0), SHR(0.0), + RatedInletDBTemp(0.0), RatedInletWBTemp(0.0), RatedInletWaterTemp(0.0), FoundTank(false), HeatPumpAirInletNode(0), HeatPumpAirOutletNode(0), OutsideAirNode(0), ExhaustAirNode(0), CondWaterInletNode(0), CondWaterOutletNode(0), WHUseInletNode(0), WHUseOutletNode(0), WHUseSidePlantLoopNum(0), DXCoilNum(0), DXCoilTypeNum(0), DXCoilAirInletNode(0), DXCoilPLFFPLR(0), FanType_Num(0), FanNum(0), FanPlacement(0), FanOutletNode(0), WaterHeaterTankNum(0), OutletAirSplitterSchPtr(0), InletAirMixerSchPtr(0), Mode(0), @@ -405,17 +406,17 @@ namespace WaterThermalTanks { struct WaterThermalTankData : PlantComponent { // Members - std::string Name; // Name of water heater - std::string Type; // Type of water heater (MIXED or STRATIFIED) - int TypeNum; // integer parameter for water heater(if part of an HPWH,then=HPWH) - bool IsChilledWaterTank; // logical flag, true if for chilled water, false if for hot water - std::string EndUseSubcategoryName; // User-defined end-use subcategory name - bool Init; // Flag for initialization: TRUE means do the init - bool StandAlone; // Flag for operation with no plant connections (no source or use) - Real64 Volume; // Tank volume (m3) - bool VolumeWasAutoSized; // true if tank volume was autosize on input - Real64 Mass; // Total mass of fluid in the tank (kg) - Real64 TimeElapsed; // Fraction of the current hour that has elapsed (h) + std::string Name; // Name of water heater + std::string Type; // Type of water heater (MIXED or STRATIFIED) + DataPlant::PlantEquipmentType WaterThermalTankType; // integer parameter for water heater(if part of an HPWH,then=HPWH) + bool IsChilledWaterTank; // logical flag, true if for chilled water, false if for hot water + std::string EndUseSubcategoryName; // User-defined end-use subcategory name + bool Init; // Flag for initialization: TRUE means do the init + bool StandAlone; // Flag for operation with no plant connections (no source or use) + Real64 Volume; // Tank volume (m3) + bool VolumeWasAutoSized; // true if tank volume was autosize on input + Real64 Mass; // Total mass of fluid in the tank (kg) + Real64 TimeElapsed; // Fraction of the current hour that has elapsed (h) // Saved in order to identify the beginning of a new system time AmbientTempEnum AmbientTempIndicator; // Indicator for ambient tank losses (SCHEDULE, ZONE, EXTERIOR) int AmbientTempSchedule; // Schedule index pointer @@ -448,7 +449,7 @@ namespace WaterThermalTanks { Real64 OnCycParaLoad; // Rate for on-cycle parasitic load (W) std::string OnCycParaFuelType; // Fuel type for on-cycle parasitic load Real64 OnCycParaFracToTank; // Fraction of on-cycle parasitic energy ending up in tank (W) - DataPlant::iFlowLock UseCurrentFlowLock; // current flow lock setting on use side + DataPlant::FlowLock UseCurrentFlowLock; // current flow lock setting on use side int UseInletNode; // Inlet node on the use side; colder water returning to a hottank Real64 UseInletTemp; // Use side inlet temperature (C) int UseOutletNode; // Outlet node on the use side; hot tank water @@ -608,15 +609,15 @@ namespace WaterThermalTanks { // Default Constructor WaterThermalTankData() - : TypeNum(0), IsChilledWaterTank(false), Init(true), StandAlone(false), Volume(0.0), VolumeWasAutoSized(false), Mass(0.0), - TimeElapsed(0.0), AmbientTempIndicator(AmbientTempEnum::OutsideAir), AmbientTempSchedule(0), AmbientTempZone(0), - AmbientTempOutsideAirNode(0), AmbientTemp(0.0), AmbientZoneGain(0.0), LossCoeff(0.0), OffCycLossCoeff(0.0), OffCycLossFracToZone(0.0), - OnCycLossCoeff(0.0), OnCycLossFracToZone(0.0), Mode(0), SavedMode(0), ControlType(ControlTypeEnum::Cycle), MaxCapacity(0.0), - MaxCapacityWasAutoSized(false), MinCapacity(0.0), Efficiency(0.0), PLFCurve(0), SetPointTempSchedule(0), SetPointTemp(0.0), - DeadBandDeltaTemp(0.0), TankTempLimit(0.0), IgnitionDelay(0.0), OffCycParaLoad(0.0), OffCycParaFracToTank(0.0), OnCycParaLoad(0.0), - OnCycParaFracToTank(0.0), UseCurrentFlowLock(DataPlant::iFlowLock::Unlocked), UseInletNode(0), UseInletTemp(0.0), UseOutletNode(0), - UseOutletTemp(0.0), UseMassFlowRate(0.0), UseEffectiveness(0.0), PlantUseMassFlowRateMax(0.0), SavedUseOutletTemp(0.0), - UseDesignVolFlowRate(0.0), UseDesignVolFlowRateWasAutoSized(false), + : WaterThermalTankType(DataPlant::PlantEquipmentType::Invalid), IsChilledWaterTank(false), Init(true), StandAlone(false), Volume(0.0), + VolumeWasAutoSized(false), Mass(0.0), TimeElapsed(0.0), AmbientTempIndicator(AmbientTempEnum::OutsideAir), AmbientTempSchedule(0), + AmbientTempZone(0), AmbientTempOutsideAirNode(0), AmbientTemp(0.0), AmbientZoneGain(0.0), LossCoeff(0.0), OffCycLossCoeff(0.0), + OffCycLossFracToZone(0.0), OnCycLossCoeff(0.0), OnCycLossFracToZone(0.0), Mode(0), SavedMode(0), ControlType(ControlTypeEnum::Cycle), + MaxCapacity(0.0), MaxCapacityWasAutoSized(false), MinCapacity(0.0), Efficiency(0.0), PLFCurve(0), SetPointTempSchedule(0), + SetPointTemp(0.0), DeadBandDeltaTemp(0.0), TankTempLimit(0.0), IgnitionDelay(0.0), OffCycParaLoad(0.0), OffCycParaFracToTank(0.0), + OnCycParaLoad(0.0), OnCycParaFracToTank(0.0), UseCurrentFlowLock(DataPlant::FlowLock::Unlocked), UseInletNode(0), UseInletTemp(0.0), + UseOutletNode(0), UseOutletTemp(0.0), UseMassFlowRate(0.0), UseEffectiveness(0.0), PlantUseMassFlowRateMax(0.0), + SavedUseOutletTemp(0.0), UseDesignVolFlowRate(0.0), UseDesignVolFlowRateWasAutoSized(false), UseBranchControlType(DataBranchAirLoopPlant::ControlTypeEnum::Passive), UseSidePlantSizNum(0), UseSideSeries(true), UseSideAvailSchedNum(0), UseSideLoadRequested(0.0), SourceInletNode(0), SourceInletTemp(0.0), SourceOutletNode(0), SourceOutletTemp(0.0), SourceMassFlowRate(0.0), SourceEffectiveness(0.0), PlantSourceMassFlowRateMax(0.0), SavedSourceOutletTemp(0.0), @@ -805,21 +806,21 @@ namespace WaterThermalTanks { struct WaterHeaterDesuperheaterData { // Members - std::string Name; // Name of heat pump water heater desuperheater - std::string Type; // Type of water heater desuperheating coil - int InsuffTemperatureWarn; // Used for recurring error count on low source temperature - int AvailSchedPtr; // Index to Availability Schedule curve index - int SetPointTempSchedule; // Index to Setpoint Temperature Schedule curve - Real64 DeadBandTempDiff; // Dead band temperature difference (cut-in temperature) - Real64 HeatReclaimRecoveryEff; // recovery efficiency of desuperheater (0.3 max) - int WaterInletNode; // Desuperheater water inlet node - int WaterOutletNode; // Desuperheater water outlet node - Real64 RatedInletWaterTemp; // Inlet water temp at rated heat reclaim recovery eff (C) - Real64 RatedOutdoorAirTemp; // Outdoor air temp at rated heat reclaim recovery eff (C) - Real64 MaxInletWaterTemp; // Max water temp for heat reclaim recovery (C) - std::string TankType; // Type of water heater (MIXED or STRATIFIED) - int TankTypeNum; // Parameter for tank type (MIXED or STRATIFIED) - std::string TankName; // Name of tank associated with desuperheater + std::string Name; // Name of heat pump water heater desuperheater + std::string Type; // Type of water heater desuperheating coil + int InsuffTemperatureWarn; // Used for recurring error count on low source temperature + int AvailSchedPtr; // Index to Availability Schedule curve index + int SetPointTempSchedule; // Index to Setpoint Temperature Schedule curve + Real64 DeadBandTempDiff; // Dead band temperature difference (cut-in temperature) + Real64 HeatReclaimRecoveryEff; // recovery efficiency of desuperheater (0.3 max) + int WaterInletNode; // Desuperheater water inlet node + int WaterOutletNode; // Desuperheater water outlet node + Real64 RatedInletWaterTemp; // Inlet water temp at rated heat reclaim recovery eff (C) + Real64 RatedOutdoorAirTemp; // Outdoor air temp at rated heat reclaim recovery eff (C) + Real64 MaxInletWaterTemp; // Max water temp for heat reclaim recovery (C) + std::string TankType; // Type of water heater (MIXED or STRATIFIED) + DataPlant::PlantEquipmentType TankTypeNum; // Parameter for tank type (MIXED or STRATIFIED) + std::string TankName; // Name of tank associated with desuperheater int TankNum; bool StandAlone; // Flag for operation with no plant connections (no use nodes) std::string HeatingSourceType; // Type of heating source (DX coil or refrigerated rack) @@ -870,14 +871,15 @@ namespace WaterThermalTanks { // Default Constructor WaterHeaterDesuperheaterData() : InsuffTemperatureWarn(0), AvailSchedPtr(0), SetPointTempSchedule(0), DeadBandTempDiff(0.0), HeatReclaimRecoveryEff(0.0), - WaterInletNode(0), WaterOutletNode(0), RatedInletWaterTemp(0.0), RatedOutdoorAirTemp(0.0), MaxInletWaterTemp(0.0), TankTypeNum(0), - TankNum(0), StandAlone(false), HeaterRate(0.0), HeaterEnergy(0.0), PumpPower(0.0), PumpEnergy(0.0), PumpElecPower(0.0), - PumpFracToWater(0.0), OperatingWaterFlowRate(0.0), HEffFTemp(0), HEffFTempOutput(0.0), SetPointTemp(0.0), WaterHeaterTankNum(0), - DesuperheaterPLR(0.0), OnCycParaLoad(0.0), OffCycParaLoad(0.0), OnCycParaFuelEnergy(0.0), OnCycParaFuelRate(0.0), - OffCycParaFuelEnergy(0.0), OffCycParaFuelRate(0.0), Mode(0), SaveMode(0), SaveWHMode(0), BackupElementCapacity(0.0), DXSysPLR(0.0), - ReclaimHeatingSourceIndexNum(0), ReclaimHeatingSource(CoilObjEnum::DXCooling), SetPointError(0), SetPointErrIndex1(0), - IterLimitErrIndex1(0), IterLimitExceededNum1(0), RegulaFalsiFailedIndex1(0), RegulaFalsiFailedNum1(0), IterLimitErrIndex2(0), - IterLimitExceededNum2(0), RegulaFalsiFailedIndex2(0), RegulaFalsiFailedNum2(0), FirstTimeThroughFlag(true), ValidSourceType(false) + WaterInletNode(0), WaterOutletNode(0), RatedInletWaterTemp(0.0), RatedOutdoorAirTemp(0.0), MaxInletWaterTemp(0.0), + TankTypeNum(DataPlant::PlantEquipmentType::Invalid), TankNum(0), StandAlone(false), HeaterRate(0.0), HeaterEnergy(0.0), PumpPower(0.0), + PumpEnergy(0.0), PumpElecPower(0.0), PumpFracToWater(0.0), OperatingWaterFlowRate(0.0), HEffFTemp(0), HEffFTempOutput(0.0), + SetPointTemp(0.0), WaterHeaterTankNum(0), DesuperheaterPLR(0.0), OnCycParaLoad(0.0), OffCycParaLoad(0.0), OnCycParaFuelEnergy(0.0), + OnCycParaFuelRate(0.0), OffCycParaFuelEnergy(0.0), OffCycParaFuelRate(0.0), Mode(0), SaveMode(0), SaveWHMode(0), + BackupElementCapacity(0.0), DXSysPLR(0.0), ReclaimHeatingSourceIndexNum(0), ReclaimHeatingSource(CoilObjEnum::DXCooling), + SetPointError(0), SetPointErrIndex1(0), IterLimitErrIndex1(0), IterLimitExceededNum1(0), RegulaFalsiFailedIndex1(0), + RegulaFalsiFailedNum1(0), IterLimitErrIndex2(0), IterLimitExceededNum2(0), RegulaFalsiFailedIndex2(0), RegulaFalsiFailedNum2(0), + FirstTimeThroughFlag(true), ValidSourceType(false) { } }; diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index c1459f30d35..86041823e92 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -97,8 +97,6 @@ namespace WaterToAirHeatPump { using namespace DataLoopNode; using DataHVACGlobals::ContFanCycCoil; using DataHVACGlobals::CycFanCycCoil; - using DataPlant::TypeOf_CoilWAHPCoolingParamEst; - using DataPlant::TypeOf_CoilWAHPHeatingParamEst; static constexpr std::string_view fluidNameWater("WATER"); @@ -173,14 +171,14 @@ namespace WaterToAirHeatPump { } // Calculate the Correct Water to Air HP Model with the current HPNum - if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum == TypeOf_CoilWAHPCoolingParamEst) { + if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType == DataPlant::PlantEquipmentType::CoilWAHPCoolingParamEst) { InitWatertoAirHP( state, HPNum, InitFlag, MaxONOFFCyclesperHour, HPTimeConstant, FanDelayTime, SensLoad, LatentLoad, DesignAirflow, PartLoadRatio); CalcWatertoAirHPCooling(state, HPNum, CyclingScheme, FirstHVACIteration, RuntimeFrac, InitFlag, SensLoad, CompOp, PartLoadRatio); UpdateWatertoAirHP(state, HPNum); - } else if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum == TypeOf_CoilWAHPHeatingParamEst) { + } else if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType == DataPlant::PlantEquipmentType::CoilWAHPHeatingParamEst) { InitWatertoAirHP( state, HPNum, InitFlag, MaxONOFFCyclesperHour, HPTimeConstant, FanDelayTime, SensLoad, LatentLoad, DesignAirflow, PartLoadRatio); CalcWatertoAirHPHeating(state, HPNum, CyclingScheme, FirstHVACIteration, RuntimeFrac, InitFlag, SensLoad, CompOp, PartLoadRatio); @@ -298,7 +296,7 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name = AlphArray(1); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WatertoAirHPType = "COOLING"; - state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum = TypeOf_CoilWAHPCoolingParamEst; + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType = DataPlant::PlantEquipmentType::CoilWAHPCoolingParamEst; state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Refrigerant = AlphArray(3); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).DesignWaterVolFlowRate = NumArray(1); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).CoolingCapacity = NumArray(2); @@ -491,7 +489,7 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name = AlphArray(1); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WatertoAirHPType = "HEATING"; - state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum = TypeOf_CoilWAHPHeatingParamEst; + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType = DataPlant::PlantEquipmentType::CoilWAHPHeatingParamEst; state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Refrigerant = AlphArray(3); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).DesignWaterVolFlowRate = NumArray(1); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).HeatingCapacity = NumArray(2); @@ -650,7 +648,7 @@ namespace WaterToAirHeatPump { for (HPNum = 1; HPNum <= state.dataWaterToAirHeatPump->NumWatertoAirHPs; ++HPNum) { - if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum == TypeOf_CoilWAHPCoolingParamEst) { + if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType == DataPlant::PlantEquipmentType::CoilWAHPCoolingParamEst) { // COOLING COIL: Setup Report variables for the Heat Pump SetupOutputVariable(state, "Cooling Coil Electricity Rate", @@ -764,7 +762,7 @@ namespace WaterToAirHeatPump { OutputProcessor::SOVTimeStepType::System, OutputProcessor::SOVStoreType::Average, state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name); - } else if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum == TypeOf_CoilWAHPHeatingParamEst) { + } else if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType == DataPlant::PlantEquipmentType::CoilWAHPHeatingParamEst) { // HEATING COIL Setup Report variables for the Heat Pump SetupOutputVariable(state, "Heating Coil Electricity Rate", @@ -941,7 +939,7 @@ namespace WaterToAirHeatPump { errFlag = false; ScanPlantLoopsForObject(state, state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, - state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum, + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType, state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum, state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopSide, state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).BranchNum, diff --git a/src/EnergyPlus/WaterToAirHeatPump.hh b/src/EnergyPlus/WaterToAirHeatPump.hh index 7dec42c691f..9301911620b 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.hh +++ b/src/EnergyPlus/WaterToAirHeatPump.hh @@ -66,10 +66,10 @@ namespace WaterToAirHeatPump { struct WatertoAirHPEquipConditions { // Members - std::string Name; // Name of the Water to Air Heat pump - std::string WatertoAirHPType; // Type of WatertoAirHP ie. Heating or Cooling - int WAHPPlantTypeOfNum; // type of component in plant - std::string Refrigerant; // Refrigerant name + std::string Name; // Name of the Water to Air Heat pump + std::string WatertoAirHPType; // Type of WatertoAirHP ie. Heating or Cooling + DataPlant::PlantEquipmentType WAHPType; // type of component in plant + std::string Refrigerant; // Refrigerant name bool SimFlag; Real64 InletAirMassFlowRate; // Inlet Air Mass Flow through the Water to Air Heat Pump being Simulated [kg/s] Real64 OutletAirMassFlowRate; // Outlet Air Mass Flow through the Water to Air Heat Pump being Simulated [kg/s] @@ -141,17 +141,17 @@ namespace WaterToAirHeatPump { // Default Constructor WatertoAirHPEquipConditions() - : WAHPPlantTypeOfNum(0), SimFlag(false), InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), InletAirDBTemp(0.0), InletAirHumRat(0.0), - OutletAirDBTemp(0.0), OutletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), InletWaterTemp(0.0), OutletWaterTemp(0.0), - InletWaterMassFlowRate(0.0), OutletWaterMassFlowRate(0.0), DesignWaterMassFlowRate(0.0), DesignWaterVolFlowRate(0.0), - InletWaterEnthalpy(0.0), OutletWaterEnthalpy(0.0), Power(0.0), Energy(0.0), QSensible(0.0), QLatent(0.0), QSource(0.0), - EnergySensible(0.0), EnergyLatent(0.0), EnergySource(0.0), RunFrac(0.0), PartLoadRatio(0.0), HeatingCapacity(0.0), CoolingCapacity(0.0), - QLoadTotal(0.0), EnergyLoadTotal(0.0), Twet_Rated(0.0), Gamma_Rated(0.0), MaxONOFFCyclesperHour(0.0), HPTimeConstant(0.0), - FanDelayTime(0.0), SourceSideUACoeff(0.0), LoadSideTotalUACoeff(0.0), LoadSideOutsideUACoeff(0.0), CompPistonDisp(0.0), - CompClearanceFactor(0.0), CompSucPressDrop(0.0), SuperheatTemp(0.0), PowerLosses(0.0), LossFactor(0.0), RefVolFlowRate(0.0), - VolumeRatio(0.0), LeakRateCoeff(0.0), SourceSideHTR1(0.0), SourceSideHTR2(0.0), HighPressCutoff(0.0), LowPressCutoff(0.0), - CompressorType(0), AirInletNodeNum(0), AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), LowPressClgError(0), - HighPressClgError(0), LowPressHtgError(0), HighPressHtgError(0), LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0) + : WAHPType(DataPlant::PlantEquipmentType::Invalid), SimFlag(false), InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), + InletAirDBTemp(0.0), InletAirHumRat(0.0), OutletAirDBTemp(0.0), OutletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), + InletWaterTemp(0.0), OutletWaterTemp(0.0), InletWaterMassFlowRate(0.0), OutletWaterMassFlowRate(0.0), DesignWaterMassFlowRate(0.0), + DesignWaterVolFlowRate(0.0), InletWaterEnthalpy(0.0), OutletWaterEnthalpy(0.0), Power(0.0), Energy(0.0), QSensible(0.0), QLatent(0.0), + QSource(0.0), EnergySensible(0.0), EnergyLatent(0.0), EnergySource(0.0), RunFrac(0.0), PartLoadRatio(0.0), HeatingCapacity(0.0), + CoolingCapacity(0.0), QLoadTotal(0.0), EnergyLoadTotal(0.0), Twet_Rated(0.0), Gamma_Rated(0.0), MaxONOFFCyclesperHour(0.0), + HPTimeConstant(0.0), FanDelayTime(0.0), SourceSideUACoeff(0.0), LoadSideTotalUACoeff(0.0), LoadSideOutsideUACoeff(0.0), + CompPistonDisp(0.0), CompClearanceFactor(0.0), CompSucPressDrop(0.0), SuperheatTemp(0.0), PowerLosses(0.0), LossFactor(0.0), + RefVolFlowRate(0.0), VolumeRatio(0.0), LeakRateCoeff(0.0), SourceSideHTR1(0.0), SourceSideHTR2(0.0), HighPressCutoff(0.0), + LowPressCutoff(0.0), CompressorType(0), AirInletNodeNum(0), AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), + LowPressClgError(0), HighPressClgError(0), LowPressHtgError(0), HighPressHtgError(0), LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0) { } }; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index bf73de5d616..c20d9bf0a99 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -74,10 +74,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -188,7 +186,8 @@ namespace WaterToAirHeatPumpSimple { OnOffAirFlowRatio = 1.0; } - if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum == DataPlant::TypeOf_CoilWAHPCoolingEquationFit) { + if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType == + DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit) { // Cooling mode InitSimpleWatertoAirHP(state, HPNum, @@ -202,7 +201,8 @@ namespace WaterToAirHeatPumpSimple { FirstHVACIteration); CalcHPCoolingSimple(state, HPNum, CyclingScheme, RuntimeFrac, SensLoad, LatentLoad, CompOp, PartLoadRatio, OnOffAirFlowRatio); UpdateSimpleWatertoAirHP(state, HPNum); - } else if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum == DataPlant::TypeOf_CoilWAHPHeatingEquationFit) { + } else if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType == + DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit) { // Heating mode InitSimpleWatertoAirHP(state, HPNum, @@ -323,7 +323,7 @@ namespace WaterToAirHeatPumpSimple { GlobalNames::VerifyUniqueCoilName(state, CurrentModuleObject, AlphArray(1), ErrorsFound, CurrentModuleObject + " Name"); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name = AlphArray(1); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType = "COOLING"; - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedAirVolFlowRate = NumArray(1); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedWaterVolFlowRate = NumArray(2); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal = NumArray(3); @@ -519,7 +519,7 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name = AlphArray(1); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType = "HEATING"; - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedAirVolFlowRate = NumArray(1); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedWaterVolFlowRate = NumArray(2); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapHeat = NumArray(3); @@ -658,7 +658,8 @@ namespace WaterToAirHeatPumpSimple { for (HPNum = 1; HPNum <= state.dataWaterToAirHeatPumpSimple->NumWatertoAirHPs; ++HPNum) { - if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum == DataPlant::TypeOf_CoilWAHPCoolingEquationFit) { + if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType == + DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit) { // COOLING COIL Setup Report variables for the Heat Pump SetupOutputVariable(state, "Cooling Coil Electricity Rate", @@ -767,8 +768,8 @@ namespace WaterToAirHeatPumpSimple { OutputProcessor::SOVStoreType::Average, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name); - } else if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum == - DataPlant::TypeOf_CoilWAHPHeatingEquationFit) { + } else if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType == + DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit) { // HEATING COIL Setup Report variables for the Heat Pump SetupOutputVariable(state, "Heating Coil Electricity Rate", @@ -929,7 +930,7 @@ namespace WaterToAirHeatPumpSimple { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, simpleWatertoAirHP.Name, - simpleWatertoAirHP.WAHPPlantTypeOfNum, + simpleWatertoAirHP.WAHPPlantType, simpleWatertoAirHP.LoopNum, simpleWatertoAirHP.LoopSide, simpleWatertoAirHP.BranchNum, @@ -956,7 +957,7 @@ namespace WaterToAirHeatPumpSimple { if (FirstHVACIteration) { if (state.dataWaterToAirHeatPumpSimple->SimpleHPTimeStepFlag(HPNum)) { - if (simpleWatertoAirHP.WAHPPlantTypeOfNum == DataPlant::TypeOf_CoilWAHPCoolingEquationFit) { + if (simpleWatertoAirHP.WAHPPlantType == DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit) { if (simpleWatertoAirHP.CompanionHeatingCoilNum > 0) { if (simpleWatertoAirHP.WaterFlowMode) { simpleWatertoAirHP.LastOperatingMode = DataHVACGlobals::Cooling; @@ -997,7 +998,7 @@ namespace WaterToAirHeatPumpSimple { } } else { state.dataWaterToAirHeatPumpSimple->SimpleHPTimeStepFlag(HPNum) = true; - if (simpleWatertoAirHP.WAHPPlantTypeOfNum == DataPlant::TypeOf_CoilWAHPCoolingEquationFit) { + if (simpleWatertoAirHP.WAHPPlantType == DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit) { if (simpleWatertoAirHP.CompanionHeatingCoilNum > 0) state.dataWaterToAirHeatPumpSimple->SimpleHPTimeStepFlag(simpleWatertoAirHP.CompanionHeatingCoilNum) = true; } else { @@ -1113,7 +1114,7 @@ namespace WaterToAirHeatPumpSimple { simpleWatertoAirHP.WaterMassFlowRate = 0.0; simpleWatertoAirHP.AirMassFlowRate = 0.0; if ((simpleWatertoAirHP.WaterCyclingMode) == DataHVACGlobals::WaterConstant) { - if (simpleWatertoAirHP.WAHPPlantTypeOfNum == DataPlant::TypeOf_CoilWAHPCoolingEquationFit) { + if (simpleWatertoAirHP.WAHPPlantType == DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit) { if (simpleWatertoAirHP.CompanionHeatingCoilNum > 0) { if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWatertoAirHP.CompanionHeatingCoilNum).QLoadTotal > 0.0) { // do nothing, there will be flow through this coil @@ -1127,7 +1128,7 @@ namespace WaterToAirHeatPumpSimple { simpleWatertoAirHP.WaterMassFlowRate = simpleWatertoAirHP.DesignWaterMassFlowRate; } } - } else if (simpleWatertoAirHP.WAHPPlantTypeOfNum == DataPlant::TypeOf_CoilWAHPHeatingEquationFit) { + } else if (simpleWatertoAirHP.WAHPPlantType == DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit) { // It's a heating coil if (simpleWatertoAirHP.CompanionCoolingCoilNum > 0) { if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWatertoAirHP.CompanionCoolingCoilNum).QLoadTotal > 0.0) { diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh index b32e0f89812..a0f26c79326 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh @@ -68,20 +68,20 @@ namespace WaterToAirHeatPumpSimple { struct SimpleWatertoAirHPConditions { // Members - std::string Name; // Name of the Water to Air Heat pump - std::string WatertoAirHPType; // Type of WatertoAirHP ie. Heating or Cooling - int WAHPPlantTypeOfNum; // type of component in plant - bool SimFlag; // Heat Pump Simulation Flag - Real64 AirVolFlowRate; // Air Volumetric Flow Rate[m3/s] - Real64 AirMassFlowRate; // Air Mass Flow Rate[kg/s] - Real64 InletAirDBTemp; // Inlet Air Dry Bulb Temperature [C] - Real64 InletAirHumRat; // Inlet Air Humidity Ratio [kg/kg] - Real64 InletAirEnthalpy; // Inlet Air Enthalpy [J/kg] - Real64 OutletAirDBTemp; // Outlet Air Dry Bulb Temperature [C] - Real64 OutletAirHumRat; // Outlet Air Humidity Ratio [kg/kg] - Real64 OutletAirEnthalpy; // Outlet Air Enthalpy [J/kg] - Real64 WaterVolFlowRate; // Water Volumetric Flow Rate [m3/s] - Real64 WaterMassFlowRate; // Water Mass Flow Rate [kg/s] + std::string Name; // Name of the Water to Air Heat pump + std::string WatertoAirHPType; // Type of WatertoAirHP ie. Heating or Cooling + DataPlant::PlantEquipmentType WAHPPlantType; // type of component in plant + bool SimFlag; // Heat Pump Simulation Flag + Real64 AirVolFlowRate; // Air Volumetric Flow Rate[m3/s] + Real64 AirMassFlowRate; // Air Mass Flow Rate[kg/s] + Real64 InletAirDBTemp; // Inlet Air Dry Bulb Temperature [C] + Real64 InletAirHumRat; // Inlet Air Humidity Ratio [kg/kg] + Real64 InletAirEnthalpy; // Inlet Air Enthalpy [J/kg] + Real64 OutletAirDBTemp; // Outlet Air Dry Bulb Temperature [C] + Real64 OutletAirHumRat; // Outlet Air Humidity Ratio [kg/kg] + Real64 OutletAirEnthalpy; // Outlet Air Enthalpy [J/kg] + Real64 WaterVolFlowRate; // Water Volumetric Flow Rate [m3/s] + Real64 WaterMassFlowRate; // Water Mass Flow Rate [kg/s] Real64 DesignWaterMassFlowRate; Real64 InletWaterTemp; // Inlet Water Temperature [C] Real64 InletWaterEnthalpy; // Inlet Water Enthalpy [J/kg] @@ -144,8 +144,8 @@ namespace WaterToAirHeatPumpSimple { bool reportCoilFinalSizes; // one time report of sizes to coil report // Default Constructor SimpleWatertoAirHPConditions() - : WAHPPlantTypeOfNum(0), SimFlag(false), AirVolFlowRate(0.0), AirMassFlowRate(0.0), InletAirDBTemp(0.0), InletAirHumRat(0.0), - InletAirEnthalpy(0.0), OutletAirDBTemp(0.0), OutletAirHumRat(0.0), OutletAirEnthalpy(0.0), WaterVolFlowRate(0.0), + : WAHPPlantType(DataPlant::PlantEquipmentType::Invalid), SimFlag(false), AirVolFlowRate(0.0), AirMassFlowRate(0.0), InletAirDBTemp(0.0), + InletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirDBTemp(0.0), OutletAirHumRat(0.0), OutletAirEnthalpy(0.0), WaterVolFlowRate(0.0), WaterMassFlowRate(0.0), DesignWaterMassFlowRate(0.0), InletWaterTemp(0.0), InletWaterEnthalpy(0.0), OutletWaterTemp(0.0), OutletWaterEnthalpy(0.0), Power(0.0), QLoadTotal(0.0), QLoadTotalReport(0.0), QSensible(0.0), QLatent(0.0), QSource(0.0), Energy(0.0), EnergyLoadTotal(0.0), EnergySensible(0.0), EnergyLatent(0.0), EnergySource(0.0), COP(0.0), RunFrac(0.0), PartLoadRatio(0.0), diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index feafb1936ef..89c8a898289 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -1674,7 +1674,7 @@ namespace WaterUse { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, - DataPlant::TypeOf_WaterUseConnection, + DataPlant::PlantEquipmentType::WaterUseConnection, this->PlantLoopNum, this->PlantLoopSide, this->PlantLoopBranchNum, diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc index ffd27dd7b7a..83a30f38cbf 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc @@ -7651,7 +7651,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; auto &CWLoopSizingData(state->dataSize->PlantSizData(2)); @@ -7668,7 +7668,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) HWLoop.FluidIndex = 1; HWLoop.FluidName = "WATER"; HWLoop.LoopSide(1).Branch(1).Comp(1).Name = HWCoil.Name; - HWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + HWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; HWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = HWCoil.WaterInletNodeNum; HWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = HWCoil.WaterOutletNodeNum; auto &HWLoopSizingData(state->dataSize->PlantSizData(1)); @@ -8084,7 +8084,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; auto &CWLoopSizingData(state->dataSize->PlantSizData(2)); @@ -8101,7 +8101,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) HWLoop.FluidIndex = 1; HWLoop.FluidName = "WATER"; HWLoop.LoopSide(1).Branch(1).Comp(1).Name = HWCoil.Name; - HWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + HWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; HWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = HWCoil.WaterInletNodeNum; HWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = HWCoil.WaterOutletNodeNum; auto &HWLoopSizingData(state->dataSize->PlantSizData(1)); diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc index 9f2e9f778f1..0f0cb032e29 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc @@ -189,9 +189,10 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctSeriesPIUReheat_GetInputtest) GetPIUs(*state); ASSERT_EQ(1, state->dataPowerInductionUnits->NumSeriesPIUs); - EXPECT_EQ("SPACE1-1 ZONE COIL", state->dataPowerInductionUnits->PIU(1).HCoil); // heating coil name - EXPECT_EQ("COIL:HEATING:WATER", state->dataPowerInductionUnits->PIU(1).HCoilType); // hot water heating coil - EXPECT_GT(state->dataPowerInductionUnits->PIU(1).HotControlNode, 0); // none zero integer node index is expected + EXPECT_EQ("SPACE1-1 ZONE COIL", state->dataPowerInductionUnits->PIU(1).HCoil); // heating coil name + EXPECT_EQ("COIL:HEATING:WATER", + HCoilNamesUC[static_cast(state->dataPowerInductionUnits->PIU(1).HCoilType)]); // hot water heating coil + EXPECT_GT(state->dataPowerInductionUnits->PIU(1).HotControlNode, 0); // none zero integer node index is expected } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctSeriesPIU_SetADUInletNodeTest) diff --git a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc index d11a25d4d96..c93414f8c10 100644 --- a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc +++ b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc @@ -259,7 +259,7 @@ TEST_F(EnergyPlusFixture, Boiler_HotWater_BoilerEfficiency) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisBoiler.Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Simple; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Boiler_Simple; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisBoiler.BoilerInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisBoiler.BoilerOutletNodeNum; diff --git a/tst/EnergyPlus/unit/BoilerSteam.unit.cc b/tst/EnergyPlus/unit/BoilerSteam.unit.cc index 437efaec36b..bf8cf9965b8 100644 --- a/tst/EnergyPlus/unit/BoilerSteam.unit.cc +++ b/tst/EnergyPlus/unit/BoilerSteam.unit.cc @@ -168,7 +168,7 @@ TEST_F(EnergyPlusFixture, BoilerSteam_BoilerEfficiency) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "STEAM"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisBoiler.Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Steam; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Boiler_Steam; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisBoiler.BoilerInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisBoiler.BoilerOutletNodeNum; diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index 6f46174085c..6e970eaaf0a 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -1818,11 +1818,11 @@ TEST_F(EnergyPlusFixture, ChillerAbsorption_Calc) // lock the evap flow at test condition specified int LoopNum = thisChiller.CWLoopNum; int LoopSideNum = thisChiller.CWLoopSideNum; - state->dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::FlowLock::Locked; // calc generator flow int GenLoopNum = thisChiller.GenLoopNum; int GenLoopSideNum = thisChiller.GenLoopSideNum; - state->dataPlnt->PlantLoop(GenLoopNum).LoopSide(GenLoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(GenLoopNum).LoopSide(GenLoopSideNum).FlowLock = DataPlant::FlowLock::Unlocked; // run CalcBLASTAbsorberModel thisChiller.EquipFlowCtrl = EquipFlowCtrl; thisChiller.calculate(*state, AbsChillEvapLoad, AbsChillRunFlag); diff --git a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc index 9f0f55996d8..5ecbbd8f894 100644 --- a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc +++ b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc @@ -118,7 +118,7 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisChiller.Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ConstCOP; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_ConstCOP; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisChiller.EvapInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisChiller.EvapOutletNodeNum; @@ -128,7 +128,7 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) state->dataPlnt->PlantLoop(2).PlantSizNum = 2; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = thisChiller.Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ConstCOP; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_ConstCOP; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisChiller.CondInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisChiller.CondOutletNodeNum; diff --git a/tst/EnergyPlus/unit/ChillerElectric.unit.cc b/tst/EnergyPlus/unit/ChillerElectric.unit.cc index c8efacc5c69..f0a3d912568 100644 --- a/tst/EnergyPlus/unit/ChillerElectric.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectric.unit.cc @@ -128,7 +128,7 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_Electric; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).EvapInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).EvapOutletNodeNum; @@ -138,7 +138,7 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) state->dataPlnt->PlantLoop(2).PlantSizNum = 2; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_Electric; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).CondInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).CondOutletNodeNum; @@ -255,7 +255,7 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Simulate) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_Electric; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).EvapInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).EvapOutletNodeNum; @@ -265,7 +265,7 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Simulate) state->dataPlnt->PlantLoop(2).PlantSizNum = 2; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_Electric; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).CondInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).CondOutletNodeNum; diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index 2319e44c26d..8841937f352 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -57,6 +57,7 @@ #include #include #include +#include #include #include "Fixtures/EnergyPlusFixture.hh" @@ -214,7 +215,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisEIR.Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ElectricEIR; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_ElectricEIR; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisEIR.EvapInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisEIR.EvapOutletNodeNum; @@ -321,7 +322,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisEIRChiller.Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ElectricEIR; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Chiller_ElectricEIR; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisEIRChiller.EvapInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisEIRChiller.EvapOutletNodeNum; @@ -346,7 +347,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) Real64 MyLoad(-18000.0); openOutputFiles(*state); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataLoopNodes->Node(thisEIRChiller.EvapOutletNodeNum).TempSetPoint = 6.67; state->dataLoopNodes->Node(thisEIRChiller.EvapInletNodeNum).Temp = 16.0; // init and size diff --git a/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc index ffcdfeb94cd..1c1035d23c8 100644 --- a/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc @@ -651,9 +651,9 @@ TEST_F(EnergyPlusFixture, ExhAbsorption_calcHeater_Fix_Test) thisChillerHeater.HWLoopSideNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).FluidIndex = 1; - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(3).Temp = 60.0; state->dataLoopNodes->Node(3).MassFlowRate = 0.5; state->dataLoopNodes->Node(4).TempSetPoint = 70.0; diff --git a/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc index 9e130c4c5e2..18154c66067 100644 --- a/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc @@ -340,9 +340,9 @@ TEST_F(EnergyPlusFixture, GasAbsorption_calculateHeater_Fix_Test) thisChillerHeater.HWLoopSideNum = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).FluidIndex = 1; - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(3).Temp = 60.0; state->dataLoopNodes->Node(3).MassFlowRate = 0.5; state->dataLoopNodes->Node(4).TempSetPoint = 70.0; diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index 8015f13eec8..2b6cd2037fd 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -3963,7 +3963,7 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) Real64 WaterFlowRateRatio = 0.75; Real64 AirWetBulbTemp = state->dataEnvrn->OutWetBulbTemp; - state->dataPlnt->PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).FlowLock = DataPlant::FlowLock::Locked; state->dataPlnt->PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).TempSetPoint = 30.0; VSTower.WaterMassFlowRate = VSTower.DesWaterMassFlowRate * WaterFlowRateRatio; diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index 2e3d4ada5b4..8108baabd8c 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -256,11 +256,11 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo // create 2 components on a single branch to simulate water flow control for entire branch state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 2; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(2); - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 41; // Coil:Heating:Water + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; // Coil:Heating:Water state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "Zone1FanCoilHeatingCoil"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 2; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = 21; // Pipe:Adiabatic + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Type = DataPlant::PlantEquipmentType::Pipe; // Pipe:Adiabatic state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Name = "Pipe"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 2; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 3; @@ -420,11 +420,11 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate // create 2 components on a single branch to simulate water flow control for entire branch state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 2; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(2); - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 41; // Coil:Heating:Water + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; // Coil:Heating:Water state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "Zone1FanCoilHeatingCoil"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 2; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = 21; // Pipe:Adiabatic + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Type = DataPlant::PlantEquipmentType::Pipe; // Pipe:Adiabatic state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Name = "Pipe"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 2; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 3; diff --git a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc index 29d703a1dc5..e3cad6368e3 100644 --- a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc @@ -100,7 +100,7 @@ TEST_F(EvapFluidCoolersFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) // In general, values set here attempt to avoid as much code as possible so that only the defect code is run. // Obviously, not everything can be skipped so some of this information is needed to avoid crashes in other routines. auto &thisEFC = state->dataEvapFluidCoolers->SimpleEvapFluidCooler(1); - thisEFC.TypeOf_Num = DataPlant::TypeOf_EvapFluidCooler_TwoSpd; + thisEFC.Type = DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd; thisEFC.MyOneTimeFlag = false; thisEFC.OneTimeFlagForEachEvapFluidCooler = false; thisEFC.MyEnvrnFlag = false; @@ -127,12 +127,12 @@ TEST_F(EvapFluidCoolersFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) state->dataLoopNodes->Node(1).MassFlowRateMaxAvail = 0.05; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).MyLoad = 1.0; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).ON = false; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).CurOpSchemeType = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).CurOpSchemeType = DataPlant::OpScheme::Unassigned; thisEFC.DesignWaterFlowRateWasAutoSized = false; thisEFC.LowSpeedAirFlowRateWasAutoSized = false; thisEFC.HighSpeedEvapFluidCoolerUAWasAutoSized = false; diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index 163e0a2111a..7d548d37baa 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -362,7 +362,7 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilHeatingTest) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; @@ -370,7 +370,7 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilHeatingTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataFanCoilUnits->CoolingLoad = false; @@ -682,7 +682,7 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilCoolingTest) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; @@ -690,7 +690,7 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilCoolingTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataFanCoilUnits->HeatingLoad = false; @@ -1008,20 +1008,20 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; state->dataFanCoilUnits->FanCoil(1).CoolCoilLoopNum = 2; state->dataFanCoilUnits->FanCoil(1).HeatCoilLoopNum = 1; @@ -1067,7 +1067,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) EXPECT_EQ(state->dataLoopNodes->Node(state->dataFanCoilUnits->FanCoil(1).AirInNode).MassFlowRate, state->dataLoopNodes->Node(state->dataFanCoilUnits->FanCoil(1).AirOutNode).MassFlowRate); FirstHVACIteration = false; - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(state->dataFanCoilUnits->FanCoil(1).HeatCoilFluidInletNode).MassFlowRate = 0.2; // Simulate with flow lock on and locked flow > demand flow; bypass extra flow Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1086,7 +1086,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) // normal heating, no flow lock, heating capacity exceeded QZnReq = 5000.0; state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 5000.00; - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); EXPECT_NEAR(4420.0, QUnitOut, 5.0); // expect inlet and outlet node air mass flow rates are equal @@ -1096,7 +1096,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) // Coil Off Capacity Test #1 - low heating load, no flow lock, setting QUnitOutNoHC when flow lock = 0 QZnReq = 80.0; state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 80.00; - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); // FC hits the 80 W target load EXPECT_NEAR(80.0, QUnitOut, 1.0); @@ -1108,7 +1108,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) state->dataLoopNodes->Node(state->dataFanCoilUnits->FanCoil(1).AirOutNode).MassFlowRate); // Coil Off Capacity Test #2 - lock plant flow after previous call - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(state->dataMixedAir->OAMixer(1).RetNode).Temp = 25.0; // change inlet air condition so off capacity will change to see if QUnitOutNoHC remains fixed state->dataLoopNodes->Node(state->dataMixedAir->OAMixer(1).RetNode).Enthalpy = 39000; @@ -1124,7 +1124,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) state->dataLoopNodes->Node(state->dataFanCoilUnits->FanCoil(1).AirOutNode).MassFlowRate); // Coil Off Capacity Test #3 - unlock plant flow to ensure that water flow rate would have been different had flow not been locked - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); // FC hits the 80 W target load EXPECT_NEAR(80.0, QUnitOut, 1.0); @@ -1388,10 +1388,10 @@ TEST_F(EnergyPlusFixture, ElectricCoilFanCoilHeatingTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; state->dataFanCoilUnits->FanCoil(1).CoolCoilLoopNum = 1; state->dataFanCoilUnits->FanCoil(1).HeatCoilLoopNum = 0; @@ -1731,20 +1731,20 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilCoolingTest) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; state->dataFanCoilUnits->FanCoil(1).CoolCoilLoopNum = 2; state->dataFanCoilUnits->FanCoil(1).HeatCoilLoopNum = 1; @@ -1790,7 +1790,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilCoolingTest) state->dataLoopNodes->Node(state->dataFanCoilUnits->FanCoil(1).AirOutNode).MassFlowRate); FirstHVACIteration = false; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(state->dataFanCoilUnits->FanCoil(1).CoolCoilFluidInletNode).MassFlowRate = 0.2; // cooling simulation with flow lock on and locked flow > flow that meets load; bypass extra flow Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1811,7 +1811,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilCoolingTest) // normal cooling, no flow lock, cooling capacity exceeded QZnReq = -5000.0; state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputReqToCoolSP = -5000.00; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); EXPECT_NEAR(-4420.0, QUnitOut, 5.0); // expect inlet and outlet node air mass flow rates are equal @@ -2088,7 +2088,7 @@ TEST_F(EnergyPlusFixture, FanCoil_ASHRAE90VariableFan) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; @@ -2097,7 +2097,7 @@ TEST_F(EnergyPlusFixture, FanCoil_ASHRAE90VariableFan) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; @@ -2363,7 +2363,7 @@ TEST_F(EnergyPlusFixture, Test_TightenWaterFlowLimits) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; @@ -2372,7 +2372,7 @@ TEST_F(EnergyPlusFixture, Test_TightenWaterFlowLimits) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; @@ -2821,7 +2821,7 @@ TEST_F(EnergyPlusFixture, FanCoil_CyclingFanMode) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; @@ -2830,7 +2830,7 @@ TEST_F(EnergyPlusFixture, FanCoil_CyclingFanMode) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; @@ -3250,7 +3250,7 @@ TEST_F(EnergyPlusFixture, FanCoil_FanSystemModelCyclingFanMode) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; // hot water plant loop @@ -3260,7 +3260,7 @@ TEST_F(EnergyPlusFixture, FanCoil_FanSystemModelCyclingFanMode) HWLoop.FluidIndex = 1; HWLoop.FluidName = "WATER"; HWLoop.LoopSide(1).Branch(1).Comp(1).Name = HWCoil.Name; - HWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + HWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; HWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = HWCoil.WaterInletNodeNum; HWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = HWCoil.WaterOutletNodeNum; @@ -3633,7 +3633,7 @@ TEST_F(EnergyPlusFixture, FanCoil_ElecHeatCoilMultiSpeedFanCyclingFanMode) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; @@ -4002,7 +4002,7 @@ TEST_F(EnergyPlusFixture, FanCoil_ElecHeatCoilMultiSpeedFanContFanMode) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; @@ -4371,7 +4371,7 @@ TEST_F(EnergyPlusFixture, FanCoil_CalcFanCoilElecHeatCoilPLRResidual) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; @@ -4685,7 +4685,7 @@ TEST_F(EnergyPlusFixture, FanCoil_ElectricHeatingCoilASHRAE90VariableFan) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; diff --git a/tst/EnergyPlus/unit/FaultsManager.unit.cc b/tst/EnergyPlus/unit/FaultsManager.unit.cc index 7fd1d99ec4e..fd6f15f736e 100644 --- a/tst/EnergyPlus/unit/FaultsManager.unit.cc +++ b/tst/EnergyPlus/unit/FaultsManager.unit.cc @@ -877,10 +877,11 @@ TEST_F(EnergyPlusFixture, FaultsManager_FoulingCoil_AssignmentAndCalc) int FaultIndex = 1; EXPECT_EQ("AHU HW HEATING COIL", state->dataWaterCoils->WaterCoil(CoilNum).Name); EXPECT_NEAR(6.64, state->dataWaterCoils->WaterCoil(CoilNum).UACoil, 0.0001); - EXPECT_EQ(DataPlant::TypeOf_CoilWaterSimpleHeating, state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType)); EXPECT_EQ(CoilNum, state->dataFaultsMgr->FouledCoils(FaultIndex).FouledCoilNum); - EXPECT_EQ(DataPlant::TypeOf_CoilWaterSimpleHeating, state->dataFaultsMgr->FouledCoils(FaultIndex).FouledCoiledType); + EXPECT_TRUE( + compare_enums(DataPlant::PlantEquipmentType::CoilWaterSimpleHeating, state->dataFaultsMgr->FouledCoils(FaultIndex).FouledCoilType)); EXPECT_TRUE(state->dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingFlag); EXPECT_EQ(FaultIndex, state->dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingIndex); @@ -905,10 +906,10 @@ TEST_F(EnergyPlusFixture, FaultsManager_FoulingCoil_AssignmentAndCalc) int CoilNum = 2; int FaultIndex = 2; EXPECT_EQ("AHU CHW COOLING COIL", state->dataWaterCoils->WaterCoil(CoilNum).Name); - EXPECT_EQ(DataPlant::TypeOf_CoilWaterCooling, state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::CoilWaterCooling, state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType)); EXPECT_EQ(CoilNum, state->dataFaultsMgr->FouledCoils(FaultIndex).FouledCoilNum); - EXPECT_EQ(DataPlant::TypeOf_CoilWaterCooling, state->dataFaultsMgr->FouledCoils(FaultIndex).FouledCoiledType); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::CoilWaterCooling, state->dataFaultsMgr->FouledCoils(FaultIndex).FouledCoilType)); EXPECT_TRUE(state->dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingFlag); EXPECT_EQ(FaultIndex, state->dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingIndex); @@ -938,7 +939,7 @@ TEST_F(EnergyPlusFixture, FaultsManager_FoulingCoil_AssignmentAndCalc) { int CoilNum = 3; EXPECT_EQ("AHU CHW COIL WITH NO FAULT", state->dataWaterCoils->WaterCoil(CoilNum).Name); - EXPECT_EQ(DataPlant::TypeOf_CoilWaterCooling, state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::CoilWaterCooling, state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType)); EXPECT_FALSE(state->dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingFlag); EXPECT_EQ(0, state->dataWaterCoils->WaterCoil(CoilNum).FaultyCoilFoulingIndex); diff --git a/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc b/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc index 48108393558..dc8bd95edc9 100644 --- a/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc +++ b/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc @@ -799,11 +799,11 @@ TEST_F(EnergyPlusFixture, FuelCellTest) EXPECT_TRUE(has_err_output(true)); auto &generatorController = state->dataElectPwrSvcMgr->facilityElectricServiceObj->elecLoadCenterObjs[0]->elecGenCntrlObj[0]; - EXPECT_TRUE(compare_enums(GeneratorType::FuelCell, generatorController->compGenTypeOf_Num)); + EXPECT_TRUE(compare_enums(GeneratorType::FuelCell, generatorController->generatorType)); EXPECT_EQ("GENERATOR FUEL CELL 1", generatorController->name); - EXPECT_EQ("GENERATOR:FUELCELL", generatorController->typeOfName); + EXPECT_EQ("GENERATOR:FUELCELL", GeneratorTypeNamesUC[static_cast(generatorController->generatorType)]); - EXPECT_EQ(DataPlant::TypeOf_Generator_FCExhaust, generatorController->compPlantTypeOf_Num); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::Generator_FCExhaust, generatorController->compPlantType)); // Note: plantInfoFound (and cogenLocation) are only set when mode is FollowThermal or FollowThermalLimitElectric // Here it's 'Baseload' @@ -1746,11 +1746,11 @@ TEST_F(EnergyPlusFixture, DISABLED_FuelCellTest_Zero_Cp_Fix) EXPECT_TRUE(simulation_err); auto &generatorController = state->dataElectPwrSvcMgr->facilityElectricServiceObj->elecLoadCenterObjs[0]->elecGenCntrlObj[0]; - EXPECT_TRUE(compare_enums(GeneratorType::FuelCell, generatorController->compGenTypeOf_Num)); + EXPECT_TRUE(compare_enums(GeneratorType::FuelCell, generatorController->generatorType)); EXPECT_EQ("GENERATOR FUEL CELL 1", generatorController->name); - EXPECT_EQ("GENERATOR:FUELCELL", generatorController->typeOfName); + EXPECT_EQ("GENERATOR:FUELCELL", GeneratorTypeNamesUC[static_cast(generatorController->generatorType)]); - EXPECT_EQ(DataPlant::TypeOf_Generator_FCExhaust, generatorController->compPlantTypeOf_Num); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::Generator_FCExhaust, generatorController->compPlantType)); // Note: plantInfoFound (and cogenLocation) are only set when mode is FollowThermal or FollowThermalLimitElectric // Here it's 'Baseload' diff --git a/tst/EnergyPlus/unit/Furnaces.unit.cc b/tst/EnergyPlus/unit/Furnaces.unit.cc index 634d408b176..c07cb502c66 100644 --- a/tst/EnergyPlus/unit/Furnaces.unit.cc +++ b/tst/EnergyPlus/unit/Furnaces.unit.cc @@ -266,9 +266,9 @@ TEST_F(EnergyPlusFixture, SetVSHPAirFlowTest_VSFurnaceFlowTest) state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP.allocate(2); state->dataWaterToAirHeatPumpSimple->NumWatertoAirHPs = 2; state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).Name = "WATERCOOLINGCOIL"; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WAHPPlantTypeOfNum = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; + state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).Name = "WATERHEATINGCOIL"; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WAHPPlantTypeOfNum = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; + state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; state->dataWaterToAirHeatPumpSimple->SimpleHPTimeStepFlag.allocate(2); state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).AirInletNodeNum = 1; state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).AirOutletNodeNum = 3; @@ -310,9 +310,9 @@ TEST_F(EnergyPlusFixture, SetVSHPAirFlowTest_VSFurnaceFlowTest) state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).FluidIndex = 1; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATERCOOLINGCOIL"; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATERHEATINGCOIL"; state->dataHeatBal->HeatReclaimSimple_WAHPCoil.allocate(2); diff --git a/tst/EnergyPlus/unit/HVACControllers.unit.cc b/tst/EnergyPlus/unit/HVACControllers.unit.cc index 12f134c8f82..fd242097d6d 100644 --- a/tst/EnergyPlus/unit/HVACControllers.unit.cc +++ b/tst/EnergyPlus/unit/HVACControllers.unit.cc @@ -264,7 +264,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_TestTempAndHumidityRatioCtrlVarType) state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 39; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 3; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; @@ -411,7 +411,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_WaterCoilOnPrimaryLoopCheckTest) GetControllerInput(*state); ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).Name, "CHILLED WATER COIL"); - ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).WaterCoilType, DataPlant::TypeOf_CoilWaterCooling); + ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).WaterCoilType, DataPlant::PlantEquipmentType::CoilWaterCooling); OutputReportPredefined::SetPredefinedTables(*state); state->dataSimAirServingZones->GetAirLoopInputFlag = false; @@ -504,7 +504,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_WaterCoilOnOutsideAirSystemCheckTest) GetControllerInput(*state); ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).Name, "OA PREHEAT HW COIL"); - ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).WaterCoilType, DataPlant::TypeOf_CoilWaterSimpleHeating); + ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).WaterCoilType, DataPlant::PlantEquipmentType::CoilWaterSimpleHeating); OutputReportPredefined::SetPredefinedTables(*state); state->dataSimAirServingZones->GetAirLoopInputFlag = false; @@ -636,7 +636,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_CoilSystemCoolingWaterOnOutsideAirSyst GetControllerInput(*state); ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).Name, "DETAILED PRE COOLING COIL"); - ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).WaterCoilType, DataPlant::TypeOf_CoilWaterDetailedFlatCooling); + ASSERT_EQ(state->dataWaterCoils->WaterCoil(1).WaterCoilType, DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling); OutputReportPredefined::SetPredefinedTables(*state); state->dataSimAirServingZones->GetAirLoopInputFlag = false; @@ -977,7 +977,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_MaxFlowZero) state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 39; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 3; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index 679486733f0..8835cbd2dc5 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -1754,7 +1754,7 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateOneZone) bool FirstHVACIteration = true; // PlantManager::InitializeLoops( FirstHVACIteration ); - PlantUtilities::SetAllFlowLocks(*state, DataPlant::iFlowLock::Unlocked); + PlantUtilities::SetAllFlowLocks(*state, DataPlant::FlowLock::Unlocked); // first run with a sensible cooling load of 5000 W and cold supply air state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputRequired = -5000.0; state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = -4000.0; @@ -4830,7 +4830,7 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateHighOA) bool FirstHVACIteration = true; // PlantManager::InitializeLoops( FirstHVACIteration ); - PlantUtilities::SetAllFlowLocks(*state, DataPlant::iFlowLock::Unlocked); + PlantUtilities::SetAllFlowLocks(*state, DataPlant::FlowLock::Unlocked); // next run with heating load and neutral supply air state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputRequired = 5000.0; state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 5000.0; diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 564a6863432..f7ef0ab6e8d 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -8315,7 +8315,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilWater) state->dataWaterCoils->WaterCoil.allocate(state->dataWaterCoils->NumWaterCoils); state->dataWaterCoils->WaterCoil(CoilNum).Name = thisVRFTU.SuppHeatCoilName; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::HeatingSimple; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilTypeA = "Heating"; state->dataWaterCoils->WaterCoil(CoilNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; @@ -8360,7 +8360,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilWater) state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataWaterCoils->CheckEquipName.dimension(state->dataWaterCoils->NumWaterCoils, true); @@ -8448,7 +8448,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilSteam) state->dataSteamCoils->SteamCoil(CoilNum).LoopSide = 1; state->dataSteamCoils->SteamCoil(CoilNum).BranchNum = 1; state->dataSteamCoils->SteamCoil(CoilNum).CompNum = 1; - state->dataSteamCoils->SteamCoil(CoilNum).Coil_PlantTypeNum = DataPlant::TypeOf_CoilSteamAirHeating; + state->dataSteamCoils->SteamCoil(CoilNum).CoilType = DataPlant::PlantEquipmentType::CoilSteamAirHeating; state->dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil = state->dataSteamCoils->ZoneLoadControl; state->dataSteamCoils->GetSteamCoilsInputFlag = false; state->dataSteamCoils->CheckEquipName.dimension(state->dataSteamCoils->NumSteamCoils, true); @@ -8476,7 +8476,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilSteam) state->dataPlnt->PlantLoop(1).FluidName = "STEAM"; state->dataPlnt->PlantLoop(1).FluidIndex = state->dataSteamCoils->SteamIndex; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataSteamCoils->SteamCoil(CoilNum).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilSteamAirHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilSteamAirHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum; state->dataGlobal->SysSizingCalc = true; diff --git a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc index 46e8f2c660c..cb6d2d9cbd2 100644 --- a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc @@ -147,7 +147,7 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_HWBaseboardWaterFlowResetTest) HWBaseboard(1).DesignObjectPtr = 1; HWBaseboard(1).EquipID = "HWRadiativeConvectiveBB"; - HWBaseboard(1).EquipType = TypeOf_Baseboard_Rad_Conv_Water; + HWBaseboard(1).EquipType = DataPlant::PlantEquipmentType::Baseboard_Rad_Conv_Water; HWBaseboard(1).ZonePtr = 1; HWBaseboard(1).AirInletTemp = 21.0; HWBaseboard(1).WaterInletTemp = 82.; @@ -187,7 +187,7 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_HWBaseboardWaterFlowResetTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = HWBaseboard(1).EquipID; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = HWBaseboard(1).EquipType; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = HWBaseboard(1).EquipType; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HWBaseboard(1).WaterInletNode; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = HWBaseboard(1).WaterOutletNode; diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index c7f82bbba71..760ca245c69 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -1156,7 +1156,7 @@ TEST_F(LowTempRadiantSystemTest, AutosizeLowTempRadiantVariableFlowTest) ErrorsFound = false; PlantUtilities::ScanPlantLoopsForObject(*state, state->dataLowTempRadSys->HydrRadSys(RadSysNum).Name, - TypeOf_LowTempRadiant_VarFlow, + DataPlant::PlantEquipmentType::LowTempRadiant_VarFlow, state->dataLowTempRadSys->HydrRadSys(RadSysNum).HWLoopNum, state->dataLowTempRadSys->HydrRadSys(RadSysNum).HWLoopSide, state->dataLowTempRadSys->HydrRadSys(RadSysNum).HWBranchNum, @@ -1172,7 +1172,7 @@ TEST_F(LowTempRadiantSystemTest, AutosizeLowTempRadiantVariableFlowTest) ErrorsFound = false; PlantUtilities::ScanPlantLoopsForObject(*state, state->dataLowTempRadSys->HydrRadSys(RadSysNum).Name, - TypeOf_LowTempRadiant_VarFlow, + DataPlant::PlantEquipmentType::LowTempRadiant_VarFlow, state->dataLowTempRadSys->HydrRadSys(RadSysNum).CWLoopNum, state->dataLowTempRadSys->HydrRadSys(RadSysNum).CWLoopSide, state->dataLowTempRadSys->HydrRadSys(RadSysNum).CWBranchNum, diff --git a/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc b/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc index a99f669eede..d70a74248e0 100644 --- a/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc +++ b/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc @@ -290,10 +290,10 @@ TEST_F(EnergyPlusFixture, MicroCHPTest_InitGeneratorDynamics) auto &MicroCHP1(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1)); auto &MicroCHP2(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(2).Comp(1)); MicroCHP1.TypeOf = "GENERATOR:MICROCHP"; - MicroCHP1.TypeOf_Num = DataPlant::TypeOf_Generator_MicroCHP; + MicroCHP1.Type = DataPlant::PlantEquipmentType::Generator_MicroCHP; MicroCHP1.Name = "MICROCOGEN1"; MicroCHP2.TypeOf = "GENERATOR:MICROCHP"; - MicroCHP2.TypeOf_Num = DataPlant::TypeOf_Generator_MicroCHP; + MicroCHP2.Type = DataPlant::PlantEquipmentType::Generator_MicroCHP; MicroCHP2.Name = "MICROCOGEN2"; MicroCHP1.compPtr = MicroCHPElectricGenerator::MicroCHPDataStruct::factory(*state, "MICROCOGEN1"); MicroCHP2.compPtr = MicroCHPElectricGenerator::MicroCHPDataStruct::factory(*state, "MICROCOGEN2"); diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index f160559981a..30050db118d 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -585,9 +585,8 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).ExtFanType); EXPECT_EQ(1, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).NumComponents); - EXPECT_TRUE( - compare_enums(OutdoorAirUnit::CompType::WaterCoil_Cooling, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).ComponentType_Num)); - EXPECT_EQ(TypeOf_CoilWaterCooling, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilPlantTypeOfNum); + EXPECT_TRUE(compare_enums(OutdoorAirUnit::CompType::WaterCoil_Cooling, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).Type)); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::CoilWaterCooling, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilType)); state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -614,7 +613,7 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; @@ -899,9 +898,9 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).ExtFanType); EXPECT_EQ(1, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).NumComponents); + EXPECT_TRUE(compare_enums(OutdoorAirUnit::CompType::SteamCoil_AirHeat, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).Type)); EXPECT_TRUE( - compare_enums(OutdoorAirUnit::CompType::SteamCoil_AirHeat, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).ComponentType_Num)); - EXPECT_EQ(TypeOf_CoilSteamAirHeating, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilPlantTypeOfNum); + compare_enums(DataPlant::PlantEquipmentType::CoilSteamAirHeating, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilType)); state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); @@ -928,7 +927,7 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) state->dataPlnt->PlantLoop(1).FluidIndex = 0; state->dataPlnt->PlantLoop(1).FluidName = "STEAM"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataSteamCoils->SteamCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_CoilSteamAirHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilSteamAirHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataSteamCoils->SteamCoil(1).SteamInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataSteamCoils->SteamCoil(1).SteamOutletNodeNum; diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index 0706292e2c3..b3786c74507 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -493,7 +493,7 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataVariableSpeedCoils->VarSpeedCoil(1).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPCoolingEquationFit; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilVSWAHPCoolingEquationFit; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataVariableSpeedCoils->VarSpeedCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataVariableSpeedCoils->VarSpeedCoil(1).WaterOutletNodeNum; @@ -502,7 +502,7 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataVariableSpeedCoils->VarSpeedCoil(2).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilVSWAHPHeatingEquationFit; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataVariableSpeedCoils->VarSpeedCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataVariableSpeedCoils->VarSpeedCoil(2).WaterOutletNodeNum; diff --git a/tst/EnergyPlus/unit/Pipes.unit.cc b/tst/EnergyPlus/unit/Pipes.unit.cc index a0b6a4cf472..14400238d68 100644 --- a/tst/EnergyPlus/unit/Pipes.unit.cc +++ b/tst/EnergyPlus/unit/Pipes.unit.cc @@ -74,7 +74,7 @@ TEST_F(EnergyPlusFixture, TestPipesInput) ASSERT_TRUE(process_idf(idf_objects)); Pipes::GetPipeInput(*state); EXPECT_EQ(2u, state->dataPipes->LocalPipe.size()); - EXPECT_EQ(DataPlant::TypeOf_Pipe, state->dataPipes->LocalPipe(1).TypeOf); - EXPECT_EQ(DataPlant::TypeOf_PipeSteam, state->dataPipes->LocalPipe(2).TypeOf); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::Pipe, state->dataPipes->LocalPipe(1).Type)); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::PipeSteam, state->dataPipes->LocalPipe(2).Type)); } } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc index 31e51c0b5f4..060f00bf0dc 100644 --- a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc +++ b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc @@ -84,7 +84,7 @@ TEST_F(EnergyPlusFixture, TestPlantComponentTemperatureSource) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_WaterSource; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::WaterSource; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = "FLUIDSOURCE"; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; diff --git a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc index 85325ff5c15..880e5250d87 100644 --- a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc +++ b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc @@ -125,7 +125,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Sequential) { auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Sequential; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::LoadingScheme::Sequential; // Loop demand 550W DistributePlantLoadTest::ResetLoads(); @@ -290,7 +290,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Uniform) { auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Uniform; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::LoadingScheme::Uniform; // Start with 5 components state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; @@ -406,7 +406,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Optimal) { auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Optimal; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::LoadingScheme::Optimal; // Start with 5 components and smaller component 4 state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; @@ -536,7 +536,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_UniformPLR) { auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::UniformPLR; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::LoadingScheme::UniformPLR; // Start with 5 components and smaller component 4 state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; @@ -658,7 +658,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_SequentialUniformPLR) { auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::SequentialUniformPLR; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::LoadingScheme::SequentialUniformPLR; // Start with 5 components and smaller component 4 state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; @@ -861,8 +861,8 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) int CompNum = 1; std::string compName = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name; EXPECT_EQ(compName, "CHILLER"); - auto CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; - EXPECT_TRUE(compare_enums(CtrlTypeNum, DataPlant::iCtrlType::CoolingOp)); + auto CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType; + EXPECT_TRUE(compare_enums(CtrlTypeNum, DataPlant::CtrlType::CoolingOp)); } { @@ -871,17 +871,17 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) // Ensure we have the right component (the TES tank) EXPECT_EQ(compName, "ICE THERMAL STORAGE"); - auto CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; + auto CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlType; // Could just test this, but want to improve reporting - // EXPECT_TRUE(compare_enums(CtrlTypeNum, PlantCondLoopOperation::DualOp)); + // EXPECT_TRUE(compare_enums(CtrlType, PlantCondLoopOperation::DualOp)); std::string ctrlType = "Unknown"; - if (CtrlTypeNum == DataPlant::iCtrlType::CoolingOp) { + if (CtrlTypeNum == DataPlant::CtrlType::CoolingOp) { ctrlType = "CoolingOp"; - } else if (CtrlTypeNum == DataPlant::iCtrlType::HeatingOp) { + } else if (CtrlTypeNum == DataPlant::CtrlType::HeatingOp) { ctrlType = "HeatingOp"; - } else if (CtrlTypeNum == DataPlant::iCtrlType::DualOp) { + } else if (CtrlTypeNum == DataPlant::CtrlType::DualOp) { ctrlType = "DualOp"; } diff --git a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc index aaa8bb520f7..e069d5078a7 100644 --- a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc +++ b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc @@ -2330,7 +2330,7 @@ TEST_F(EnergyPlusFixture, PlantHXControlWithFirstHVACIteration) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantHXFluidToFluid->FluidHX(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantHXFluidToFluid->FluidHX(1).SupplySideLoop.inletNodeNum; state->dataPlantHXFluidToFluid->FluidHX(1).SupplySideLoop.loopNum = 1; state->dataPlantHXFluidToFluid->FluidHX(1).SupplySideLoop.loopSideNum = 1; @@ -2341,7 +2341,7 @@ TEST_F(EnergyPlusFixture, PlantHXControlWithFirstHVACIteration) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantHXFluidToFluid->FluidHX(1).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantHXFluidToFluid->FluidHX(1).DemandSideLoop.inletNodeNum; state->dataPlantHXFluidToFluid->FluidHX(1).DemandSideLoop.loopNum = 2; state->dataPlantHXFluidToFluid->FluidHX(1).DemandSideLoop.loopSideNum = 1; @@ -2448,14 +2448,14 @@ TEST_F(EnergyPlusFixture, PlantHXControl_CoolingSetpointOnOffWithComponentOverri state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = state->dataPlantHXFluidToFluid->FluidHX(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = state->dataPlantHXFluidToFluid->FluidHX(1).SupplySideLoop.inletNodeNum; state->dataPlnt->PlantLoop(2).Name = "HX demand side loop "; state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantHXFluidToFluid->FluidHX(1).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::FluidToFluidPlantHtExchg; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantHXFluidToFluid->FluidHX(1).DemandSideLoop.inletNodeNum; state->dataPlantHXFluidToFluid->FluidHX(1).DemandSideLoop.MassFlowRateMax = 2.0; diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 75574233de5..c66c244f753 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -111,7 +111,7 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_WaterSource) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -122,7 +122,7 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_WaterSource) // validate the heating side EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRHeating, thisHeatingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRHeating, thisHeatingPLHP->EIRHPType)); EXPECT_EQ(thisCoolingPLHP, thisHeatingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisHeatingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisHeatingPLHP->powerRatioFuncTempCurveIndex); @@ -130,17 +130,17 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_WaterSource) // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRCooling, thisCoolingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRCooling, thisCoolingPLHP->EIRHPType)); EXPECT_EQ(thisHeatingPLHP, thisCoolingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisCoolingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncPLRCurveIndex); // calling the factory with an invalid name or type will call ShowFatalError, which will trigger a runtime exception - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP HEATING SIDE"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP HEATING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); } TEST_F(EnergyPlusFixture, PairingCompanionCoils) @@ -153,11 +153,11 @@ TEST_F(EnergyPlusFixture, PairingCompanionCoils) // a successful try coil1->name = "name1"; coil1->companionCoilName = "name2"; - coil1->plantTypeOfNum = DataPlant::TypeOf_HeatPumpEIRCooling; + coil1->EIRHPType = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; coil1->companionHeatPumpCoil = nullptr; coil2->name = "name2"; coil2->companionCoilName = "name1"; - coil2->plantTypeOfNum = DataPlant::TypeOf_HeatPumpEIRHeating; + coil2->EIRHPType = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; coil2->companionHeatPumpCoil = nullptr; EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::pairUpCompanionCoils(*state); EXPECT_EQ(coil2, coil1->companionHeatPumpCoil); @@ -168,11 +168,11 @@ TEST_F(EnergyPlusFixture, PairingCompanionCoils) // but what if we can't find a companion! coil1->name = "name1"; coil1->companionCoilName = "name6"; - coil1->plantTypeOfNum = DataPlant::TypeOf_HeatPumpEIRCooling; + coil1->EIRHPType = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; coil1->companionHeatPumpCoil = nullptr; coil2->name = "name2"; coil2->companionCoilName = "name1"; - coil2->plantTypeOfNum = DataPlant::TypeOf_HeatPumpEIRHeating; + coil2->EIRHPType = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; coil2->companionHeatPumpCoil = nullptr; EXPECT_THROW(EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::pairUpCompanionCoils(*state), std::runtime_error); } @@ -181,11 +181,11 @@ TEST_F(EnergyPlusFixture, PairingCompanionCoils) // or what if we find a companion but it's the same coil type coil1->name = "name1"; coil1->companionCoilName = "name2"; - coil1->plantTypeOfNum = DataPlant::TypeOf_HeatPumpEIRCooling; + coil1->EIRHPType = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; coil1->companionHeatPumpCoil = nullptr; coil2->name = "name2"; coil2->companionCoilName = "name1"; - coil2->plantTypeOfNum = DataPlant::TypeOf_HeatPumpEIRCooling; + coil2->EIRHPType = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; coil2->companionHeatPumpCoil = nullptr; EXPECT_THROW(EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::pairUpCompanionCoils(*state), std::runtime_error); } @@ -218,7 +218,7 @@ TEST_F(EnergyPlusFixture, HeatingConstructionFullObjectsNoCompanion) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -228,15 +228,15 @@ TEST_F(EnergyPlusFixture, HeatingConstructionFullObjectsNoCompanion) // validate the heating side EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRHeating, thisHeatingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRHeating, thisHeatingPLHP->EIRHPType)); EXPECT_EQ(nullptr, thisHeatingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisHeatingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisHeatingPLHP->powerRatioFuncTempCurveIndex); EXPECT_EQ(1, thisHeatingPLHP->powerRatioFuncPLRCurveIndex); // calling the factory with an invalid name or type will call ShowFatalError, which will trigger a runtime exception - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP HEATING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP HEATING SIDE"), std::runtime_error); } TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectsNoCompanion) @@ -266,7 +266,7 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectsNoCompanion) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -276,15 +276,15 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectsNoCompanion) // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRCooling, thisCoolingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRCooling, thisCoolingPLHP->EIRHPType)); EXPECT_EQ(nullptr, thisCoolingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisCoolingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncPLRCurveIndex); // calling the factory with an invalid name or type will call ShowFatalError, which will trigger a runtime exception - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); } TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectWithDefaults) @@ -314,7 +314,7 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectWithDefaults) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -324,7 +324,7 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectWithDefaults) // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRCooling, thisCoolingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRCooling, thisCoolingPLHP->EIRHPType)); EXPECT_NEAR(1, thisCoolingPLHP->sizingFactor, 0.001); } @@ -355,7 +355,7 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_WaterSource) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -365,15 +365,15 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_WaterSource) // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRCooling, thisCoolingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRCooling, thisCoolingPLHP->EIRHPType)); EXPECT_EQ(nullptr, thisCoolingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisCoolingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncPLRCurveIndex); // calling the factory with an invalid name or type will call ShowFatalError, which will trigger a runtime exception - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); } TEST_F(EnergyPlusFixture, CatchErrorsOnBadCurves) @@ -396,7 +396,7 @@ TEST_F(EnergyPlusFixture, CatchErrorsOnBadCurves) " dummyCurveC;"}); ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs, it should throw for the bad curves - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"), std::runtime_error); } TEST_F(EnergyPlusFixture, Initialization) @@ -435,7 +435,7 @@ TEST_F(EnergyPlusFixture, Initialization) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // then the source side state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; @@ -443,13 +443,13 @@ TEST_F(EnergyPlusFixture, Initialization) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // the init call expects a "from" calling point PlantLocation myLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -542,7 +542,7 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -591,10 +591,10 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); auto &loop2demandComponent2 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2); - loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop1supplyComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - loop2demandComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + loop1supplyComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop2demandComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop1supplyComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + loop2demandComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; loop1supplyComponent1.Name = thisHeatingPLHP->name; loop2demandComponent1.Name = thisHeatingPLHP->name; @@ -729,7 +729,7 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyHardsizedHeatingWithCompanion) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -777,10 +777,10 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyHardsizedHeatingWithCompanion) auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); auto &loop2demandComponent2 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2); - loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop1supplyComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - loop2demandComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + loop1supplyComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop2demandComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop1supplyComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + loop2demandComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; loop1supplyComponent1.Name = thisHeatingPLHP->name; loop2demandComponent1.Name = thisHeatingPLHP->name; @@ -866,7 +866,7 @@ TEST_F(EnergyPlusFixture, TestSizing_WithCompanionNoPlantSizing) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -906,10 +906,10 @@ TEST_F(EnergyPlusFixture, TestSizing_WithCompanionNoPlantSizing) auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); auto &loop2demandComponent2 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2); - loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop1supplyComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - loop2demandComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + loop1supplyComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop2demandComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop1supplyComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + loop2demandComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; loop1supplyComponent1.Name = thisHeatingPLHP->name; loop2demandComponent1.Name = thisHeatingPLHP->name; @@ -979,7 +979,7 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingError) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1015,8 +1015,8 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingError) auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); auto &loop2demandComponent1 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; + loop1supplyComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop2demandComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; loop1supplyComponent1.Name = thisHeatingPLHP->name; loop2demandComponent1.Name = thisHeatingPLHP->name; @@ -1068,7 +1068,7 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingHardSized) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1104,8 +1104,8 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingHardSized) auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); auto &loop2demandComponent1 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; + loop1supplyComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop2demandComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; loop1supplyComponent1.Name = thisHeatingPLHP->name; loop2demandComponent1.Name = thisHeatingPLHP->name; @@ -1171,10 +1171,10 @@ TEST_F(EnergyPlusFixture, CoolingOutletSetpointWorker) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1195,21 +1195,21 @@ TEST_F(EnergyPlusFixture, CoolingOutletSetpointWorker) PLHPPlantLoadSideLoop.TempSetPointNodeNum = 5; // set up the plant setpoint conditions and test for single setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPoint = 3.141; state->dataLoopNodes->Node(5).TempSetPoint = 2.718; EXPECT_NEAR(3.141, thisCoolingPLHP->getLoadSideOutletSetPointTemp(*state), 0.001); - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CoolingRB; EXPECT_NEAR(2.718, thisCoolingPLHP->getLoadSideOutletSetPointTemp(*state), 0.001); // test for dual setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPointHi = 6.282; state->dataLoopNodes->Node(5).TempSetPointHi = 5.436; EXPECT_NEAR(6.282, thisCoolingPLHP->getLoadSideOutletSetPointTemp(*state), 0.001); - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CoolingRB; EXPECT_NEAR(5.436, thisCoolingPLHP->getLoadSideOutletSetPointTemp(*state), 0.001); } @@ -1249,7 +1249,7 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // then the source side state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; @@ -1257,13 +1257,13 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // the init call expects a "from" calling point PlantLocation myLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1297,7 +1297,7 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.2, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag off, load side flow locked - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.24; state->dataLoopNodes->Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRateMinAvail = 0.0; thisCoolingPLHP->running = false; @@ -1306,8 +1306,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on load side - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; state->dataLoopNodes->Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.2; thisCoolingPLHP->running = true; @@ -1316,8 +1316,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.2, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on source side - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.2; state->dataLoopNodes->Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; @@ -1326,8 +1326,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on both sides - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; state->dataLoopNodes->Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; @@ -1336,8 +1336,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at nonzero both - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.14; state->dataLoopNodes->Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.13; thisCoolingPLHP->running = true; @@ -1376,7 +1376,7 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; @@ -1386,7 +1386,7 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(2).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(2).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; @@ -1399,13 +1399,13 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) auto &PLHPPlantDemandSideComp = state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1); auto &extraPLHPPlantSupplySideComp = state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1); auto &extraPLHPPlantDemandSideComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantSupplySideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - PLHPPlantDemandSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - extraPLHPPlantSupplySideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - extraPLHPPlantDemandSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantSupplySideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + PLHPPlantDemandSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + extraPLHPPlantSupplySideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + extraPLHPPlantDemandSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); EIRPlantLoopHeatPump *thisCoolingPLHP = &state->dataEIRPlantLoopHeatPump->heatPumps[0]; @@ -1494,14 +1494,14 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // then the source side state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; @@ -1509,14 +1509,14 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // the init call expects a "from" calling point PlantLocation myLoadLocation = PlantLocation(1, 2, 1, 1); PlantLocation mySourceLocation = PlantLocation(2, 1, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1628,14 +1628,14 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // then the source side state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; @@ -1643,13 +1643,13 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; // the init call expects a "from" calling point PlantLocation myLoadLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1794,7 +1794,7 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_AirSource) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1805,7 +1805,7 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_AirSource) // validate the heating side EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRHeating, thisHeatingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRHeating, thisHeatingPLHP->EIRHPType)); EXPECT_EQ(thisCoolingPLHP, thisHeatingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisHeatingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisHeatingPLHP->powerRatioFuncTempCurveIndex); @@ -1813,17 +1813,17 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_AirSource) // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRCooling, thisCoolingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRCooling, thisCoolingPLHP->EIRHPType)); EXPECT_EQ(thisHeatingPLHP, thisCoolingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisCoolingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncPLRCurveIndex); // calling the factory with an invalid name or type will call ShowFatalError, which will trigger a runtime exception - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP HEATING SIDE"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP HEATING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); } TEST_F(EnergyPlusFixture, CoolingSimulate_AirSource) @@ -1857,20 +1857,20 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_AirSource) state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // the init call expects a "from" calling point PlantLocation myLoadLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -1974,20 +1974,20 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_AirSource) state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // the init call expects a "from" calling point PlantLocation myLoadLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2103,7 +2103,7 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_AirSource) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2113,15 +2113,15 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_AirSource) // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); - EXPECT_EQ(DataPlant::TypeOf_HeatPumpEIRCooling, thisCoolingPLHP->plantTypeOfNum); + EXPECT_TRUE(compare_enums(DataPlant::PlantEquipmentType::HeatPumpEIRCooling, thisCoolingPLHP->EIRHPType)); EXPECT_EQ(nullptr, thisCoolingPLHP->companionHeatPumpCoil); EXPECT_EQ(1, thisCoolingPLHP->capFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncTempCurveIndex); EXPECT_EQ(1, thisCoolingPLHP->powerRatioFuncPLRCurveIndex); // calling the factory with an invalid name or type will call ShowFatalError, which will trigger a runtime exception - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "fake"), std::runtime_error); - EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "fake"), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP COOLING SIDE"), std::runtime_error); } TEST_F(EnergyPlusFixture, ClearState) @@ -2151,7 +2151,7 @@ TEST_F(EnergyPlusFixture, ClearState) ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); EXPECT_EQ(state->dataEIRPlantLoopHeatPump->heatPumps.size(), 1u); // test that vector is cleared @@ -2195,13 +2195,13 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // the init call expects a "from" calling point PlantLocation myLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2232,7 +2232,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag off, load side flow locked - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.24; thisCoolingPLHP->running = false; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2240,7 +2240,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on load side - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2248,7 +2248,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on source side - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.2; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2256,7 +2256,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(1.29, thisCoolingPLHP->sourceSideMassFlowRate, 0.1); // call with run flag ON, flow locked at zero on both sides - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2264,7 +2264,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at nonzero both - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.14; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2315,7 +2315,7 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2357,8 +2357,8 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); - loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop1supplyComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + loop1supplyComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop1supplyComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; loop1supplyComponent1.Name = thisHeatingPLHP->name; loop1supplyComponent2.Name = thisCoolingPLHP->name; @@ -2479,7 +2479,7 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ ASSERT_TRUE(process_idf(idf_objects)); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2517,8 +2517,8 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); - loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - loop1supplyComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + loop1supplyComponent1.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + loop1supplyComponent2.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; loop1supplyComponent1.Name = thisHeatingPLHP->name; loop1supplyComponent2.Name = thisCoolingPLHP->name; @@ -2654,7 +2654,7 @@ TEST_F(EnergyPlusFixture, Test_DoPhysics) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideLoop = state->dataPlnt->PlantLoop(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // then the source side state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; @@ -2663,10 +2663,10 @@ TEST_F(EnergyPlusFixture, Test_DoPhysics) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(2u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2687,18 +2687,18 @@ TEST_F(EnergyPlusFixture, Test_DoPhysics) PLHPPlantLoadSideLoop.TempSetPointNodeNum = 5; // set up the plant setpoint conditions and test for single setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPoint = 3.141; state->dataLoopNodes->Node(5).TempSetPoint = 2.718; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CoolingRB; // test for dual setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPointHi = 6.282; state->dataLoopNodes->Node(5).TempSetPointHi = 5.436; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CoolingRB; state->dataHVACGlobal->TimeStepSys = 60; @@ -2745,14 +2745,14 @@ TEST_F(EnergyPlusFixture, CoolingMetering) state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // then the source side state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; @@ -2760,13 +2760,13 @@ TEST_F(EnergyPlusFixture, CoolingMetering) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // the init call expects a "from" calling point PlantLocation myLoadLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2846,14 +2846,14 @@ TEST_F(EnergyPlusFixture, HeatingMetering) state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); - state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; - PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; + PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // then the source side state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; @@ -2861,13 +2861,13 @@ TEST_F(EnergyPlusFixture, HeatingMetering) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRHeating; // the init call expects a "from" calling point PlantLocation myLoadLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2952,13 +2952,13 @@ TEST_F(EnergyPlusFixture, TestOperatingFlowRates_FullyAutosized_AirSource) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; // the init call expects a "from" calling point PlantLocation myLocation = PlantLocation(1, 2, 1, 1); // call the factory with a valid name to trigger reading inputs - EIRPlantLoopHeatPump::factory(*state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition EXPECT_EQ(1u, state->dataEIRPlantLoopHeatPump->heatPumps.size()); @@ -2986,7 +2986,7 @@ TEST_F(EnergyPlusFixture, TestOperatingFlowRates_FullyAutosized_AirSource) state->dataPlnt->PlantLoop(1).PlantSizNum = 1; // call with run flag ON, flow locked at nonzero both - state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::FlowLock::Locked; state->dataLoopNodes->Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.14; thisCoolingPLHP->running = true; thisCoolingPLHP->sizeLoadSide(*state); diff --git a/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc b/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc index 04fd5c724bf..839eb5d7224 100644 --- a/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc +++ b/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc @@ -1735,7 +1735,7 @@ TEST_F(EnergyPlusFixture, PipingSystemFullSimulation) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_PipingSystemPipeCircuit; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::PipingSystemPipeCircuit; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = "MY PIPE CIRCUIT"; state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; @@ -1753,7 +1753,8 @@ TEST_F(EnergyPlusFixture, PipingSystemFullSimulation) // first call the factory, it will call GetInput bool initLoopEquip = true; - PlantComponent *thisCircuit = PlantPipingSystemsManager::Circuit::factory(*state, DataPlant::TypeOf_PipingSystemPipeCircuit, "MY PIPE CIRCUIT"); + PlantComponent *thisCircuit = + PlantPipingSystemsManager::Circuit::factory(*state, DataPlant::PlantEquipmentType::PipingSystemPipeCircuit, "MY PIPE CIRCUIT"); EXPECT_EQ(2u, state->dataPlantPipingSysMgr->domains.size()); diff --git a/tst/EnergyPlus/unit/PlantUtilities.unit.cc b/tst/EnergyPlus/unit/PlantUtilities.unit.cc index 7626d0ace16..9fdf9f0b8ec 100644 --- a/tst/EnergyPlus/unit/PlantUtilities.unit.cc +++ b/tst/EnergyPlus/unit/PlantUtilities.unit.cc @@ -102,7 +102,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) // if the component's ON flag is false, then it should return zero flow request no matter the other values thisComponent.ON = false; - thisComponent.CurOpSchemeType = DataPlant::HeatingRBOpSchemeType; // meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::HeatingRB; // meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -114,7 +114,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); - thisComponent.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; // meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::CoolingRB; // meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -126,7 +126,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); - thisComponent.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -138,7 +138,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); - thisComponent.CurOpSchemeType = DataPlant::UncontrolledOpSchemeType; // NOT meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::Uncontrolled; // NOT meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -153,7 +153,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) // if the component's ON flag is true, then it needs to make decisions thisComponent.ON = true; - thisComponent.CurOpSchemeType = DataPlant::HeatingRBOpSchemeType; // meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::HeatingRB; // meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -165,7 +165,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); - thisComponent.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; // meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::CoolingRB; // meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -177,7 +177,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); - thisComponent.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::CompSetPtBased; // meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -189,7 +189,7 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); - thisComponent.CurOpSchemeType = DataPlant::UncontrolledOpSchemeType; // NOT meaningful load + thisComponent.CurOpSchemeType = DataPlant::OpScheme::Uncontrolled; // NOT meaningful load thisComponent.MyLoad = 0.0; returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); @@ -274,7 +274,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, criteriaValue1); EXPECT_EQ(1, criteriaCheckIndex1); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -288,7 +288,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::Temperature, + DataPlant::CriteriaType::Temperature, criteriaValue2); EXPECT_EQ(2, criteriaCheckIndex2); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -302,7 +302,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::HeatTransferRate, + DataPlant::CriteriaType::HeatTransferRate, criteriaValue3); EXPECT_EQ(3, criteriaCheckIndex3); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -320,7 +320,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, criteriaValue1); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -334,7 +334,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::Temperature, + DataPlant::CriteriaType::Temperature, criteriaValue2); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -348,7 +348,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::HeatTransferRate, + DataPlant::CriteriaType::HeatTransferRate, criteriaValue3); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -362,7 +362,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, criteriaValue1); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); @@ -375,7 +375,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::Temperature, + DataPlant::CriteriaType::Temperature, criteriaValue2); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); @@ -388,7 +388,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::HeatTransferRate, + DataPlant::CriteriaType::HeatTransferRate, criteriaValue3); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); @@ -403,7 +403,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::MassFlowRate, + DataPlant::CriteriaType::MassFlowRate, criteriaValue1); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); @@ -417,7 +417,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::Temperature, + DataPlant::CriteriaType::Temperature, criteriaValue2); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); @@ -431,7 +431,7 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, - DataPlant::iCriteriaType::HeatTransferRate, + DataPlant::CriteriaType::HeatTransferRate, criteriaValue3); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); } @@ -547,7 +547,7 @@ TEST_F(EnergyPlusFixture, TestScanPlantLoopsErrorFlagReturnType) state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "comp_name"; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Simple; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::Boiler_Simple; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 0; // just skip the supply side search int loopNum = 0, loopSideNum = 0, branchNum = 0, compNum = 0; @@ -555,7 +555,7 @@ TEST_F(EnergyPlusFixture, TestScanPlantLoopsErrorFlagReturnType) // test simple searching first PlantUtilities::ScanPlantLoopsForObject( - *state, "comp_name", DataPlant::TypeOf_Boiler_Simple, loopNum, loopSideNum, branchNum, compNum, errorFlag); + *state, "comp_name", DataPlant::PlantEquipmentType::Boiler_Simple, loopNum, loopSideNum, branchNum, compNum, errorFlag); EXPECT_EQ(1, loopNum); EXPECT_EQ(1, loopSideNum); EXPECT_EQ(1, branchNum); @@ -564,6 +564,6 @@ TEST_F(EnergyPlusFixture, TestScanPlantLoopsErrorFlagReturnType) // then test to make sure errorFlag is passed by reference PlantUtilities::ScanPlantLoopsForObject( - *state, "comp_name_not_here", DataPlant::TypeOf_Boiler_Simple, loopNum, loopSideNum, branchNum, compNum, errorFlag); + *state, "comp_name_not_here", DataPlant::PlantEquipmentType::Boiler_Simple, loopNum, loopSideNum, branchNum, compNum, errorFlag); EXPECT_TRUE(errorFlag); } diff --git a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc index a3417f43dae..a7470c56e37 100644 --- a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc +++ b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc @@ -554,7 +554,7 @@ TEST_F(EnergyPlusFixture, PIUArrayOutOfBounds) int PIUNum = 1; state->dataPowerInductionUnits->PIU(PIUNum).Name = "Series PIU"; state->dataPowerInductionUnits->PIU(PIUNum).UnitType_Num = DataDefineEquip::iZnAirLoopEquipType::SingleDuct_SeriesPIU_Reheat; - state->dataPowerInductionUnits->PIU(PIUNum).HCoilType_Num = PoweredInductionUnits::iHCoilType::Electric; + state->dataPowerInductionUnits->PIU(PIUNum).HCoilType = PoweredInductionUnits::iHCoilType::Electric; // Go into all of the autosize blocks (aside from Heating/Steam coils) state->dataPowerInductionUnits->PIU(PIUNum).MaxPriAirVolFlow = AutoSize; diff --git a/tst/EnergyPlus/unit/SZVAVModel.unit.cc b/tst/EnergyPlus/unit/SZVAVModel.unit.cc index 365db4b81f9..84420f422d0 100644 --- a/tst/EnergyPlus/unit/SZVAVModel.unit.cc +++ b/tst/EnergyPlus/unit/SZVAVModel.unit.cc @@ -701,7 +701,7 @@ TEST_F(EnergyPlusFixture, SZVAV_FanCoilUnit_Testing) CWLoop.FluidIndex = 1; CWLoop.FluidName = "WATER"; CWLoop.LoopSide(1).Branch(1).Comp(1).Name = CWCoil.Name; - CWLoop.LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + CWLoop.LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 63609db3e5b..90d149d82bc 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -387,7 +387,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineCondEntSetPointManager) thisSPM.LoopIndexDemandSide = condLoopIndex; thisSPM.ChillerIndexDemandSide = chillerBranchCW; thisSPM.BranchIndexDemandSide = chillerCompIndex; - thisSPM.TypeNum = DataPlant::TypeOf_Chiller_Electric; + thisSPM.Type = DataPlant::PlantEquipmentType::Chiller_Electric; // switch: Weighted ratio > 9 && etc... state->dataPlnt->PlantLoop(1).CoolingDemand = 4700; @@ -548,8 +548,8 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) ScheduleManager::UpdateScheduleValues(*state); // CtrlType Bug - // state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::HeatingOp; + // state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::CtrlType::CoolingOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::CtrlType::HeatingOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OnSched; @@ -569,8 +569,8 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).ChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); // CtrlType Bug - // state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp; - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; + // state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::CtrlType::DualOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::CtrlType::CoolingOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state); EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); diff --git a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc index 9d624f06be9..1919e4eb95c 100644 --- a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc +++ b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc @@ -264,7 +264,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; @@ -514,7 +514,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; @@ -763,7 +763,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; @@ -1012,7 +1012,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; @@ -1219,7 +1219,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils5) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSize->PlantSizData(1).DeltaT = 11.0; @@ -1435,7 +1435,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils6) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; diff --git a/tst/EnergyPlus/unit/StandardRatings.unit.cc b/tst/EnergyPlus/unit/StandardRatings.unit.cc index 389a2bd7a82..8d6b3dc0b88 100644 --- a/tst/EnergyPlus/unit/StandardRatings.unit.cc +++ b/tst/EnergyPlus/unit/StandardRatings.unit.cc @@ -254,7 +254,6 @@ TEST_F(EnergyPlusFixture, SingleSpeedHeatingCoilCurveTest) TEST_F(EnergyPlusFixture, ChillerIPLVTestAirCooled) { - using DataPlant::TypeOf_Chiller_ElectricEIR; using StandardRatings::CalcChillerIPLV; // Setup an air-cooled Chiller:Electric:EIR chiller @@ -325,7 +324,7 @@ TEST_F(EnergyPlusFixture, ChillerIPLVTestAirCooled) Real64 IPLV; CalcChillerIPLV(*state, state->dataChillerElectricEIR->ElectricEIRChiller(1).Name, - TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, state->dataChillerElectricEIR->ElectricEIRChiller(1).RefCap, state->dataChillerElectricEIR->ElectricEIRChiller(1).RefCOP, state->dataChillerElectricEIR->ElectricEIRChiller(1).CondenserType, @@ -344,7 +343,6 @@ TEST_F(EnergyPlusFixture, ChillerIPLVTestAirCooled) TEST_F(EnergyPlusFixture, ChillerIPLVTestWaterCooled) { - using DataPlant::TypeOf_Chiller_ElectricEIR; using StandardRatings::CalcChillerIPLV; // Setup a water-cooled Chiller:Electric:EIR chiller with reference conditions being at non-rated conditions @@ -418,7 +416,7 @@ TEST_F(EnergyPlusFixture, ChillerIPLVTestWaterCooled) Real64 IPLV; CalcChillerIPLV(*state, state->dataChillerElectricEIR->ElectricEIRChiller(1).Name, - TypeOf_Chiller_ElectricEIR, + DataPlant::PlantEquipmentType::Chiller_ElectricEIR, state->dataChillerElectricEIR->ElectricEIRChiller(1).RefCap, state->dataChillerElectricEIR->ElectricEIRChiller(1).RefCOP, state->dataChillerElectricEIR->ElectricEIRChiller(1).CondenserType, diff --git a/tst/EnergyPlus/unit/SwimmingPool.unit.cc b/tst/EnergyPlus/unit/SwimmingPool.unit.cc index 18a6a65eb03..1e15b6c93da 100644 --- a/tst/EnergyPlus/unit/SwimmingPool.unit.cc +++ b/tst/EnergyPlus/unit/SwimmingPool.unit.cc @@ -152,10 +152,10 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantLoopIndex) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::SwimmingPool_Indoor; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "FirstPool"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; - state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::SwimmingPool_Indoor; state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).Name = "SecondPool"; state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 11; @@ -202,7 +202,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantNodeFlow) state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::SwimmingPool_Indoor; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "FirstPool"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; diff --git a/tst/EnergyPlus/unit/UnitHeater.unit.cc b/tst/EnergyPlus/unit/UnitHeater.unit.cc index d182405e633..f3818e4a9de 100644 --- a/tst/EnergyPlus/unit/UnitHeater.unit.cc +++ b/tst/EnergyPlus/unit/UnitHeater.unit.cc @@ -1330,7 +1330,7 @@ TEST_F(EnergyPlusFixture, UnitHeater_SimUnitHeaterTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 2b7da9e11bc..929d86e36ec 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -348,7 +348,7 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopCompNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = DataSizing::AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = DataSizing::AutoSize; @@ -374,7 +374,7 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) state->dataSize->PlantSizData(1).ExitTemp = 5.7; state->dataSize->PlantSizData(1).DeltaT = 5.0; state->dataSize->FinalSysSizing(1).MassFlowAtCoolPeak = state->dataSize->FinalSysSizing(1).DesMainVolFlow * state->dataEnvrn->StdRhoAir; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; state->dataSize->DataWaterLoopNum = 1; state->dataFluidProps->NumOfGlycols = 1; @@ -412,7 +412,7 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopCompNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = DataSizing::AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = DataSizing::AutoSize; @@ -422,7 +422,7 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = DataSizing::AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = DataSizing::AutoSize; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; state->dataSize->DataWaterLoopNum = 2; state->dataSize->PlantSizData(2).DeltaT = 5.0; @@ -3139,17 +3139,17 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_WaterCoilSPControl) EXPECT_EQ(thisSys->m_MaxNoCoolHeatAirVolFlow, 0.8); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 10; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 11; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATER HEATING COIL"; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 4; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 5; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).Name = "SUPP WATER HEATING COIL"; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 8; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 9; @@ -3515,7 +3515,7 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_WaterCoilSPControl_Latent) auto coolingCoilWaterOutletNodeIndex = UtilityRoutines::FindItemInList("CHWOUTLETNODE", state->dataLoopNodes->NodeID); // was Node 10 state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = coolingCoilWaterInletNodeIndex; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = coolingCoilWaterOutletNodeIndex; @@ -4331,7 +4331,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem) state->dataWaterCoils->GetWaterCoilsInputFlag = false; state->dataWaterCoils->WaterCoil(1).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; state->dataWaterCoils->WaterCoil(1).Name = "Water Heating Coil"; - state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(1).DesAirVolFlowRate = 1.0; state->dataWaterCoils->WaterCoil(1).MaxWaterVolFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).UACoil = 400.0; @@ -4382,7 +4382,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; thisSys.m_HeatingCoilIndex = 1; @@ -4472,7 +4472,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) state->dataWaterCoils->GetWaterCoilsInputFlag = false; state->dataWaterCoils->WaterCoil(1).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; state->dataWaterCoils->WaterCoil(1).Name = "Water Cooling Coil"; - state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(1).WaterCoilModel = WaterCoils::iCoilModel::CoolingSimple; state->dataWaterCoils->WaterCoil(1).DesAirVolFlowRate = 1.0; state->dataWaterCoils->WaterCoil(1).MaxWaterVolFlowRate = ColdWaterMassFlowRate; @@ -4535,7 +4535,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; thisSys.m_CoolingCoilIndex = 1; @@ -8242,7 +8242,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "SYS 1 HEAT PUMP COOLING MODE"; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 6; state->dataPlnt->PlantLoop(2).Name = "HotWaterLoop"; @@ -8250,7 +8250,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "SYS 1 HEAT PUMP HEATING MODE"; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 9; std::string compName = "UNITARY SYSTEM MODEL"; @@ -8581,7 +8581,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 9; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 10; @@ -8590,7 +8590,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATER HEATING COIL"; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 6; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 7; @@ -12469,12 +12469,12 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_FractionOfAutoSizedCoolingValueTes // DataSizing::NumPltSizInput = 2; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; @@ -12610,12 +12610,12 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_FlowPerCoolingCapacityTest) state->dataSize->ZoneSizingRunDone = true; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; @@ -17680,7 +17680,7 @@ TEST_F(EnergyPlusFixture, CoilSystemCoolingWater_ControlStatusTest) state->dataWaterCoils->CheckEquipName.allocate(1); state->dataWaterCoils->GetWaterCoilsInputFlag = false; state->dataWaterCoils->WaterCoil(1).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(1).WaterCoilModel = WaterCoils::iCoilModel::CoolingSimple; state->dataWaterCoils->WaterCoil(1).DesAirVolFlowRate = 1.0; state->dataWaterCoils->WaterCoil(1).MaxWaterVolFlowRate = ColdWaterMassFlowRate; @@ -17742,7 +17742,7 @@ TEST_F(EnergyPlusFixture, CoilSystemCoolingWater_ControlStatusTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; @@ -17931,7 +17931,7 @@ TEST_F(EnergyPlusFixture, CoilSystemCoolingWater_CalcTest) state->dataWaterCoils->CheckEquipName.allocate(1); state->dataWaterCoils->GetWaterCoilsInputFlag = false; state->dataWaterCoils->WaterCoil(1).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(1).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(1).WaterCoilModel = WaterCoils::iCoilModel::CoolingSimple; state->dataWaterCoils->WaterCoil(1).DesAirVolFlowRate = 1.0; state->dataWaterCoils->WaterCoil(1).MaxWaterVolFlowRate = ColdWaterMassFlowRate; @@ -17993,7 +17993,7 @@ TEST_F(EnergyPlusFixture, CoilSystemCoolingWater_CalcTest) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; thisSys.CoolCoilFluidInletNode = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; @@ -18195,7 +18195,7 @@ TEST_F(EnergyPlusFixture, CoilSystemCoolingWater_HeatRecoveryLoop) state->dataWaterCoils->GetWaterCoilsInputFlag = false; for (int i = 1; i <= 2; ++i) { state->dataWaterCoils->WaterCoil(i).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - state->dataWaterCoils->WaterCoil(i).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(i).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(i).WaterCoilModel = WaterCoils::iCoilModel::CoolingSimple; state->dataWaterCoils->WaterCoil(i).DesAirVolFlowRate = 1.0; state->dataWaterCoils->WaterCoil(i).MaxWaterVolFlowRate = ColdWaterMassFlowRate; @@ -18260,14 +18260,14 @@ TEST_F(EnergyPlusFixture, CoilSystemCoolingWater_HeatRecoveryLoop) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; thisSys.CoolCoilFluidInletNode = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; thisSys.CoolCoilFluidOutletNodeNum = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; thisSys.m_SystemCoolControlNodeNum = thisSys.AirOutNode; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 454ba5b0e45..71ffd3a3de0 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -207,7 +207,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Water Cooling Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; @@ -289,7 +289,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataAirLoop->AirLoopControlInfo(1).UnitarySys = true; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Water Heating Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; @@ -320,7 +320,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataSize->FinalSysSizing(1).MassFlowAtCoolPeak = state->dataSize->FinalSysSizing(1).DesMainVolFlow * state->dataEnvrn->StdRhoAir; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Water Heating Coil 2"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; @@ -441,7 +441,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::HeatingSimple; state->dataWaterCoils->WaterCoil(CoilNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; @@ -597,7 +597,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::HeatingSimple; state->dataWaterCoils->WaterCoil(CoilNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; @@ -756,7 +756,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::HeatingSimple; state->dataWaterCoils->WaterCoil(CoilNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; @@ -873,7 +873,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Simple Water Cooling Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::CoolingSimple; state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; @@ -976,7 +976,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Detailed Water Cooling Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterCooling; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::CoolingDetailed; state->dataWaterCoils->WaterCoil(CoilNum).TubeOutsideSurfArea = 6.23816; @@ -1090,7 +1090,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Detailed Water Cooling Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterDetailedFlatCooling; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::CoolingDetailed; state->dataWaterCoils->WaterCoil(CoilNum).TubeOutsideSurfArea = 6.23816; @@ -1131,7 +1131,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterDetailedFlatCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; @@ -1273,7 +1273,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) int CoilNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Simple Water Heating Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::HeatingSimple; state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; @@ -1373,7 +1373,7 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; state->dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum = 1; state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::iCoilModel::HeatingSimple; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataWaterCoils->WaterCoil(CoilNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn; state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; @@ -1716,20 +1716,20 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterCooling; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLock::Unlocked; state->dataFanCoilUnits->FanCoil(1).CoolCoilLoopNum = 2; state->dataFanCoilUnits->FanCoil(1).HeatCoilLoopNum = 1; diff --git a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc index 62c071ac007..d9398c31d49 100644 --- a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc +++ b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc @@ -2682,7 +2682,7 @@ TEST_F(EnergyPlusFixture, StratifiedTank_GSHP_DesuperheaterSourceHeat) auto &CoilBranch(SupplySideloop.Branch(BranchNum)); CoilBranch.TotalComponents = 1; CoilBranch.Comp.allocate(CompNum); - CoilBranch.Comp(CompNum).TypeOf_Num = 67; + CoilBranch.Comp(CompNum).Type = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; CoilBranch.Comp(CompNum).Name = "GSHP_COIL1"; state->dataGlobal->BeginEnvrnFlag = true; @@ -5352,7 +5352,7 @@ TEST_F(EnergyPlusFixture, setBackupElementCapacityTest) auto &DSup = state->dataWaterThermalTanks->WaterHeaterDesuperheater(1); auto &Tank = state->dataWaterThermalTanks->WaterThermalTank(1); - HPWH.TypeNum = DataPlant::TypeOf_HeatPumpWtrHeaterPumped; + HPWH.HPWHType = DataPlant::PlantEquipmentType::HeatPumpWtrHeaterPumped; // Test 1: Heat Pump Hot Water Heater. BackupHeaterCapacity is negative--should be reset to whatever the tank max capacity is. Tank.HeatPumpNum = 1; @@ -5403,7 +5403,7 @@ TEST_F(EnergyPlusFixture, setBackupElementCapacityTest) EXPECT_NEAR(DSup.BackupElementCapacity, expectedAnswer, allowedTolerance); // Test 6: Wrapped Heat Pump Water Heater. Do not do anything. - HPWH.TypeNum = DataPlant::TypeOf_HeatPumpWtrHeaterWrapped; + HPWH.HPWHType = DataPlant::PlantEquipmentType::HeatPumpWtrHeaterWrapped; Tank.HeatPumpNum = 1; Tank.DesuperheaterNum = 0; Tank.MaxCapacity = 200.0; diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc index 50ddd51ad43..ea8d6c65dc1 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc @@ -228,7 +228,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpTest_SimWaterToAir) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum; bool InitFlag(true); @@ -266,7 +266,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpTest_SimWaterToAir) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPType; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum; state->dataLoopNodes->Node(state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum).Temp = 35.0; diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc index 62d5bc5fec4..fdcdd6e475b 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc @@ -355,8 +355,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestAirFlow) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; @@ -481,8 +480,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestAirFlow) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; @@ -790,8 +788,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestWaterFlowControl) state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).FluidName = "WATER"; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; - state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; @@ -915,8 +912,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestWaterFlowControl) state->dataPlnt->PlantLoop(2).FluidIndex = 1; state->dataPlnt->PlantLoop(2).FluidName = "WATER"; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; - state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Type = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType; state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum;