Skip to content

Commit

Permalink
pull setting EquipFlowCtrl out of PlantLoopEquip
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchute committed Jan 16, 2020
1 parent 2ff63bd commit bdd6800
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/EnergyPlus/ChillerElectricEIR.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ namespace ChillerElectricEIR {
// model, initializes simulation variables, calls the appropriate model and sets
// up reporting variables.

if (this->oneTimeInit) {
this->setupOutputVars();
this->oneTimeInit = false;
}

if (calledFromLocation.loopNum == this->CWLoopNum) {
this->initialize(RunFlag, CurLoad);
this->calculate(CurLoad, RunFlag);
Expand Down Expand Up @@ -970,7 +965,10 @@ namespace ChillerElectricEIR {
static std::string const RoutineName("InitElectricEIRChiller");

// Init more variables
if (this->MyFlag) {
if (this->oneTimeFlag) {

this->setupOutputVars();

// Locate the chillers on the plant loops for later usage
bool errFlag = false;
PlantUtilities::ScanPlantLoopsForObject(this->Name,
Expand Down Expand Up @@ -1071,9 +1069,11 @@ namespace ChillerElectricEIR {
DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi;
}
}
this->MyFlag = false;
this->oneTimeFlag = false;
}

this->EquipFlowCtrl = DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl;

if (this->MyEnvrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) {

Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName,
Expand Down Expand Up @@ -1629,7 +1629,7 @@ namespace ChillerElectricEIR {
// if the component control is SERIESACTIVE we set the component flow to inlet flow so that
// flow resolver will not shut down the branch
if (MyLoad >= 0 || !RunFlag) {
if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive ||
if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive ||
DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 1) {
this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate;
}
Expand Down
7 changes: 3 additions & 4 deletions src/EnergyPlus/ChillerElectricEIR.hh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ namespace ChillerElectricEIR {
std::string EndUseSubcategory; // identifier use for the end use subcategory
Real64 TimeStepSysLast;
Real64 CurrentEndTimeLast;
bool MyFlag;
bool oneTimeFlag;
bool MyEnvrnFlag;
Real64 EvapWaterConsump; // Evap cooler water consumption (m3)
Real64 EvapWaterConsumpRate; // Evap condenser water consumption rate [m3/s]
Expand Down Expand Up @@ -224,13 +224,12 @@ namespace ChillerElectricEIR {
CDCompNum(0), HRLoopNum(0), HRLoopSideNum(0), HRBranchNum(0), HRCompNum(0), BasinHeaterSchedulePtr(0), CondMassFlowIndex(0),
MsgDataLast(0.0), PrintMessage(false), MsgErrorCount(0), ErrCount1(0), PossibleSubcooling(false), FaultyChillerSWTFlag(false),
FaultyChillerSWTIndex(0), FaultyChillerSWTOffset(0.0), FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0),
FaultyChillerFoulingFactor(1.0), TimeStepSysLast(0.0), CurrentEndTimeLast(0.0), MyFlag(true), MyEnvrnFlag(true), EvapWaterConsump(0.0),
FaultyChillerFoulingFactor(1.0), TimeStepSysLast(0.0), CurrentEndTimeLast(0.0), oneTimeFlag(true), MyEnvrnFlag(true), EvapWaterConsump(0.0),
EvapWaterConsumpRate(0.0), Power(0.0), QEvaporator(0.0), QCondenser(0.0), QHeatRecovered(0.0), HeatRecOutletTemp(0.0),
CondenserFanPower(0.0), ChillerCapFT(0.0), ChillerEIRFT(0.0), ChillerEIRFPLR(0.0), ChillerPartLoadRatio(0.0), ChillerCyclingRatio(0.0),
BasinHeaterPower(0.0), ChillerFalseLoadRate(0.0), ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0),
CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), HeatRecMassFlow(0.0),
ChillerCondAvgTemp(0.0), CondenserFanEnergyConsumption(0.0), BasinHeaterConsumption(0.0), IPLVFlag(true), EquipFlowCtrl(true),
oneTimeInit(true)
ChillerCondAvgTemp(0.0), CondenserFanEnergyConsumption(0.0), BasinHeaterConsumption(0.0), IPLVFlag(true), EquipFlowCtrl(true)
{
}

Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/PlantLoopEquip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ namespace PlantLoopEquip {
sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag);

} else if (EquipTypeNum == TypeOf_Chiller_ElectricEIR) {
dynamic_cast<ChillerElectricEIR::ElectricEIRChillerSpecs*> (sim_component.compPtr)->EquipFlowCtrl = EquipFlowCtrl;
sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag);

} else if (EquipTypeNum == TypeOf_Chiller_ElectricReformEIR) {
Expand Down

5 comments on commit bdd6800

@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.

chillerElecEIRrefactor (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2652 of 2652 tests passed, 38 test warnings)

Messages:\n

  • 38 tests had: BND diffs.

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.

chillerElecEIRrefactor (mitchute) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build 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.

chillerElecEIRrefactor (mitchute) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (11 of 11 tests passed, 0 test warnings)

Build 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.

chillerElecEIRrefactor (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1266 of 1266 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

chillerElecEIRrefactor (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (676 of 677 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 676
  • Timeout: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.