Skip to content

Commit

Permalink
replace first part
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanluo113 committed Jan 24, 2021
1 parent 6cc1bf4 commit e7af4ec
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 92 deletions.
17 changes: 7 additions & 10 deletions src/EnergyPlus/DaylightingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3675,7 +3675,7 @@ namespace EnergyPlus::DaylightingManager {
state.dataDaylightingManager->EDIRSUdisk(iHour, 1) = RAYCOS(3) * TVISS * ObTransDisk; // Bare window

TransBmBmMult = 0.0;
if (ShType == WinShadingType::ExtBlind || ShType == WinShadingType::IntBlind || ShType == WinShadingType::BGBlind) {
if (IS_BLIND_ON(ShType)) {
ProfileAngle(IWin, RAYCOS, Blind(BlNum).SlatOrientation, ProfAng);
// Contribution of beam passing through slats and reaching reference point
for (JB = 1; JB <= MaxSlatAngs; ++JB) {
Expand Down Expand Up @@ -3729,7 +3729,7 @@ namespace EnergyPlus::DaylightingManager {
XAVWL = 14700.0 * std::sqrt(0.000068 * POSFAC) * double(NWX * NWY) / std::pow(WindowSolidAngleDaylightPoint, 0.8);
state.dataDaylightingManager->AVWLSUdisk(iHour, 1) = XAVWL * TVISS * ObTransDisk; // Bare window

if (ShType == WinShadingType::ExtBlind || ShType == WinShadingType::IntBlind || ShType == WinShadingType::BGBlind) {
if (IS_BLIND_ON(ShType)) {
for (JB = 1; JB <= MaxSlatAngs; ++JB) {
// IF (.NOT. SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT
state.dataDaylightingManager->AVWLSUdisk(iHour, JB + 1) = XAVWL * TVISS * TransBmBmMult(JB) * ObTransDisk;
Expand Down Expand Up @@ -3842,7 +3842,7 @@ namespace EnergyPlus::DaylightingManager {
state.dataDaylightingManager->EDIRSUdisk(iHour, 1) += SunVecMir(3) * SpecReflectance * TVisRefl; // Bare window

TransBmBmMultRefl = 0.0;
if (ShType == WinShadingType::ExtBlind || ShType == WinShadingType::IntBlind || ShType == WinShadingType::BGBlind) {
if (IS_BLIND_ON(ShType)) {
ProfileAngle(IWin, SunVecMir, Blind(BlNum).SlatOrientation, ProfAng);
// Contribution of reflected beam passing through slats and reaching reference point
Real64 const Pi_SlatAng_fac(DataGlobalConstants::Pi / (MaxSlatAngs - 1));
Expand Down Expand Up @@ -3879,7 +3879,7 @@ namespace EnergyPlus::DaylightingManager {
XAVWL = 14700.0 * std::sqrt(0.000068 * POSFAC) * double(NWX * NWY) /
std::pow(SurfaceWindow(IWin).SolidAngAtRefPtWtd(iRefPoint), 0.8);
state.dataDaylightingManager->AVWLSUdisk(iHour, 1) += XAVWL * TVisRefl * SpecReflectance; // Bare window
if (ShType == WinShadingType::ExtBlind || ShType == WinShadingType::IntBlind || ShType == WinShadingType::BGBlind) {
if (IS_BLIND_ON(ShType)) {
for (JB = 1; JB <= MaxSlatAngs; ++JB) {
// IF(.NOT. SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT
state.dataDaylightingManager->AVWLSUdisk(iHour, JB + 1) += XAVWL * TVisRefl * SpecReflectance * TransBmBmMultRefl(JB);
Expand All @@ -3898,10 +3898,7 @@ namespace EnergyPlus::DaylightingManager {

} // Last pass

if ((ICtrl > 0 && (ShType == WinShadingType::IntShade || ShType == WinShadingType::ExtShade || ShType == WinShadingType::BGShade ||
ShType == WinShadingType::IntBlind || ShType == WinShadingType::ExtBlind || ShType == WinShadingType::BGBlind ||
ShType == WinShadingType::ExtScreen)) ||
SurfWinSolarDiffusing(IWin)) {
if ((ICtrl > 0 && (IS_BLIND_ON(ShType) || IS_SHADE_SCREEN_ON(ShType))) || SurfWinSolarDiffusing(IWin)) {

// ----- CASE II -- WINDOW WITH SCREEN, SHADE, BLIND, OR DIFFUSING WINDOW

Expand Down Expand Up @@ -7940,8 +7937,8 @@ namespace EnergyPlus::DaylightingManager {
BlNum = SurfWinBlindNumber(IWin);
// ScNum = SurfaceWindow( IWin ).ScreenNumber; //Unused Set but never used

ShadeOn = (ShType == WinShadingType::IntShade || ShType == WinShadingType::ExtShade || ShType == WinShadingType::BGShade);
BlindOn = (ShType == WinShadingType::IntBlind || ShType == WinShadingType::ExtBlind || ShType == WinShadingType::BGBlind);
ShadeOn = IS_SHADE_ON(ShType);
BlindOn = IS_BLIND_ON(ShType);
ScreenOn = (ShType == WinShadingType::ExtScreen);
}

Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/HWBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ namespace HWBaseboardRadiator {
Area = Surface(SurfNum).Area;

if (Surface(SurfNum).Class == SurfaceClass::Window) {
if (SurfWinShadingFlag(SurfNum) == WinShadingType::IntShade || SurfWinShadingFlag(SurfNum) == WinShadingType::IntBlind) {
if (IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
// The area is the shade or blind area = the sum of the glazing area and the divider area (which is zero if no divider)
Area += SurfWinDividerArea(SurfNum);
}
Expand All @@ -1746,8 +1746,7 @@ namespace HWBaseboardRadiator {
SurfWinFrameTempSurfIn(SurfNum);
}

if (SurfWinDividerArea(SurfNum) > 0.0 && SurfWinShadingFlag(SurfNum) != WinShadingType::IntShade &&
SurfWinShadingFlag(SurfNum) != WinShadingType::IntBlind) {
if (SurfWinDividerArea(SurfNum) > 0.0 && !IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
// Window divider contribution (only from shade or blind for window with divider and interior shade or blind)
SumHATsurf += HConvIn(SurfNum) * SurfWinDividerArea(SurfNum) * (1.0 + 2.0 * SurfWinProjCorrDivIn(SurfNum)) *
SurfWinDividerTempSurfIn(SurfNum);
Expand Down
9 changes: 3 additions & 6 deletions src/EnergyPlus/HeatBalanceIntRadExchange.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ namespace HeatBalanceIntRadExchange {
if (state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow) {
ShadeFlag = SurfWinShadingFlag(SurfNum);
ShadeFlagPrev = SurfWinExtIntShadePrevTS(SurfNum);
if ((ShadeFlagPrev != WinShadingType::IntShade && ShadeFlag == WinShadingType::IntShade) ||
(ShadeFlagPrev != WinShadingType::IntBlind && ShadeFlag == WinShadingType::IntBlind) ||
(ShadeFlagPrev == WinShadingType::IntShade && ShadeFlag != WinShadingType::IntShade) || (ShadeFlagPrev == WinShadingType::IntBlind && ShadeFlag != WinShadingType::IntBlind))
if (ShadeFlagPrev != ShadeFlag && (IS_INT_SHADED(ShadeFlagPrev) || IS_INT_SHADED(ShadeFlag)))
IntShadeOrBlindStatusChanged = true;
if (SurfWinWindowModelType(SurfNum) == WindowEQLModel &&
DataWindowEquivalentLayer::CFS(state.dataConstruction->Construct(Surface(SurfNum).Construction).EQLConsPtr).ISControlled) {
Expand All @@ -291,8 +289,7 @@ namespace HeatBalanceIntRadExchange {
int const ConstrNum = Surface(SurfNum).Construction;
zone_info.Emissivity(ZoneSurfNum) = state.dataConstruction->Construct(ConstrNum).InsideAbsorpThermal;
auto const &surface_window(SurfaceWindow(SurfNum));
if (state.dataConstruction->Construct(ConstrNum).TypeIsWindow &&
(SurfWinShadingFlag(SurfNum) == WinShadingType::IntShade || SurfWinShadingFlag(SurfNum) == WinShadingType::IntBlind)) {
if (state.dataConstruction->Construct(ConstrNum).TypeIsWindow && IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
zone_info.Emissivity(ZoneSurfNum) =
InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), surface_window.EffShBlindEmiss) +
InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), surface_window.EffGlassEmiss);
Expand Down Expand Up @@ -346,7 +343,7 @@ namespace HeatBalanceIntRadExchange {
SurfaceEmiss[ZoneSurfNum] = construct.InsideAbsorpThermal;
// For windows with an interior shade or blind an effective inside surface temp
// and emiss is used here that is a weighted combination of shade/blind and glass temp and emiss.
} else if (SurfWinShadingFlag(SurfNum) == WinShadingType::IntShade || SurfWinShadingFlag(SurfNum) == WinShadingType::IntBlind) {
} else if (IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
SurfaceTempRad[ZoneSurfNum] = SurfWinEffInsSurfTemp(SurfNum);
SurfaceEmiss[ZoneSurfNum] = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), surface_window.EffShBlindEmiss) +
InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), surface_window.EffGlassEmiss);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3879,7 +3879,7 @@ namespace HeatBalanceSurfaceManager {
for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) {
// For window with an interior shade or blind, emissivity is a combination of glass and shade/blind emissivity
WinShadingType ShadeFlag = SurfWinShadingFlag(SurfNum);
if (ShadeFlag == WinShadingType::IntShade || ShadeFlag == WinShadingType::IntBlind)
if (IS_INT_SHADED(ShadeFlag))
ITABSF(SurfNum) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum),
SurfaceWindow(SurfNum).EffShBlindEmiss) +
InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum),
Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/HighTempRadiantSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ namespace HighTempRadiantSystem {
Area = Surface(SurfNum).Area;

if (Surface(SurfNum).Class == SurfaceClass::Window) {
if (SurfWinShadingFlag(SurfNum) == WinShadingType::IntShade || SurfWinShadingFlag(SurfNum) == WinShadingType::IntBlind) {
if (IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
// The area is the shade or blind area = the sum of the glazing area and the divider area (which is zero if no divider)
Area += SurfWinDividerArea(SurfNum);
}
Expand All @@ -1502,8 +1502,7 @@ namespace HighTempRadiantSystem {
SurfWinFrameTempSurfIn(SurfNum);
}

if (SurfWinDividerArea(SurfNum) > 0.0 && SurfWinShadingFlag(SurfNum) != WinShadingType::IntShade &&
SurfWinShadingFlag(SurfNum) != WinShadingType::IntBlind) {
if (SurfWinDividerArea(SurfNum) > 0.0 && !IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
// Window divider contribution (only from shade or blind for window with divider and interior shade or blind)
SumHATsurf += HConvIn(SurfNum) * SurfWinDividerArea(SurfNum) * (1.0 + 2.0 * SurfWinProjCorrDivIn(SurfNum)) *
SurfWinDividerTempSurfIn(SurfNum);
Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/LowTempRadiantSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5570,7 +5570,7 @@ namespace LowTempRadiantSystem {
Real64 Area = Surface(surfNum).Area;

if (Surface(surfNum).Class == SurfaceClass::Window) {
if (SurfWinShadingFlag(surfNum) == WinShadingType::IntShade || SurfWinShadingFlag(surfNum) == WinShadingType::IntBlind) {
if (IS_INT_SHADED(SurfWinShadingFlag(surfNum))) {
// The area is the shade or blind are = sum of the glazing area and the divider area (which is zero if no divider)
Area += SurfWinDividerArea(surfNum);
}
Expand All @@ -5581,8 +5581,7 @@ namespace LowTempRadiantSystem {
SurfWinFrameTempSurfIn(surfNum);
}

if (SurfWinDividerArea(surfNum) > 0.0 && SurfWinShadingFlag(surfNum) != WinShadingType::IntShade &&
SurfWinShadingFlag(surfNum) != WinShadingType::IntBlind) {
if (SurfWinDividerArea(surfNum) > 0.0 && !IS_INT_SHADED(SurfWinShadingFlag(surfNum))) {
// Window divider contribution (only from shade or blind for window with divider and interior shade or blind)
sumHATsurf += HConvIn(surfNum) * SurfWinDividerArea(surfNum) * (1.0 + 2.0 * SurfWinProjCorrDivIn(surfNum)) *
SurfWinDividerTempSurfIn(surfNum);
Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/RoomAirModelAirflowNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,7 @@ namespace RoomAirModelAirflowNetwork {
HA += HConvIn(SurfNum) * SurfWinFrameArea(SurfNum) * (1.0 + SurfWinProjCorrFrIn(SurfNum));
}

if (SurfWinDividerArea(SurfNum) > 0.0 && SurfWinShadingFlag(SurfNum) != WinShadingType::IntShade &&
SurfWinShadingFlag(SurfNum) != WinShadingType::IntBlind) {
if (SurfWinDividerArea(SurfNum) > 0.0 && !IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
// Window divider contribution(only from shade or blind for window with divider and interior shade or blind)
SumHATsurf += HConvIn(SurfNum) * SurfWinDividerArea(SurfNum) * (1.0 + 2.0 * SurfWinProjCorrDivIn(SurfNum)) *
SurfWinDividerTempSurfIn(SurfNum);
Expand Down
4 changes: 1 addition & 3 deletions src/EnergyPlus/SolarShading.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10503,9 +10503,7 @@ namespace SolarShading {
Real64 AbsorpEff = 0.0; // Effective absorptance of isolated shade layer (fraction of
// of incident radiation remaining after reflected portion is
// removed that is absorbed
if (WindowShadingControl(WinShadeCtrlNum).ShadingType == WinShadingType::IntShade ||
WindowShadingControl(WinShadeCtrlNum).ShadingType == WinShadingType::ExtShade ||
WindowShadingControl(WinShadeCtrlNum).ShadingType == WinShadingType::BGShade) {
if (IS_SHADE_ON(WindowShadingControl(WinShadeCtrlNum).ShadingType)) {
int ConstrNumSh = Surface(SurfNum).activeShadedConstruction; // Window construction number with shade
int TotLay = state.dataConstruction->Construct(ConstrNumSh).TotLayers; // Total layers in a construction

Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/SteamBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ namespace SteamBaseboardRadiator {
Area = Surface(SurfNum).Area;

if (Surface(SurfNum).Class == SurfaceClass::Window) {
if (SurfWinShadingFlag(SurfNum) == WinShadingType::IntShade || SurfWinShadingFlag(SurfNum) == WinShadingType::IntBlind) {
if (IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
// The area is the shade or blind area = the sum of the glazing area and the divider area (which is zero if no divider)
Area += SurfWinDividerArea(SurfNum);
}
Expand All @@ -1391,8 +1391,7 @@ namespace SteamBaseboardRadiator {
SurfWinFrameTempSurfIn(SurfNum);
}

if (SurfWinDividerArea(SurfNum) > 0.0 && SurfWinShadingFlag(SurfNum) != WinShadingType::IntShade &&
SurfWinShadingFlag(SurfNum) != WinShadingType::IntBlind) {
if (SurfWinDividerArea(SurfNum) > 0.0 && !IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
// Window divider contribution (only from shade or blind for window with divider and interior shade or blind)
SumHATsurf += HConvIn(SurfNum) * SurfWinDividerArea(SurfNum) * (1.0 + 2.0 * SurfWinProjCorrDivIn(SurfNum)) *
SurfWinDividerTempSurfIn(SurfNum);
Expand Down
15 changes: 4 additions & 11 deletions src/EnergyPlus/SurfaceGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4770,11 +4770,7 @@ namespace SurfaceGeometry {
if (ConstrNumSh > 0) {
state.dataSurfaceGeometry->SurfaceTmp(SurfNum).activeShadedConstruction = ConstrNumSh;
} else {
if (WindowShadingControl(WSCPtr).ShadingType == WinShadingType::IntShade ||
WindowShadingControl(WSCPtr).ShadingType == WinShadingType::IntBlind ||
WindowShadingControl(WSCPtr).ShadingType == WinShadingType::ExtShade ||
WindowShadingControl(WSCPtr).ShadingType == WinShadingType::ExtScreen ||
WindowShadingControl(WSCPtr).ShadingType == WinShadingType::ExtBlind) {
if (IS_INT_SHADED(WindowShadingControl(WSCPtr).ShadingType) || IS_EXT_SHADED(WindowShadingControl(WSCPtr).ShadingType)) {
ShDevNum = WindowShadingControl(WSCPtr).ShadingDevice;
if (ShDevNum > 0) {
CreateShadedWindowConstruction(state, SurfNum, WSCPtr, ShDevNum, shadeControlIndex);
Expand All @@ -4789,8 +4785,7 @@ namespace SurfaceGeometry {
ConstrNum = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction;
if (!ErrorsFound && WSCPtr > 0 && ConstrNum > 0 && ConstrNumSh > 0) {

if (WindowShadingControl(WSCPtr).ShadingType == WinShadingType::IntShade ||
WindowShadingControl(WSCPtr).ShadingType == WinShadingType::IntBlind) {
if (IS_INT_SHADED(WindowShadingControl(WSCPtr).ShadingType)) {
TotLayers = state.dataConstruction->Construct(ConstrNum).TotLayers;
TotShLayers = state.dataConstruction->Construct(ConstrNumSh).TotLayers;
if (TotShLayers - 1 != TotLayers) {
Expand All @@ -4813,9 +4808,7 @@ namespace SurfaceGeometry {
}
}

if (WindowShadingControl(WSCPtr).ShadingType == WinShadingType::ExtShade ||
WindowShadingControl(WSCPtr).ShadingType == WinShadingType::ExtScreen ||
WindowShadingControl(WSCPtr).ShadingType == WinShadingType::ExtBlind) {
if (IS_EXT_SHADED(WindowShadingControl(WSCPtr).ShadingType)) {
TotLayers = state.dataConstruction->Construct(ConstrNum).TotLayers;
TotShLayers = state.dataConstruction->Construct(ConstrNumSh).TotLayers;
if (TotShLayers - 1 != TotLayers) {
Expand Down Expand Up @@ -11688,7 +11681,7 @@ namespace SurfaceGeometry {
ShDevName = state.dataMaterial->Material(ShDevNum).Name;
ConstrNum = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction;
ConstrName = state.dataConstruction->Construct(ConstrNum).Name;
if (WindowShadingControl(WSCPtr).ShadingType == WinShadingType::IntShade || WindowShadingControl(WSCPtr).ShadingType == WinShadingType::IntBlind) {
if (IS_INT_SHADED(WindowShadingControl(WSCPtr).ShadingType)) {
ConstrNameSh = ConstrName + ':' + ShDevName + ":INT";
} else {
ConstrNameSh = ConstrName + ':' + ShDevName + ":EXT";
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/UFADManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ namespace UFADManager {
if (SurfNum == 0) continue;
if (Surface(SurfNum).ExtBoundCond == ExternalEnvironment || Surface(SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt ||
Surface(SurfNum).ExtBoundCond == OtherSideCoefCalcExt || Surface(SurfNum).ExtBoundCond == OtherSideCondModeledExt) {
if (SurfWinShadingFlag(SurfNum) == WinShadingType::IntShade || SurfWinShadingFlag(SurfNum) == WinShadingType::IntBlind) {
if (IS_INT_SHADED(SurfWinShadingFlag(SurfNum))) {
++NumShadesDown;
}
}
Expand Down
Loading

0 comments on commit e7af4ec

Please sign in to comment.