Repository navigation
Fix WindowProperty:FrameAndDivider convection from frame/dividers with projections - #11589
Conversation
|
|
|
|
|
|
|
|
|
|
|
@joseph-robertson it looks like if there's a bad frame geometry it isn't being caught here, which can result in bad data propagating downstream and cause a fatal error. I added the following bad object into HybridVentilationControl.idf and referenced it from the Zn001:Wall001:Win001 FenestrationDetailed:Surface object and got the following failure. I think we need to capture and handle this condition rather than just issuing a message and moving on. EnergyPlus/src/EnergyPlus/SurfaceGeometry.cc Line 13052 in 21bb86b This is out of scope on this current issue, so let's handle it separately. |
|
I'll hold on to this until you can take a look. If you'd rather address that here, that's fine, too. |
| if ((FrWidth > 0.0) && (FrArea > 0.0) && !ErrorInSurface) { | ||
| // Correction factor for portion of frame subject to frame projection correction | ||
| state.dataSurface->SurfWinProjCorrFrOut(ThisSurf) = | ||
| (state.dataSurface->FrameDivider(FrDivNum).FrameProjectionOut / FrWidth) * | ||
| (ThisHeight + ThisWidth - | ||
| (state.dataSurface->FrameDivider(FrDivNum).HorDividers + state.dataSurface->FrameDivider(FrDivNum).VertDividers) * | ||
| DivWidth) / | ||
| (ThisHeight + ThisWidth + 2 * FrWidth); | ||
| state.dataSurface->SurfWinProjCorrFrIn(ThisSurf) = | ||
| (state.dataSurface->FrameDivider(FrDivNum).FrameProjectionIn / FrWidth) * | ||
| (ThisHeight + ThisWidth - | ||
| (state.dataSurface->FrameDivider(FrDivNum).HorDividers + state.dataSurface->FrameDivider(FrDivNum).VertDividers) * | ||
| DivWidth) / | ||
| (ThisHeight + ThisWidth + 2 * FrWidth); | ||
| } | ||
|
|
||
| if ((DivWidth > 0.0) && (DivArea > 0.0) && !ErrorInSurface) { | ||
| auto &surfWin = state.dataSurface->SurfaceWindow(ThisSurf); | ||
| surfWin.glazedFrac = surf.Area / (surf.Area + state.dataSurface->SurfWinDividerArea(ThisSurf)); | ||
| // Correction factor for portion of divider subject to divider projection correction | ||
| DivFrac = (1.0 - state.dataSurface->FrameDivider(FrDivNum).HorDividers * | ||
| state.dataSurface->FrameDivider(FrDivNum).VertDividers * pow_2(DivWidth) / DivArea); | ||
| state.dataSurface->SurfWinProjCorrDivOut(ThisSurf) = | ||
| DivFrac * state.dataSurface->FrameDivider(FrDivNum).DividerProjectionOut / DivWidth; | ||
| state.dataSurface->SurfWinProjCorrDivIn(ThisSurf) = | ||
| DivFrac * state.dataSurface->FrameDivider(FrDivNum).DividerProjectionIn / DivWidth; | ||
| } |
There was a problem hiding this comment.
Pulling these out from under the DivArea > 0 block. The top block is the core fix in this PR -- we want to still calculate the frame projection correction factor even when there are no dividers.
| state.dataSurface->FrameDivider(FrDivNum).VertDividers * DivWidth); | ||
| state.dataSurface->SurfWinDividerArea(ThisSurf) = DivArea * surf.Multiplier; | ||
| if ((surf.Area - state.dataSurface->SurfWinDividerArea(ThisSurf)) <= 0.0) { | ||
| if (state.dataSurface->SurfWinDividerArea(ThisSurf) <= 0.0) { |
There was a problem hiding this comment.
This change allows the severe error to actually be thrown. We want to throw the error when calculated divider area is negative. Previously, if this value was negative, glazed opening minus divider area was a positive value.
| } | ||
| surf.Area -= state.dataSurface->SurfWinDividerArea(ThisSurf); // Glazed area | ||
| if (DivArea <= 0.0) { | ||
| ShowWarningError(state, std::format("{}Calculated Divider Area <= 0.0 for Window={}", RoutineName, surf.Name)); |
There was a problem hiding this comment.
I believe we don't need this warning if the other related severe error is activated.
|
|
|
Regressions are related to files having the WindowProperty:FrameAndDivider object with frame outside/inside projections but no dividers. For CmplxGlz_Daylighting_SouthVB45deg.idf, for example, the change in this PR causes total energy use to increase slightly (cooling down, heating up). |
Addressed in 88c48fa. |
|
| state.dataSurface->FrameDivider(FrDivNum).VertDividers * DivWidth); | ||
| state.dataSurface->SurfWinDividerArea(ThisSurf) = DivArea * surf.Multiplier; | ||
| if ((surf.Area - state.dataSurface->SurfWinDividerArea(ThisSurf)) <= 0.0) { | ||
| if (state.dataSurface->SurfWinDividerArea(ThisSurf) <= 0.0) { |
|
|
|
…n zero separately
|
|
mitchute
left a comment
There was a problem hiding this comment.
Thanks @joseph-robertson. I think we're all good on this now. Merging.
Pull request overview
Description of the purpose of this PR
Pull Request Author
Reviewer