Skip to content

Commit

Permalink
Merge pull request #8850 from NREL/8776FanOnOffZeroFanPowerDuringCooling
Browse files Browse the repository at this point in the history
On-Off Fan Showing Zero Fan Power During Cooling for Unitary Systems with Single Speed Cooling Coil
  • Loading branch information
Myoldmopar authored Jul 16, 2021
2 parents cdc3bf2 + f5061a9 commit f44c136
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/EnergyPlus/UnitarySystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10253,7 +10253,7 @@ namespace UnitarySystems {
}
} else { // IF(MultiOrVarSpeedCoolCoil(UnitarySysNum)) THEN
state.dataUnitarySystems->CompOnMassFlow = this->MaxCoolAirMassFlow;
state.dataUnitarySystems->CompOnFlowRatio = this->m_CoolingSpeedRatio;
state.dataUnitarySystems->CompOnFlowRatio = this->m_CoolingFanSpeedRatio;
if (this->m_FanOpMode == DataHVACGlobals::ContFanCycCoil) {
if (this->m_AirFlowControl == UseCompFlow::UseCompressorOnFlow) {
state.dataUnitarySystems->CompOffMassFlow = this->MaxCoolAirMassFlow;
Expand Down
2 changes: 2 additions & 0 deletions testfiles/FurnaceWithDXSystem.idf
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,8 @@

Output:Variable,*,Unitary System Fan Part Load Ratio,timestep;

Output:Variable,*,Fan Electricity Rate,timestep; !- HVAC Average [W]

Output:Variable,*,Zone Air System Sensible Heating Energy,timestep;

Output:Variable,*,Zone Air System Sensible Cooling Energy,timestep;
Expand Down
33 changes: 33 additions & 0 deletions tst/EnergyPlus/unit/UnitarySystem.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3735,6 +3735,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.5, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(1.0, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(1.0, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.setSpeedVariables(*state, state->dataUnitarySystems->HeatingLoad, PartLoadRatio);
EXPECT_EQ(0.5, state->dataHVACGlobal->MSHPMassFlowRateLow);
Expand All @@ -3744,6 +3745,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.5, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(1.0, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(1.0, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.setSpeedVariables(*state, state->dataUnitarySystems->HeatingLoad, PartLoadRatio);
EXPECT_EQ(0.5, state->dataHVACGlobal->MSHPMassFlowRateLow);
Expand All @@ -3768,11 +3770,13 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.25, state->dataUnitarySystems->CompOnFlowRatio);

PartLoadRatio = 0.7;
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.25, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.setSpeedVariables(*state, state->dataUnitarySystems->HeatingLoad, PartLoadRatio);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateLow);
Expand Down Expand Up @@ -3816,6 +3820,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
EXPECT_EQ(0.25, state->dataUnitarySystems->CompOnMassFlow);
EXPECT_EQ(0.0, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.25, state->dataUnitarySystems->CompOnFlowRatio);

// cooling load at various speeds
thisSys.m_HeatingSpeedNum = 0;
Expand All @@ -3825,6 +3830,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.6, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(1.2, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(1.2, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.m_HeatingSpeedNum = 0;
thisSys.m_CoolingSpeedNum = 2;
Expand All @@ -3833,6 +3839,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.6, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.6, state->dataUnitarySystems->CompOnFlowRatio);

// cycling fan mode should drop to 0 flow rate at speed = 1
thisSys.m_HeatingSpeedNum = 0;
Expand All @@ -3844,6 +3851,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
EXPECT_EQ(0.3, state->dataUnitarySystems->CompOnMassFlow);
EXPECT_EQ(0.0, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.3, state->dataUnitarySystems->CompOnFlowRatio);

// constant fan mode should not drop to idle flow rate at speed = 1
thisSys.m_FanOpMode = DataHVACGlobals::ContFanCycCoil;
Expand All @@ -3857,6 +3865,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
EXPECT_EQ(0.3, state->dataUnitarySystems->CompOnMassFlow);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.3, state->dataUnitarySystems->CompOnFlowRatio);

// no load condition (operates at idle speed)
thisSys.m_HeatingSpeedNum = 0;
Expand All @@ -3868,6 +3877,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
EXPECT_EQ(0.2, state->dataUnitarySystems->CompOnMassFlow);
EXPECT_EQ(0.2, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.2, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.2, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.m_MultiSpeedHeatingCoil = true;
thisSys.m_HeatingSpeedNum = 1;
Expand All @@ -3877,6 +3887,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.25, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.setSpeedVariables(*state, state->dataUnitarySystems->HeatingLoad, PartLoadRatio);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateLow);
Expand All @@ -3888,6 +3899,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.25, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.setSpeedVariables(*state, state->dataUnitarySystems->HeatingLoad, PartLoadRatio);
EXPECT_EQ(0.25, state->dataHVACGlobal->MSHPMassFlowRateLow);
Expand All @@ -3902,6 +3914,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateHigh);
EXPECT_EQ(0.3, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.setSpeedVariables(*state, state->dataUnitarySystems->CoolingLoad, PartLoadRatio);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateLow);
Expand All @@ -3912,10 +3925,30 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest)
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateHigh);
// EXPECT_EQ(0.3, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.setSpeedVariables(*state, state->dataUnitarySystems->CoolingLoad, PartLoadRatio);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateLow);
EXPECT_EQ(0.3, state->dataHVACGlobal->MSHPMassFlowRateHigh);

// tests to make sure the proper speed ratio is used to set CompOnFlowRatio
thisSys.m_CoolingSpeedNum = 1;
thisSys.m_CoolingSpeedRatio = 0.0;
thisSys.m_CoolingFanSpeedRatio = 1.0;
thisSys.m_MultiOrVarSpeedCoolCoil = false;
state->dataUnitarySystems->HeatingLoad = false;
state->dataUnitarySystems->CoolingLoad = true;
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(1.0, state->dataUnitarySystems->CompOnFlowRatio);

thisSys.m_CoolingSpeedNum = 1;
thisSys.m_CoolingSpeedRatio = 1.0;
thisSys.m_CoolingFanSpeedRatio = 0.5;
thisSys.m_MultiOrVarSpeedCoolCoil = false;
state->dataUnitarySystems->HeatingLoad = false;
state->dataUnitarySystems->CoolingLoad = true;
thisSys.setOnOffMassFlowRate(*state, OnOffAirFlowRatio, PartLoadRatio);
EXPECT_EQ(0.5, state->dataUnitarySystems->CompOnFlowRatio);
}

TEST_F(EnergyPlusFixture, UnitarySystemModel_ConfirmUnitarySystemSizingTest)
Expand Down

0 comments on commit f44c136

Please sign in to comment.