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

Follow up to #10617 and allow other ZoneHVAC:* component with Airflow Network simulations #10637

Merged
merged 7 commits into from
Aug 16, 2024

Conversation

lymereJ
Copy link
Collaborator

@lymereJ lymereJ commented Aug 2, 2024

Pull request overview

This PR is a follow up to #10617, it adds support for other types of zonal systems such as VRF terminals, PTHP, PTAC, and WSHP. The PR also address some of the review comments from #10617.

Pull Request Author

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

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@lymereJ lymereJ added NewFeature Includes code to add a new feature to EnergyPlus AirflowNetwork Related primarily on airflow-network portions of the codebase labels Aug 2, 2024
@lymereJ lymereJ added this to the EnergyPlus 24.2 IOFreeze milestone Aug 2, 2024
Copy link
Collaborator Author

@lymereJ lymereJ left a comment

Choose a reason for hiding this comment

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

Code change walk-through.

Comment on lines +10844 to +10865
bool getVRFTUNodeNumber(EnergyPlusData &state, int const nodeNumber)
{
for (int vrfTUIndex = 1; vrfTUIndex <= state.dataHVACVarRefFlow->NumVRFTU; ++vrfTUIndex) {
auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(vrfTUIndex);

bool noVrfTUOutdoorAir = false;
if (vrfTU.CoolOutAirVolFlow == 0 && vrfTU.HeatOutAirVolFlow == 0 && vrfTU.NoCoolHeatOutAirVolFlow == 0) {
noVrfTUOutdoorAir = true;
}

if (noVrfTUOutdoorAir &&
(nodeNumber == vrfTU.VRFTUInletNodeNum || nodeNumber == vrfTU.VRFTUOutletNodeNum || nodeNumber == vrfTU.fanInletNode ||
nodeNumber == vrfTU.fanOutletNode || nodeNumber == vrfTU.heatCoilAirOutNode || nodeNumber == vrfTU.coolCoilAirOutNode ||
nodeNumber == vrfTU.VRFTUOAMixerOANodeNum || nodeNumber == vrfTU.VRFTUOAMixerRelNodeNum || nodeNumber == vrfTU.VRFTUOAMixerRetNodeNum ||
nodeNumber == vrfTU.VRFTUOAMixerMixedNodeNum || nodeNumber == vrfTU.SuppHeatCoilAirInletNode ||
nodeNumber == vrfTU.SuppHeatCoilAirOutletNode)) {
return true;
}
}
return false;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New function to identify nodes used by VRF terminal units that don't use any OA so they can be excluded from the AFN distribution validation.

Comment on lines +16750 to +16776
bool getUnitarySystemNodeNumber(EnergyPlusData &state, int const nodeNumber)
{
for (int unitarySysIndex = 0; unitarySysIndex <= state.dataUnitarySystems->numUnitarySystems - 1; ++unitarySysIndex) {
auto &unitarySys = state.dataUnitarySystems->unitarySys[unitarySysIndex];

int FanInletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->inletNodeNum;
int FanOutletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->outletNodeNum;

bool noUnitarySysOutdoorAir = false;
if (unitarySys.m_CoolOutAirVolFlow == 0 && unitarySys.m_HeatOutAirVolFlow == 0 && unitarySys.m_NoCoolHeatOutAirVolFlow == 0) {
noUnitarySysOutdoorAir = true;
}

if (unitarySys.m_sysType == UnitarySys::SysType::PackagedWSHP || unitarySys.m_sysType == UnitarySys::SysType::PackagedAC ||
unitarySys.m_sysType == UnitarySys::SysType::PackagedHP) {
if (noUnitarySysOutdoorAir && (nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex ||
nodeNumber == unitarySys.AirInNode || nodeNumber == unitarySys.m_OAMixerNodes[0] ||
nodeNumber == unitarySys.m_OAMixerNodes[1] || nodeNumber == unitarySys.m_OAMixerNodes[2]) ||
nodeNumber == unitarySys.m_OAMixerNodes[3] || nodeNumber == unitarySys.CoolCoilOutletNodeNum ||
nodeNumber == unitarySys.HeatCoilOutletNodeNum) {
return true;
}
}
}
return false;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New function to identify nodes used by PTAC/PTHP/WSHP that don't use any OA so they can be excluded from the AFN distribution validation.

Comment on lines -1502 to +1518
bool GetWindowACNodeNumber(EnergyPlusData &state, int const NodeNumber)
bool getWindowACNodeNumber(EnergyPlusData &state, int const nodeNumber)
{
if (state.dataWindowAC->GetWindowACInputFlag) {
GetWindowAC(state);
state.dataWindowAC->GetWindowACInputFlag = false;
}

bool windowACOutdoorAir = false;

for (int windowACIndex = 1; windowACIndex <= state.dataWindowAC->NumWindAC; ++windowACIndex) {
auto &windowAC = state.dataWindowAC->WindAC(windowACIndex);
if (windowAC.OutAirVolFlow == 0) {
windowACOutdoorAir = true;
} else {
windowACOutdoorAir = false;
}
int FanInletNodeIndex = 0;
int FanOutletNodeIndex = 0;
FanInletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->inletNodeNum;
FanOutletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->outletNodeNum;

if (windowACOutdoorAir &&
(NodeNumber == windowAC.OutsideAirNode || NodeNumber == windowAC.MixedAirNode || NodeNumber == windowAC.AirReliefNode ||
NodeNumber == FanInletNodeIndex || NodeNumber == FanOutletNodeIndex || NodeNumber == windowAC.AirInNode)) {
int FanInletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->inletNodeNum;
int FanOutletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->outletNodeNum;

if (windowAC.OutAirVolFlow == 0 &&
(nodeNumber == windowAC.OutsideAirNode || nodeNumber == windowAC.MixedAirNode || nodeNumber == windowAC.AirReliefNode ||
nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex || nodeNumber == windowAC.AirInNode ||
nodeNumber == windowAC.CoilOutletNodeNum || nodeNumber == windowAC.AirOutNode || nodeNumber == windowAC.ReturnAirNode)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Address review comments from #10617.

Comment on lines +10152 to +10153
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP &&
this->m_sysType != SysType::PackagedWSHP) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Exclude PTHP/PTAC/WSHP since they are excluded from AFN simulation with distribution.

@lymereJ lymereJ marked this pull request as ready for review August 5, 2024 18:30
Copy link
Member

@jasondegraw jasondegraw left a comment

Choose a reason for hiding this comment

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

This appears to be following the pattern that was set out in previous PRs. I guess if I have a concern it's that some of the logical conditions are getting a little on the long side, but I'm not sure what we can do to help there. Maybe a comment on what the conditions all mean? I'm not sure about that. Anyway, no objections from me.

@Myoldmopar
Copy link
Member

Anyway, no objections from me.

Thanks for looking this over @jasondegraw ! This is on track to merge then.

@Myoldmopar
Copy link
Member

This is still all happy with develop pulled in, thanks @lymereJ and @jasondegraw

@Myoldmopar Myoldmopar merged commit 9f28e62 into develop Aug 16, 2024
15 checks passed
@Myoldmopar Myoldmopar deleted the allow_wahp_afn branch August 16, 2024 13:27
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 NewFeature Includes code to add a new feature to EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants