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

Protect divide by 0 for Terminal Unit with Zone Floor Area = 0 #5568

Conversation

Projects
None yet
6 participants
@rraustad
Copy link
Contributor

commented Mar 23, 2016

Pull request overview

Zone floor area must be greater than 0 when AirTerminal:SingleDuct:VAV:Reheat input for Maximum Flow per Zone Floor Area During Reheat is entered as AutoCalculate (#5273).

Work Checklist

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)
  • At least one of the following appropriate labels must be added to this PR to be consumed into the changelog:
    • Defect: This pull request repairs a github defect issue. The github issue should be referenced in the PR description
    • Refactoring: This pull request includes code changes that don't change the functionality of the program, just perform refactoring
    • NewFeature: This pull request includes code to add a new feature to EnergyPlus
    • Performance: This pull request includes code changes that are directed at improving the runtime performance of EnergyPlus
    • DoNoPublish: This pull request includes changes that shouldn't be included in the changelog

Review Checklist

This will not be exhaustively relevant to every PR.

  • Code style (parentheses padding, variable names)
  • Functional code review (it has to work!)
  • If defect, results of running current develop vs this branch should exhibit the fix
  • CI status: all green or justified
  • Performance: CI Linux results include performance check -- verify this
  • Unit Test(s)
  • C++ checks:
    • Argument types
    • If any virtual classes, ensure virtual destructor included, other things
  • IDD changes:
    • Verify naming conventions and styles, memos and notes and defaults
    • If transition, add rules to spreadsheet
    • If transition, add transition source
    • If transition, update idfs
  • If new idf included, locally check the err file and other outputs
  • Documentation changes in place
  • ExpandObjects changes??
  • If output changes, including tabular output structure, add to output rules file for interfaces

…Size Maximum Flow per Zone Floor Area during Reheat is AutoCalculate

Protect divide by 0 for Terminal Unit with Zone Area = 0 when Design …
…Size Maximum Flow per Zone Floor Area during Reheat is AutoCalculate
@nrel-bot-3

This comment has been minimized.

Copy link

commented on 786b5d9 Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-MacOS-10.9-clang: OK (2167 of 2167 tests passed, 0 test warnings)

Build Badge Test Badge

This comment has been minimized.

Copy link

replied Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

This comment has been minimized.

Copy link

replied Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (2205 of 2205 tests passed, 0 test warnings)

Build Badge Test Badge

This comment has been minimized.

Copy link

replied Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

This comment has been minimized.

Copy link

replied Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - i386-Windows-7-VisualStudio-12: OK (2173 of 2173 tests passed, 0 test warnings)

Build Badge Test Badge

This comment has been minimized.

Copy link

