Skip to content

Commit

Permalink
Merge pull request #10719 from NREL/fixAirLoopTopoCrash
Browse files Browse the repository at this point in the history
Fix airloop topology crash
  • Loading branch information
Myoldmopar authored Sep 10, 2024
2 parents 08056a2 + aa8a95e commit bce315d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/DataAirLoop.hh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace DataAirLoop {
Array1D_int TermUnitCoolSizingIndex; // Air terminal sizing numbers for zones cooled by this air loop
Array1D_int TermUnitHeatSizingIndex; // Air terminal sizing numbers for zones heated by this air loop
Array1D<HVAC::AirDuctType> SupplyDuctType; // 1=main, 2=cooling, 3=heating, 4=other
EPVector<int> SupplyDuctBranchNum; // Supply duct branch number
EPVector<int> SupplyDuctBranchNum; // Supply duct branch number (airloop branchnum, not the actual branch index)
EPVector<int> SupplyAirPathNum; // Supply air path indexes
EPVector<int> ReturnAirPathNum; // Return air path indexes
};
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/DataAirSystems.hh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace DataAirSystems {
AirLoopMixerData Mixer; // Data for mixer (if any)
Array1D_bool ControlConverged; // Convergence Parameter for controllers
int NumOutletBranches = 0;
std::array<int, 3> OutletBranchNum = {0}; // branch numbers of system outlets
std::array<int, 3> OutletBranchNum = {0}; // airloop branch numbers of system outlets (not the actual branch index)
int NumInletBranches = 0;
std::array<int, 3> InletBranchNum = {0}; // branch number of system inlets
bool CentralHeatCoilExists = true; // true if there are central heating coils
Expand Down
5 changes: 3 additions & 2 deletions src/EnergyPlus/DataZoneEquipment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,9 @@ namespace DataZoneEquipment {
int InNode; // Air distribution unit inlet node
int OutNode; // Air distribution unit Outlet node
bool SupplyAirPathExists;
int MainBranchIndex;
int SupplyBranchIndex;
int AirLoopNum = 0; // airloop number serving this ADU
int MainBranchIndex; // airloop branch index (not the actual branch index)
int SupplyBranchIndex; // airloop branch index (not the actual branch index)
int AirDistUnitIndex; // equipment number in EquipList
int TermUnitSizingIndex; // Pointer to TermUnitSizing and TermUnitFinalZoneSizing data for this terminal unit
int SupplyAirPathIndex; // Pointer to SupplyAirPath serving this terminal unit
Expand Down
6 changes: 6 additions & 0 deletions src/EnergyPlus/SystemReports.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ void InitEnergyReports(EnergyPlusData &state)
++OutNum) {
if (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).ZoneEquipSupplyNodeNum(OutNum) ==
state.dataZoneEquip->SupplyAirPath(SAPNum).InletNodeNum) {
thisZoneEquipConfig.AirDistUnitCool(ZoneInletNodeNum).AirLoopNum = AirLoopNum;
thisZoneEquipConfig.AirDistUnitCool(ZoneInletNodeNum).SupplyBranchIndex =
state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).OutletBranchNum[OutNum - 1];
if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Splitter.Exists) {
Expand Down Expand Up @@ -192,6 +193,7 @@ void InitEnergyReports(EnergyPlusData &state)
++BranchNum) {
if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).NodeNumOut ==
state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).AirLoopSupplyNodeNum(NodeIndex)) {
thisZoneEquipConfig.AirDistUnitCool(ZoneInletNodeNum).AirLoopNum = AirLoopNum;
thisZoneEquipConfig.AirDistUnitCool(ZoneInletNodeNum).SupplyBranchIndex = BranchNum;
if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Splitter.Exists) {
for (int MainBranchNum = 1;
Expand Down Expand Up @@ -229,6 +231,7 @@ void InitEnergyReports(EnergyPlusData &state)
++OutNum) {
if (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).ZoneEquipSupplyNodeNum(OutNum) ==
state.dataZoneEquip->SupplyAirPath(SAPNum).InletNodeNum) {
thisZoneEquipConfig.AirDistUnitHeat(ZoneInletNodeNum).AirLoopNum = AirLoopNum;
thisZoneEquipConfig.AirDistUnitHeat(ZoneInletNodeNum).SupplyBranchIndex =
state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).OutletBranchNum[OutNum - 1];
if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Splitter.Exists) {
Expand Down Expand Up @@ -261,6 +264,7 @@ void InitEnergyReports(EnergyPlusData &state)
++BranchNum) {
if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).NodeNumOut ==
state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).AirLoopSupplyNodeNum(NodeIndex)) {
thisZoneEquipConfig.AirDistUnitHeat(ZoneInletNodeNum).AirLoopNum = AirLoopNum;
thisZoneEquipConfig.AirDistUnitHeat(ZoneInletNodeNum).SupplyBranchIndex = BranchNum;
if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Splitter.Exists) {
for (int MainBranchNum = 1;
Expand Down Expand Up @@ -4871,6 +4875,7 @@ void reportAirLoopToplogy(EnergyPlusData &state)
auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum);
auto &zel = state.dataZoneEquip->ZoneEquipList(zoneNum);
for (auto &thisCoolADU : thisZoneEquipConfig.AirDistUnitCool) {
if (thisCoolADU.AirLoopNum != airLoopNum) continue;
if (thisCoolADU.SupplyBranchIndex != thisAtoZInfo.SupplyDuctBranchNum(ductNum)) continue;
if (thisCoolADU.SupplyAirPathExists) {
int spCompNum = thisSupplyPath.OutletNodeSupplyPathCompNum(thisCoolADU.SupplyAirPathOutNodeIndex);
Expand Down Expand Up @@ -4923,6 +4928,7 @@ void reportAirLoopToplogy(EnergyPlusData &state)
auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum);
auto &zel = state.dataZoneEquip->ZoneEquipList(zoneNum);
for (auto &thisHeatADU : thisZoneEquipConfig.AirDistUnitHeat) {
if (thisHeatADU.AirLoopNum != airLoopNum) continue;
if (thisHeatADU.SupplyBranchIndex != thisAtoZInfo.SupplyDuctBranchNum(ductNum)) continue;
if (thisHeatADU.SupplyAirPathExists) {
int spCompNum = thisSupplyPath.OutletNodeSupplyPathCompNum(thisHeatADU.SupplyAirPathOutNodeIndex);
Expand Down

0 comments on commit bce315d

Please sign in to comment.