Skip to content

Commit

Permalink
Use parenthesis for HysteresisModel conditions that clang-format 17 i…
Browse files Browse the repository at this point in the history
…s treating as a template param
  • Loading branch information
jmarrec committed Dec 22, 2023
1 parent 34493f7 commit e233def
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/EnergyPlus/PhaseChangeModeling/HysteresisModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ namespace HysteresisPhaseChange {
phaseChangeState = PhaseChangeStates::FREEZING;
this->enthNew =
this->getEnthalpy(updatedTempTDT, this->peakTempFreezing, this->deltaTempFreezingLow, this->deltaTempFreezingHigh);
} else if (this->enthNew > this->enthalpyM && this->enthNew < this->enthalpyF) {
} else if ((this->enthNew < this->enthalpyF) && (this->enthNew > this->enthalpyM)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew = (this->specHeatTransition * updatedTempTDT) + (this->enthOld - (this->specHeatTransition * prevTempTD));
} else if (this->enthNew < this->enthalpyF && updatedTempTDT > phaseChangeTempReverse) {
} else if ((this->enthNew < this->enthalpyF) && (updatedTempTDT > phaseChangeTempReverse)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew =
(this->specHeatTransition * updatedTempTDT) + (this->enthRev - (this->specHeatTransition * phaseChangeTempReverse));
} else if (this->enthNew <= this->enthalpyM && updatedTempTDT <= phaseChangeTempReverse) {
} else if ((this->enthNew <= this->enthalpyM) && (updatedTempTDT <= phaseChangeTempReverse)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew =
(this->specHeatTransition * updatedTempTDT) + (this->enthRev - (this->specHeatTransition * phaseChangeTempReverse));
Expand All @@ -191,11 +191,11 @@ namespace HysteresisPhaseChange {
this->enthNew = (this->specHeatTransition * updatedTempTDT) + (this->enthOld - (this->specHeatTransition * prevTempTD));
this->enthalpyM = this->getEnthalpy(updatedTempTDT, this->peakTempMelting, this->deltaTempMeltingLow, this->deltaTempMeltingHigh);
this->enthalpyF = this->getEnthalpy(updatedTempTDT, this->peakTempMelting, this->deltaTempMeltingLow, this->deltaTempMeltingHigh);
if (this->enthNew > this->enthalpyF && updatedTempTDT < phaseChangeTempReverse) {
if ((updatedTempTDT < phaseChangeTempReverse) && (this->enthNew > this->enthalpyF)) {
phaseChangeState = PhaseChangeStates::FREEZING;
this->enthNew =
this->getEnthalpy(updatedTempTDT, this->peakTempFreezing, this->deltaTempFreezingLow, this->deltaTempFreezingHigh);
} else if (this->enthNew > this->enthalpyM && this->enthNew < this->enthalpyF &&
} else if ((this->enthNew < this->enthalpyF) && (this->enthNew > this->enthalpyM) &&
(updatedTempTDT < prevTempTD || updatedTempTDT > prevTempTD)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew =
Expand All @@ -211,7 +211,7 @@ namespace HysteresisPhaseChange {
this->enthNew = (this->specHeatTransition * updatedTempTDT) + (this->enthRev - (this->specHeatTransition * phaseChangeTempReverse));
this->enthalpyM = this->getEnthalpy(updatedTempTDT, this->peakTempMelting, this->deltaTempMeltingLow, this->deltaTempMeltingHigh);
this->enthalpyF = this->getEnthalpy(updatedTempTDT, this->peakTempFreezing, this->deltaTempFreezingLow, this->deltaTempFreezingHigh);
if (this->enthNew > this->enthalpyM && this->enthNew < this->enthalpyF) {
if ((this->enthNew < this->enthalpyF) && (this->enthNew > this->enthalpyM)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew =
(this->specHeatTransition * updatedTempTDT) + (this->enthRev - (this->specHeatTransition * phaseChangeTempReverse));
Expand All @@ -223,14 +223,14 @@ namespace HysteresisPhaseChange {
this->enthNew = (this->specHeatTransition * updatedTempTDT) + (this->enthOld - (this->specHeatTransition * prevTempTD));
this->enthalpyM = this->getEnthalpy(updatedTempTDT, this->peakTempMelting, this->deltaTempMeltingLow, this->deltaTempMeltingHigh);
this->enthalpyF = this->getEnthalpy(updatedTempTDT, this->peakTempFreezing, this->deltaTempFreezingLow, this->deltaTempFreezingHigh);
if (this->enthNew < this->enthOld && updatedTempTDT < prevTempTD) {
if ((this->enthNew < this->enthOld) && (updatedTempTDT < prevTempTD)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew = (this->specHeatTransition * updatedTempTDT) + (this->enthOld - (this->specHeatTransition * prevTempTD));
} else if (this->enthNew > this->enthalpyM && this->enthNew < this->enthalpyF && updatedTempTDT < prevTempTD) {
} else if ((this->enthNew < this->enthalpyF) && (this->enthNew > this->enthalpyM) && (updatedTempTDT < prevTempTD)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew =
(this->specHeatTransition * updatedTempTDT) + (this->enthRev - (this->specHeatTransition * phaseChangeTempReverse));
} else if (this->enthNew >= this->enthalpyF && updatedTempTDT <= phaseChangeTempReverse) {
} else if ((this->enthNew >= this->enthalpyF) && (updatedTempTDT <= phaseChangeTempReverse)) {
phaseChangeState = PhaseChangeStates::TRANSITION;
this->enthNew =
(this->specHeatTransition * updatedTempTDT) + (this->enthRev - (this->specHeatTransition * phaseChangeTempReverse));
Expand Down

5 comments on commit e233def

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

GCC13-fixes (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3587 of 3587 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.

GCC13-fixes (jmarrec) - Win64-Windows-10-VisualStudio-16: OK (2759 of 2759 tests passed, 0 test warnings)

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.

GCC13-fixes (jmarrec) - x86_64-MacOS-10.17-clang-14.0.0: OK (3546 of 3546 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.

GCC13-fixes (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (790 of 790 tests passed, 0 test warnings)

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

GCC13-fixes (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1972 of 1972 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.