Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
lgu1234 committed May 10, 2023
1 parent b5424bd commit e86f452
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 85 deletions.
13 changes: 7 additions & 6 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4537,7 +4537,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound)
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxCoolAirVolFlow != DataSizing::AutoSize) {
for (int i = 1; i <= state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedCooling; ++i) {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolMassFlowRate[i] =
state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i-1);
state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i - 1);
}
}
}
Expand All @@ -4552,7 +4552,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound)
}
}
}
ShowWarningError(state, cCurrentModuleObject + " = " + thisVrfTU.Name + " with Fan:SystemModel is used in " + cAlphaArgs(8) + "\"");
ShowWarningError(state,
cCurrentModuleObject + " = " + thisVrfTU.Name + " with Fan:SystemModel is used in " + cAlphaArgs(8) + "\"");
ShowContinueError(state, format("...The number of speed = {:.0R}.", double(NumSpeeds)));
ShowContinueError(state, "...Multiple speed fan will be appiled to this unit. The speed number is determined by load.");
}
Expand Down Expand Up @@ -9488,7 +9489,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state,

if (SpeedNum == 1) {
this->SpeedRatio = 0.0;
}
}
auto f = [&state, VRFTUNum, FirstHVACIteration, QZnReq, OnOffAirFlowRatio](Real64 const PartLoadRatio) {
Real64 QZnReqTemp = QZnReq; // denominator representing zone load (W)
Real64 ActualOutput; // delivered capacity of VRF terminal unit
Expand Down Expand Up @@ -9523,7 +9524,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state,
this->SpeedRatio = 0.0;
if (SolFla > 0 && PartLoadRatio <= 1.0) break;
} else {
this->CycRatio = 1.0;
this->CycRatio = 1.0;
this->SpeedRatio = PartLoadRatio;
if (SolFla > 0 && PartLoadRatio <= 1.0) break;
}
Expand Down Expand Up @@ -9636,7 +9637,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state,
}
}
if (FullOutput - NoCompOutput == 0.0) {
PartLoadRatio = 0.0;
PartLoadRatio = 0.0;
} else {
PartLoadRatio = min(1.0, max(MinPLF, std::abs(QZnReq - NoCompOutput) / std::abs(FullOutput - NoCompOutput)));
}
Expand Down Expand Up @@ -10191,7 +10192,7 @@ void SetAverageAirFlow(EnergyPlusData &state,
} else {
state.dataHVACVarRefFlow->FanSpeedRatio = state.dataHVACVarRefFlow->CompOnFlowRatio;
}
}
}

