Skip to content

Commit

Permalink
branch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanluo113 committed Oct 28, 2020
1 parent 67e4624 commit 1dd4dff
Showing 1 changed file with 31 additions and 47 deletions.
78 changes: 31 additions & 47 deletions src/EnergyPlus/SolarShading.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6795,7 +6795,36 @@ namespace SolarShading {
SkySolarInc = SurfSkySolarInc(SurfNum);
GndSolarInc = SurfGndSolarInc(SurfNum);

if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // complex fenestration
// Special calculations for DiffTrans, DSZoneWin and DGZoneWin if daylighting diffusers or shelves are present. TODO: Move this out of branch.
if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) {
DiffTrans = TransTDD(state, PipeNum, CosInc, SolarAniso);
DSZoneWin = AnisoSkyMult(SurfNum2) * DiffTrans * Surface(SurfNum).Area;
DGZoneWin = Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso * Surface(SurfNum).Area;

} else if (Surface(SurfNum).Class == SurfaceClass_TDD_Dome) {
DiffTrans = state.dataConstruction->Construct(ConstrNum).TransDiff;
DSZoneWin = 0.0; // Solar not added by TDD:DOME; added to zone via TDD:DIFFUSER
DGZoneWin = 0.0; // Solar not added by TDD:DOME; added to zone via TDD:DIFFUSER

} else if (OutShelfSurf > 0) { // Outside daylighting shelf
DiffTrans = state.dataConstruction->Construct(ConstrNum).TransDiff;
DSZoneWin = AnisoSkyMult(SurfNum) * DiffTrans * Surface(SurfNum).Area;
ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * CosIncAng(TimeStep, HourOfDay, OutShelfSurf) +
DifSolarRad * AnisoSkyMult(OutShelfSurf)) *
Shelf(ShelfNum).OutReflectSol;
// Add all reflected solar from the outside shelf to the ground solar
// NOTE: If the shelf blocks part of the view to the ground, the user must reduce the ground view factor!!
// In order to get the effect of the daylighting shelf in here, must take into account the fact that this
// is ultimately multiplied by GndSolarRad to get QD and QDV in InitSolarHeatGains.
// DGZoneWin = (GndVF*Trans*Area*GndSolarRad + ShelfVF*Trans*Area*ShelfSolarRad) / GndSolarRad
if (GndSolarRad != 0.0) {
DGZoneWin = (Surface(SurfNum).ViewFactorGround * DiffTrans * Surface(SurfNum).Area * GndSolarRad +
Shelf(ShelfNum).ViewFactor * DiffTrans * Surface(SurfNum).Area * ShelfSolarRad) / GndSolarRad;
} else {
DGZoneWin = 0.0;
}

} else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // complex fenestration
FenSolAbsPtr = WindowScheduledSolarAbs(SurfNum, ConstrNum);
if (FenSolAbsPtr == 0) {
// Sky Diffuse transmitted by Complex Fen
Expand Down Expand Up @@ -6845,10 +6874,8 @@ namespace SolarShading {
TBmDif = 0.0;
NomDiffTrans = 0.0;
}
} else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) {

} else { // Regular or EQLModel window
DiffTrans = state.dataConstruction->Construct(ConstrNum).TransDiff;

if (DifSolarRad != 0.0) {
DSZoneWin = (SkySolarInc * DiffTrans * Surface(SurfNum).Area) / (DifSolarRad);
} else {
Expand All @@ -6859,49 +6886,6 @@ namespace SolarShading {
} else {
DGZoneWin = (GndSolarInc * DiffTrans * Surface(SurfNum).Area) / (1.e-8);
}
} else { // Regular window
DiffTrans = state.dataConstruction->Construct(ConstrNum).TransDiff;
if (DifSolarRad != 0.0) {
DSZoneWin = (SkySolarInc * DiffTrans * Surface(SurfNum).Area) / (DifSolarRad);
} else {
DSZoneWin = (SkySolarInc * DiffTrans * Surface(SurfNum).Area) / (1.e-8);
}
if (GndSolarRad != 0.0) {
DGZoneWin = (GndSolarInc * DiffTrans * Surface(SurfNum).Area) / (GndSolarRad);
} else {
DGZoneWin = (GndSolarInc * DiffTrans * Surface(SurfNum).Area) / (1.e-8);
}
}

// Update DiffTrans, DSZoneWin and DGZoneWin if daylighting diffuser or shelves are present. TODO: Move this out of branch.
if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) {
DiffTrans = TransTDD(state, PipeNum, CosInc, SolarAniso);
DSZoneWin = AnisoSkyMult(SurfNum2) * DiffTrans * Surface(SurfNum).Area;
DGZoneWin = Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso * Surface(SurfNum).Area;

} else if (Surface(SurfNum).Class == SurfaceClass_TDD_Dome) {
DiffTrans = state.dataConstruction->Construct(ConstrNum).TransDiff;
DSZoneWin = 0.0; // Solar not added by TDD:DOME; added to zone via TDD:DIFFUSER
DGZoneWin = 0.0; // Solar not added by TDD:DOME; added to zone via TDD:DIFFUSER

} else if (OutShelfSurf > 0) { // Outside daylighting shelf
DiffTrans = state.dataConstruction->Construct(ConstrNum).TransDiff;
DSZoneWin = AnisoSkyMult(SurfNum) * DiffTrans * Surface(SurfNum).Area;
ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * CosIncAng(TimeStep, HourOfDay, OutShelfSurf) +
DifSolarRad * AnisoSkyMult(OutShelfSurf)) *
Shelf(ShelfNum).OutReflectSol;
// Add all reflected solar from the outside shelf to the ground solar
// NOTE: If the shelf blocks part of the view to the ground, the user must reduce the ground view factor!!
// In order to get the effect of the daylighting shelf in here, must take into account the fact that this
// is ultimately multiplied by GndSolarRad to get QD and QDV in InitSolarHeatGains.
// DGZoneWin = (GndVF*Trans*Area*GndSolarRad + ShelfVF*Trans*Area*ShelfSolarRad) / GndSolarRad
if (GndSolarRad != 0.0) {
DGZoneWin = (Surface(SurfNum).ViewFactorGround * DiffTrans * Surface(SurfNum).Area * GndSolarRad +
Shelf(ShelfNum).ViewFactor * DiffTrans * Surface(SurfNum).Area * ShelfSolarRad) / GndSolarRad;
} else {
DGZoneWin = 0.0;
}

}

if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && SurfWinWindowModelType(SurfNum) != WindowEQLModel) {
Expand Down

5 comments on commit 1dd4dff

@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.

fix-tdd-solar (xuanluo113) - x86_64-MacOS-10.15-clang-11.0.0: OK (2985 of 2986 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ESO big diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 716
  • Failed: 1

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

fix-tdd-solar (xuanluo113) - Win64-Windows-10-VisualStudio-16: OK (2242 of 2242 tests passed, 0 test warnings)

Build Badge Test 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.

fix-tdd-solar (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3024 of 3026 tests passed, 0 test warnings)

Messages:\n

  • 2 tests had: EIO diffs.
  • 1 test had: ESO big diffs.
  • 2 tests had: Table big diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.

Failures:\n

regression Test Summary

  • Passed: 735
  • Failed: 2

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.

fix-tdd-solar (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1550 of 1550 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.

fix-tdd-solar (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (721 of 722 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 721
  • Timeout: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.