Skip to content

Consider moving D-center measured gap thickness adjustment out of WCE into WinCalc #247

@vidanovic

Description

@vidanovic

Background

CIGUGapLayer::getThickness() has special handling for m_isDCenterMeasured that adjusts gap thickness by subtracting half the adjacent shade layer thickness on each side. This is because shade gap width is measured from the center of the shade layer rather than from its surface.

if(m_isDCenterMeasured)
{
    auto prevSolid = std::dynamic_pointer_cast<CIGUSolidLayer>(getPreviousLayer());
    if(prevSolid != nullptr && prevSolid->isShadeLayer())
        thickness -= prevSolid->getThickness() / 2;
    auto nxtSolid = std::dynamic_pointer_cast<CIGUSolidLayer>(getNextLayer());
    if(nxtSolid != nullptr && nxtSolid->isShadeLayer())
        thickness -= nxtSolid->getThickness() / 2;
}

Issue

This approach:

  • Adds shade-specific logic inside CIGUGapLayer which is otherwise a general-purpose gap
  • Requires dynamic_pointer_cast<CIGUSolidLayer> to check neighbor types
  • Is the only remaining reason IGUGapLayer.cpp includes IGUSolidLayer.hpp
  • Mixes measurement convention concerns (D-center vs surface-to-surface) with thermal calculation

Proposal

Consider pre-computing the adjusted gap thickness in WinCalc before passing it to WCE. WinCalc already knows which layers are shades and their thicknesses, so it could subtract the half-thicknesses before creating the gap layer. WCE would then always work with surface-to-surface gap thickness, simplifying the calculation engine.

This would allow removing m_isDCenterMeasured from CIGUGapLayer and the dynamic_pointer_cast calls in getThickness().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions