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

Space Sizing and HVAC Documentation and Unit Test Updates #10239

Merged
merged 8 commits into from
Sep 22, 2023

Conversation

mjwitte
Copy link
Contributor

@mjwitte mjwitte commented Sep 21, 2023

Pull request overview

Completes the Space Sizing and HVAC new feature. See also
#9982
#10174
#10205

  • I/O Ref updates for Space Sizing and HVAC. (Thanks to @rraustad for the figure!)
  • Engineering Ref updates for Space Sizing and HVAC.
  • Unit test -space splitter
  • Unit test - space mixer
  • Fix example file
  • Fix zone equip config inits for spaces

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
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

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

@mjwitte mjwitte added the NewFeature Includes code to add a new feature to EnergyPlus label Sep 21, 2023
@mjwitte mjwitte added this to the EnergyPlus 23.2 milestone Sep 21, 2023
@mjwitte mjwitte changed the title Space Sizing and HVAC Documantation and Unit Test Updates Space Sizing and HVAC Documentation and Unit Test Updates Sep 21, 2023
@mjwitte mjwitte marked this pull request as ready for review September 21, 2023 22:31
@mjwitte
Copy link
Contributor Author

mjwitte commented Sep 22, 2023

@Myoldmopar @rraustad Funny how unit tests uncover issues. So, found that a big chunk of zone equipment config inits weren't being done for spaces. Hopefully this will come back clean and pass muster to go in for v23.2.

if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
for (auto &thisSpaceEquipConfig : state.dataZoneEquip->spaceEquipConfig) {
if (!thisSpaceEquipConfig.IsControlled) continue;
thisSpaceEquipConfig.beginEnvirnInit(state);
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, so you needed to do this for zone AND spaces. Easy to overlook since it's only updating exhaust and return nodes, and only on BeginEnvrnFlag.

if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
for (auto &thisSpaceEquipConfig : state.dataZoneEquip->spaceEquipConfig) {
if (!thisSpaceEquipConfig.IsControlled) continue;
thisSpaceEquipConfig.hvacTimeStepInit(state, FirstHVACIteration);
Copy link
Contributor

Choose a reason for hiding this comment

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

Now this one happens each FirstHVACIteration, still easy to overlook.

@mjwitte mjwitte requested a review from Myoldmopar September 22, 2023 12:32
Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

This does pass muster with me, and really does a good job of polishing up this work. Thanks @mjwitte

}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I am a big fan of these functions with clear purposes. This type of code makes it easy to envision more intentional calling points like we do in plant. One big one-time-init pass and then no need to check one-time-flag inside the components anymore. This is a good step.

EXPECT_NEAR(mixSpace1Node.MassFlowRateMaxAvail, equipInletNode.MassFlowRateMaxAvail * mixSpace1.fraction, 0.0001);
EXPECT_NEAR(mixSpace2Node.MassFlowRateMaxAvail, equipInletNode.MassFlowRateMaxAvail * mixSpace2.fraction, 0.0001);
EXPECT_NEAR(mixSpace3Node.MassFlowRateMaxAvail, equipInletNode.MassFlowRateMaxAvail * mixSpace3.fraction, 0.0001);
}
Copy link
Member

Choose a reason for hiding this comment

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

Wonderful unit tests.

@Myoldmopar
Copy link
Member

CI is happy, just the one space file with expected diffs. Pulled in develop and it's happy locally as well. Merging this, thanks @mjwitte

@Myoldmopar Myoldmopar merged commit b4769ab into develop Sep 22, 2023
@Myoldmopar Myoldmopar deleted the SpaceSizingHVACFollowup branch September 22, 2023 14:42
@mjwitte mjwitte mentioned this pull request Jun 17, 2024
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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