Skip to content

Commit

Permalink
clangFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
jmythms committed Oct 9, 2021
1 parent b5e8409 commit 48f2c30
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 80 deletions.
4 changes: 2 additions & 2 deletions src/EnergyPlus/HeatBalFiniteDiffManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ namespace HeatBalFiniteDiffManager {

if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) {
{
state.dataHeatBalFiniteDiffMgr->CondFDSchemeType =
static_cast<CondFDScheme>(getEnumerationValue(CondFDSchemeTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1))));
state.dataHeatBalFiniteDiffMgr->CondFDSchemeType = static_cast<CondFDScheme>(
getEnumerationValue(CondFDSchemeTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1))));
if (state.dataHeatBalFiniteDiffMgr->CondFDSchemeType == CondFDScheme::Unassigned) {
ShowSevereError(state,
cCurrentModuleObject + ": invalid " + state.dataIPShortCut->cAlphaFieldNames(1) +
Expand Down
5 changes: 3 additions & 2 deletions src/EnergyPlus/HeatBalanceAirManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,9 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err
}

{
state.dataHeatBal->ZoneAirBalance(Loop).BalanceMethod = static_cast<AirBalance>(getEnumerationValue(
DataHeatBalance::AirBalanceTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum
state.dataHeatBal->ZoneAirBalance(Loop).BalanceMethod = static_cast<AirBalance>(
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,
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/Plant/PlantManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,8 @@ void GetPlantLoopData(EnergyPlusData &state)
if (NumAlphas >= PressSimAlphaIndex) {
MatchedPressureString = false;

this_loop.PressureSimType = static_cast<DataPlant::PressSimType>(getEnumerationValue(PressureSimTypeNamesUC, UtilityRoutines::MakeUPPERCase(Alpha(PressSimAlphaIndex))));
this_loop.PressureSimType = static_cast<DataPlant::PressSimType>(
getEnumerationValue(PressureSimTypeNamesUC, UtilityRoutines::MakeUPPERCase(Alpha(PressSimAlphaIndex))));
switch (this_loop.PressureSimType) {
// Check all types
case DataPlant::PressSimType::NoPressure:
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/PlantCondLoopOperation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,8 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration)
auto &this_equip_list(this_op_scheme.EquipList(ListNum));
for (int EquipNum = 1, EquipNum_end = this_equip_list.NumComps; EquipNum <= EquipNum_end; ++EquipNum) {
auto &this_equip(this_equip_list.Comp(EquipNum));
Type = static_cast<DataPlant::PlantEquipmentType>(getEnumerationValue(PlantEquipTypeNames, UtilityRoutines::MakeUPPERCase(this_equip.TypeOf)));
Type = static_cast<DataPlant::PlantEquipmentType>(
getEnumerationValue(PlantEquipTypeNames, UtilityRoutines::MakeUPPERCase(this_equip.TypeOf)));
errFlag1 = false;
PlantUtilities::ScanPlantLoopsForObject(state,
this_equip.Name,
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/RoomAirModelManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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, UtilityRoutines::MakeUPPERCase(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<DataHeatBalance::IntGainType>(TypeNum);
Expand Down
7 changes: 4 additions & 3 deletions src/EnergyPlus/UserDefinedComponents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@ namespace UserDefinedComponents {

{
state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed =
static_cast<DataPlant::HowMet>(getEnumerationValue(DataPlant::HowMetTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 2))));
static_cast<DataPlant::HowMet>(
getEnumerationValue(DataPlant::HowMetTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 2))));
if (state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed ==
DataPlant::HowMet::ByNominalCapLowOutLimit) {
// actuator for low out limit
Expand All @@ -667,8 +668,8 @@ namespace UserDefinedComponents {

{
state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).FlowPriority =
static_cast<DataPlant::LoopFlowStatus>(
getEnumerationValue(DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 3))));
static_cast<DataPlant::LoopFlowStatus>(getEnumerationValue(
DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 3))));
}

// find program manager for initial setup, begin environment and sizing of this plant connection
Expand Down
121 changes: 63 additions & 58 deletions src/EnergyPlus/WaterThermalTanks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4267,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.WaterThermalTankType == DataPlant::PlantEquipmentType::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;
Expand Down Expand Up @@ -5037,44 +5038,43 @@ void WaterThermalTankData::setupZoneInternalGains(EnergyPlusData &state)
if (this->AmbientTempZone > 0) {
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;

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;
}
}
}
Expand Down Expand Up @@ -6002,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->WaterThermalTankType, 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).");
Expand Down Expand Up @@ -9007,8 +9012,8 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c
state.dataHVACGlobal->HPWHInletDBTemp > HeatPump.MaxAirTempForHPOperation || HPSetPointTemp >= this->TankTempLimit ||
(!HeatPump.AllowHeatingElementAndHeatPumpToRunAtSameTime && this->WaterThermalTankType == DataPlant::PlantEquipmentType::WtrHeaterMixed &&
this->SavedMode == state.dataWaterThermalTanks->heatMode) ||
(!HeatPump.AllowHeatingElementAndHeatPumpToRunAtSameTime && this->WaterThermalTankType == DataPlant::PlantEquipmentType::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) {
Expand Down Expand Up @@ -9284,14 +9289,14 @@ 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
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 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;
state.dataLoopNodes->Node(HPWaterOutletNode).MassFlowRate = 0.0;
Expand Down Expand Up @@ -9690,13 +9695,13 @@ 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
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 (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) {
SpeedNum = i;
Expand Down
Loading

5 comments on commit 48f2c30

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enumsDataPlant (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3218 of 3218 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enumsDataPlant (jmythms) - Win64-Windows-10-VisualStudio-16: OK (2423 of 2423 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enumsDataPlant (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1710 of 1710 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enumsDataPlant (jmythms) - x86_64-MacOS-10.15-clang-11.0.0: OK (3177 of 3177 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enumsDataPlant (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (737 of 737 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.