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

Variable speed fan powered induction boxes #10368

Merged
merged 39 commits into from
Jun 25, 2024
Merged

Conversation

lymereJ
Copy link
Collaborator

@lymereJ lymereJ commented Jan 13, 2024

Pull request overview

Implement variable speed fan powered induction boxes. Follows the approach of #10336 and supersedes it.

Simulation results for the different controls are shown here (see the .ipnyb file).

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 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

@lymereJ lymereJ added NewFeature Includes code to add a new feature to EnergyPlus IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) labels Jan 13, 2024
@lymereJ lymereJ added this to the EnergyPlus 24.2 IOFreeze milestone Jan 13, 2024
@nrel-bot-2
Copy link

@lymereJ @Myoldmopar it has been 28 days since this pull request was last updated.

@lymereJ lymereJ added the OutputChange Code changes output in such a way that it cannot be merged after IO freeze label Mar 8, 2024
Comment on lines -3053 to -3058

} else {
// fill PlantSizFac from data structure
// for (BranchNum = 1;
// BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideLocation::Supply).TotalBranches; ++BranchNum) {
// if (PlantLoop(LoopNum).LoopSide(LoopSideLocation::Supply).NodeNumIn ==
// PlantLoop(LoopNum).LoopSide(LoopSideLocation::Supply).Branch(BranchNum).NodeNumIn) {
// break;
// }
// }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unused.

Comment on lines +117 to +120
${PROJECT_SOURCE_DIR}/input-output-reference/media/VSFanStagedHeatControlDiag.png
${PROJECT_SOURCE_DIR}/input-output-reference/media/SeriesVSFanModulatedHeatControlDiag.png
${PROJECT_SOURCE_DIR}/input-output-reference/media/vav_parallel_fpb_trane_staged.png
${PROJECT_SOURCE_DIR}/input-output-reference/media/vav_parallel_fpb_trane_modulated.png
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add new figures/pictures.

@@ -1964,3 +1966,1069 @@ TEST_F(EnergyPlusFixture, PIU_InducedAir_Plenums)
});
EXPECT_TRUE(compare_err_stream(expectedError, true));
}

TEST_F(EnergyPlusFixture, VSParallelPIUStagedHeat)
Copy link
Collaborator Author

@lymereJ lymereJ Mar 8, 2024

Choose a reason for hiding this comment

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

New tests were added for both the VS series and parallel PIUs for each stage of the staged and modulated heating operations. A test was also added for the VS cooling operation of the series PIU.

Comment on lines 1608 to 1617
if (thisPIU.fanControlType == FanCntrlType::VariableSpeedFan) {
// calculate fan speed ratio
Real64 fanFlowRatio(1.0);
if (thisPIU.MaxTotAirMassFlow > 0.0) {
fanFlowRatio = (thisPIU.PriAirMassFlow + thisPIU.SecAirMassFlow) / thisPIU.MaxTotAirMassFlow;
}
state.dataHVACFan->fanObjs[thisPIU.Fan_Index]->simulate(state, fanFlowRatio, _);
} else {
state.dataHVACFan->fanObjs[thisPIU.Fan_Index]->simulate(state, _, _);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This might seem redundant but it is setup this way to avoid regression diffs due to #10438.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since your math looks correct, which fan output report changed in the existing example files? FYI, I just fixed a fan sizing issue in PIU in a forked repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here's what I see in the EIO file for PlantLoopHeatPump_EIR_Large-Office-2-AWHP-DedHR-AuxBoiler-Pri-Sec-HW.idf when running it from this branch but also from develop:

 Component Sizing Information, AirTerminal:SingleDuct:SeriesPIU:Reheat, CORE_BOTTOM PIUHEATING, Design Size Maximum Primary Air Flow Rate [m3/s], 4.18760
 Component Sizing Information, Fan:SystemModel, CORE_BOTTOM PIUHEATING FAN, Design Size Design Maximum Air Flow Rate [m3/s], 4.51031

The file is intended to be run for Chicago but I'm running it for Golden, CO.

Copy link
Contributor

@rraustad rraustad Mar 15, 2024

Choose a reason for hiding this comment

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

If you look at SystemAirFlowSizing.cc you will see that the TU fan sizes using FinalZoneSizing data while the TU sizes using TermUnitFinalZoneSizing. So the TU needs to set a flag to use the correct data for sizing a fan. This is what I set over in PoweredInductionUnits.cc to get fan sizing correct for:

SeriesPIU:

state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum).SystemAirFlow = true;
state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum).AirVolFlow = 
    state.dataPowerInductionUnits->PIU(PIUNum).MaxTotAirVolFlow; 

Parallel PIU:

state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum).SystemAirFlow = true;
state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum).AirVolFlow =
    state.dataPowerInductionUnits->PIU(PIUNum).MaxSecAirVolFlow;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I'll take a look at it. Is that okay if I include these changes in a dedicated PR for #10438? There's already a lot of changes (in my opinion) in this PR and the CI comes out relatively clean, at least with a manageable number of (expected) diffs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, OK to include this fan sizing change in #10438.

