-
Notifications
You must be signed in to change notification settings - Fork 425
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
12 again here.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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! :)
There was a problem hiding this comment.
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!
@mitchute It is ready for the second review. |
The results all look good here. Unit tests run locally and the improved fuel use output tables look sharp! Merging. |
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)
Expected diffs
Size diffs in output tables in the reports below:
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.
Reviewer
This will not be exhaustively relevant to every PR.