Skip to content

Comments

Corrects Coil:Heating:Gas:MultiStage to call the gas coil model instead of electric coil model#9525

Merged
Myoldmopar merged 1 commit intodevelopfrom
9414-follow-up
Aug 1, 2022
Merged

Corrects Coil:Heating:Gas:MultiStage to call the gas coil model instead of electric coil model#9525
Myoldmopar merged 1 commit intodevelopfrom
9414-follow-up

Conversation

@rraustad
Copy link
Collaborator

@rraustad rraustad commented Jul 7, 2022

Pull request overview

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.

  • 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

@rraustad rraustad added the Defect Includes code to repair a defect in EnergyPlus label Jul 7, 2022
@rraustad
Copy link
Collaborator Author

rraustad commented Jul 7, 2022

@yzhou601 I believe these are the 2 issues. I think to make sure this works as expected a test file is needed that can test both load control and Setpoint control (or 2 test files). This branch just tests for diffs and is not ready to merge without more testing. I already ran the unit tests and all pass.

FanOpMode = int(Par[6]);

HeatingCoils::CalcMultiStageElectricHeatingCoil(state, CoilIndex, SpeedRatio, CycRatio, SpeedNum, FanOpMode, QActual, SuppHeat);
HeatingCoils::CalcMultiStageGasHeatingCoil(state, CoilIndex, SpeedRatio, CycRatio, SpeedNum, FanOpMode);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was wondering why the CalcMultiStageElectricHeatingCoil passed a SuppHeat argument and see this. Why doesn't this happen regardless if the coil is a heating coil or supplemental heating coil? I think these staged coils (all staged coils) should always use MSHPMassFlowRateLow and MSHPMassFlowRateHigh for the calculations. So if cycling fan the air flow used by the model is the top end flow, and if constant fan the bottom end flow. Something feels off here.

            // for cycling fan, reset mass flow to full on rate
            if (FanOpMode == CycFanCycCoil) AirMassFlow /= PartLoadRat;
            if (FanOpMode == ContFanCycCoil) {
                if (!SuppHeat) {
                    AirMassFlow = state.dataHVACGlobal->MSHPMassFlowRateLow;
                }
            }

Copy link
Contributor

Choose a reason for hiding this comment

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

In the PR #9414 I removed MSHPMassFlowRateHigh and MSHPMassFlowRateLow in other calculations. You will see they're equivalent if you write down all the previous equations and offset against variables. And for supplemental coil, isn't it good enough to pass the inlet airflow rate for constant fan?

Copy link
Contributor

@yzhou601 yzhou601 Jul 8, 2022

Choose a reason for hiding this comment

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

I did it in this way because MSHPMassFlowRateLow and MSHPMassFlowRateHigh are basically only set for main coils, I don't think it's worth creating two additional variables and setting proper values specifically for supplemental coils if there's no obvious reason to do so. I will give it a second thought tomorrow.

Copy link
Contributor

@yzhou601 yzhou601 Jul 8, 2022

Choose a reason for hiding this comment

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

Current approach is consistent with single speed electric coil (the same function is called for both supplemental coils and main heating coils):
https://github.com/NREL/EnergyPlus/blob/develop/src/EnergyPlus/HeatingCoils.cc#L1978-L1987.
When it's constant fan, simply pass the InletAirMassFlowRate otherwise divide it by part load ratio. (when cycling at lowest speed)

Even though they're consistent, I still got questions: The part load ratio being divided here is the supplemental coil part load ratio instead of the main coil part load ratio. Is it correct? It means if the main heating coil runs 100%, while the PLR of supp coil <1, then the enthalpy/temperature at outlet is calculated with airflow rate (inlet airflow/suppcoilPLR), is inlet airflow the full airflow rate?(is it determined by main coil?). Another case is that the main coil is not enabled (eg. outdoor temperature too low), then the backup coil will be the only heating source, will the airflow be determined by its PLR? I think the only doubt from me is to make sure the part load ratio being divided makes sense for both situations.

@rraustad rraustad added the DoNotMerge Code that requires additional attention and investigation label Jul 8, 2022
@Myoldmopar
Copy link
Member

This branch just tests for diffs and is not ready to merge without more testing.

I assume this still captures the status of this PR. It's clean for CI, but this indicates additional testing/results/plots are needed to verify the changes.

@Myoldmopar
Copy link
Member

@rraustad could you clarify the intent/status of this PR?

@rraustad
Copy link
Collaborator Author

This issue/PR was intended to fix a couple things found during the multistage heating coil add-on as supp heater to UnitarySystem. I wanted to get back to this to look for more. This initial commit corrects 2 things found during review of the MS heating coil work by @yzhou601. I think @yzhou601 and I are both in agreement that these 2 changes are needed. We could get this part of the review into develop, I am OK with that, and would just open a new issue to remind me to go after what else we think is wrong.

@rraustad rraustad removed the DoNotMerge Code that requires additional attention and investigation label Aug 1, 2022
@rraustad rraustad changed the title Fixes 2 issues found after 9414 merge Corrects Coil:Heating:Gas:MultiStage to call the gas coil model instead of electric coil model Aug 1, 2022
@rraustad
Copy link
Collaborator Author

rraustad commented Aug 1, 2022

@Myoldmopar there are no diffs or merge conflicts here therefore I did not pull develop and run CI tests again.

@Myoldmopar
Copy link
Member

Quick paste-o fix and use of the proper calc function, this is fine, let's merge and move on.

@Myoldmopar Myoldmopar merged commit 2ba6ccc into develop Aug 1, 2022
@Myoldmopar Myoldmopar deleted the 9414-follow-up branch August 1, 2022 18:47
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

Development

Successfully merging this pull request may close these issues.

Coil:Heating:Gas:MultiStage calls the electric multi stage model when using UnitarySystem set point control

7 participants