Skip to content

Commit

Permalink
Merge pull request #9053 from NREL/enumsDataPlant
Browse files Browse the repository at this point in the history
Conversion to enum class - DataPlant::PlantEquipmentType
  • Loading branch information
Myoldmopar authored Nov 2, 2021
2 parents d8602da + 7ca2499 commit 1ce2365
Show file tree
Hide file tree
Showing 199 changed files with 5,157 additions and 4,484 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ namespace AirLoopHVACDOAS {
}
PlantUtilities::ScanPlantLoopsForObject(state,
CompName,
DataPlant::TypeOf_CoilWaterCooling,
DataPlant::PlantEquipmentType::CoilWaterCooling,
thisDOAS.CWLoopNum,
thisDOAS.CWLoopSide,
thisDOAS.CWBranchNum,
Expand Down Expand Up @@ -536,7 +536,7 @@ namespace AirLoopHVACDOAS {
}
PlantUtilities::ScanPlantLoopsForObject(state,
CompName,
DataPlant::TypeOf_CoilWaterSimpleHeating,
DataPlant::PlantEquipmentType::CoilWaterSimpleHeating,
thisDOAS.HWLoopNum,
thisDOAS.HWLoopSide,
thisDOAS.HWBranchNum,
Expand Down Expand Up @@ -576,7 +576,7 @@ namespace AirLoopHVACDOAS {
}
PlantUtilities::ScanPlantLoopsForObject(state,
CompName,
DataPlant::TypeOf_CoilWaterDetailedFlatCooling,
DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling,
thisDOAS.CWLoopNum,
thisDOAS.CWLoopSide,
thisDOAS.CWBranchNum,
Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/BaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 8 additions & 7 deletions src/EnergyPlus/BaseboardRadiator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/Plant/DataPlant.hh>

namespace EnergyPlus {

Expand All @@ -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;
Expand Down Expand Up @@ -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)
{
}
};
Expand Down
49 changes: 26 additions & 23 deletions src/EnergyPlus/BoilerSteam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
}
Expand All @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/EnergyPlus/Boilers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand All @@ -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;
}

Expand Down
Loading

0 comments on commit 1ce2365

Please sign in to comment.