-
Notifications
You must be signed in to change notification settings - Fork 222
Addresses #3936, subSurface Type reset when assigned to surface #4023
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
Conversation
|
I wonder if there is really any interest in actually calling (The FixedWindow IDD Default would be pointless in that case). |
|
Can you explain this further? What would that block of code replace? What could be the surprise if it's left the way it is now? |
src/model/SubSurface.cpp
Outdated
| bool SubSurface_Impl::setSurface(const Surface& surface) | ||
| { | ||
| bool emptySurface = isEmpty(OS_SubSurfaceFields::SurfaceName); | ||
| bool emptySubSurfaceType = isEmpty(OS_SubSurfaceFields::SubSurfaceType); |
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.
| bool emptySubSurfaceType = isEmpty(OS_SubSurfaceFields::SubSurfaceType); |
src/model/SubSurface.cpp
Outdated
| bool emptySubSurfaceType = isEmpty(OS_SubSurfaceFields::SubSurfaceType); | ||
| bool result = setPointer(OS_SubSurfaceFields::SurfaceName, surface.handle()); | ||
| if (result && emptySurface){ | ||
| if (result && emptySurface && emptySubSurfaceType){ |
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.
| if (result && emptySurface && emptySubSurfaceType){ | |
| if (result && emptySurface && isSubSurfaceTypeDefaulted()){ |
Well, the API is actually assigning a value based on logic, which is what I would call a (smart) default. There will be no way of knowing whether the user actually assigned a value or if it was automatically assigned by Openstudio. eg: Perhaps it's not too big of a deal in E+ context though: I did check the FT, and it appears that the result in E+ will end up fine, as the only thing that matters for E+ is 'Door', 'GlassDoor' or 'Window'. |
|
Side note: This blocks need review, and definitely corrections to the "changing SubSurfaceType to Dloor/GlassDoor" warnings OpenStudio/src/energyplus/ForwardTranslator/ForwardTranslateSubSurface.cpp Lines 71 to 93 in ff0e898
OpenStudio/src/energyplus/ForwardTranslator/ForwardTranslateSubSurface.cpp Lines 86 to 88 in ff0e898
Should be: Perhaps we should also double check that the flow control is handling every case... And we should probably catch all other situations (but Door/GlassDoor) where a non-opaque type is used and the construction is opaque (eg FixedWindow, but using an Opaque construction... though perhaps that should be done in model API) |
|
@kbenne Can you review #4023 (comment) and decide whether we choose to change things or just go with this PR please? I am not extremely opinionated on the subject so it'd be great to have another pair of eyes. |
jmarrec
left a comment
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.
Unless we decide to change the underlying logic (assign a default or just actually default it), these changes are good and ready to drop.
| LOG(Warn, "SubSurface '" << modelObject.name().get() << "' uses fenestration construction, changing SubSurfaceType to GlassDoor"); | ||
| subSurfaceType = "GlassDoor"; | ||
| } else if (subSurfaceType == "GlassDoor" && !construction->isFenestration()){ | ||
| LOG(Warn, "SubSurface '" << modelObject.name().get() << "' uses non-fenestration construction, changing SubSurfaceType to GlassDoor"); | ||
| LOG(Warn, "SubSurface '" << modelObject.name().get() << "' uses non-fenestration construction, changing SubSurfaceType to Door"); |
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.
👍
Pull request overview
Please read OpenStudio Pull Requests to better understand the OpenStudio Pull Request protocol.
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)src/openstudio_lib/library/OpenStudioPolicy.xml)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.