Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9049,7 +9049,7 @@ namespace AirflowNetwork {
}

for (AirLoopNum = 1; AirLoopNum <= NumPrimaryAirSys; ++AirLoopNum) {
if (DisSysNumOfCVFs == 0) {
if (DisSysNumOfCVFs == 0 || !distribution_simulated) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like a good fix. I guess another way would be to make sure whatever array crashed (assuming that is what happened) was allocated? This is probably the easiest and cleanest fix, so this is good.

    CurrentModuleObject = "AirflowNetwork:Distribution:Component:Fan";
    DisSysNumOfCVFs = m_state.dataInputProcessing->inputProcessor->getNumObjectsFound(m_state, CurrentModuleObject);

I wonder if other components could cause the same type of crash? Maybe not since the AFN Coil component works in the unit test. For example:

AirflowNetwork:Distribution:Component:HeatExchanger
AirflowNetwork:Distribution:Component:TerminalUnit

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed. This looks OK. distribution_simulated is checked in a bunch of different places, so this is inline with what we're already doing.

continue;
}
for (FanNum = 1; FanNum <= DisSysNumOfCVFs; ++FanNum) {
Expand Down Expand Up @@ -9378,7 +9378,7 @@ namespace AirflowNetwork {

// Rewrite AirflowNetwork airflow rate
for (AirLoopNum = 1; AirLoopNum <= NumPrimaryAirSys; ++AirLoopNum) {
if (DisSysNumOfCVFs == 0) {
if (DisSysNumOfCVFs == 0 || !distribution_simulated) {
continue;
}
for (FanNum = 1; FanNum <= DisSysNumOfCVFs; ++FanNum) {
Expand Down
Loading
Loading