Skip to content
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

Merged
merged 7 commits into from
Jun 27, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void CoilCoolingDXCurveFitOperatingMode::size(EnergyPlusData &state)
ReportSizingManager::RequestSizing(state, CompType, CompName, SizingMethod, SizingString, TempSize, PrintFlag, RoutineName);
this->ratedEvapAirFlowRate = TempSize;
Real64 const ratedInletAirTemp(26.6667); // 26.6667C or 80F
Real64 const ratedInletAirHumRat(0.01125); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
Real64 const ratedInletAirHumRat(0.0111847); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
this->ratedEvapAirMassFlowRate = this->ratedEvapAirFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(
DataEnvironment::StdBaroPress, ratedInletAirTemp, ratedInletAirHumRat, RoutineName);

Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ CoilCoolingDXCurveFitSpeed::CoilCoolingDXCurveFitSpeed(const std::string& name_t

// rating data
RatedInletAirTemp(26.6667), // 26.6667C or 80F
RatedInletWetBulbTemp(19.44), // 19.44 or 67F
RatedInletAirHumRat(0.01125), // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
RatedInletWetBulbTemp(19.4444), // 19.44 or 67F
RatedInletAirHumRat(0.0111847), // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
RatedOutdoorAirTemp(35.0), // 35 C or 95F
DryCoilOutletHumRatioMin(0.00001) // dry coil outlet minimum hum ratio kgH2O/kgdry air

Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ struct CoilCoolingDXCurveFitSpeed

// rating data
Real64 RatedInletAirTemp = 26.6667; // 26.6667C or 80F
Real64 RatedInletWetBulbTemp = 19.44; // 19.44 or 67F
Real64 RatedInletAirHumRat = 0.01125; // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
Real64 RatedInletWetBulbTemp = 19.4444; // 19.44 or 67F
Real64 RatedInletAirHumRat = 0.0111847; // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
Copy link
Member

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.

Real64 RatedOutdoorAirTemp = 35.0; // 35 C or 95F
Real64 DryCoilOutletHumRatioMin = 0.00001; // dry coil outlet minimum hum ratio kgH2O/kgdry air

Expand Down
279 changes: 157 additions & 122 deletions src/EnergyPlus/DXCoils.cc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/EnergyPlus/ReportSizingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ namespace ReportSizingManager {
Array1D<Real64> Par(4); // array passed to RegulaFalsi
std::string ScalableSM; // scalable sizing methods label for reporting
Real64 const RatedInletAirTemp(26.6667); // 26.6667C or 80F
Real64 const RatedInletAirHumRat(0.01125); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
Real64 const RatedInletAirHumRat(0.0111847); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb

std::string DDNameFanPeak; // Name of the design day that produced the Peak
std::string dateTimeFanPeak; // A String representing the DateTime of the Peak
Expand Down
14 changes: 7 additions & 7 deletions src/EnergyPlus/VariableSpeedCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ namespace VariableSpeedCoils {
// MODULE PARAMETER DEFINITIONS

Real64 const RatedInletAirTemp(26.6667); // 26.6667C or 80F
Real64 const RatedInletWetBulbTemp(19.44); // 19.44 or 67F, cooling mode
Real64 const RatedInletAirHumRat(0.01125); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
Real64 const RatedInletWaterTemp(29.4); // 85 F cooling mode
Real64 const RatedInletWetBulbTemp(19.4444); // 19.44 or 67F, cooling mode
Real64 const RatedInletAirHumRat(0.0111847); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
Real64 const RatedInletWaterTemp(29.4444); // 85 F cooling mode
Real64 const RatedAmbAirTemp(35.0); // 95 F cooling mode
Real64 const RatedInletAirTempHeat(21.11); // 21.11C or 70F, heating mode
Real64 const RatedInletWaterTempHeat(21.11); // 21.11C or 70F, heating mode
Real64 const RatedAmbAirTempHeat(8.33); // 8.33 or 47F, heating mode
Real64 const RatedAmbAirWBHeat(6.11); // 8.33 or 43F, heating mode, rated wet bulb temperature
Real64 const RatedInletAirTempHeat(21.1111); // 21.11C or 70F, heating mode
Real64 const RatedInletWaterTempHeat(21.1111); // 21.11C or 70F, heating mode
Real64 const RatedAmbAirTempHeat(8.3333); // 8.33 or 47F, heating mode
Real64 const RatedAmbAirWBHeat(6.1111); // 8.33 or 43F, heating mode, rated wet bulb temperature

// Water Systems
int const CondensateDiscarded(1001); // default mode where water is "lost"
Expand Down
75 changes: 46 additions & 29 deletions tst/EnergyPlus/unit/DXCoils.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The 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;
Expand All @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
}
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. OK, thanks!


} // namespace EnergyPlus
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ TEST_F(CBVAVSys, UnitaryBypassVAV_NoOASys)
HVACUnitaryBypassVAV::InitCBVAV(state, cbvavNum, FirstHVACIteration, AirLoopNum, OnOffAirFlowRatio, HXUnitOn);
Real64 FullOutput = 0.0;
HVACUnitaryBypassVAV::CalcCBVAV(state, cbvavNum, FirstHVACIteration, PartLoadFrac, FullOutput, OnOffAirFlowRatio, HXUnitOn);
EXPECT_NEAR(PartLoadFrac, 0.935, 0.001); // load = -7000 W, coil capacity = 10,000 W, SHR = 0.7 so max sensible is just over 7,000 W
EXPECT_NEAR(PartLoadFrac, 0.9387, 0.001); // load = -7000 W, coil capacity = 10,000 W, SHR = 0.7 so max sensible is just over 7,000 W
EXPECT_NEAR(cbvav.OutletTempSetPoint, DataLoopNode::Node(cbvav.AirOutNode).Temp, 0.0001);
EXPECT_NEAR(cbvav.OutletTempSetPoint, 12.771, 0.001);

Expand Down
Loading