Fix heating and cooling runtime fraction for AirLoopHVAC:UnitarySystem for airflow network simulations#11491
Fix heating and cooling runtime fraction for AirLoopHVAC:UnitarySystem for airflow network simulations#11491
AirLoopHVAC:UnitarySystem for airflow network simulations#11491Conversation
lymereJ
left a comment
There was a problem hiding this comment.
Code walk-through:
| // Report the current output | ||
| this->reportUnitarySystem(state, AirLoopNum); | ||
|
|
||
| // Get the actual maximum RTF for AFN simulations |
There was a problem hiding this comment.
Similar changes as for #11367. We save the RTFs at the system level instead of at the coil level and make the determination here, that way we can also include the supplemental heating coil.
| int CompIndex = this->m_HeatingCoilIndex; | ||
| HVAC::FanOp fanOp = this->m_FanOpMode; | ||
| Real64 DesOutTemp = this->m_DesiredOutletTemp; | ||
|
|
There was a problem hiding this comment.
These were only applied when the system is controller to a setpoint. The propose changes apply to both load-based and setpoint control.
| latOut); | ||
|
|
||
| // Check that the runtime fraction is less than one so the impact of cycling fan is correctly accounted for in the AFN | ||
| EXPECT_TRUE(state->dataAirLoop->AirLoopAFNInfo(1).AFNLoopHeatingCoilMaxRTF < 1); |
There was a problem hiding this comment.
New unit test to make sure that the correct RTF is retrieved. This verification fails on develop.
|
src/EnergyPlus/UnitarySystem.cc
Outdated
|
|
||
| // Get the actual maximum RTF for AFN simulations | ||
| if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
| this->m_sysType != SysType::PackagedWSHP && AirLoopNum > 0) { |
There was a problem hiding this comment.
I think there may be a problem with these conditionals. The first is that we should move away from checking for the "Packaged" sysType because it was added to reduce diffs. These special considerations should be removed slowly and will cause little diffs so should probably be done 1 at a time. What is important here is that this is a system level object. Not zone equipment, OA sys equipment, or in a ZoneHVAC:OutdoorAirUnit object. The second is that AirLoopNum > 0 will also be true (I think) for a UnitarySystem in the OutdoorAir system.
This conditional would be the same as:
if (state.afn->distribution_simulated && !this->IsZoneEquipment && AirLoopNum > 0) {
except the snag that this system could be called from MixedAir and be part of an outdoor air system. You could probably use this to capture a system object (air loop equipment):
if (state.afn->distribution_simulated && AirLoopNum > 0 && state.dataSize->CurOASysNum == 0) {
I am not positive that AFN would not include OA systems here but if so then CurOASysNum==0 would not be needed (I think it's needed).
There was a problem hiding this comment.
I see, thanks. I was following the existing pattern. Should these mods be done as a follow up PR, or should I include them here?
There was a problem hiding this comment.
Just include them here. This is a small change that also gets rid of some "Packaged" sysType checks.
There was a problem hiding this comment.
I made the changes.
| if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
| this->m_sysType != SysType::PackagedWSHP && AirLoopNum > 0) { | ||
| refAFNLoopHeatingCoilMaxRTF = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF; | ||
| refAFNLoopCoolingCoilMaxRTF = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; |
There was a problem hiding this comment.
Can't you just move these last 2 lines down inside of the block below?
There was a problem hiding this comment.
I don't think so because I think this needs to happen before controlUnitarySystemtoSP or controlUnitarySystemtoLoad are called.
There was a problem hiding this comment.
I see. Because these same AFN variables are set in the child. In this parent there can be 2 heating coils so the larger RTF should be used and calling the control functions will set AFNLoopHeatingCoilMaxRTF to the RTF of the last coil called.



Pull request overview
AirLoopHVAC:UnitarySystemin AFN simulation with distribution losses #11490Pull Request Author
Reviewer