-
Notifications
You must be signed in to change notification settings - Fork 392
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
Accept Air Terminal objects in RoomAir:Node:AirflowNetwork:HVACEquipment #9498
Accept Air Terminal objects in RoomAir:Node:AirflowNetwork:HVACEquipment #9498
Conversation
ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment(state); | ||
state.dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag = false; | ||
} | ||
for (int AirDistUnitNum = 1; AirDistUnitNum <= numAirDistUnits; ++AirDistUnitNum) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check air terminal objects under AirDistUnit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could probably propose some cleanups in here, but the arrays and nested structures are quite intertwined, so I'm not actually sure what auto &
references would be most beneficial. And this is only done during GetInput so I don't think it's worth rigoring over too much. If this fixes the defect, I would just let it be.
|
||
// constructor | ||
RAFNData() : ZoneNum(0), RoomAirNode(0) | ||
RAFNData() : ZoneNum(0), RoomAirNode(0), numAirDistUnits(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new variable in the module level for unit test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgu1234 I'm not super sure about this new variable. Does it have a use other than for unit testing?
Unrelated to this new variable, it looks like the class
should be a struct
since everything is public, probably can leave that for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasondegraw The module level variable of numAirDistUnits is not necessary for unit test. I made it as a local variable and still pass the unit test. The code modification was uploaded a while ago. Please check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgu1234 Sorry I missed this message. I am wondering if this variable is actually needed, but let's not let this hold things up.
EXPECT_NEAR(1010.1746, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).CpAir, 0.001); | ||
|
||
thisRAFN.numAirDistUnits = 0; | ||
state->dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new section of unit test to ensure ErrorFound = false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is perfectly fine. And no big deal, but there's no need to 'cleanup' state at the end of the unit test, it will be wiped entirely for every new unit test being run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in my comments, I could propose some tweaks, but I'm not sure they are justified in this small bug fix. Accompanying unit test is fine. I'll test the defect file locally to verify the fix, but from a code change perspective it's OK.
@rraustad could you just checkout the branch and see if it looks good to you from a red squiggle analysis
@jasondegraw do you want to look this over as well? It's not affecting airflow network guts themselves, but it's adjacent or maybe tangential.
EXPECT_NEAR(1010.1746, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).CpAir, 0.001); | ||
|
||
thisRAFN.numAirDistUnits = 0; | ||
state->dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is perfectly fine. And no big deal, but there's no need to 'cleanup' state at the end of the unit test, it will be wiped entirely for every new unit test being run.
ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment(state); | ||
state.dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag = false; | ||
} | ||
for (int AirDistUnitNum = 1; AirDistUnitNum <= numAirDistUnits; ++AirDistUnitNum) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could probably propose some cleanups in here, but the arrays and nested structures are quite intertwined, so I'm not actually sure what auto &
references would be most beneficial. And this is only done during GetInput so I don't think it's worth rigoring over too much. If this fixes the defect, I would just let it be.
@@ -83,6 +85,7 @@ | |||
#include <EnergyPlus/RoomAirModelAirflowNetwork.hh> | |||
#include <EnergyPlus/SteamBaseboardRadiator.hh> | |||
#include <EnergyPlus/UtilityRoutines.hh> | |||
#include <EnergyPlus/ZoneAirLoopEquipmentManager.hh> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI didn't seem to report entirely on this PR feed, but you can tell on the dashboard that it is all clean. The Linux release build has the SolarShading diffs, but otherwise it's 100%. |
@lgu1234 is there a defect file? |
@Myoldmopar Here is a link for a defect file: |
OK, ran that input file with develop, fatal error, ran it with this branch, success. However, the error file has this:
Is there something being missed during GetInput? |
@lgu1234 my comment from 27 days ago still applies. This is still showing in the error file of the defect:
I understand this is a user defect file, so there could be some issue causing this message, but it is very suspicious given what this PR is supposed to fix. Please confirm so that this can merge. |
@lgu1234 my comment from 7 days ago still applies. Please confirm whether this error is expected to occur for this user's configuration? It smells suspiciously like a node connection check is missing. |
@lgu1234 my comment from 8 days ago still applies. Please confirm whether this error is expected to occur for this user's configuration? It smells suspiciously like a node connection check is missing. |
@Myoldmopar I am going to to take a look at the test file. |
@Myoldmopar I debug the test file and found a possible node connection issue in the test file. The test file is added: https://github.com/NREL/EnergyPlusDevSupport/blob/master/DefectFiles/8000s/8419/RoomAirflowNetwork_mod-v221WithNew%20connection.idf. After make right connections for all nodes, I still got a similar error. It is node connection error and nothing to do with my fix. I would like to post a new issue to address this. Before I do anything. I would like to ask you and @mjwitte a question first. Do we allow AirTerminal:SingleDuct:ConstantVolume:NoReheat to be used in ZoneEquirpment only? When I look at example files, the terminal units are part of AirLoopHVAC and is connected with a splitter. If it can be used standalone, I can make one more check in the connection to bypass it, so that no connection error occurs. |
@lgu1234 look at the ZoneHVAC:EquipmentList object. It will have an air distribution object that uses the terminal unit. AirTerminal:* are only used as zone equipment. |
@lgu1234 I do not understand your question. As @rraustad said, AirTerminal:SingleDuct:ConstantVolume:NoReheat is a terminal unit that is always a child of a ZoneHVAC:AirDistributionUnit object. The ZoneHVAC:AirDistributionUnit will always be listed in a ZoneHVAC:EquipmentList. The inlet node to AirTerminal:SingleDuct:ConstantVolume:NoReheat will typically be the outlet from an AirloopHVAC:ZoneSplitter, but that component is not required. So, the inlet node could be the same as the AirloopHVAC Demand Side Inlet Node. This defect file has many problems. It has a fan, a heating coil, a cooling coil and an airdistribution unit with nothing to connect them. I'm surprised this file even runs. It needs an AirloopHVAC, a Branch, and outdoor air system, etc. The HVAC components are doing nothing here. |
@mjwitte Thanks for your quick reply. The connection error message shown in the test file run is nothing to do with my fix. Although I tried to eliminate the error message, I was not successful so far. It may need a lot of work to make it happen. I hope to accept this fix and open a new issue to fix error message as follow up. |
Since I posted the original defect, I will make a working defect file that tests this fix. There is no other defect related to the node connection warning, it's a real problem in the idf file. |
That seems to sound like this is ready. I'll kick off a local build/test, because if so, then this can merge in all clean. |
And per some offline discussion, I misunderstood, so this will hold for right now to make sure we have it tested out more robustly. |
@Myoldmopar @mjwitte Finally, I made a test file without error message. The test file was revised based on an example file of RoomAirflowNetwork.idf. Please test it and let me know what happens. |
@lgu1234 thanks for the example file. I scanned through the file checking on the new air terminal support, ran the file and took a look through the outputs. The ERR file is clean with no node connection warning, so that's a great sign. I didn't take the time to process exactly what the numerics should be in this particular example, but the zone conditions all seem reasonable, so with that combined with the clean CI and the unit test that ensures flow fractions are set appropriately, I'll merge this in. I've run the full test suite locally with latest develop and it's good to go. Thanks |
Pull request overview
Fixes #8419
The current code only checks HVAC equipment listed in ZoneEquipList. Air Terminal objects are not listed in ZoneEquipList directly. Instead, Air Terminal objects are listed in ZoneHVAC:AirDistributionUnit, while ZoneHVAC:AirDistributionUnit is listed in ZoneEquipList. Therefore, one more loop is needed to search air terminal objects under ZoneHVAC:AirDistributionUnit, after ZoneHVAC:AirDistributionUnit is found in ZoneEquipList.
The test file runs to completion.
NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.