Skip to content

Commit

Permalink
Fix a few remaining blind issues
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Aug 5, 2024
1 parent 115743c commit d431cc7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/EnergyPlus/WindowManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,6 @@ namespace Window {
// Interior blind
} else if (IntBlind) {
auto const *matBlind = dynamic_cast<Material::MaterialBlind const *>(s_mat->materials(BlNum));
// Correction factors for inter-reflections between glass and shading device
ShadeReflFac = 1.0 / (1.0 - ShadeRefl * thisConstruct.ReflectSolDiffBack);
ShadeReflFacVis = 1.0 / (1.0 - ShadeReflVis * thisConstruct.ReflectVisDiffBack);

for (int iSlatAng = 0; iSlatAng < Material::MaxSlatAngs; ++iSlatAng) {
auto const &btar = matBlind->tars[iSlatAng];
Expand All @@ -1192,6 +1189,10 @@ namespace Window {
ShadeReflSky = btar.Sol.Front.Df.RefSky;
ShadeReflVis = btar.Vis.Front.Df.Ref;

// Correction factors for inter-reflections between glass and shading device
ShadeReflFac = 1.0 / (1.0 - ShadeRefl * thisConstruct.ReflectSolDiffBack);
ShadeReflFacVis = 1.0 / (1.0 - ShadeReflVis * thisConstruct.ReflectVisDiffBack);

// Front incident solar, diffuse, interior blind
for (int IGlass = 1; IGlass <= NGlass; ++IGlass) {
auto &dfAbs = constr.layerSlatBlindDfAbs(IGlass)[iSlatAng];
Expand Down Expand Up @@ -1228,10 +1229,6 @@ namespace Window {
} else if (ExtBlind) {
auto const *matBlind = dynamic_cast<Material::MaterialBlind const *>(s_mat->materials(BlNum));

// Correction factors for inter-reflections between glass and shading device
ShadeReflFac = 1.0 / (1.0 - ShadeRefl * constr.ReflectSolDiffFront);
ShadeReflFacVis = 1.0 / (1.0 - ShadeReflVis * constr.ReflectVisDiffFront);

for (int iSlatAng = 0; iSlatAng < Material::MaxSlatAngs; ++iSlatAng) {
auto const &btar = matBlind->tars[iSlatAng];
ShadeTrans = btar.Sol.Front.Df.Tra;
Expand All @@ -1242,6 +1239,9 @@ namespace Window {
ShadeRefl = btar.Sol.Back.Df.Ref;
ShadeReflVis = btar.Vis.Back.Df.Ref;

// Correction factors for inter-reflections between glass and shading device
ShadeReflFac = 1.0 / (1.0 - ShadeRefl * constr.ReflectSolDiffFront);
ShadeReflFacVis = 1.0 / (1.0 - ShadeReflVis * constr.ReflectVisDiffFront);

for (int IGlass = 1; IGlass <= NGlass; ++IGlass) {
auto &dfAbs = constr.layerSlatBlindDfAbs(IGlass)[iSlatAng];
Expand Down Expand Up @@ -1534,7 +1534,7 @@ namespace Window {

// surfShade.blind has not been initialized yet
surfShade.blind.slatAngThisTSDeg = matBlind->SlatAngle;
surfShade.blind.slatAngThisTS = surfShade.blind.slatAngThisTS * Constant::DegToRad;
surfShade.blind.slatAngThisTS = surfShade.blind.slatAngThisTSDeg * Constant::DegToRad;

Material::GetSlatIndicesInterpFac(surfShade.blind.slatAngThisTS,
surfShade.blind.slatAngIdxLo, surfShade.blind.slatAngIdxHi, surfShade.blind.slatAngInterpFac);
Expand Down Expand Up @@ -3673,7 +3673,10 @@ namespace Window {
reflDiff = state.dataConstruction->Construct(ConstrNumSh).ReflectSolDiffBack;
} else if (ANY_BLIND(ShadeFlag)) {
auto const &surfShade = s_surf->surfShades(SurfNum);
reflDiff = surfShade.blind.tar.Sol.Back.Df.Ref;
auto const &constrSh = state.dataConstruction->Construct(ConstrNumSh);
reflDiff = Interp(constrSh.blindTARs[surfShade.blind.slatAngIdxLo].Sol.Back.Df.Ref,
constrSh.blindTARs[surfShade.blind.slatAngIdxHi].Sol.Back.Df.Ref,
surfShade.blind.slatAngInterpFac);
} else if (ShadeFlag == WinShadingType::SwitchableGlazing) {
reflDiff = InterpSw(s_surf->SurfWinSwitchingFactor(SurfNum),
state.dataConstruction->Construct(ConstrNum).ReflectSolDiffBack,
Expand Down

5 comments on commit d431cc7

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

Blind (amirroth) - Win64-Windows-10-VisualStudio-16: OK (2862 of 2862 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Blind (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3480 of 3695 tests passed, 17 test warnings)

Messages:\n

  • 170 tests had: EIO diffs.
  • 20 tests had: EDD diffs.
  • 210 tests had: Table string diffs.
  • 9 tests had: ESO small diffs.
  • 5 tests had: Table small diffs.
  • 7 tests had: Table big diffs.
  • 3 tests had: ERR diffs.
  • 4 tests had: ESO big diffs.

Failures:\n

regression Test Summary

  • Passed: 596
  • Failed: 215

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

Blind (amirroth) - x86_64-MacOS-10.18-clang-15.0.0: OK (3442 of 3654 tests passed, 11 test warnings)

Messages:\n

  • 162 tests had: EIO diffs.
  • 20 tests had: EDD diffs.
  • 209 tests had: Table string diffs.
  • 5 tests had: Table big diffs.
  • 3 tests had: ERR diffs.
  • 3 tests had: ESO big diffs.

Failures:\n

integration Test Summary

  • Passed: 793
  • Failed: 1

regression Test Summary

  • Passed: 580
  • Failed: 211

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

Blind (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2070 of 2070 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

Blind (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (794 of 795 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 794
  • Failed: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.