Skip to content

Commit

Permalink
fix branch order
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanluo113 committed Oct 27, 2020
1 parent 447e069 commit 67e4624
Showing 1 changed file with 45 additions and 55 deletions.
100 changes: 45 additions & 55 deletions src/EnergyPlus/SolarShading.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6326,12 +6326,9 @@ namespace SolarShading {
if (AnyBSDF) AWinCFOverlap = 0.0;

for (int const SurfNum : thisEnclosure.SurfacePtr) {
if (((Surface(SurfNum).ExtBoundCond != ExternalEnvironment) && (Surface(SurfNum).ExtBoundCond != OtherSideCondModeledExt)) &&
SurfWinOriginalClass(SurfNum) != SurfaceClass_TDD_Diffuser)
continue;
if (!Surface(SurfNum).HeatTransSurf) continue;
// TH added 3/24/2010 while debugging CR 7872
if (!Surface(SurfNum).ExtSolar) continue;
if (!Surface(SurfNum).ExtSolar && SurfWinOriginalClass(SurfNum) != SurfaceClass_TDD_Diffuser) continue;
ConstrNum = Surface(SurfNum).Construction;
ConstrNumSh = Surface(SurfNum).activeShadedConstruction;
if (SurfWinStormWinFlag(SurfNum) == 1) {
Expand Down Expand Up @@ -6798,56 +6795,7 @@ namespace SolarShading {
SkySolarInc = SurfSkySolarInc(SurfNum);
GndSolarInc = SurfGndSolarInc(SurfNum);

if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel &&
SurfWinWindowModelType(SurfNum) != WindowEQLModel) { // 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);
}
} else 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
if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // complex fenestration
FenSolAbsPtr = WindowScheduledSolarAbs(SurfNum, ConstrNum);
if (FenSolAbsPtr == 0) {
// Sky Diffuse transmitted by Complex Fen
Expand Down Expand Up @@ -6897,7 +6845,6 @@ namespace SolarShading {
TBmDif = 0.0;
NomDiffTrans = 0.0;
}

} else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) {

DiffTrans = state.dataConstruction->Construct(ConstrNum).TransDiff;
Expand All @@ -6912,6 +6859,49 @@ 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 67e4624

@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-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: 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-2
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
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-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-IntegrationCoverage-Debug: OK (722 of 722 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.