Skip to content

ZoneHVAC:HybridUnitaryHVAC - Check for ventilation setting before defaulting to standby#11642

Open
kevin-moos wants to merge 3 commits into
NatLabRockies:developfrom
bigladder:#11568-find-best-ventilation-only-setting
Open

ZoneHVAC:HybridUnitaryHVAC - Check for ventilation setting before defaulting to standby#11642
kevin-moos wants to merge 3 commits into
NatLabRockies:developfrom
bigladder:#11568-find-best-ventilation-only-setting

Conversation

@kevin-moos

Copy link
Copy Markdown
Collaborator

Pull request overview

Description of the purpose of this PR

When heating and cooling are not requested but ventilation is still requested, check for a ventilation-only setting instead of just defaulting to standby mode.

When heating is requested, ventilation should not exceed Min OA. When cooling is requested, ventilation may exceed Min OA.

Pull Request Author

  • 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
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

Reviewer

  • 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

@kevin-moos

Copy link
Copy Markdown
Collaborator Author

The regressions show higher electricity use and ventilation, but also a lot more timesteps where sensible load was met. The changes include finding settings that can meet partial cooling loads or at least meet ventilation requirements without going into standby. So, these results were expected since the system selected more appropriate settings.

@kevin-moos kevin-moos marked this pull request as ready for review June 19, 2026 14:45

if (Mvent > 0) {
if (VentilationRequested && Mvent > 0) {
PLVentRatio = MinOA_Msa / Mvent;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. is this redundant?, 2) is Mvent > 0 possible if StepIns.MinimumOA = 0? and 3) does it hurt to calculate PLVentRatio each time step?

     if (StepIns.MinimumOA > 0) {
         VentilationRequested = true;
     }
    

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it will be common, but yes, Mvent > 0 is possible when StepIns.MinimumOA is 0. Checking for VentilationRequested might be a little redundant, but I figured it was better to skip a division when we know the result is 0.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Anything else on this point @rraustad?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nothing else. I think this meets the objective.

@mitchute mitchute left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is looking on-track. I made one comment that I hope you can confirm.

PartRuntimeFraction = PLVentRatio;

if (SensibleRoomORZone > 0) {
if (CoolingRequested && SensibleRoomORZone > 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems like a reasonable guard.

}

if (SensibleRoomORZone < 0) {
if (HeatingRequested && SensibleRoomORZone < 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here.

Real64 Wma;
Real64 Hsa;
Real64 Hma;
Real64 PreviousMaxiumConditioningOutput = 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Spelling correction. OK.

Comment on lines +1466 to +1467
RunFractionTotalFuel = (thisSetting.ElectricalPower * thisSetting.Runtime_Fraction) +
(thisSetting.SupplyFanElectricPower * thisSetting.Runtime_Fraction);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like that these are tied to the actual settings now.

RunFractionTotalFuel = thisSetting.WaterConsumptionRate * thisSetting.Runtime_Fraction;
break;
}
thisSetting.Runtime_Fraction = PartRuntimeFraction; //

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess we don't need to assert(false) here since these are the only four valid options?

Comment on lines +1512 to 1521
} else if (VentilationRequested && !DidWePartlyMeetLoad) {
// If no load is requested but ventilation is required, find the setting that uses the least supply fan power.
// Note that settings that meet partial load still take priority, so use logic separate from store_best_attempt.
Real64 RunFractionSupplyFanElectricPower = thisSetting.SupplyFanElectricPower * thisSetting.Runtime_Fraction;
if (RunFractionSupplyFanElectricPower < PreviousMaximumSupplyFanElectricPower) {
PreviousMaximumSupplyFanElectricPower = RunFractionSupplyFanElectricPower;
OptimalSetting = thisSetting;
DidWeMeetVentilation = true;
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess the reasoning is that if we're only requiring ventilation, we should minimize the fan power, and not necessarily the specified objective function, which could be fuel or water. Is that correct? I think I can agree with that, if true.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Correct, that was the reasoning.

Comment on lines +1568 to 1574
PrimaryModeRuntimeFraction = OptimalSetting.Runtime_Fraction;
oStandBy.Runtime_Fraction = (1 - PrimaryModeRuntimeFraction);
if (oStandBy.Runtime_Fraction < 0) {
oStandBy.Runtime_Fraction = 0;
}
CurrentOperatingSettings[1] = oStandBy;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks OK to me.

1, !- Mode 4 Maximum Outdoor Air Fraction
0.7039, !- Mode 4 Minimum Supply Air Mass Flow Rate Ratio
0.957, !- Mode 4 Maximum Supply Air Mass Flow Rate Ratio
1, !- Mode 4 Maximum Supply Air Mass Flow Rate Ratio

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure why the change, but I assume it's fine.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

One of the unit tests was failing to find this mode because the ventilation ratio wasn't high enough. This small change seemed to fix it without breaking anything else and I didn't have to rework that section of the unit test.

@mitchute mitchute added the Defect Includes code to repair a defect in EnergyPlus label Jun 23, 2026
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

4 participants