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

Fix #10355 - Correctly Set up Zone Internal Gains when Refrigeration:CompressorRack serves a Refrigeration:WalkIn object with "Zone" Heat Transfer Location #10525

Merged
merged 2 commits into from
May 30, 2024

Conversation

jmarrec
Copy link
Contributor

@jmarrec jmarrec commented May 27, 2024

Pull request overview

I have ran the Defect file (which I hosted on EnergyPlusDevSupport/DefectFiles/10000s/10355) before and after fix. Confirmed the segfault before, and completion after.

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

jmarrec added 2 commits May 27, 2024 13:26
…CompressorRack serves a Refrigeration:WalkIn object with "Zone" Heat Transfer Location
@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label May 27, 2024
@jmarrec jmarrec self-assigned this May 27, 2024
@@ -197,6 +197,7 @@ set(test_src
Psychrometrics.unit.cc
Pumps.unit.cc
PurchasedAirManager.unit.cc
RefrigeratedCase.unit.cc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's quite scary that there was zero unit test for any Refrigeration objects...

; !- Zone Equipment Sequential Heating Fraction Schedule Name 1
)IDF";

TEST_F(EnergyPlusFixture, RefrigeratedRackWithCaseInZone)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I've set up 4 unit tests:

  • CompressorRack references a Case, directly
  • CompressorRack references a WalkIn, directly (failed initially)
  • CompressorRack references only a WalkIn, via a CaseAndWalkInList (failed initially)
  • CompressorRack references both a Walkin and a Case, via a CaseAndWalkinList (Walkin first, then case).

Comment on lines +8637 to +8639
// If CoilFlag is true and Location is Zone, GetRefrigerationInput ensures you must have a Heat Rejection Zone provided already
SetupZoneInternalGain(state,
RefrigCase(rack.CaseNum(1)).ActualZoneNum,
rack.HeatRejectionZoneNum,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case that means NumCoils > 0, Get input routine will throw if you don't have a HeatRejectionZone, so safe to use

Comment on lines +8798 to +8809

// if Location is Zone, GetRefrigerationInputEither checks that you have at least one load and that either:
// * You have only cases, and they must be all in the same zone
// * Or you must have a Heat Rejection Zone provided
int rackZoneNum = -1;
if (rack.HeatRejectionZoneNum > 0) {
rackZoneNum = rack.HeatRejectionZoneNum;
} else {
rackZoneNum = RefrigCase(rack.CaseNum(1)).ActualZoneNum;
}
SetupZoneInternalGain(state,
RefrigCase(rack.CaseNum(1)).ActualZoneNum,
rackZoneNum,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When CoilFlag is not set, NumCoils == 0, and either you have NumWalkIns > 0, in which case you MUST have a heat rejection zone. Otherwise that means NumCases > 0 and it's enforced that all of them must be in the same zone.
(It also enforces that NumCoils + NumWalkIns + NumCases > 0, so we know there is a load)

@jmarrec jmarrec requested a review from Myoldmopar May 27, 2024 12:48
Copy link
Contributor

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

Everything looks good here. Thanks @jmarrec !

@mjwitte mjwitte merged commit 6cccca9 into develop May 30, 2024
17 checks passed
@mjwitte mjwitte deleted the 10355_CompressorRack_WalkIn_InZone branch May 30, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
7 participants