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

Wx bug fix fenestration expansion missing construction name #1507

Conversation

weilixu
Copy link
Collaborator

@weilixu weilixu commented May 9, 2023

We discover one issue with a sample model below (change the txt to osm to test)
sample_med_os_ad1.txt

The model does not have defaultConstructionSet assigned to space, spaceType, building or even model. However, it does run successfully.
This causes our code failure when searching for the defaultConstructionSet to fill up empty construction.

The failure cause EnergyPlus simulation failure due to missing construction name.

I suggest to handle this as assertion instead of return empty hashmap - give enough information for user to debug their model.

…s not assigned, which cause the incorrect baseline construction assignment, and ultimately energyplus simulation failure.
@weilixu weilixu added the AppendixG Methods to enable the Appendix G model workflow label May 9, 2023
@weilixu weilixu self-assigned this May 9, 2023
@weilixu
Copy link
Collaborator Author

weilixu commented May 9, 2023

I took another approach to address this issue.
I created a new assertion method to handle such issue in the PRM routine.
By calling this assert function, the OSSTD will raise PRMError exception with message.

In the measure, we can capture PRMError exception and display message to users.

In addition, the assertion function exports the prm log for debug purpose.

In order to have the log correctly exported to the sizing run directory, I added a class variable @sizing_run_dir in the ASHRAE901PRM class. This class variable will be set in the handle_user_input_data, which implemented in the ashrae_90_1_prm.Model.rb

Let me know if that is a desired approach and whether the implementation could be improved.

@weilixu weilixu requested a review from dmaddoxwhite May 9, 2023 23:17
class PRMError < StandardError
end

# Finds capacity in W
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that a place holder? The description doesn't seem to match with what's in the function.

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 was a copy paste error - thanks for pointing it out!

@@ -54,8 +54,10 @@ def planar_surface_apply_standard_construction(planar_surface, climate_zone, pre
cons_set = space.model.building.get.defaultConstructionSet.get
construction = get_default_surface_cons_from_surface_type(surface_category, surface_type, cons_set)
end

return previous_construction_map if construction.nil?
prm_raise(construction,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add the conditional to only call prm_raise if construction.nil? is true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dmaddoxwhite that is handled inside the prm_raise function
See:

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, so if construction is nil, then it is interpreted as "FALSE" by prm_raise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dmaddoxwhite That is correct - in ruby, False and nil is Falsey.
Alternatively, you can also do:

prm_raise(construction == nil, @sizing_run_dir, ...)

This would explicitly expose the condition logic - I am OK with both way in this specific case.

@weilixu weilixu marked this pull request as ready for review May 15, 2023 15:56
@weilixu
Copy link
Collaborator Author

weilixu commented May 16, 2023

All passed but the test performance tests are failed.

@weilixu weilixu merged commit ba7ab64 into AppendixG_Dev May 16, 2023
0 of 2 checks passed
@weilixu weilixu mentioned this pull request Sep 22, 2023
16 tasks
@weilixu weilixu deleted the wx_bug_fix_fenestration_expansion_missing_construction_name branch February 11, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AppendixG Methods to enable the Appendix G model workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants