Skip to content

Commit d0fcb45

Browse files
committed
Fix unit test = AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSide
1 parent 22d2b8c commit d0fcb45

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

src/EnergyPlus/HVACVariableRefrigerantFlow.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12660,6 +12660,25 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state,
1266012660
// now calculate the the mixer outlet air conditions (and the secondary air inlet flow rate). The mixer outlet flow rate has already
1266112661
// been set above (it is the "inlet" node flow rate)
1266212662
SimATMixer(state, this->ATMixerName, FirstHVACIteration, this->ATMixerIndex);
12663+
// inlet side ATMixer can change the VRF TU inlet condition and therefore the operating air flow rate
12664+
if (this->fanOp == HVAC::FanOp::Cycling && PartLoadRatio > 0) {
12665+
if (this->HeatingCoilPresent && state.dataHVACVarRefFlow->MaxHeatingCapacity(VRFCond) < Constant::MaxCap) {
12666+
// Only fix heating only mode for now
12667+
state.dataHVACVarRefFlow->CompOnMassFlow = CalVRFTUAirFlowRate_FluidTCtrl(
12668+
state, VRFTUNum, PartLoadRatio, FirstHVACIteration, state.dataHVACVarRefFlow->MaxHeatingCapacity(VRFCond));
12669+
} else {
12670+
state.dataHVACVarRefFlow->CompOnMassFlow = CalVRFTUAirFlowRate_FluidTCtrl(state, VRFTUNum, PartLoadRatio, FirstHVACIteration, _);
12671+
}
12672+
if (std::abs(state.dataHVACVarRefFlow->CompOnMassFlow - AirMassFlow) > HVAC::SmallMassFlow) {
12673+
SetAverageAirFlow(state, VRFTUNum, PartLoadRatio, OnOffAirFlowRatio);
12674+
AirMassFlow = state.dataLoopNodes->Node(VRFTUInletNodeNum).MassFlowRate;
12675+
// set the primary air inlet mass flow rate
12676+
state.dataLoopNodes->Node(this->ATMixerPriNode).MassFlowRate =
12677+
min(state.dataLoopNodes->Node(this->ATMixerPriNode).MassFlowRateMaxAvail,
12678+
state.dataLoopNodes->Node(VRFTUInletNodeNum).MassFlowRate);
12679+
SimATMixer(state, this->ATMixerName, FirstHVACIteration, this->ATMixerIndex);
12680+
}
12681+
}
1266312682
}
1266412683
} else {
1266512684
state.dataHVACVarRefFlow->ATMixOutNode2 = 0;

tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3314,7 +3314,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRF_ATMSupplySide)
33143314
// check the terminal air mixer outlet air mass flow rate
33153315
ATMixerOutletMassFlowRate = SecondaryAirMassFlowRate + PrimaryAirMassFlowRate;
33163316
ASSERT_EQ(ATMixerOutletMassFlowRate, state->dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate);
3317-
// check the cooling output delivered is within 2.0 Watt of zone cooling load
3317+
// check the cooling output delivered is within 4.0 Watt of zone cooling load
33183318
ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 4.0);
33193319
}
33203320

@@ -5094,6 +5094,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSi
50945094
ASSERT_EQ(HVACInletMassFlowRate, state->dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate);
50955095
// check the cooling output delivered is within 5.0 Watt of zone cooling load
50965096
ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 5.0);
5097+
EXPECT_NEAR(0.965, state->dataDXCoils->DXCoil(1).PartLoadRatio, 0.001);
50975098
}
50985099

50995100
TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMSupplySide)

0 commit comments

Comments
 (0)