Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tdd calculations in CalcInteriorSolarDistribution #8358

Merged
merged 15 commits into from
Nov 13, 2020
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 6 additions & 31 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,51 +6795,31 @@ 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) {
// 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;
Shelf(ShelfNum).ViewFactor * DiffTrans * Surface(SurfNum).Area * ShelfSolarRad) / GndSolarRad;
} else {
DGZoneWin = 0.0;
}
Expand Down Expand Up @@ -6897,11 +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 Down Expand Up @@ -8189,6 +8163,7 @@ namespace SolarShading {
if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) {
PipeNum = SurfWinTDDPipeNum(SurfNum);
SurfNum2 = TDDPipe(PipeNum).Dome;
CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like CosInc should be declared here with local scope (and also up in line 6360?). Possibly the same for some of these other variables. If you are planning that already in the next windowstruct branch, then it's ok here as-is.


DifSolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) + GndSolarRad * Surface(SurfNum2).ViewFactorGround;

Expand Down