Skip to content

Commit

Permalink
Correct VAV maximum air flow fraction during reheat
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Sep 24, 2024
1 parent e7ecb2d commit 90f2846
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
12 changes: 9 additions & 3 deletions src/EnergyPlus/SingleDuct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2877,8 +2877,10 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state)

CheckZoneSizing(state, this->sysType, this->SysName);

MaxAirVolFlowRateDes = max(state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesCoolVolFlow,
state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlow);
Real64 heatingMaxFlow = (this->DamperHeatingAction == Action::ReverseWithLimits)
? state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlowMax
: state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlow;
MaxAirVolFlowRateDes = max(state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesCoolVolFlow, heatingMaxFlow);

if (MaxAirVolFlowRateDes < SmallAirVolFlow) {
MaxAirVolFlowRateDes = 0.0;
Expand Down Expand Up @@ -2927,7 +2929,11 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state)
}
} else {
CheckZoneSizing(state, this->sysType, this->SysName);
MaxHeatAirVolFlowRateDes = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlow;
if (this->DamperHeatingAction == Action::ReverseWithLimits) {
MaxHeatAirVolFlowRateDes = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlowMax;
} else {
MaxHeatAirVolFlowRateDes = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlow;
}
if (MaxHeatAirVolFlowRateDes < SmallAirVolFlow) {
MaxHeatAirVolFlowRateDes = 0.0;
}
Expand Down
39 changes: 34 additions & 5 deletions tst/EnergyPlus/unit/SingleDuct.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2737,23 +2737,52 @@ TEST_F(EnergyPlusFixture, VAVReheatTerminal_SizeMinFrac)
EXPECT_TRUE(compare_err_stream(""));

int SysNum = 1;
auto &thisSys = state->dataSingleDuct->sd_airterminal(SysNum);

// First test - design min flow < max flow
state->dataSize->ZoneSizingRunDone = true;
state->dataSize->CurZoneEqNum = 1;
state->dataSize->CurTermUnitSizingNum = 1;
state->dataSize->TermUnitFinalZoneSizing(1).DesCoolVolFlowMin = 0.5;
state->dataSingleDuct->sd_airterminal(SysNum).SizeSys(*state);
EXPECT_EQ(0.5, state->dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes);
thisSys.SizeSys(*state);
EXPECT_EQ(0.5, thisSys.ZoneMinAirFracDes);

// Second test - design min flow > max flow
state->dataSize->ZoneSizingRunDone = true;
state->dataSize->CurZoneEqNum = 1;
state->dataSize->CurTermUnitSizingNum = 1;
state->dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = AutoSize; // need to reset this so it sizes again
thisSys.ZoneMinAirFracDes = AutoSize; // need to reset this so it sizes again
state->dataSize->TermUnitFinalZoneSizing(1).DesCoolVolFlowMin = 1.5;
state->dataSingleDuct->sd_airterminal(SysNum).SizeSys(*state);
EXPECT_EQ(1.0, state->dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes);
thisSys.SizeSys(*state);
EXPECT_EQ(1.0, thisSys.ZoneMinAirFracDes);

// test Maximum Flow Fraction During Reheat for heating dominated
thisSys.MaxAirVolFlowRate = DataSizing::AutoSize;
thisSys.ZoneMinAirFracDes = DataSizing::AutoSize;
thisSys.MaxAirVolFlowRateDuringReheat = DataSizing::AutoSize;
thisSys.MaxAirVolFractionDuringReheat = DataSizing::AutoSize;
state->dataSize->TermUnitFinalZoneSizing(1).DesHeatVolFlow = 1.7;
state->dataSize->TermUnitFinalZoneSizing(1).DesHeatVolFlowMax = 1.6;
thisSys.SizeSys(*state);
Real64 expectedZoneMinAirFracDes = std::min(1.0, state->dataSize->TermUnitFinalZoneSizing(1).DesCoolVolFlowMin / thisSys.MaxAirVolFlowRate);
Real64 expectedMaxAirVolFractionDuringReheat = state->dataSize->TermUnitFinalZoneSizing(1).DesHeatVolFlowMax / thisSys.MaxAirVolFlowRate;
EXPECT_EQ(expectedZoneMinAirFracDes, thisSys.ZoneMinAirFracDes);
EXPECT_EQ(1.0, thisSys.MaxAirVolFractionDuringReheat);
EXPECT_EQ(expectedMaxAirVolFractionDuringReheat, thisSys.MaxAirVolFractionDuringReheat);

// test Maximum Flow Fraction During Reheat for cooling dominated
thisSys.MaxAirVolFlowRate = DataSizing::AutoSize;
thisSys.ZoneMinAirFracDes = DataSizing::AutoSize;
thisSys.MaxAirVolFlowRateDuringReheat = DataSizing::AutoSize;
thisSys.MaxAirVolFractionDuringReheat = DataSizing::AutoSize;
state->dataSize->TermUnitFinalZoneSizing(1).DesHeatVolFlow = 1.4;
state->dataSize->TermUnitFinalZoneSizing(1).DesHeatVolFlowMax = 1.3;
thisSys.SizeSys(*state);
expectedZoneMinAirFracDes = std::min(1.0, state->dataSize->TermUnitFinalZoneSizing(1).DesCoolVolFlowMin / thisSys.MaxAirVolFlowRate);
expectedMaxAirVolFractionDuringReheat = state->dataSize->TermUnitFinalZoneSizing(1).DesHeatVolFlowMax / thisSys.MaxAirVolFlowRate;
EXPECT_EQ(expectedZoneMinAirFracDes, thisSys.ZoneMinAirFracDes);
EXPECT_EQ(1.0, thisSys.MaxAirVolFractionDuringReheat);
EXPECT_EQ(expectedMaxAirVolFractionDuringReheat, thisSys.MaxAirVolFractionDuringReheat);
}

TEST_F(EnergyPlusFixture, setATMixerSizingProperties_Test)
Expand Down

4 comments on commit 90f2846

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

10762-VAV-Reheat-shows-reheat-fraction-less-than-1 (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2913 of 2913 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.

10762-VAV-Reheat-shows-reheat-fraction-less-than-1 (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-RelWithDebInfo: OK (799 of 799 tests passed, 0 test warnings)

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.

10762-VAV-Reheat-shows-reheat-fraction-less-than-1 (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: OK (2097 of 2097 tests passed, 0 test warnings)

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

10762-VAV-Reheat-shows-reheat-fraction-less-than-1 (rraustad) - Win64-Windows-10-VisualStudio-16: OK (2891 of 2891 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.