-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Provide accurate value of RatedInletAirHumRat in DXCoils #7993
Changes from 6 commits
24f4064
fd6e1cc
98d2788
19051fb
39159fa
9267bba
3442b48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,21 +56,21 @@ | |
#include "Fixtures/SQLiteFixture.hh" | ||
#include <EnergyPlus/CurveManager.hh> | ||
#include <EnergyPlus/DXCoils.hh> | ||
#include <EnergyPlus/Data/EnergyPlusData.hh> | ||
#include <EnergyPlus/DataAirLoop.hh> | ||
#include <EnergyPlus/DataAirSystems.hh> | ||
#include <EnergyPlus/DataEnvironment.hh> | ||
#include <EnergyPlus/DataHeatBalance.hh> | ||
#include <EnergyPlus/DataSizing.hh> | ||
#include <EnergyPlus/General.hh> | ||
#include <EnergyPlus/Data/EnergyPlusData.hh> | ||
#include <EnergyPlus/OutputProcessor.hh> | ||
#include <EnergyPlus/NodeInputManager.hh> | ||
#include <EnergyPlus/OutAirNodeManager.hh> | ||
#include <EnergyPlus/OutputFiles.hh> | ||
#include <EnergyPlus/OutputProcessor.hh> | ||
#include <EnergyPlus/OutputReportPredefined.hh> | ||
#include <EnergyPlus/OutputReportTabular.hh> | ||
#include <EnergyPlus/Psychrometrics.hh> | ||
#include <EnergyPlus/ScheduleManager.hh> | ||
#include <EnergyPlus/OutputReportTabular.hh> | ||
|
||
using namespace EnergyPlus; | ||
using namespace DXCoils; | ||
|
@@ -1498,8 +1498,8 @@ TEST_F(EnergyPlusFixture, DXCoil_ValidateADPFunction) | |
DXCoil(1).RatedSHR(1), | ||
true); | ||
|
||
EXPECT_NEAR(0.788472, DXCoil(1).RatedSHR(1), 0.0000001); | ||
EXPECT_NEAR(0.0003944, CBF_calculated, 0.0000001); | ||
EXPECT_NEAR(0.792472, DXCoil(1).RatedSHR(1), 0.0000001); | ||
EXPECT_NEAR(0.00213735, CBF_calculated, 0.0000001); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That small change on SHR caused a pretty big difference in the bypass factor. I don't disagree, just noting. |
||
|
||
DXCoil(1).RatedTotCap(1) = 35000.0; // simulate outlet condition right at the saturation curve | ||
DXCoil(1).RatedSHR(1) = AutoSize; | ||
|
@@ -1514,8 +1514,8 @@ TEST_F(EnergyPlusFixture, DXCoil_ValidateADPFunction) | |
DXCoil(1).RatedSHR(1), | ||
true); | ||
|
||
EXPECT_NEAR(0.67608322, DXCoil(1).RatedSHR(1), 0.0000001); | ||
EXPECT_NEAR(0.0003243, CBF_calculated, 0.0000001); | ||
EXPECT_NEAR(0.67908322, DXCoil(1).RatedSHR(1), 0.0000001); | ||
EXPECT_NEAR(0.00298921, CBF_calculated, 0.0000001); | ||
|
||
DXCoil(1).RatedTotCap(1) = 40000.0; // reverse perturb SHR (i.e., decrease SHR), CalcCBF would have failed with RH >= 1.0 | ||
DXCoil(1).RatedSHR(1) = AutoSize; | ||
|
@@ -1530,8 +1530,8 @@ TEST_F(EnergyPlusFixture, DXCoil_ValidateADPFunction) | |
DXCoil(1).RatedSHR(1), | ||
true); | ||
|
||
EXPECT_NEAR(0.64408322, DXCoil(1).RatedSHR(1), 0.0000001); | ||
EXPECT_NEAR(0.0028271, CBF_calculated, 0.0000001); | ||
EXPECT_NEAR(0.64708322, DXCoil(1).RatedSHR(1), 0.0000001); | ||
EXPECT_NEAR(0.00252307, CBF_calculated, 0.0000001); | ||
} | ||
|
||
TEST_F(EnergyPlusFixture, TestMultiSpeedCoolingCrankcaseOutput) | ||
|
@@ -2267,10 +2267,11 @@ TEST_F(SQLiteFixture, DXCoils_TestComponentSizingOutput_TwoSpeed) | |
const std::string compName = DXCoils::DXCoil(1).Name; | ||
EXPECT_EQ(compName, "MAIN COOLING COIL 1"); | ||
|
||
struct TestQuery { | ||
struct TestQuery | ||
{ | ||
TestQuery(std::string t_description, std::string t_units, Real64 t_value) | ||
: description(t_description), units(t_units), expectedValue(t_value), | ||
displayString("Description='" + description + "'; Units='" + units + "'") {}; | ||
displayString("Description='" + description + "'; Units='" + units + "'"){}; | ||
|
||
const std::string description; | ||
const std::string units; | ||
|
@@ -2286,13 +2287,17 @@ TEST_F(SQLiteFixture, DXCoils_TestComponentSizingOutput_TwoSpeed) | |
TestQuery("Design Size Low Speed Evaporative Condenser Pump Rated Power Consumption", "W", lowSpeedCondPumpPower), | ||
}); | ||
|
||
for (auto& testQuery : testQueries) { | ||
for (auto &testQuery : testQueries) { | ||
|
||
std::string query("SELECT Value From ComponentSizes" | ||
" WHERE CompType = '" + compType + "'" | ||
" AND CompName = '" + compName + "'" | ||
" AND Description = '" + testQuery.description + "'" + | ||
" AND Units = '" + testQuery.units + "'"); | ||
" WHERE CompType = '" + | ||
compType + | ||
"'" | ||
" AND CompName = '" + | ||
compName + | ||
"'" | ||
" AND Description = '" + | ||
testQuery.description + "'" + " AND Units = '" + testQuery.units + "'"); | ||
|
||
// execAndReturnFirstDouble returns -10000.0 if not found | ||
Real64 return_val = SQLiteFixture::execAndReturnFirstDouble(query); | ||
|
@@ -2479,10 +2484,11 @@ TEST_F(SQLiteFixture, DXCoils_TestComponentSizingOutput_SingleSpeed) | |
const std::string compName = DXCoils::DXCoil(1).Name; | ||
EXPECT_EQ(compName, "FURNACE ACDXCOIL 1"); | ||
|
||
struct TestQuery { | ||
struct TestQuery | ||
{ | ||
TestQuery(std::string t_description, std::string t_units, Real64 t_value) | ||
: description(t_description), units(t_units), expectedValue(t_value), | ||
displayString("Description='" + description + "'; Units='" + units + "'") {}; | ||
displayString("Description='" + description + "'; Units='" + units + "'"){}; | ||
|
||
const std::string description; | ||
const std::string units; | ||
|
@@ -2496,13 +2502,17 @@ TEST_F(SQLiteFixture, DXCoils_TestComponentSizingOutput_SingleSpeed) | |
TestQuery("Design Size Evaporative Condenser Pump Rated Power Consumption", "W", condPumpPower), | ||
}); | ||
|
||
for (auto& testQuery : testQueries) { | ||
for (auto &testQuery : testQueries) { | ||
|
||
std::string query("SELECT Value From ComponentSizes" | ||
" WHERE CompType = '" + compType + "'" | ||
" AND CompName = '" + compName + "'" | ||
" AND Description = '" + testQuery.description + "'" + | ||
" AND Units = '" + testQuery.units + "'"); | ||
" WHERE CompType = '" + | ||
compType + | ||
"'" | ||
" AND CompName = '" + | ||
compName + | ||
"'" | ||
" AND Description = '" + | ||
testQuery.description + "'" + " AND Units = '" + testQuery.units + "'"); | ||
|
||
// execAndReturnFirstDouble returns -10000.0 if not found | ||
Real64 return_val = SQLiteFixture::execAndReturnFirstDouble(query); | ||
|
@@ -3506,7 +3516,7 @@ TEST_F(EnergyPlusFixture, TestMultiSpeedCoilsAutoSizingOutput) | |
" 1, !- Maximum Value of x {BasedOnField A2}", | ||
" 0.7, !- Minimum Curve Output {BasedOnField A3}", | ||
" 1; !- Maximum Curve Output {BasedOnField A3}", | ||
}); | ||
}); | ||
|
||
ASSERT_TRUE(process_idf(idf_objects)); | ||
|
||
|
@@ -3558,7 +3568,7 @@ TEST_F(EnergyPlusFixture, TestMultiSpeedCoilsAutoSizingOutput) | |
EXPECT_EQ("ASHP HTG COIL", DXCoil(2).Name); | ||
EXPECT_EQ("Coil:Heating:DX:MultiSpeed", DXCoil(2).DXCoilType); | ||
// set companion dx cooling coil | ||
DXCoil( 2 ).CompanionUpstreamDXCoil = 1; | ||
DXCoil(2).CompanionUpstreamDXCoil = 1; | ||
SizeDXCoil(state, 2); | ||
EXPECT_EQ(1.75, DXCoil(2).MSRatedAirVolFlowRate(2)); | ||
EXPECT_EQ(0.875, DXCoil(2).MSRatedAirVolFlowRate(2) * 0.5); | ||
|
@@ -3758,7 +3768,7 @@ TEST_F(EnergyPlusFixture, TestMultiSpeedCoolingCoilPartialAutoSizeOutput) | |
" 0.7, !- Minimum Curve Output {BasedOnField A3}", | ||
" 1; !- Maximum Curve Output {BasedOnField A3}", | ||
|
||
}); | ||
}); | ||
|
||
ASSERT_TRUE(process_idf(idf_objects)); | ||
|
||
|
@@ -3843,7 +3853,6 @@ TEST_F(EnergyPlusFixture, DXCoils_GetDXCoilCapFTCurveIndexTest) | |
DXCoil(2).DXCoilType_Num = CoilDX_MultiSpeedHeating; | ||
DXCoil(2).DXCoilType = "Coil:Heating:DX:MultiSpeed"; | ||
|
||
|
||
for (DXCoilNum = 1; DXCoilNum <= 2; ++DXCoilNum) { | ||
DXCoil(DXCoilNum).NumOfSpeeds = 2; | ||
DXCoil(DXCoilNum).MSRatedTotCap.allocate(DXCoil(DXCoilNum).NumOfSpeeds); | ||
|
@@ -3932,7 +3941,7 @@ TEST_F(EnergyPlusFixture, DXCoils_GetDXCoilCapFTCurveIndexTest) | |
// dx cooling coil | ||
int CoilIndex = 1; | ||
EXPECT_EQ(DXCoil(CoilIndex).DXCoilType, "Coil:Cooling:DX:MultiSpeed"); | ||
DataTotCapCurveIndex = DXCoils::GetDXCoilCapFTCurveIndex( CoilIndex, ErrorsFound ); | ||
DataTotCapCurveIndex = DXCoils::GetDXCoilCapFTCurveIndex(CoilIndex, ErrorsFound); | ||
EXPECT_EQ(2, DataTotCapCurveIndex); | ||
// evaluate dx cooling coil curves to show impacts of incorrect curve index | ||
Real64 TotCapTempModFac_lowestSpeed = CurveValue(1, 19.4, 30.0); | ||
|
@@ -3949,7 +3958,7 @@ TEST_F(EnergyPlusFixture, DXCoils_GetDXCoilCapFTCurveIndexTest) | |
// dx heating coil | ||
CoilIndex = 2; | ||
EXPECT_EQ(DXCoil(CoilIndex).DXCoilType, "Coil:Heating:DX:MultiSpeed"); | ||
DataTotCapCurveIndex = DXCoils::GetDXCoilCapFTCurveIndex( CoilIndex, ErrorsFound ); | ||
DataTotCapCurveIndex = DXCoils::GetDXCoilCapFTCurveIndex(CoilIndex, ErrorsFound); | ||
EXPECT_EQ(4, DataTotCapCurveIndex); | ||
// evaluate dx heating coil curves to show impacts of incorrect curve index | ||
TotCapTempModFac_lowestSpeed = CurveValue(3, 5.0, 10.0); | ||
|
@@ -3963,5 +3972,13 @@ TEST_F(EnergyPlusFixture, DXCoils_GetDXCoilCapFTCurveIndexTest) | |
EXPECT_DOUBLE_EQ(8763.2701224550547, NominalHeatingDesignCapacity_lowestSpeed); | ||
EXPECT_DOUBLE_EQ(8945.5439208717980, NominalHeatingDesignCapacity_designSpeed); | ||
} | ||
TEST_F(EnergyPlusFixture, DXCoils_RatedInletAirWTest) | ||
{ | ||
|
||
Real64 Tdb = 26.6667; | ||
Real64 Twet = 19.4444; | ||
Real64 RatedW = Psychrometrics::PsyWFnTdbTwbPb(Tdb, Twet, 101325.0); | ||
EXPECT_NEAR(RatedInletAirHumRat, RatedW, 0.000001); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is kind of a funny little unit test. Where is RatedInletAirHumRat declared? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Myoldmopar The RatedInletAirHumRat is defined at line 159 in DXCoils as below: Real64 const RatedInletAirHumRat(0.0111847); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. OK, thanks! |
||
|
||
} // namespace EnergyPlus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish these could be declared on some single location, but regardless these seem completely valid.