replied Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (1059 of 1059 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

This comment has been minimized.

Copy link

replied Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (1617 of 1617 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - Win64-Windows-7-VisualStudio-12: OK (2172 of 2173 tests passed, 0 test warnings)

Build Badge Test Badge

@rraustad

This comment has been minimized.

Copy link
Contributor Author

commented Mar 23, 2016

The way this is now may be too restrictive. If floor area = 0, then they get no flow during reheat. If I only set Sys( SysNum ).MaxAirVolFlowRateDuringReheat = 0, and leave Sys( SysNum ).MaxAirVolFractionDuringReheat to calculate it's own value, then MaxAirVolFractionDuringReheat = 0.3 and MaxAirVolFlowRateDuringReheat will wind up as 0.367 since:

Sys( SysNum ).MaxAirVolFlowRateDuringReheat = max( Sys( SysNum ).MaxAirVolFlowRateDuringReheat, Sys( SysNum ).MaxAirVolFractionDuringReheat * Sys( SysNum ).MaxAirVolFlowRate );

where:
  MaxAirVolFlowRate = 1.223

AirTerminal:SingleDuct:VAV:Reheat,
  Constant,                !- Zone Minimum Air Flow Input Method
  0.3,                     !- Constant Minimum Air Flow Fraction
  ,                        !- Fixed Minimum Air Flow Rate {m3/s}
  ,                        !- Minimum Air Flow Fraction Schedule Name
  AUTOCALCULATE,           !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2}
  AUTOCALCULATE;           !- Maximum Flow Fraction During Reheat

The user won't know what is setting the maximum flow during reheat, unless I show a warning, but then there is already a warning in the err file about zone floor area = 0.

 ** Warning ** No floor exists in Zone="ZN_1_FLR_1_SEC_1", zone floor area is zero. All values for this zone that are entered per floor area will be zero.

I guess this needs more discussion and can wait until after release.

@rraustad

This comment has been minimized.

Copy link
Contributor Author

commented Mar 23, 2016

Decided that discussion above dictated what needed to be done here. Since the model uses the max of the Maximum Flow per Zone Floor Area During Reheat and Maximum Flow Fraction During Reheat, they should each size independently and be used to calculate the final Maximum Flow per Zone Floor Area During Reheat. When you think about it, as zone floor area goes to 0, the Maximum Flow Fraction During Reheat becomes the limit. This code does just that.

// use the larger of the two reheat flow rate methods for the simulated maximum flow during reheat
Sys( SysNum ).MaxAirVolFlowRateDuringReheat = max( Sys( SysNum ).MaxAirVolFlowRateDuringReheat, Sys( SysNum ).MaxAirVolFractionDuringReheat * Sys( SysNum ).MaxAirVolFlowRate );
Sys( SysNum ).MaxAirVolFlowRateDuringReheat = min( Sys( SysNum ).MaxAirVolFlowRateDuringReheat, Sys( SysNum ).MaxAirVolFlowRate );
@nrel-bot-2

This comment has been minimized.

Copy link

commented on 172d24c Mar 23, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-MacOS-10.9-clang: OK (2167 of 2167 tests passed, 0 test warnings)

Build Badge Test Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (1059 of 1059 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (2205 of 2205 tests passed, 0 test warnings)

Build Badge Test Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (1617 of 1617 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - i386-Windows-7-VisualStudio-12: OK (2173 of 2173 tests passed, 0 test warnings)

Build Badge Test Badge

This comment has been minimized.

Copy link

replied Mar 24, 2016

#5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area (rraustad) - Win64-Windows-7-VisualStudio-12: OK (2173 of 2173 tests passed, 0 test warnings)

Build Badge Test Badge

@rraustad

This comment has been minimized.

Copy link
Contributor Author

commented Mar 24, 2016

Why would the performance change on the Full Dashboard when this fix changed nothing in the test suite results?

@Myoldmopar

This comment has been minimized.

Copy link
Member

commented Mar 24, 2016

Just because of the extra checking being done. Same numeric results but it is an extra couple steps along the way. The difference is very small, and I don't see a way to easily not have the conditional statement in there with this fix. So it's fine. Thanks.

@Myoldmopar Myoldmopar merged commit 9d4086a into develop Mar 24, 2016

8 checks passed

Win64-Windows-7-VisualStudio-12 OK (2173 of 2173 tests passed, 0 test warnings)
Details
i386-Windows-7-VisualStudio-12 OK (2173 of 2173 tests passed, 0 test warnings)
Details
x86_64-Linux-Ubuntu-14.04-cppcheck-1.61 OK (0 of 0 tests passed, 0 test warnings)
Details
x86_64-Linux-Ubuntu-14.04-custom_check OK (0 of 0 tests passed, 0 test warnings)
Details
x86_64-Linux-Ubuntu-14.04-gcc-4.8 OK (2205 of 2205 tests passed, 0 test warnings)
Details
x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug OK (1617 of 1617 tests passed, 0 test warnings)
Details
x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug OK (1059 of 1059 tests passed, 0 test warnings)
Details
x86_64-MacOS-10.9-clang OK (2167 of 2167 tests passed, 0 test warnings)
Details

@Myoldmopar Myoldmopar deleted the #5273-Design-Size-Maximum-Flow-per-Zone-Floor-Area-during-Reheat-overflows-if-zone-has-zero-floor-area branch Mar 24, 2016

@Myoldmopar Myoldmopar added the Defect label Mar 24, 2016

@Myoldmopar Myoldmopar changed the title Protect divide by 0 for Terminal Unit with Zone Area = 0 when Design … Protect divide by 0 for Terminal Unit with Zone Floor Area = 0 Mar 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.