Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash if AFN zone doesn't have inlet or return node connection #7328

Closed
2 of 3 tasks
aaron-boranian opened this issue Jun 6, 2019 · 6 comments · Fixed by #7338
Closed
2 of 3 tasks

Crash if AFN zone doesn't have inlet or return node connection #7328

aaron-boranian opened this issue Jun 6, 2019 · 6 comments · Fixed by #7338
Assignees
Labels
AirflowNetwork Related primarily on airflow-network portions of the codebase Defect Includes code to repair a defect in EnergyPlus

Comments

@aaron-boranian
Copy link
Contributor

aaron-boranian commented Jun 6, 2019

Issue overview

If an airflow network zone (AirflowNetwork:MultiZone:Zone) is defined, and the AFN:SimulationControl object is using "MultiZoneWithDistribution", but the corresponding Zone has no inlet or return node connections defined in ZoneHVAC:EquipmentConnections, EnergyPlus will crash. After assigning an inlet or return node connection, there is a severe error message telling the user to hook up the necessary AFN objects (AFN:Distribution:Node, AFN:Distribution:Linkage, AFN:Distribution:Component:Duct, etc.). There should be a similar severe error letting the user know that for "MultiZoneWithDistribution", zones must have inlet or return node connections.

Attached defect file is a slightly modified version of the AirflowNetwork_MultiAirLoops.idf example file. The user added a baseboard heater to the unconditioned attic zone (new objects at top of file). Their goal was to simulate a zone that only has a baseboard heater (no conditioned supply air), then mixes air into an adjacent zone before returned back to air system.

AirflowNetwork_MultiAirLoops MOD.txt

Details

Some additional details for this issue (if relevant):

  • Version 9.1.0

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file added: EnergyPlusDevSupport - 7328
  • Ticket added to Pivotal for defect (development team task)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@jmarrec jmarrec self-assigned this Jun 11, 2019
@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus AirflowNetwork Related primarily on airflow-network portions of the codebase labels Jun 11, 2019
@jmarrec
Copy link
Contributor

jmarrec commented Jun 11, 2019

If you have a Zone referenced in an AirflowNetwork:MultiZone:Zone and that is controlled, I am not 100% sure it should require the zone to be hooked to an AirLoopHVAC actually.
In any case it shouldn't crash.

jmarrec added a commit to jmarrec/EnergyPlus that referenced this issue Jun 11, 2019
jmarrec added a commit to jmarrec/EnergyPlus that referenced this issue Jun 11, 2019
@edwardv720
Copy link

edwardv720 commented Jun 13, 2019

If you have a Zone referenced in an AirflowNetwork:MultiZone:Zone and that is controlled, I am not 100% sure it should require the zone to be hooked to an AirLoopHVAC actually.
In any case it shouldn't crash.

I agree @jmarrec . It shouldn't require the zone to be hooked up to an air loop, I don't think that was the intention of the AFN.

As @aaron-boranian mentioned, the intended goal was to model include a zone, with a baseboard heater but no associated air loop, into the air flow network. So that adjacent zones that do have an distribution system can force air into the controlled zone that doesn't have an air loop. It should be do-able. But I don't think code allows that to happen right now - although the documentation doesn't disallow it.

The relevant code may be:

In AirflowNetworkBalanceManager.cc https://github.com/NREL/EnergyPlus/blob/develop/src/EnergyPlus/AirflowNetworkBalanceManager.cc#L9840, for every AirflowNetwork:MultiZone:Zone object, it takes the air loop number of the zone's inlet air node (ZoneEquipConfig(j).InletNodeAirLoopNum(1)) and assigns it as the air loop number for the corresponding AFN node airloop number AirflowNetworkNodeData(i).AirLoopNum.

            // Zone first
            for (i = 1; i <= AirflowNetworkNumOfZones; i++) {
                for (j = 1; j <= NumOfZones; j++) {
                    if (!ZoneEquipConfig(j).IsControlled) continue;
                    if (MultizoneZoneData(i).ZoneNum == j) {
                        // No multiple Airloop
                        AirflowNetworkNodeData(i).AirLoopNum = ZoneEquipConfig(j).InletNodeAirLoopNum(1);
                    }
                }
            }

This works fine when every AirflowNetwork:MultiZone:Zone has an air loop. But if there isn't an air loop for that zone, a zone air inlet node is not defined in the ZoneHVAC:EquipmentConnections object, and the ZoneEquipConfig().InletNodeAirLoopNum() is not allocated https://github.com/NREL/EnergyPlus/blob/develop/src/EnergyPlus/DataZoneEquipment.cc#L793. So effectively, when the AFN:SimulationControl object is set to "MultiZoneWithDistribution", all zones in the AFN must have an air loop.

Is this correct?

@lgu1234
Copy link
Contributor

lgu1234 commented Jun 13, 2019

@jmarrec I tested the defect file and realized this zone is not served by an AirLoop. Although it has a base board, the zone equipment does not any inlet and outlet nodes (very rare). Therefore, no check is needed. Here is my fix:

                if (MultizoneZoneData(i).ZoneNum == j && ZoneEquipConfig(j).NumInletNodes > 0) {
                    // No multiple Airloop
                    AirflowNetworkNodeData(i).AirLoopNum = ZoneEquipConfig(j).InletNodeAirLoopNum(1);
                }

The program ran to completion with the release version. The debug version has a known issue with underflow: AirflowNetwork floating point underflow #7233. We will fix it late.

@jmarrec
Copy link
Contributor

jmarrec commented Jun 17, 2019

@lgu1234 Ok so this is what I had came up with as my second try. Thanks a lot for looking into it and confirming!

@edwardv720
Copy link

Hi @jmarrec , so with the the commit, Eplus will not permit a zone with only a baseboard to be simulated as part of the AFN with distribution? It must contain an inlet (and the associated air loops etc etc)?

@jmarrec
Copy link
Contributor

jmarrec commented Jun 17, 2019

@edwardv720 no it'll work. The defect file runs to completion

Myoldmopar added a commit that referenced this issue Jul 17, 2019
…Inlet

Fix #7328 - Crash if AFN zone doesn't have inlet or return node connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AirflowNetwork Related primarily on airflow-network portions of the codebase Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants