Skip to content

Commit

Permalink
For NREL#9878 - Update Unit test with proper behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Sep 18, 2023
1 parent c916b09 commit 0fbe564
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ TEST_F(EnergyPlusFixture, ExhAbsorption_calcHeater_Fix_Test)
constexpr Real64 exhaustInTemp = 350.0;
constexpr Real64 absLeavingTemp = 176.667;
constexpr Real64 exhaustInMassFlowRate = 0.5;
constexpr Real64 exhaustInHumRate = 0.000; // FIXME: use a non zero one
constexpr Real64 exhaustInHumRate = 0.005;
state->dataLoopNodes->Node(thisChillerHeater.ExhaustAirInletNodeNum).Temp = exhaustInTemp;
state->dataLoopNodes->Node(thisChillerHeater.ExhaustAirInletNodeNum).MassFlowRate = exhaustInMassFlowRate;
state->dataLoopNodes->Node(thisChillerHeater.ExhaustAirInletNodeNum).HumRat = exhaustInHumRate;
Expand All @@ -685,12 +685,11 @@ TEST_F(EnergyPlusFixture, ExhAbsorption_calcHeater_Fix_Test)
bool const runflaginput = true;
thisChillerHeater.calcHeater(*state, loadinput, runflaginput);

// FIXME: this shouldn't be zero
const Real64 CpHW = FluidProperties::GetSpecificHeatGlycol(*state, hwPlantLoop.FluidName, 0.0, hwPlantLoop.FluidIndex, "UnitTest");
EXPECT_EQ(4217.0, CpHW);
const Real64 CpHW = FluidProperties::GetSpecificHeatGlycol(*state, hwPlantLoop.FluidName, hwReturnTemp, hwPlantLoop.FluidIndex, "UnitTest");
EXPECT_EQ(4185.0, CpHW);
const Real64 expectedHeatingLoad = (hwSupplySetpoint - hwReturnTemp) * hwMassFlow * CpHW;

EXPECT_NEAR(21085.0, expectedHeatingLoad, 1e-6);
EXPECT_NEAR(20925.0, expectedHeatingLoad, 1e-6);

EXPECT_NEAR(thisChillerHeater.HeatingLoad, expectedHeatingLoad, 1e-6);
EXPECT_NEAR(thisChillerHeater.HeatElectricPower, 400.0, 1e-6);
Expand All @@ -705,8 +704,8 @@ TEST_F(EnergyPlusFixture, ExhAbsorption_calcHeater_Fix_Test)

Real64 const CpAir = Psychrometrics::PsyCpAirFnW(exhaustInHumRate);
Real64 const epectedExhHeatRecPotentialHeat = exhaustInMassFlowRate * CpAir * (exhaustInTemp - absLeavingTemp);
EXPECT_NEAR(87087.5769469, epectedExhHeatRecPotentialHeat, 1e-6);
EXPECT_NEAR(epectedExhHeatRecPotentialHeat, thisChillerHeater.ExhHeatRecPotentialHeat, 1e-6);
EXPECT_NEAR(87891.51, epectedExhHeatRecPotentialHeat, 0.01);
EXPECT_NEAR(epectedExhHeatRecPotentialHeat, thisChillerHeater.ExhHeatRecPotentialHeat, 0.01);
}

TEST_F(EnergyPlusFixture, ExhAbsorption_GetInput_Multiple_Objects_Test)
Expand Down

0 comments on commit 0fbe564

Please sign in to comment.