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

Disaggregate "Additional Fuel" in End Uses, etc. output tables #7895

Merged
merged 18 commits into from
Apr 6, 2020

Conversation

dareumnam
Copy link
Collaborator

@dareumnam dareumnam commented Apr 1, 2020

Pull request overview

  • Fixes Disaggregate "Additional Fuel" in End Uses, etc. output tables #7591

  • OutputReportPredefined.cc, OutputReportPredefined.hh, and OutputReportTabular.cc
    Disaggregate "additional fuel" to "Gasoline, Diesel, Coal, Fuel oil no 1, Fuel oil no 2, Propane, Other fuel 1, and Other fuel 2"

  • Output tables were checked with several regression tests after the code change
    Example: End Uses in Annual Building Utility Performance Summary:Entire Facility
    (1ZoneUncontrolled_OtherEquipmentWithFuel.idf)
    image

  • Expected diffs
    Size diffs in output tables in the reports below:

    • Annual Building Utility Performance Summary
      • End Uses
      • End Uses By Subcategory
      • Normalized Metrics: Utility Use Per Conditioned Floor Area
      • Normalized Metrics: Utility Use Per Total Floor Area
    • Demand End Use Components Summary
      • End Uses
      • End Uses By Subcategory
    • Source Energy End Use Components Summary
      • Source Energy End Use Components Summary
      • Normalized Metrics: Source Energy End Use Components Per Conditioned Floor Area
      • Normalized Metrics: Source Energy End Use Components Per Total Floor Area
    • LEED Summary
      • EAp2-4/5. Performance Rating Method Compliance
  • OutputReportTabular.unit.cc
    Add three more test (SQL query) cases to check the result side in an existing unit test
    (SQLiteFixture, OutputReportTabular_EndUseBySubcategorySQL)

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

@dareumnam dareumnam added the Defect Includes code to repair a defect in EnergyPlus label Apr 1, 2020
@dareumnam dareumnam added this to the EnergyPlus 9.4.0 milestone Apr 1, 2020
@dareumnam dareumnam self-assigned this Apr 1, 2020
@dareumnam dareumnam requested a review from Myoldmopar April 2, 2020 16:53
Copy link
Collaborator

@mitchute mitchute left a comment

Choose a reason for hiding this comment

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

Thanks for the work @dareumnam. It looks really close!

@@ -7715,7 +7743,7 @@ namespace OutputReportTabular {
// determine which resource is the primary heating resourse
resourcePrimaryHeating = 0;
heatingMaximum = 0.0;
for (iResource = 1; iResource <= 5; ++iResource) { // don't do water
for (iResource = 1; iResource <= 12; ++iResource) { // don't do water
Copy link
Collaborator

Choose a reason for hiding this comment

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

Changed upper limit in FOR loop to 12 here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's because this FOR loop does not count "water" resource. Some FOR loops that count water resource use 13, like below.

columnWidth.allocate(13);
columnWidth = 10; // array assignment - same for all columns
tableBody.allocate(13, 16);
for (iResource = 1; iResource <= 13; ++iResource) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

But it's 13 here? Looks like 13 is correct, but this needs to be double-checked.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is 13 here because this FOR loop counts water.

@@ -8312,7 +8367,7 @@ namespace OutputReportTabular {
leedSiteSrvWatr = 0.0;
leedSiteRecept = 0.0;
leedSiteTotal = 0.0;
for (iResource = 1; iResource <= 5; ++iResource) { // don't bother with water
for (iResource = 1; iResource <= 12; ++iResource) { // don't bother with water
Copy link
Collaborator

Choose a reason for hiding this comment

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

12 again here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is 12 here because this FOR loop doesn't count water.


// check the result size for all fuels (including disaggregated "additional fuel")
{
std::string query("SELECT Value From TabularDataWithStrings"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like these SQL queries... but that's nor your fault.

It looks like you're looking for electric categories. Should we be looking for fuel categories?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried to use fuel categories instead of electricity, but there was a crash. It seemed like the existing unit test uses a function to create an object for Electricity with a function (https://github.com/NREL/EnergyPlus/blob/develop/tst/EnergyPlus/unit/OutputReportTabular.unit.cc#L7734) to avoid a crash, but I couldn't find the functions like this for the other fuel yet. I'll figure out it more and try to change it to the fuel category. If I have questions about this, I'll let you know. Thank you for all your reviews! :)

Copy link
Collaborator Author

@dareumnam dareumnam Apr 3, 2020

Choose a reason for hiding this comment

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

It seems like the query test parts that I added do not need to create an object for another fuel. I was able to make test cases that look for fuel categories. I'll update this branch and see what CI testing says. Thanks for your review!

@dareumnam dareumnam removed the request for review from Myoldmopar April 3, 2020 02:32
@mitchute mitchute changed the title Disaggregate"Additional Fuel" in End Uses, etc. output tables Disaggregate "Additional Fuel" in End Uses, etc. output tables Apr 3, 2020
@dareumnam
Copy link
Collaborator Author

@mitchute It is ready for the second review.

@mitchute
Copy link
Collaborator

mitchute commented Apr 6, 2020

The results all look good here. Unit tests run locally and the improved fuel use output tables look sharp! Merging.

# for free to join this conversation on GitHub. Already have an account? # 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.

Disaggregate "Additional Fuel" in End Uses, etc. output tables
7 participants