diff --git a/src/HPWH.cc b/src/HPWH.cc index 7eb137f2..c69c5c46 100644 --- a/src/HPWH.cc +++ b/src/HPWH.cc @@ -2572,7 +2572,7 @@ double HPWH::getCompressorMinRuntime(UNITS units /*=UNITS_MIN*/) const return minimumRuntime; } -int HPWH::getSizingFractions(double& aquaFract, double& useableFract) const +void HPWH::getSizingFractions(double& aquaFract, double& useableFract) const { double aFract = 1.; double useFract = 1.; @@ -2628,8 +2628,6 @@ int HPWH::getSizingFractions(double& aquaFract, double& useableFract) const { useableFract = 1. - aquaFract + TOL_MINVALUE; } - - return 0; } bool HPWH::isHPWHScalable() const { return canScale; } diff --git a/src/HPWH.hh b/src/HPWH.hh index 1a0de693..3a33d436 100644 --- a/src/HPWH.hh +++ b/src/HPWH.hh @@ -897,7 +897,7 @@ class HPWH : public Courier::Sender double getCompressorMinRuntime(UNITS units = UNITS_MIN) const; - int getSizingFractions(double& aquafract, double& percentUseable) const; + void getSizingFractions(double& aquafract, double& percentUseable) const; /**< returns the fraction of total tank volume from the bottom up where the aquastat is or the turn on logic for the compressor, and the USEable fraction of storage or 1 minus where the shut off logic is for the compressor. If the logic spans multiple nodes it diff --git a/test/unit_tests/sizingFractionsTest.cpp b/test/unit_tests/sizingFractionsTest.cpp index c4e3a1ce..0c1ed691 100644 --- a/test/unit_tests/sizingFractionsTest.cpp +++ b/test/unit_tests/sizingFractionsTest.cpp @@ -22,7 +22,7 @@ TEST(SizingFractionsTest, TamScalable_SP_SizingFract) double aquaFrac, useableFrac; const double aquaFrac_answer = 4. / logicSize; - EXPECT_EQ(hpwh.getSizingFractions(aquaFrac, useableFrac), 0); + hpwh.getSizingFractions(aquaFrac, useableFrac); EXPECT_NEAR(aquaFrac, aquaFrac_answer, tol); EXPECT_NEAR(useableFrac, 1. - 1. / logicSize, tol); } @@ -40,7 +40,7 @@ TEST(SizingFractionsTest, Sanden80_SizingFract) double aquaFrac, useableFrac; const double aquaFrac_answer = 8. / logicSize; - EXPECT_EQ(hpwh.getSizingFractions(aquaFrac, useableFrac), 0); + hpwh.getSizingFractions(aquaFrac, useableFrac); EXPECT_NEAR(aquaFrac, aquaFrac_answer, tol); EXPECT_NEAR(useableFrac, 1. - 1. / logicSize, tol); } @@ -58,7 +58,7 @@ TEST(SizingFractionsTest, ColmacCxV_5_SP_SizingFract) double aquaFrac, useableFrac; const double aquaFrac_answer = 4. / logicSize; - EXPECT_EQ(hpwh.getSizingFractions(aquaFrac, useableFrac), 0); + hpwh.getSizingFractions(aquaFrac, useableFrac); EXPECT_NEAR(aquaFrac, aquaFrac_answer, tol); EXPECT_NEAR(useableFrac, 1. - 1. / logicSize, tol); } @@ -76,7 +76,7 @@ TEST(SizingFractionsTest, AOSmithHPTU50_SizingFract) double aquaFrac, useableFrac; const double aquaFrac_answer = (1. + 2. + 3. + 4.) / 4. / logicSize; - EXPECT_EQ(hpwh.getSizingFractions(aquaFrac, useableFrac), 0); + hpwh.getSizingFractions(aquaFrac, useableFrac); EXPECT_NEAR(aquaFrac, aquaFrac_answer, tol); EXPECT_NEAR(useableFrac, 1., tol); } @@ -94,7 +94,7 @@ TEST(SizingFractionsTest, GE_SizingFract) double aquaFrac, useableFrac; const double aquaFrac_answer = (1. + 2. + 3. + 4.) / 4. / logicSize; - EXPECT_EQ(hpwh.getSizingFractions(aquaFrac, useableFrac), 0); + hpwh.getSizingFractions(aquaFrac, useableFrac); EXPECT_NEAR(aquaFrac, aquaFrac_answer, tol); EXPECT_NEAR(useableFrac, 1., tol); } @@ -112,7 +112,7 @@ TEST(SizingFractionsTest, Stiebel220e_SizingFract) double aquaFrac, useableFrac; const double aquaFrac_answer = (5. + 6.) / 2. / logicSize; - EXPECT_EQ(hpwh.getSizingFractions(aquaFrac, useableFrac), 0); + hpwh.getSizingFractions(aquaFrac, useableFrac); EXPECT_NEAR(aquaFrac, aquaFrac_answer, tol); EXPECT_NEAR(useableFrac, 1. - 1. / logicSize, tol); }