@rraustad
Copy link
Contributor

Configuration reminder:

image

@lymereJ another good test for these changes to TU controls is to plot the air flow and outlet temperature versus the zone predicted load. Like these plots in the Eng. Ref. Probably want to also look at primary and secondary flow versus the expected performance.

image

@lymereJ
Copy link
Collaborator Author

lymereJ commented Mar 19, 2024

@lymereJ another good test for these changes to TU controls is to plot the air flow and outlet temperature versus the zone predicted load. Like these plots in the Eng. Ref. Probably want to also look at primary and secondary flow versus the expected performance.

Because this requires lots of plots (which might need to get updated based on review comments), I thought that perhaps it would be best to host them somewhere else so I put them a separate repository, here (see the .ipnyb file).

@lymereJ
Copy link
Collaborator Author

lymereJ commented Mar 19, 2024

The only diffs are AUD, RDD, and Table diffs and are due to the new outputs.

@rraustad
Copy link
Contributor

Those ipnyb plots look pretty good. The controls are in good shape.

@lymereJ lymereJ marked this pull request as ready for review March 21, 2024 15:43
@lymereJ lymereJ requested a review from EnergyArchmage March 21, 2024 15:43
@nrel-bot-3
Copy link

@lymereJ @Myoldmopar it has been 28 days since this pull request was last updated.

@Myoldmopar
Copy link
Member

@lymereJ so this got conflicted with some of the other refactors. The GitHub web interface is offering to let me resolve them, so they aren't very complex, but I'm not able to see exactly what changed. Could you take a pass and see what needs to be done? I am assuming it is purely the fan hierarchy refactor that @amirroth contributed. Let me know if you need assistance.

@lymereJ
Copy link
Collaborator Author

lymereJ commented May 8, 2024

Thanks for letting me know, I'll take a stab at it and try not to break things.

@lymereJ
Copy link
Collaborator Author

lymereJ commented May 9, 2024

@Myoldmopar - Conflicts resolved!

@nrel-bot
Copy link

nrel-bot commented Jun 7, 2024

@lymereJ @Myoldmopar it has been 28 days since this pull request was last updated.

Copy link
Contributor

@EnergyArchmage EnergyArchmage left a comment

Choose a reason for hiding this comment

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

I have studied the code, built locally, compared to contribution in #10336. Looks good. I really like how the control logic is collected into new routines and reused between series PIU and parallel PIU. Going to be a great improvement.

@dareumnam
Copy link
Collaborator

I pulled the develop branch and resolved the errors regarding compare_enums. The diffs are due to the new outputs, which are expected. All comments have been addressed and everything looks clean. I think this is ready to be merged. @Myoldmopar

@Myoldmopar
Copy link
Member

Thanks @dareumnam, I concur. Everything looks happy. Merging this. Thanks @lymereJ

@Myoldmopar Myoldmopar merged commit 9eae3c1 into develop Jun 25, 2024
16 checks passed
@Myoldmopar Myoldmopar deleted the variable_speed_piu branch June 25, 2024 16:54
if (SolFla == -1) {
ShowSevereError(state, "Iteration limit exceeded in calculating variable speed fan powered box cooling signal");
ShowContinueErrorTimeStamp(state, "");
ShowFatalError(state, format("Series PIU control failed for {}:{} ", thisPIU.UnitType, thisPIU.Name));
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not good practice to fatal out on an iteration (or even SolFla ==2) error. It's better to write an error message, guess at a result, and proceed.

Comment on lines +2577 to +2581
VariableSpeed,
0.5,
Staged,
,
;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm super late to the party, but this is unfortunate this doesn't have the field comments, as grepping for "Heating Control Type" in the testfiles/ folder returns nothing. I was trying to find an example file to test this is new feature.

Comment on lines +465 to +466
ShowSevereError(state, format("Illegal Heating Control Type = {}", heating_control_type));
ShowContinueError(state, format("Occurs in {} = {}", cCurrentModuleObject, thisPIU.Name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Specifically, the thing I was trying to test was this error message.

The "Heating Control Type" field isn't marked required, because it's used only when "Fan Control Type" = VariableSpeed.

The error is less than informative in case you just forgot to fill it.

   ** Severe  ** Illegal Heating Control Type = 
   **   ~~~   ** Occurs in AirTerminal:SingleDuct:SeriesPIU:Reheat = SPACE1-1 VAV REHEAT
   **  Fatal  ** GetPIUs:  Errors found in getting input.  Preceding conditions cause termination.
--- a/testfiles/5ZoneAirCooledConvCoef_VSFan.idf
+++ b/testfiles/5ZoneAirCooledConvCoef_VSFan.idf
@@ -2436,7 +2436,7 @@
     0.0001,                  !- Convergence Tolerance
     VariableSpeed,
     0.5,
-    Modulated,
+    ,
     ,
     ;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing it out, I'll address it today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) NewFeature Includes code to add a new feature to EnergyPlus OutputChange Code changes output in such a way that it cannot be merged after IO freeze
Projects
None yet
Development

Successfully merging this pull request may close these issues.