// if the terminal unit and fan are scheduled on then set flow rate
if (GetCurrentScheduleValue(state, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SchedPtr) > 0.0 &&
Expand Down
110 changes: 55 additions & 55 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -701,61 +701,61 @@ namespace HVACVariableRefrigerantFlow {
bool SuppHeatingCoilPresent = false; // FALSE if coil not present
std::string AvailManagerListName; // Name of an availability manager list object
int AvailStatus = 0;
Real64 TerminalUnitSensibleRate = 0.0; // sensible cooling/heating rate of VRF terminal unit (W)
Real64 TerminalUnitLatentRate = 0.0; // latent dehumidification/humidification rate of VRF terminal unit (W)
Real64 TotalCoolingRate = 0.0; // report variable for total cooling rate (W)
Real64 TotalHeatingRate = 0.0; // report variable for total heating rate (W)
Real64 SensibleCoolingRate = 0.0; // report variable for sensible cooling rate (W)
Real64 SensibleHeatingRate = 0.0; // report variable for sensible heating rate (W)
Real64 LatentCoolingRate = 0.0; // report variable for latent cooling rate (W)
Real64 LatentHeatingRate = 0.0; // report variable for latent heating rate (W)
Real64 TotalCoolingEnergy = 0.0; // report variable for total cooling energy (J)
Real64 TotalHeatingEnergy = 0.0; // report variable for total heating energy (J)
Real64 SensibleCoolingEnergy = 0.0; // report variable for sensible cooling energy (J)
Real64 SensibleHeatingEnergy = 0.0; // report variable for sensible heating energy (J)
Real64 LatentCoolingEnergy = 0.0; // report variable for latent cooling energy (J)
Real64 LatentHeatingEnergy = 0.0; // report variable for latent heating energy (J)
bool EMSOverridePartLoadFrac = false; // User defined EMS function
Real64 EMSValueForPartLoadFrac = 0.0; // user defined value for EMS function
int IterLimitExceeded = 0; // index used for warning messages
int FirstIterfailed = 0; // index used for warning messages
int HVACSizingIndex = 0; // index of a HVACSizing object for a VRF terminal
bool ATMixerExists = false; // True if there is an ATMixer
std::string ATMixerName; // name of air terminal mixer
int ATMixerIndex = 0; // index to the air terminal mixer
int ATMixerType = 0; // 1 = inlet side mixer, 2 = supply side mixer
int ATMixerPriNode = 0; // primary inlet air node number for the air terminal mixer
int ATMixerSecNode = 0; // secondary air inlet node number for the air terminal mixer
int ATMixerOutNode = 0; // outlet air node number for the air terminal mixer
int SuppHeatCoilAirInletNode = 0; // supplemental heating coil air inlet node
int SuppHeatCoilAirOutletNode = 0; // supplemental heating coil air outlet node
int SuppHeatCoilFluidInletNode = 0; // supplemental heating coil fluid inlet node
int SuppHeatCoilFluidOutletNode = 0; // supplemental heating coil fluid outlet node
bool firstPass = true; // used to reset global sizing data
PlantLocation SuppHeatCoilPlantLoc{}; // supplemental heating coil plant component index
Real64 coilInNodeT = 0.0; // coil inlet node temp at full flow (C)
Real64 coilInNodeW = 0.0; // coil inlet node humidity ratio at full flow (kg/kg)
int fanInletNode = 0; // fan inlet node index
int fanOutletNode = 0; // fan outlet node index
bool MySuppCoilPlantScanFlag = true; // flag used to initialize plant comp for water and steam heating coils
int airLoopNum = 0; // index to air loop
bool isInOASys = false; // true if TU is configured in outside air system
bool isInAirLoop = false; // true if TU is configured in an air loop
bool isInZone = false; // true if TU is configured as zone equipment
bool isSetPointControlled = false; // TU is controlled via setpoint instead of the standard load control
bool coolSPActive = false; // set point controlled cooling coil active (needs to operate)
bool heatSPActive = false; // set point controlled heating coil active (needs to operate)
Real64 coolLoadToSP = 0.0; // load to set point in cooling mode
Real64 heatLoadToSP = 0.0; // load to set point in heating mode
Real64 coilTempSetPoint = 0.0; // coil control temperature
Real64 suppTempSetPoint = 0.0; // supplemental heating coil control temperature
Real64 controlZoneMassFlowFrac = 1.0; // ratio of control zone air mass flow rate to total zone air mass flow rate
int zoneSequenceCoolingNum = 0; // zone equipment cooling sequence
int zoneSequenceHeatingNum = 0; // zone equipment heating sequence
int coolCoilAirInNode = 0; // cooling coil air inlet node number
int coolCoilAirOutNode = 0; // cooling coil air outlet node number
int heatCoilAirInNode = 0; // heating coil air inlet node number
int heatCoilAirOutNode = 0; // heating coil air outlet node number
Real64 TerminalUnitSensibleRate = 0.0; // sensible cooling/heating rate of VRF terminal unit (W)
Real64 TerminalUnitLatentRate = 0.0; // latent dehumidification/humidification rate of VRF terminal unit (W)
Real64 TotalCoolingRate = 0.0; // report variable for total cooling rate (W)
Real64 TotalHeatingRate = 0.0; // report variable for total heating rate (W)
Real64 SensibleCoolingRate = 0.0; // report variable for sensible cooling rate (W)
Real64 SensibleHeatingRate = 0.0; // report variable for sensible heating rate (W)
Real64 LatentCoolingRate = 0.0; // report variable for latent cooling rate (W)
Real64 LatentHeatingRate = 0.0; // report variable for latent heating rate (W)
Real64 TotalCoolingEnergy = 0.0; // report variable for total cooling energy (J)
Real64 TotalHeatingEnergy = 0.0; // report variable for total heating energy (J)
Real64 SensibleCoolingEnergy = 0.0; // report variable for sensible cooling energy (J)
Real64 SensibleHeatingEnergy = 0.0; // report variable for sensible heating energy (J)
Real64 LatentCoolingEnergy = 0.0; // report variable for latent cooling energy (J)
Real64 LatentHeatingEnergy = 0.0; // report variable for latent heating energy (J)
bool EMSOverridePartLoadFrac = false; // User defined EMS function
Real64 EMSValueForPartLoadFrac = 0.0; // user defined value for EMS function
int IterLimitExceeded = 0; // index used for warning messages
int FirstIterfailed = 0; // index used for warning messages
int HVACSizingIndex = 0; // index of a HVACSizing object for a VRF terminal
bool ATMixerExists = false; // True if there is an ATMixer
std::string ATMixerName; // name of air terminal mixer
int ATMixerIndex = 0; // index to the air terminal mixer
int ATMixerType = 0; // 1 = inlet side mixer, 2 = supply side mixer
int ATMixerPriNode = 0; // primary inlet air node number for the air terminal mixer
int ATMixerSecNode = 0; // secondary air inlet node number for the air terminal mixer
int ATMixerOutNode = 0; // outlet air node number for the air terminal mixer
int SuppHeatCoilAirInletNode = 0; // supplemental heating coil air inlet node
int SuppHeatCoilAirOutletNode = 0; // supplemental heating coil air outlet node
int SuppHeatCoilFluidInletNode = 0; // supplemental heating coil fluid inlet node
int SuppHeatCoilFluidOutletNode = 0; // supplemental heating coil fluid outlet node
bool firstPass = true; // used to reset global sizing data
PlantLocation SuppHeatCoilPlantLoc{}; // supplemental heating coil plant component index
Real64 coilInNodeT = 0.0; // coil inlet node temp at full flow (C)
Real64 coilInNodeW = 0.0; // coil inlet node humidity ratio at full flow (kg/kg)
int fanInletNode = 0; // fan inlet node index
int fanOutletNode = 0; // fan outlet node index
bool MySuppCoilPlantScanFlag = true; // flag used to initialize plant comp for water and steam heating coils
int airLoopNum = 0; // index to air loop
bool isInOASys = false; // true if TU is configured in outside air system
bool isInAirLoop = false; // true if TU is configured in an air loop
bool isInZone = false; // true if TU is configured as zone equipment
bool isSetPointControlled = false; // TU is controlled via setpoint instead of the standard load control
bool coolSPActive = false; // set point controlled cooling coil active (needs to operate)
bool heatSPActive = false; // set point controlled heating coil active (needs to operate)
Real64 coolLoadToSP = 0.0; // load to set point in cooling mode
Real64 heatLoadToSP = 0.0; // load to set point in heating mode
Real64 coilTempSetPoint = 0.0; // coil control temperature
Real64 suppTempSetPoint = 0.0; // supplemental heating coil control temperature
Real64 controlZoneMassFlowFrac = 1.0; // ratio of control zone air mass flow rate to total zone air mass flow rate
int zoneSequenceCoolingNum = 0; // zone equipment cooling sequence
int zoneSequenceHeatingNum = 0; // zone equipment heating sequence
int coolCoilAirInNode = 0; // cooling coil air inlet node number
int coolCoilAirOutNode = 0; // cooling coil air outlet node number
int heatCoilAirInNode = 0; // heating coil air inlet node number
int heatCoilAirOutNode = 0; // heating coil air outlet node number
std::string DesignSpecMultispeedHPType; // Multiuple performance object type
std::string DesignSpecMultispeedHPName; // Multiuple performance object name
int DesignSpecMSHPIndex = -1; // Multiuple performance index
Expand Down
49 changes: 25 additions & 24 deletions src/EnergyPlus/UnitarySystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3080,18 +3080,18 @@ namespace UnitarySystems {
if (this->m_NumOfSpeedCooling > 1) {
int FanIndex = this->m_FanIndex;
for (int i = 1; i <= this->m_NumOfSpeedCooling; ++i) {
if (this->m_DesignSpecMSHPIndex > -1) {
if (state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] ==
DataSizing::AutoSize) {
this->m_CoolVolumeFlowRate[i] = double(i) / double(this->m_NumOfSpeedCooling) * AirFlowRate;
} else {
this->m_CoolVolumeFlowRate[i] =
state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] * AirFlowRate;
}
if (this->m_DesignSpecMSHPIndex > -1) {
if (state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] ==
DataSizing::AutoSize) {
this->m_CoolVolumeFlowRate[i] = double(i) / double(this->m_NumOfSpeedCooling) * AirFlowRate;
} else {
this->m_CoolVolumeFlowRate[i] =
state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i - 1) / state.dataEnvrn->StdRhoAir;
state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] * AirFlowRate;
}
} else {
this->m_CoolVolumeFlowRate[i] =
state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i - 1) / state.dataEnvrn->StdRhoAir;
}
this->m_CoolMassFlowRate[i] = this->m_CoolVolumeFlowRate[i] * state.dataEnvrn->StdRhoAir;
}
}
Expand Down Expand Up @@ -11846,26 +11846,26 @@ namespace UnitarySystems {
} break;
case DataHVACGlobals::Coil_CoolingWaterToAirHPSimple: {
// WSHP coils do not have a PLF curve and do not adjust fan performance
bool errFlag = false;
this->heatPumpRunFrac(PartLoadRatio, errFlag, this->m_WSHPRuntimeFrac);
if (PartLoadRatio > 0.0 && this->m_WSHPRuntimeFrac > 0.0 && this->m_FanOpMode == DataHVACGlobals::CycFanCycCoil &&
this->m_sysType != SysType::PackagedWSHP) {
state.dataHVACGlobal->OnOffFanPartLoadFraction = PartLoadRatio / this->m_WSHPRuntimeFrac;
}


WaterToAirHeatPumpSimple::SimWatertoAirHPSimple(state,
blankString,
this->m_CoolingCoilIndex,
this->m_CoolingCoilSensDemand,
this->m_CoolingCoilLatentDemand,
this->m_FanOpMode,
this->m_WSHPRuntimeFrac,
this->m_MaxONOFFCyclesperHour,
this->m_HPTimeConstant,
this->m_FanDelayTime,
CompressorOn,
PartLoadRatio,
FirstHVACIteration);
WaterToAirHeatPumpSimple::SimWatertoAirHPSimple(state,
blankString,
this->m_CoolingCoilIndex,
this->m_CoolingCoilSensDemand,
this->m_CoolingCoilLatentDemand,
this->m_FanOpMode,
this->m_WSHPRuntimeFrac,
this->m_MaxONOFFCyclesperHour,
this->m_HPTimeConstant,
this->m_FanDelayTime,
CompressorOn,
PartLoadRatio,
FirstHVACIteration);
} break;
case DataHVACGlobals::Coil_CoolingWaterToAirHP: {
bool errFlag = false;
Expand Down Expand Up @@ -12059,6 +12059,7 @@ namespace UnitarySystems {
} break;
case DataHVACGlobals::Coil_HeatingWaterToAirHPSimple: {
// WSHP coils do not have a PLF curve and do not adjust fan performance
bool errFlag = false;
this->heatPumpRunFrac(PartLoadRatio, errFlag, this->m_WSHPRuntimeFrac);
if (PartLoadRatio > 0.0 && this->m_WSHPRuntimeFrac > 0.0 && this->m_FanOpMode == DataHVACGlobals::CycFanCycCoil &&
this->m_sysType != SysType::PackagedWSHP) { // used to match up to PTUnit results
Expand Down Expand Up @@ -15913,7 +15914,7 @@ namespace UnitarySystems {
this->m_ElecPower = locFanElecPower;
this->m_ElecPowerConsumption = this->m_ElecPower * ReportingConstant;
} break;
// May not need
// May not need
case DataHVACGlobals::Coil_CoolingWaterToAirHPSimple: {
if (this->m_NumOfSpeedCooling > 1) {
this->m_CycRatio = max(this->m_CoolingCycRatio, this->m_HeatingCycRatio);
Expand Down

4 comments on commit e86f452

@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.

MultispeedFans (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3434 of 3450 tests passed, 67 test warnings)

Messages:\n

  • 32 tests had: MTD diffs.
  • 79 tests had: RDD diffs.
  • 2 tests had: EDD diffs.
  • 17 tests had: MDD diffs.
  • 13 tests had: Table big diffs.
  • 1 test had: AUD diffs.
  • 2 tests had: ESO big diffs.

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1410
  • Failed: 1

regression Test Summary

  • Passed: 778
  • Failed: 15

Build Badge Test 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.

MultispeedFans (lgu1234) - x86_64-MacOS-10.17-clang-13.0.0: OK (3393 of 3409 tests passed, 67 test warnings)

Messages:\n

  • 32 tests had: MTD diffs.
  • 79 tests had: RDD diffs.
  • 2 tests had: EDD diffs.
  • 17 tests had: MDD diffs.
  • 13 tests had: Table big diffs.
  • 1 test had: AUD diffs.
  • 2 tests had: ESO big diffs.

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1410
  • Failed: 1

regression Test Summary

  • Passed: 758
  • Failed: 15

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.

MultispeedFans (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1860 of 1861 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1410
  • Failed: 1

Build Badge Test Badge Coverage Badge

@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.

MultispeedFans (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (777 of 778 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 777
  • Failed: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.