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

Include lighting return air fraction input during sizing when ZoneAirMassFlowConservation is used #10469

Merged

Conversation

rraustad
Copy link
Contributor

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 Apr 15, 2024
@rraustad
Copy link
Contributor Author

rraustad commented Apr 15, 2024

Defect file results when RA fraction = 0.2:

 Zone Sizing Information, SPACE1-1, Cooling, 2638.67311, 2638.67311, 0.22166, 0.22166
 Zone Sizing Information, SPACE1-1, Heating, 3863.32620, 3863.32620, 0.11659, 0.11659

Defect file results when RA fraction = 0.0:

 Zone Sizing Information, SPACE1-1, Cooling, 2955.41740, 2955.41740, 0.24826, 0.24826
 Zone Sizing Information, SPACE1-1, Heating, 3847.48587, 3847.48587, 0.11611, 0.11611

20% of Zone 1 lighting is 1584 * 0.2 = 316.8, plus 2638.67 = 2955.47 for summer design day where lighting schedule = 1, and a fraction of 0.05 for winter design day yields 316.8 * 0.05 + 3847.49 = 3863.33.

Lights,
  SPACE1-1 Lights 1,       !- Name
  SPACE1-1,                !- Zone or ZoneList or Space or SpaceList Name
  LIGHTS-1,                !- Schedule Name
  LightingLevel,           !- Design Level Calculation Method
  1584,                    !- Lighting Level {W}
  ,                        !- Watts per Zone Floor Area {W/m2}
  ,                        !- Watts per Person {W/person}
  0.2,                     !- Return Air Fraction
  0.6,                    !- Fraction Radiant
  0.2,                     !- Fraction Visible
  0,                       !- Fraction Replaceable
  GeneralLights;           !- End-Use Subcategory

Schedule:Compact,
  LIGHTS-1,                !- Name
  Fraction,                !- Schedule Type Limits Name
  Through: 12/31,          !- Field 1
  For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2
  Until: 8:00,0.05,        !- Field 3
  Until: 9:00,0.9,         !- Field 5
  Until: 10:00,0.95,       !- Field 7
  Until: 11:00,1.00,       !- Field 9
  Until: 12:00,0.95,       !- Field 11
  Until: 13:00,0.8,        !- Field 13
  Until: 14:00,0.9,        !- Field 15
  Until: 18:00,1.00,       !- Field 17
  Until: 19:00,0.60,       !- Field 19
  Until: 21:00,0.20,       !- Field 21
  Until: 24:00,0.05,       !- Field 23
  For: Weekends WinterDesignDay Holiday, !- Field 25
  Until: 24:00,0.05;       !- Field 26

AdjustedTotalReturnMassFlow = min(AdjustedTotalReturnMassFlow, zoneEquipConfig.AirLoopDesSupply);
if (!state.dataGlobal->DoingSizing) {
AdjustedTotalReturnMassFlow = min(AdjustedTotalReturnMassFlow, zoneEquipConfig.AirLoopDesSupply);
}
Copy link
Contributor Author

@rraustad rraustad Apr 16, 2024

Choose a reason for hiding this comment

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

There are actually 3 places that need this change (line 4564). However, I would rather find a place during zone sizing where zoneEquipConfig.AirLoopDesSupply could be set = to zone air mass flow rate for this time step. This would eliminate these conditionals during the simulation. I have not found that place yet.

Also not sure what the purpose of this test is other than for single zone air loops. And if there are 2 air loops connected to the zone then the AirLoopDesSupply from the second will be used. For multi-zone air loops this seems like it could be improved but given the zone RA flow is based on zone supply, exhaust and mixing then not sure how to do that. This variable is set one time in SimAirServingZones::InitAirLoops to the design system flow rate.

for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
    if (!state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) continue;
    // sets design supply air flow rate in the ZoneEquipConfig struct for use with zone air mass balance
    for (int returnNum = 1; returnNum <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumReturnNodes; ++returnNum) {
        int airLoop = state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ReturnNodeAirLoopNum(returnNum);
        if (airLoop > 0) {
            state.dataZoneEquip->ZoneEquipConfig(ZoneNum).AirLoopDesSupply = state.dataAirLoop->AirLoopFlow(airLoop).DesSupply;
        }
    }
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that this needs improvement to allow for multiple air loops serving the same zone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added issue #10493.

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.

Code changes seem reasonable here.

max(0.0, TotInletAirMassFlowRate - TotExhaustAirMassFlowRate + ZoneMixingNetAirMassFlowRate);
if (!state.dataGlobal->DoingSizing) {
AdjustedTotalReturnMassFlow = min(AdjustedTotalReturnMassFlow, zoneEquipConfig.AirLoopDesSupply);
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm all for shrinking the scope of these variables. Definitely helps make sure we know what the intent of the variable is when reviewing the code. Otherwise I have no comment on it.

@Myoldmopar
Copy link
Member

@mjwitte do you have any additional comments/review on this one? If not then I'm inclined to merge it soon.

@Myoldmopar
Copy link
Member

FWIW, it builds and tests happily with updated develop pulled in.

@mjwitte
Copy link
Contributor

mjwitte commented May 3, 2024

@Myoldmopar I'll take a quick look see.

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.

@rraustad This looks good as a part 1. Please post a new issue for the comment below.

AdjustedTotalReturnMassFlow = min(AdjustedTotalReturnMassFlow, zoneEquipConfig.AirLoopDesSupply);
if (!state.dataGlobal->DoingSizing) {
AdjustedTotalReturnMassFlow = min(AdjustedTotalReturnMassFlow, zoneEquipConfig.AirLoopDesSupply);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that this needs improvement to allow for multiple air loops serving the same zone.

@Myoldmopar
Copy link
Member

Awesome, thanks @mjwitte ! OK, I'm going to move forward with this then, merging, thanks @rraustad !

@Myoldmopar Myoldmopar merged commit 696bda5 into develop May 3, 2024
15 checks passed
@Myoldmopar Myoldmopar deleted the 10468-ZoneAirMassFlowConservation-with-RAFraction branch May 3, 2024 15:53
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.

ZoneAirMassFlowConservation causes no change in zone sizing when Lights: Return Air Fraction is changed
8 participants