Skip to content

Commit

Permalink
Merge pull request #7683 from NREL/chillerReformEIRrefactor
Browse files Browse the repository at this point in the history
Chiller Electric Reformulated EIR Plant Component Refactor
  • Loading branch information
Myoldmopar authored Jan 23, 2020
2 parents a83cb46 + c32ff50 commit cc65a0f
Show file tree
Hide file tree
Showing 7 changed files with 1,597 additions and 2,257 deletions.
3 changes: 1 addition & 2 deletions src/EnergyPlus/ChillerElectricEIR.hh
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ namespace ChillerElectricEIR {
Real64 CondenserFanEnergyConsumption; // reporting: Air-cooled condenser fan energy [J]
Real64 BasinHeaterConsumption; // Basin heater energy consumption (J)
bool IPLVFlag;
bool EquipFlowCtrl;
bool oneTimeInit;
int EquipFlowCtrl;

// Default Constructor
ElectricEIRChillerSpecs()
Expand Down
3,575 changes: 1,514 additions & 2,061 deletions src/EnergyPlus/ChillerReformulatedEIR.cc

Large diffs are not rendered by default.

232 changes: 76 additions & 156 deletions src/EnergyPlus/ChillerReformulatedEIR.hh

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4792,7 +4792,6 @@ namespace OutputReportTabular {
using ChillerElectricEIR::ElectricEIRChiller;
using ChillerElectricEIR::NumElectricEIRChillers;
using ChillerReformulatedEIR::ElecReformEIRChiller;
using ChillerReformulatedEIR::ElecReformEIRChillerReport;
using ChillerReformulatedEIR::NumElecReformEIRChillers;
using CondenserLoopTowers::NumSimpleTowers;
using CondenserLoopTowers::towers;
Expand Down Expand Up @@ -4912,7 +4911,7 @@ namespace OutputReportTabular {
}
for (iChiller = 1; iChiller <= NumElecReformEIRChillers; ++iChiller) {
if (ElecReformEIRChiller(iChiller).CondenserType != WaterCooled) {
SysTotalHVACRejectHeatLoss += ElecReformEIRChillerReport(iChiller).CondEnergy;
SysTotalHVACRejectHeatLoss += ElecReformEIRChiller(iChiller).CondEnergy;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/Plant/PlantManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include <EnergyPlus/ChillerElectricEIR.hh>
#include <EnergyPlus/ChillerGasAbsorption.hh>
#include <EnergyPlus/ChillerExhaustAbsorption.hh>
#include <EnergyPlus/ChillerReformulatedEIR.hh>
#include <EnergyPlus/CondenserLoopTowers.hh>
#include <EnergyPlus/CTElectricGenerator.hh>
#include <EnergyPlus/DataBranchAirLoopPlant.hh>
Expand Down Expand Up @@ -1084,6 +1085,7 @@ namespace EnergyPlus {
} else if (LoopSideNum == SupplySide) {
this_comp.CurOpSchemeType = UnknownStatusOpSchemeType;
}
this_comp.compPtr = ChillerReformulatedEIR::ReformulatedEIRChillerSpecs::factory(CompNames(CompNum));
} else if (UtilityRoutines::SameString(this_comp_type, "Chiller:Electric")) {
this_comp.TypeOf_Num = TypeOf_Chiller_Electric;
this_comp.GeneralEquipType = GenEquipTypes_Chiller;
Expand Down
37 changes: 1 addition & 36 deletions src/EnergyPlus/PlantLoopEquip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,13 @@ namespace PlantLoopEquip {
// as a time reduction measure. Specific ifs are set to catch those modules that don't.
// If you add a module or new equipment type, you must set up this structure.

// Using/Aliasing
using ChillerReformulatedEIR::SimReformulatedEIRChiller;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int EquipNum; // Plant side component list equipment number
int EquipTypeNum;
bool RunFlag; // TRUE if operating this iteration
int EquipFlowCtrl;
Real64 CurLoad;
Real64 MaxLoad;
Real64 MinLoad;
Real64 OptLoad;
Real64 SizingFac = 0.0; // the component sizing fraction
int GeneralEquipType; // Basic Equipment type from EquipType Used to help organize this routine
Real64 TempCondInDesign; // Design condenser inlet temp. C , or 25.d0
Real64 TempEvapOutDesign;
EnergyPlus::PlantLocation sim_component_location(LoopNum, LoopSideNum, BranchNum, Num);

// set up a reference for this component
Expand Down Expand Up @@ -303,33 +294,7 @@ namespace PlantLoopEquip {
sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag);

} else if (EquipTypeNum == TypeOf_Chiller_ElectricReformEIR) {
SimReformulatedEIRChiller(sim_component.TypeOf,
sim_component.Name,
EquipFlowCtrl,
EquipNum,
LoopNum,
RunFlag,
FirstHVACIteration,
InitLoopEquip,
CurLoad,
MaxLoad,
MinLoad,
OptLoad,
GetCompSizFac,
SizingFac,
TempCondInDesign,
TempEvapOutDesign);
if (InitLoopEquip) {
sim_component.MaxLoad = MaxLoad;
sim_component.MinLoad = MinLoad;
sim_component.OptLoad = OptLoad;
sim_component.CompNum = EquipNum;
sim_component.TempDesCondIn = TempCondInDesign;
sim_component.TempDesEvapOut = TempEvapOutDesign;
}
if (GetCompSizFac) {
sim_component.SizFac = SizingFac;
}
sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag);

// Chiller-Heater needs to know whether it is being called for heating or cooling
// Since loops are generic, pass the branch inlet nodenum
Expand Down
2 changes: 2 additions & 0 deletions tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
#include <EnergyPlus/ChillerExhaustAbsorption.hh>
#include <EnergyPlus/ChillerGasAbsorption.hh>
#include <EnergyPlus/ChillerIndirectAbsorption.hh>
#include <EnergyPlus/ChillerReformulatedEIR.hh>
#include <EnergyPlus/CondenserLoopTowers.hh>
#include <EnergyPlus/CoolTower.hh>
#include <EnergyPlus/CrossVentMgr.hh>
Expand Down Expand Up @@ -320,6 +321,7 @@ void EnergyPlusFixture::clear_all_states()
ChillerExhaustAbsorption::clear_state();
ChillerGasAbsorption::clear_state();
ChillerIndirectAbsorption::clear_state();
ChillerReformulatedEIR::clear_state();
clearCoilSelectionReportObj(); // ReportCoilSelection
clearFacilityElectricPowerServiceObject();
CondenserLoopTowers::clear_state();
Expand Down

7 comments on commit cc65a0f

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (1964 of 1964 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.

develop (Myoldmopar) - 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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (11 of 11 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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1269 of 1269 tests passed, 0 test warnings)

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

develop (Myoldmopar) - 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

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-MacOS-10.13-clang: OK (1944 of 1944 tests passed, 0 test warnings)

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

develop (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (1944 of 1944 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.