Skip to content

Commit

Permalink
Merge pull request #155 from EcotopeResearch/getCompressorCapacity_issue
Browse files Browse the repository at this point in the history
Change check to let fixed setpoint equip through
  • Loading branch information
chipbarnaby committed Dec 7, 2022
2 parents 3993e9d + 831cdd2 commit 3ab053d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/HPWH.cc
Expand Up @@ -1889,11 +1889,11 @@ double HPWH::getCompressorCapacity(double airTemp /*=19.722*/, double inletTemp
return double(HPWH_ABORT);
}

double maxSetpoint;
string answerWhy;
if(!isNewSetpointPossible(outTemp_C, maxSetpoint, answerWhy)) {
double maxAllowedSetpoint_C = setOfSources[compressorIndex].maxSetpoint_C -
setOfSources[compressorIndex].secondaryHeatExchanger.hotSideTemperatureOffset_dC;
if (outTemp_C > maxAllowedSetpoint_C) {
if (hpwhVerbosity >= VRB_reluctant) {
msg(answerWhy.c_str());
msg("Inputted outlet temperature of the compressor is higher than can be produced.");
}
return double(HPWH_ABORT);
}
Expand Down
3 changes: 2 additions & 1 deletion src/HPWH.in.hh
Expand Up @@ -641,7 +641,8 @@ class HPWH {
UNITS pwrUnit = UNITS_KW, UNITS tempUnit = UNITS_C) const;
/**< Returns the heating output capacity of the compressor for the current HPWH model.
Note only supports HPWHs with one compressor, if multiple will return the last index
of a compressor */
of a compressor. Outlet temperatures greater than the max allowable setpoints will return an error, but
for compressors with a fixed setpoint the */

int setCompressorOutputCapacity(double newCapacity, double airTemp = 19.722, double inletTemp = 14.444, double outTemp = 57.222,
UNITS pwrUnit = UNITS_KW, UNITS tempUnit = UNITS_C);
Expand Down
48 changes: 39 additions & 9 deletions test/testPerformanceMaps.cc
Expand Up @@ -513,23 +513,53 @@ void testQAHVExtrapolates() {
// test const along Tair
checkPoint = { 114.0, 176.0, 84.2, 136564.470884 };
ASSERTTRUE(relcmpd(checkPoint.outputBTUH, getCapacitySP_F_BTUHR(hpwh, checkPoint, tInOffsetQAHV_dF, tOutOffsetQAHV_dF)));

checkPoint = { 114.0, 200.0, 84.2, 136564.470884 };
double output = getCapacitySP_F_BTUHR(hpwh, checkPoint, tInOffsetQAHV_dF, tOutOffsetQAHV_dF);
ASSERTTRUE(output == HPWH::HPWH_ABORT);
}

void testSanden()
{
HPWH hpwh;
string input = "Sanden120";
performancePointSP checkPoint; // tairF, toutF, tinF, outputW
double outputBTUH;
getHPWHObject(hpwh, input);

// nominal
checkPoint = { 60, 149.0, 41.0, 15059.59167 };
outputBTUH = hpwh.getCompressorCapacity(checkPoint.tairF, checkPoint.tinF, checkPoint.toutF, HPWH::UNITS_BTUperHr, HPWH::UNITS_F);
ASSERTTRUE(relcmpd(checkPoint.outputBTUH, outputBTUH));

// Cold outlet temperature
checkPoint = { 60, 125.0, 41.0, 15059.59167 };
outputBTUH = hpwh.getCompressorCapacity(checkPoint.tairF, checkPoint.tinF, checkPoint.toutF, HPWH::UNITS_BTUperHr, HPWH::UNITS_F);
ASSERTTRUE(relcmpd(checkPoint.outputBTUH, outputBTUH));

// tests fails when output high
checkPoint = { 60, 200, 41.0, 15059.59167 };
outputBTUH = hpwh.getCompressorCapacity(checkPoint.tairF, checkPoint.tinF, checkPoint.toutF, HPWH::UNITS_BTUperHr, HPWH::UNITS_F);
ASSERTTRUE(outputBTUH == HPWH::HPWH_ABORT);
}

int main(int, char*)
{
testSanden(); // check can still work with HPWH::getCapacity() as expected

testQAHVMatchesDataMap(); // Test QAHV grid data input correctly
testQAHVExtrapolates(); // Test QAHV grid data extrapolate correctly

testCXA15MatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
testCXA30MatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
// Tests that the correct capacity is returned for specific equipement that matches the data set
testCXA15MatchesDataMap();
testCXA30MatchesDataMap();

// MP tests
testCXV5MPMatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
testCXA10MPMatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
testCXA15MPMatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
testCXA20MPMatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
testCXA25MPMatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
testCXA30MPMatchesDataMap(); //Test we can set the correct capacity for specific equipement that matches the data
testCXV5MPMatchesDataMap();
testCXA10MPMatchesDataMap();
testCXA15MPMatchesDataMap();
testCXA20MPMatchesDataMap();
testCXA25MPMatchesDataMap();
testCXA30MPMatchesDataMap();

testRheemHPHD135();
testRheemHPHD60();
Expand Down

0 comments on commit 3ab053d

Please sign in to comment.