Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix #4446 - add SizingSystem::autosizedOccupantDiversity. #4450

Merged
merged 2 commits into from
Sep 30, 2021

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Sep 29, 2021

Pull request overview

As indicated on #4446 (comment) I got puzzled by the fact that the tabular reports the Occupant Diversity for both heating and cooling.

But both report the same value:

https://github.com/NREL/EnergyPlus/blob/f420c06a69737dddcf4ba740ad855b45a03a8ef3/src/EnergyPlus/SizingManager.cc#L1594-L1595

        OutputReportPredefined::PreDefTableEntry(
            state, state.dataOutRptPredefined->pdchS62svrClD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D

https://github.com/NREL/EnergyPlus/blob/f420c06a69737dddcf4ba740ad855b45a03a8ef3/src/EnergyPlus/SizingManager.cc#L1679-L1680

        OutputReportPredefined::PreDefTableEntry(
            state, state.dataOutRptPredefined->pdchS62svrHtD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • 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

…oes it report two values,for heating **and** cooling?
@jmarrec jmarrec added component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Sep 29, 2021
@jmarrec jmarrec requested a review from tijcolem September 29, 2021 15:24
@jmarrec jmarrec self-assigned this Sep 29, 2021
Copy link
Collaborator Author

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

I manually tested this by using this executable on the baseline_sys07.rb resources test.

cd testruns/baseline_sys07.rb/run/

[1] run(main)> m = osload('in.osm')
sqlF=> #<OpenStudio::Model::Model:0x0000563c932ff910 @__swigtype__="_p_openstudio__model__Model">
[2] run(main)> sqlFile = OpenStudio::SqlFile.new("eplusout.sql")
=> #<OpenStudio::SqlFile:0x0000563c92eaa6a8 @__swigtype__="_p_openstudio__SqlFile">
[3] run(main)> m.setSqlFile(sqlFile)
=> true
[4] run(main)> a = m.getAirLoopHVACs[0]
=> #<OpenStudio::Model::AirLoopHVAC:0x0000563c946be7f8 @__swigtype__="_p_openstudio__model__AirLoopHVAC">
[5] run(main)> sz = a.sizingSystem
=> #<OpenStudio::Model::SizingSystem:0x0000563c946159f0 @__swigtype__="_p_openstudio__model__SizingSystem">
[6] run(main)> sz.autosizedOccupantDiversity
=> #<OpenStudio::OptionalDouble:0x0000563c945b4e48 @__swigtype__="_p_boost__optionalT_double_t">
[7] run(main)> sz.autosizedOccupantDiversity.get
=> 1.0

I also ran the test_autosizing_rb test that was failing because of this missing method, and now it passes.

Comment on lines +959 to +962
// Note: as of 9.6.0, for some reason, it returns one entry for cooling and one for heating...
// And it's only present in the tabular report 'Standard62.1Summary'
// Both the Heating and Cooling are actually the same underlying value. Cf https://github.com/NREL/OpenStudio/pull/4450#issue-1011104323
std::string tableName = "System Ventilation Requirements for Cooling";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: I'm using the Cooling one, but both are exactly the same

Comment on lines +1025 to +1028
val = autosizedOccupantDiversity();
if (val) {
setOccupantDiversity(val.get());
}
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 it to applySizingValues() too

Copy link
Collaborator

@tijcolem tijcolem left a comment

Choose a reason for hiding this comment

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

Looks good and all green!

@tijcolem tijcolem merged commit 9279637 into develop Sep 30, 2021
@tijcolem tijcolem deleted the 4446_autosizedOccupantDiversity branch September 30, 2021 01:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E+ 9.6.0: Add autosizedOccupantDiversity for SizingSystem
3 participants