Skip to content

Commit dc12fc6

Browse files
committed
fix bug and add to unit test
1 parent 04c32f0 commit dc12fc6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/EnergyPlus/GroundHeatExchangers.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ BuildAndGetResponseFactorsObjectFromSingleBHs(EnergyPlusData &state, std::vector
649649
// Make new props object which has the mean values of the other props objects referenced by the individual BH objects
650650
std::shared_ptr<GLHEVertProps> thisProps(new GLHEVertProps);
651651
thisProps->name = format("Response Factor Auto Generated Mean Props No: {}", state.dataGroundHeatExchanger->numAutoGeneratedResponseFactors + 1);
652-
for (auto &thisBH : state.dataGroundHeatExchanger->singleBoreholesVector) {
652+
for (auto &thisBH : singleBHsForRFVect) {
653653
thisProps->bhDiameter += thisBH->props->bhDiameter;
654654
thisProps->bhLength += thisBH->props->bhLength;
655655
thisProps->bhTopDepth += thisBH->props->bhTopDepth;

tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_Given_Single_BHs_IDF_Ch
969969
GetGroundHeatExchangerInput(*state);
970970

971971
EXPECT_EQ(2u, state->dataGroundHeatExchanger->vertPropsVector.size());
972-
EXPECT_EQ(4u, state->dataGroundHeatExchanger->singleBoreholesVector.size());
972+
EXPECT_EQ(5u, state->dataGroundHeatExchanger->singleBoreholesVector.size());
973973
EXPECT_EQ(1u, state->dataGroundHeatExchanger->verticalGLHE.size());
974974

975975
auto &thisGLHE(state->dataGroundHeatExchanger->verticalGLHE[0]);
@@ -984,6 +984,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_Given_Single_BHs_IDF_Ch
984984
EXPECT_EQ(100, thisGLHE.bhLength);
985985
EXPECT_EQ(0.04556, thisGLHE.bhUTubeDist);
986986
EXPECT_EQ(0, thisGLHE.myRespFactors->maxSimYears);
987+
EXPECT_EQ(4, thisGLHE.myRespFactors->numBoreholes);
987988
EXPECT_EQ(400, thisGLHE.totalTubeLength);
988989
EXPECT_EQ(thisGLHE.soil.k / thisGLHE.soil.rhoCp, thisGLHE.soil.diffusivity);
989990
}

0 commit comments

Comments
 (0)