Skip to content

Commit

Permalink
Fix #7711: Have to use the right index to query getObjectItem: we sto…
Browse files Browse the repository at this point in the history
…re both HPWH:Pumped and HPWH:Wrapped in the same container, but when querying for Wrapped we need the index as (HPWaterHeaterNum - NumPumpedCondenser)
  • Loading branch information
jmarrec committed Jan 27, 2020
1 parent 39e328e commit 52e55d1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/EnergyPlus/WaterThermalTanks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,9 @@ namespace WaterThermalTanks {
int nNumPossibleNumericArgs; // the number of possible numeric arguments in the idd
int nNumPossibleAlphaArgs; // the number of possible numeric arguments in the idd

// For looking up in IDF/epJSON, you need the index that corresponds to the actual object type (Pumped or Wrapped)
int HPWaterHeaterNumOfSpecificType;

for (int HPWaterHeaterNum = 1; HPWaterHeaterNum <= numHeatPumpWaterHeater; ++HPWaterHeaterNum) {

// Create reference to current HPWH object in array.
Expand All @@ -1042,25 +1045,30 @@ namespace WaterThermalTanks {
// Initialize the offsets to zero
nAlphaOffset = 0;
nNumericOffset = 0;

if (HPWaterHeaterNum <= NumPumpedCondenser) {
// Pumped Condenser
DataIPShortCuts::cCurrentModuleObject = cHPWHPumpedCondenser;
HPWH.TypeNum = DataPlant::TypeOf_HeatPumpWtrHeaterPumped;
nNumPossibleAlphaArgs = 29;
nNumPossibleNumericArgs = 9;
// Actual index of Pumped type
HPWaterHeaterNumOfSpecificType = HPWaterHeaterNum;
} else {
// Wrapped Condenser
DataIPShortCuts::cCurrentModuleObject = cHPWHWrappedCondenser;
HPWH.TypeNum = DataPlant::TypeOf_HeatPumpWtrHeaterWrapped;
nNumPossibleAlphaArgs = 27;
nNumPossibleNumericArgs = 10;
// Actual index of Wrapped type
HPWaterHeaterNumOfSpecificType = HPWaterHeaterNum - NumPumpedCondenser;
}

int NumAlphas;
int NumNums;
int IOStat;
inputProcessor->getObjectItem(DataIPShortCuts::cCurrentModuleObject,
HPWaterHeaterNum,
HPWaterHeaterNumOfSpecificType,
DataIPShortCuts::cAlphaArgs,
NumAlphas,
DataIPShortCuts::rNumericArgs,
Expand Down

6 comments on commit 52e55d1

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

7711_WaterThermalTanks_Crash (jmarrec) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

7711_WaterThermalTanks_Crash (jmarrec) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (11 of 11 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

7711_WaterThermalTanks_Crash (jmarrec) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2658 of 2658 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

7711_WaterThermalTanks_Crash (jmarrec) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1270 of 1270 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

7711_WaterThermalTanks_Crash (jmarrec) - Win64-Windows-10-VisualStudio-16: OK (2618 of 2618 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

7711_WaterThermalTanks_Crash (jmarrec) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (677 of 678 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 677
  • Timeout: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.