From fdfa1d40b670ab3233b11da30c46eb97125ab96c Mon Sep 17 00:00:00 2001 From: Tanaya Mankad Date: Wed, 4 Sep 2024 17:13:40 -0600 Subject: [PATCH] Fix performance pointer for CurveFit tests. --- ...CoilCoolingDXCurveFitOperatingMode.unit.cc | 2 +- tst/EnergyPlus/unit/StandardRatings.unit.cc | 316 +++++++++--------- 2 files changed, 160 insertions(+), 158 deletions(-) diff --git a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc index a2b072d3526..7bb78a1d7c2 100644 --- a/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc +++ b/tst/EnergyPlus/unit/Coils/CoilCoolingDXCurveFitOperatingMode.unit.cc @@ -279,7 +279,7 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitCrankcaseHeaterCurve) auto &condInletNode = state->dataLoopNodes->Node(thisCoil.condInletNodeIndex); auto &condOutletNode = state->dataLoopNodes->Node(thisCoil.condOutletNodeIndex); Real64 LoadSHR = 0.0; - thisCoil.performance.simulate( + thisCoil.performance->simulate( *state, evapInletNode, evapOutletNode, coilMode, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode, LoadSHR); EXPECT_EQ(thisCoil.performance->crankcaseHeaterPower, 120.0); } diff --git a/tst/EnergyPlus/unit/StandardRatings.unit.cc b/tst/EnergyPlus/unit/StandardRatings.unit.cc index 2fb981e89a5..a559b06b055 100644 --- a/tst/EnergyPlus/unit/StandardRatings.unit.cc +++ b/tst/EnergyPlus/unit/StandardRatings.unit.cc @@ -11735,14 +11735,14 @@ TEST_F(EnergyPlusFixture, CurveFit_02_Speed_15000W_alternateMode_SEER2_2023_Valu ASSERT_EQ("DX COOL COOLING COIL PERFORMANCE", performance->name); ASSERT_EQ("DX COOL COOLING COIL OPERATING MODE", performance->normalMode.name); ASSERT_EQ("DX COOL COOLING COIL OPERATING MODE2", performance->alternateMode.name); - int nsp = thisCoil.performance->NumSpeeds(); + int nsp = performance->NumSpeeds(); ASSERT_EQ(2, nsp); auto speed1 = performance->normalMode.speeds[0]; ASSERT_EQ("DX COOL COOLING COIL SPEED 1 PERFORMANCE", speed1.name); auto speed2 = performance->normalMode.speeds[1]; ASSERT_EQ("DX COOL COOLING COIL SPEED 2 PERFORMANCE", speed2.name); - auto coilMode = thisCoil.performance.maxAvailCoilMode; + auto coilMode = performance->maxAvailCoilMode; auto normalMode = performance->normalMode.speeds; auto alternateMode1 = performance->alternateMode; EXPECT_EQ((int)HVAC::CoilMode::Enhanced, (int)coilMode); @@ -11768,10 +11768,10 @@ TEST_F(EnergyPlusFixture, CurveFit_02_Speed_15000W_alternateMode_SEER2_2023_Valu EXPECT_EQ(0.3, maxEIRfLowPLRXInput); // Rated Total Capacity - EXPECT_NEAR(15000, thisCoil.performance->RatedGrossTotalCap(), 0.01); + EXPECT_NEAR(15000, performance->RatedGrossTotalCap(), 0.01); // Reated Air Vol Flow Rate | evap air flow rate and condenser air flow rate ?? - EXPECT_NEAR(0.80, thisCoil.performance->RatedEvapAirFlowRate(), 0.01); + EXPECT_NEAR(0.80, performance->RatedEvapAirFlowRate(), 0.01); EXPECT_NEAR(7500, speed1.rated_total_capacity, 0.01); EXPECT_NEAR(15000, speed2.rated_total_capacity, 0.01); @@ -11813,39 +11813,39 @@ TEST_F(EnergyPlusFixture, CurveFit_02_Speed_15000W_alternateMode_SEER2_2023_Valu EXPECT_EQ(1, thisEIRFFlowHs->coeff[0]); EXPECT_EQ(0, thisEIRFFlowHs->coeff[1]); - ASSERT_TRUE(thisCoil.performance.standardRatingEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity == 0); + ASSERT_TRUE(performance->standardRatingEER == 0); + ASSERT_TRUE(performance->standardRatingSEER == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_Standard == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 == 0); + ASSERT_TRUE(performance->standardRatingSEER2_User == 0); + ASSERT_TRUE(performance->standardRatingSEER2_Standard == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity2023 == 0); - thisCoil.performance.calcStandardRatings210240(*state); + performance->calcStandardRatings210240(*state); // 2017 TBD - ASSERT_TRUE(thisCoil.performance.standardRatingEER > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity > 0); - EXPECT_NEAR(3.39, thisCoil.performance.standardRatingEER, 0.01); - EXPECT_NEAR(3.93, thisCoil.performance.standardRatingSEER, 0.01); - EXPECT_NEAR(14399.91, thisCoil.performance.standardRatingCoolingCapacity, 0.01); - EXPECT_NEAR(13.42, thisCoil.performance.standardRatingSEER * StandardRatings::ConvFromSIToIP, 0.01); + ASSERT_TRUE(performance->standardRatingEER > 0); + ASSERT_TRUE(performance->standardRatingSEER > 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity > 0); + EXPECT_NEAR(3.39, performance->standardRatingEER, 0.01); + EXPECT_NEAR(3.93, performance->standardRatingSEER, 0.01); + EXPECT_NEAR(14399.91, performance->standardRatingCoolingCapacity, 0.01); + EXPECT_NEAR(13.42, performance->standardRatingSEER * StandardRatings::ConvFromSIToIP, 0.01); // 2023 - ASSERT_TRUE(thisCoil.performance.standardRatingEER2 > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User > 0.0); - EXPECT_TRUE(thisCoil.performance.standardRatingSEER2_Standard > 0.0); - EXPECT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 > 0.0); - EXPECT_NEAR(3.51, thisCoil.performance.standardRatingEER2, 0.01); - EXPECT_NEAR(4.18, thisCoil.performance.standardRatingSEER2_User, 0.01); - EXPECT_NEAR(4.12, thisCoil.performance.standardRatingSEER2_Standard, 0.01); - EXPECT_NEAR(14513.51, thisCoil.performance.standardRatingCoolingCapacity2023, 0.01); - EXPECT_NEAR(14.26, thisCoil.performance.standardRatingSEER2_User * StandardRatings::ConvFromSIToIP, 0.01); - EXPECT_NEAR(14.07, thisCoil.performance.standardRatingSEER2_Standard * StandardRatings::ConvFromSIToIP, 0.01); - - ASSERT_TRUE(thisCoil.performance.standardRatingIEER > 0); - EXPECT_NEAR(3.42, thisCoil.performance.standardRatingIEER, 0.01); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER2 > 0); - EXPECT_NEAR(3.97, thisCoil.performance.standardRatingIEER2, 0.01); + ASSERT_TRUE(performance->standardRatingEER2 > 0); + ASSERT_TRUE(performance->standardRatingSEER2_User > 0.0); + EXPECT_TRUE(performance->standardRatingSEER2_Standard > 0.0); + EXPECT_TRUE(performance->standardRatingCoolingCapacity2023 > 0.0); + EXPECT_NEAR(3.51, performance->standardRatingEER2, 0.01); + EXPECT_NEAR(4.18, performance->standardRatingSEER2_User, 0.01); + EXPECT_NEAR(4.12, performance->standardRatingSEER2_Standard, 0.01); + EXPECT_NEAR(14513.51, performance->standardRatingCoolingCapacity2023, 0.01); + EXPECT_NEAR(14.26, performance->standardRatingSEER2_User * StandardRatings::ConvFromSIToIP, 0.01); + EXPECT_NEAR(14.07, performance->standardRatingSEER2_Standard * StandardRatings::ConvFromSIToIP, 0.01); + + ASSERT_TRUE(performance->standardRatingIEER > 0); + EXPECT_NEAR(3.42, performance->standardRatingIEER, 0.01); + ASSERT_TRUE(performance->standardRatingIEER2 > 0); + EXPECT_NEAR(3.97, performance->standardRatingIEER2, 0.01); } TEST_F(EnergyPlusFixture, CurveFit_03_Speed_5000W_SEER2_2023_ValueTest) @@ -12058,7 +12058,7 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_5000W_SEER2_2023_ValueTest) ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL", thisCoil.name); ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL PERFORMANCE", performance->name); ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL OPERATING MODE", performance->normalMode.name); - int nsp = thisCoil.performance->NumSpeeds(); + int nsp = performance->NumSpeeds(); ASSERT_EQ(3, nsp); auto speed1 = performance->normalMode.speeds[0]; ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL SPEED 1 PERFORMANCE", speed1.name); @@ -12067,7 +12067,7 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_5000W_SEER2_2023_ValueTest) auto speed3 = performance->normalMode.speeds[2]; ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL SPEED 3 PERFORMANCE", speed3.name); - HVAC::CoilMode coilMode = performance.maxAvailCoilMode; + HVAC::CoilMode coilMode = performance->maxAvailCoilMode; auto alternateMode1 = performance->alternateMode.speeds; auto alternateMode2 = performance->alternateMode2.speeds; EXPECT_EQ((int)HVAC::CoilMode::Normal, (int)coilMode); @@ -12089,10 +12089,10 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_5000W_SEER2_2023_ValueTest) EXPECT_EQ(1.0, maxEIRfLowPLRXInput); // Rated Total Capacity - EXPECT_NEAR(5000, thisCoil.performance->RatedGrossTotalCap(), 0.01); + EXPECT_NEAR(5000, performance->RatedGrossTotalCap(), 0.01); // Reated Air Vol Flow Rate | evap air flow rate and condenser air flow rate ?? - EXPECT_NEAR(0.25, thisCoil.performance->RatedEvapAirFlowRate(), 0.01); + EXPECT_NEAR(0.25, performance->RatedEvapAirFlowRate(), 0.01); EXPECT_NEAR(1666.5, speed1.rated_total_capacity, 0.01); EXPECT_NEAR(3333.5, speed2.rated_total_capacity, 0.01); @@ -12138,39 +12138,39 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_5000W_SEER2_2023_ValueTest) EXPECT_EQ(.47278589, thisEIRFFlowHs->coeff[0]); EXPECT_EQ(1.2433415, thisEIRFFlowHs->coeff[1]); - ASSERT_TRUE(thisCoil.performance.standardRatingEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity == 0); - - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_Standard == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 == 0); - - thisCoil.performance.calcStandardRatings210240(*state); - - ASSERT_TRUE(thisCoil.performance.standardRatingEER > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity > 0); - EXPECT_NEAR(2.62, thisCoil.performance.standardRatingEER, 0.01); - EXPECT_NEAR(2.80, thisCoil.performance.standardRatingSEER, 0.01); - EXPECT_NEAR(4831.92, thisCoil.performance.standardRatingCoolingCapacity, 0.01); - EXPECT_NEAR(9.56, thisCoil.performance.standardRatingSEER * StandardRatings::ConvFromSIToIP, 0.01); - - ASSERT_TRUE(thisCoil.performance.standardRatingEER2 > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User > 0.0); - EXPECT_TRUE(thisCoil.performance.standardRatingSEER2_Standard > 0.0); - EXPECT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 > 0.0); - EXPECT_NEAR(2.55, thisCoil.performance.standardRatingEER2, 0.01); - EXPECT_NEAR(3.05, thisCoil.performance.standardRatingSEER2_User, 0.01); - EXPECT_NEAR(3.07, thisCoil.performance.standardRatingSEER2_Standard, 0.01); - EXPECT_NEAR(4798.04, thisCoil.performance.standardRatingCoolingCapacity2023, 0.01); - EXPECT_NEAR(10.41, thisCoil.performance.standardRatingSEER2_User * StandardRatings::ConvFromSIToIP, 0.01); - EXPECT_NEAR(10.47, thisCoil.performance.standardRatingSEER2_Standard * StandardRatings::ConvFromSIToIP, 0.01); - - ASSERT_TRUE(thisCoil.performance.standardRatingIEER > 0); - EXPECT_NEAR(2.78, thisCoil.performance.standardRatingIEER, 0.01); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER2 > 0); - EXPECT_NEAR(3.17, thisCoil.performance.standardRatingIEER2, 0.01); + ASSERT_TRUE(performance->standardRatingEER == 0); + ASSERT_TRUE(performance->standardRatingSEER == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity == 0); + + ASSERT_TRUE(performance->standardRatingSEER2_User == 0); + ASSERT_TRUE(performance->standardRatingSEER2_Standard == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity2023 == 0); + + performance->calcStandardRatings210240(*state); + + ASSERT_TRUE(performance->standardRatingEER > 0); + ASSERT_TRUE(performance->standardRatingSEER > 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity > 0); + EXPECT_NEAR(2.62, performance->standardRatingEER, 0.01); + EXPECT_NEAR(2.80, performance->standardRatingSEER, 0.01); + EXPECT_NEAR(4831.92, performance->standardRatingCoolingCapacity, 0.01); + EXPECT_NEAR(9.56, performance->standardRatingSEER * StandardRatings::ConvFromSIToIP, 0.01); + + ASSERT_TRUE(performance->standardRatingEER2 > 0); + ASSERT_TRUE(performance->standardRatingSEER2_User > 0.0); + EXPECT_TRUE(performance->standardRatingSEER2_Standard > 0.0); + EXPECT_TRUE(performance->standardRatingCoolingCapacity2023 > 0.0); + EXPECT_NEAR(2.55, performance->standardRatingEER2, 0.01); + EXPECT_NEAR(3.05, performance->standardRatingSEER2_User, 0.01); + EXPECT_NEAR(3.07, performance->standardRatingSEER2_Standard, 0.01); + EXPECT_NEAR(4798.04, performance->standardRatingCoolingCapacity2023, 0.01); + EXPECT_NEAR(10.41, performance->standardRatingSEER2_User * StandardRatings::ConvFromSIToIP, 0.01); + EXPECT_NEAR(10.47, performance->standardRatingSEER2_Standard * StandardRatings::ConvFromSIToIP, 0.01); + + ASSERT_TRUE(performance->standardRatingIEER > 0); + EXPECT_NEAR(2.78, performance->standardRatingIEER, 0.01); + ASSERT_TRUE(performance->standardRatingIEER2 > 0); + EXPECT_NEAR(3.17, performance->standardRatingIEER2, 0.01); } TEST_F(EnergyPlusFixture, CurveFit_02_Speed_30000W_alternateMode_IEER_2022_ValueTest) @@ -12356,21 +12356,22 @@ TEST_F(EnergyPlusFixture, CurveFit_02_Speed_30000W_alternateMode_IEER_2022_Value auto &thisCoil(state->dataCoilCooingDX->coilCoolingDXs[coilIndex]); // size it thisCoil.size(*state); + auto performance{dynamic_cast(thisCoil.performance.get())}; ASSERT_EQ("DX COOLING COIL", thisCoil.name); - ASSERT_EQ("DX COOL COOLING COIL PERFORMANCE", thisCoil.performance.name); - ASSERT_EQ("DX COOL COOLING COIL OPERATING MODE", thisCoil.performance.normalMode.name); - ASSERT_EQ("DX COOL COOLING COIL OPERATING MODE2", thisCoil.performance.alternateMode.name); - int nsp = (int)thisCoil.performance.normalMode.speeds.size(); + ASSERT_EQ("DX COOL COOLING COIL PERFORMANCE", performance->name); + ASSERT_EQ("DX COOL COOLING COIL OPERATING MODE", performance->normalMode.name); + ASSERT_EQ("DX COOL COOLING COIL OPERATING MODE2", performance->alternateMode.name); + int nsp = (int)performance->normalMode.speeds.size(); ASSERT_EQ(2, nsp); - auto speed1 = thisCoil.performance.normalMode.speeds[0]; + auto speed1 = performance->normalMode.speeds[0]; ASSERT_EQ("DX COOL COOLING COIL SPEED 1 PERFORMANCE", speed1.name); - auto speed2 = thisCoil.performance.normalMode.speeds[1]; + auto speed2 = performance->normalMode.speeds[1]; ASSERT_EQ("DX COOL COOLING COIL SPEED 2 PERFORMANCE", speed2.name); - // auto hasAlternateMode = thisCoil.performance.hasAlternateMode; - auto normalMode = thisCoil.performance.normalMode.speeds; - auto alternateMode1 = thisCoil.performance.alternateMode; + // auto hasAlternateMode = performance->hasAlternateMode; + auto normalMode = performance->normalMode.speeds; + auto alternateMode1 = performance->alternateMode; // EXPECT_EQ(1, hasAlternateMode); EXPECT_TRUE(2 == normalMode.size()); auto speedA1 = alternateMode1.speeds[0]; @@ -12394,10 +12395,10 @@ TEST_F(EnergyPlusFixture, CurveFit_02_Speed_30000W_alternateMode_IEER_2022_Value EXPECT_EQ(0.3, maxEIRfLowPLRXInput); // Rated Total Capacity - EXPECT_NEAR(30000, thisCoil.performance.normalMode.ratedGrossTotalCap, 0.01); + EXPECT_NEAR(30000, performance->normalMode.ratedGrossTotalCap, 0.01); // Reated Air Vol Flow Rate | evap air flow rate and condenser air flow rate ?? - EXPECT_NEAR(1.60, thisCoil.performance.normalMode.ratedEvapAirFlowRate, 0.01); + EXPECT_NEAR(1.60, performance->normalMode.ratedEvapAirFlowRate, 0.01); EXPECT_NEAR(15000, speed1.rated_total_capacity, 0.01); EXPECT_NEAR(30000, speed2.rated_total_capacity, 0.01); @@ -12414,8 +12415,8 @@ TEST_F(EnergyPlusFixture, CurveFit_02_Speed_30000W_alternateMode_IEER_2022_Value EXPECT_NEAR(631.3, speed2.rated_evap_fan_power_per_volume_flow_rate_2023, 0.01); // CondenserType is a different enum that is being used in case of CurveFit in comparison to other Cooling DX Coils - EXPECT_TRUE(CoilCoolingDXCurveFitOperatingMode::CondenserType::AIRCOOLED == thisCoil.performance.normalMode.condenserType); - EXPECT_FALSE(CoilCoolingDXCurveFitOperatingMode::CondenserType::EVAPCOOLED == thisCoil.performance.normalMode.condenserType); + EXPECT_TRUE(CoilCoolingDXCurveFitOperatingMode::CondenserType::AIRCOOLED == performance->normalMode.condenserType); + EXPECT_FALSE(CoilCoolingDXCurveFitOperatingMode::CondenserType::EVAPCOOLED == performance->normalMode.condenserType); // Check user curve coefficients @@ -12439,37 +12440,37 @@ TEST_F(EnergyPlusFixture, CurveFit_02_Speed_30000W_alternateMode_IEER_2022_Value EXPECT_EQ(1, thisEIRFFlowHs->coeff[0]); EXPECT_EQ(0, thisEIRFFlowHs->coeff[1]); - ASSERT_TRUE(thisCoil.performance.standardRatingEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity == 0); - - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_Standard == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 == 0); - - ASSERT_TRUE(thisCoil.performance.standardRatingIEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER2 == 0); - - thisCoil.performance.calcStandardRatings210240(*state); - - ASSERT_TRUE(thisCoil.performance.standardRatingEER2 > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER2 > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 > 0); - EXPECT_NEAR(3.51, thisCoil.performance.standardRatingEER2, 0.01); - EXPECT_NEAR(3.97, thisCoil.performance.standardRatingIEER2, 0.01); - EXPECT_NEAR(29027.03, thisCoil.performance.standardRatingCoolingCapacity2023, 0.01); - EXPECT_NEAR(13.56, thisCoil.performance.standardRatingIEER2 * StandardRatings::ConvFromSIToIP, 0.01); - - ASSERT_TRUE(thisCoil.performance.standardRatingEER > 0); - EXPECT_NEAR(3.39, thisCoil.performance.standardRatingEER, 0.01); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER > 0); - EXPECT_NEAR(3.93, thisCoil.performance.standardRatingSEER, 0.01); - - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User > 0); - EXPECT_NEAR(4.18, thisCoil.performance.standardRatingSEER2_User, 0.01); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_Standard > 0); - EXPECT_NEAR(4.12, thisCoil.performance.standardRatingSEER2_Standard, 0.01); + ASSERT_TRUE(performance->standardRatingEER == 0); + ASSERT_TRUE(performance->standardRatingSEER == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity == 0); + + ASSERT_TRUE(performance->standardRatingSEER2_User == 0); + ASSERT_TRUE(performance->standardRatingSEER2_Standard == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity2023 == 0); + + ASSERT_TRUE(performance->standardRatingIEER == 0); + ASSERT_TRUE(performance->standardRatingIEER2 == 0); + + performance->calcStandardRatings210240(*state); + + ASSERT_TRUE(performance->standardRatingEER2 > 0); + ASSERT_TRUE(performance->standardRatingIEER > 0); + ASSERT_TRUE(performance->standardRatingIEER2 > 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity2023 > 0); + EXPECT_NEAR(3.51, performance->standardRatingEER2, 0.01); + EXPECT_NEAR(3.97, performance->standardRatingIEER2, 0.01); + EXPECT_NEAR(29027.03, performance->standardRatingCoolingCapacity2023, 0.01); + EXPECT_NEAR(13.56, performance->standardRatingIEER2 * StandardRatings::ConvFromSIToIP, 0.01); + + ASSERT_TRUE(performance->standardRatingEER > 0); + EXPECT_NEAR(3.39, performance->standardRatingEER, 0.01); + ASSERT_TRUE(performance->standardRatingSEER > 0); + EXPECT_NEAR(3.93, performance->standardRatingSEER, 0.01); + + ASSERT_TRUE(performance->standardRatingSEER2_User > 0); + EXPECT_NEAR(4.18, performance->standardRatingSEER2_User, 0.01); + ASSERT_TRUE(performance->standardRatingSEER2_Standard > 0); + EXPECT_NEAR(4.12, performance->standardRatingSEER2_Standard, 0.01); } TEST_F(EnergyPlusFixture, CurveFit_03_Speed_20000W_IEER_2022_ValueTest) @@ -12673,25 +12674,26 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_20000W_IEER_2022_ValueTest) int coilIndex = CoilCoolingDX::factory(*state, "Sys 2 Furnace DX Cool Cooling Coil"); auto &thisCoil(state->dataCoilCooingDX->coilCoolingDXs[coilIndex]); + auto performance{dynamic_cast(thisCoil.performance.get())}; // size it thisCoil.size(*state); ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL", thisCoil.name); - ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL PERFORMANCE", thisCoil.performance.name); - ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL OPERATING MODE", thisCoil.performance.normalMode.name); - int nsp = (int)thisCoil.performance.normalMode.speeds.size(); + ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL PERFORMANCE", performance->name); + ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL OPERATING MODE", performance->normalMode.name); + int nsp = (int)performance->normalMode.speeds.size(); ASSERT_EQ(3, nsp); - auto speed1 = thisCoil.performance.normalMode.speeds[0]; + auto speed1 = performance->normalMode.speeds[0]; ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL SPEED 1 PERFORMANCE", speed1.name); - auto speed2 = thisCoil.performance.normalMode.speeds[1]; + auto speed2 = performance->normalMode.speeds[1]; ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL SPEED 2 PERFORMANCE", speed2.name); - auto speed3 = thisCoil.performance.normalMode.speeds[2]; + auto speed3 = performance->normalMode.speeds[2]; ASSERT_EQ("SYS 2 FURNACE DX COOL COOLING COIL SPEED 3 PERFORMANCE", speed3.name); - // auto hasAlternateMode = thisCoil.performance.hasAlternateMode; - auto alternateMode1 = thisCoil.performance.alternateMode.speeds; - auto alternateMode2 = thisCoil.performance.alternateMode2.speeds; + // auto hasAlternateMode = performance->hasAlternateMode; + auto alternateMode1 = performance->alternateMode.speeds; + auto alternateMode2 = performance->alternateMode2.speeds; // EXPECT_EQ(0, hasAlternateMode); EXPECT_TRUE(alternateMode1.empty()); EXPECT_TRUE(alternateMode2.empty()); @@ -12711,10 +12713,10 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_20000W_IEER_2022_ValueTest) EXPECT_EQ(1.0, maxEIRfLowPLRXInput); // Rated Total Capacity - EXPECT_NEAR(20000, thisCoil.performance.normalMode.ratedGrossTotalCap, 0.01); + EXPECT_NEAR(20000, performance->normalMode.ratedGrossTotalCap, 0.01); // Reated Air Vol Flow Rate | evap air flow rate and condenser air flow rate ?? - EXPECT_NEAR(1.0, thisCoil.performance.normalMode.ratedEvapAirFlowRate, 0.01); + EXPECT_NEAR(1.0, performance->normalMode.ratedEvapAirFlowRate, 0.01); EXPECT_NEAR(6666, speed1.rated_total_capacity, 0.01); EXPECT_NEAR(13334, speed2.rated_total_capacity, 0.01); @@ -12735,8 +12737,8 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_20000W_IEER_2022_ValueTest) EXPECT_NEAR(812.9, speed3.rated_evap_fan_power_per_volume_flow_rate_2023, 0.01); // CondenserType is a different enum that is being used in case of CurveFit in comparison to other Cooling DX Coils - EXPECT_TRUE(CoilCoolingDXCurveFitOperatingMode::CondenserType::AIRCOOLED == thisCoil.performance.normalMode.condenserType); - EXPECT_FALSE(CoilCoolingDXCurveFitOperatingMode::CondenserType::EVAPCOOLED == thisCoil.performance.normalMode.condenserType); + EXPECT_TRUE(CoilCoolingDXCurveFitOperatingMode::CondenserType::AIRCOOLED == performance->normalMode.condenserType); + EXPECT_FALSE(CoilCoolingDXCurveFitOperatingMode::CondenserType::EVAPCOOLED == performance->normalMode.condenserType); // Check user curve coefficients @@ -12760,36 +12762,36 @@ TEST_F(EnergyPlusFixture, CurveFit_03_Speed_20000W_IEER_2022_ValueTest) EXPECT_EQ(.47278589, thisEIRFFlowHs->coeff[0]); EXPECT_EQ(1.2433415, thisEIRFFlowHs->coeff[1]); - ASSERT_TRUE(thisCoil.performance.standardRatingEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity == 0); - - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_Standard == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 == 0); - - ASSERT_TRUE(thisCoil.performance.standardRatingIEER == 0); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER2 == 0); - - thisCoil.performance.calcStandardRatings210240(*state); - - ASSERT_TRUE(thisCoil.performance.standardRatingEER2 > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingIEER2 > 0); - ASSERT_TRUE(thisCoil.performance.standardRatingCoolingCapacity2023 > 0); - EXPECT_NEAR(2.55, thisCoil.performance.standardRatingEER2, 0.01); - EXPECT_NEAR(3.18, thisCoil.performance.standardRatingIEER2, 0.01); - EXPECT_NEAR(19192.186657893722, thisCoil.performance.standardRatingCoolingCapacity2023, 0.01); - EXPECT_NEAR(10.85, thisCoil.performance.standardRatingIEER2 * StandardRatings::ConvFromSIToIP, 0.01); - - ASSERT_TRUE(thisCoil.performance.standardRatingEER > 0); - EXPECT_NEAR(2.62, thisCoil.performance.standardRatingEER, 0.01); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER > 0); - EXPECT_NEAR(2.80, thisCoil.performance.standardRatingSEER, 0.01); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_User > 0); - EXPECT_NEAR(3.05, thisCoil.performance.standardRatingSEER2_User, 0.01); - ASSERT_TRUE(thisCoil.performance.standardRatingSEER2_Standard > 0); - EXPECT_NEAR(3.07, thisCoil.performance.standardRatingSEER2_Standard, 0.01); + ASSERT_TRUE(performance->standardRatingEER == 0); + ASSERT_TRUE(performance->standardRatingSEER == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity == 0); + + ASSERT_TRUE(performance->standardRatingSEER2_User == 0); + ASSERT_TRUE(performance->standardRatingSEER2_Standard == 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity2023 == 0); + + ASSERT_TRUE(performance->standardRatingIEER == 0); + ASSERT_TRUE(performance->standardRatingIEER2 == 0); + + performance->calcStandardRatings210240(*state); + + ASSERT_TRUE(performance->standardRatingEER2 > 0); + ASSERT_TRUE(performance->standardRatingIEER > 0); + ASSERT_TRUE(performance->standardRatingIEER2 > 0); + ASSERT_TRUE(performance->standardRatingCoolingCapacity2023 > 0); + EXPECT_NEAR(2.55, performance->standardRatingEER2, 0.01); + EXPECT_NEAR(3.18, performance->standardRatingIEER2, 0.01); + EXPECT_NEAR(19192.186657893722, performance->standardRatingCoolingCapacity2023, 0.01); + EXPECT_NEAR(10.85, performance->standardRatingIEER2 * StandardRatings::ConvFromSIToIP, 0.01); + + ASSERT_TRUE(performance->standardRatingEER > 0); + EXPECT_NEAR(2.62, performance->standardRatingEER, 0.01); + ASSERT_TRUE(performance->standardRatingSEER > 0); + EXPECT_NEAR(2.80, performance->standardRatingSEER, 0.01); + ASSERT_TRUE(performance->standardRatingSEER2_User > 0); + EXPECT_NEAR(3.05, performance->standardRatingSEER2_User, 0.01); + ASSERT_TRUE(performance->standardRatingSEER2_Standard > 0); + EXPECT_NEAR(3.07, performance->standardRatingSEER2_Standard, 0.01); } TEST_F(EnergyPlusFixture, ChillerCondenserEnteringFluidTemp_AHRIIPTestConditions)