Skip to content

Commit

Permalink
fix ControlType bug in SetpointManager
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchute committed Jan 7, 2021
1 parent af78cdb commit 3bfeb7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/EnergyPlus/SetPointManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5049,19 +5049,15 @@ namespace EnergyPlus::SetPointManager {
CurSchValOnPeak = GetCurrentScheduleValue(state, this->SchedPtr);
CurSchValCharge = GetCurrentScheduleValue(state, this->SchedPtrCharge);

// CtrlType bug
// if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller
if (this->CompOpType == DataPlant::iCtrlType::HeatingOp) { // this is some sort of chiller
if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller
if (CurSchValOnPeak >= OnVal) {
this->SetPt = this->NonChargeCHWTemp;
} else if (CurSchValCharge < OnVal) {
this->SetPt = this->NonChargeCHWTemp;
} else {
this->SetPt = this->ChargeCHWTemp;
}
// CtrlType Bug
// } else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system
} else if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of ice storage system
} else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system
this->SetPt = this->NonChargeCHWTemp;
}
}
Expand Down
8 changes: 2 additions & 6 deletions tst/EnergyPlus/unit/SetPointManager.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,7 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint)
state->dataEnvrn->DayOfYear_Schedule = 1;
ScheduleManager::UpdateScheduleValues(*state);

// CtrlType Bug
// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp;
state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::HeatingOp;
state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp;

state->dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OnSched;

Expand All @@ -568,9 +566,7 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint)
state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state);
EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).ChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt);

// CtrlType Bug
// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp;
state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp;
state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp;

state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state);
EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt);
Expand Down

0 comments on commit 3bfeb7f

Please sign in to comment.