Skip to content

Commit

Permalink
Merge pull request #8435 from energy-plus/shading-flag
Browse files Browse the repository at this point in the history
Convert window shading flag to enum class
  • Loading branch information
mjwitte committed Feb 23, 2021
2 parents 003df71 + 0f5b941 commit e003a91
Show file tree
Hide file tree
Showing 30 changed files with 980 additions and 1,105 deletions.
7 changes: 3 additions & 4 deletions src/EnergyPlus/ChilledCeilingPanelSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1696,8 +1696,7 @@ namespace CoolingPanelSimple {
using DataHeatBalance::HConvIn;
using DataHeatBalance::Zone;
using DataHeatBalSurface::TempSurfInTmp;
using DataSurfaces::IntBlindOn;
using DataSurfaces::IntShadeOn;
using DataSurfaces::WinShadingType;
using DataSurfaces::Surface;
using DataSurfaces::SurfWinShadingFlag;
using DataSurfaces::SurfWinFrameArea;
Expand Down Expand Up @@ -1727,7 +1726,7 @@ namespace CoolingPanelSimple {

if (ThisSurf.Class == DataSurfaces::SurfaceClass::Window) {

if (SurfWinShadingFlag(SurfNum) == IntShadeOn || SurfWinShadingFlag(SurfNum) == IntBlindOn) {
if (ANY_INTERIOR_SHADE_BLIND(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 += DataSurfaces::SurfWinDividerArea(SurfNum);
}
Expand All @@ -1737,7 +1736,7 @@ namespace CoolingPanelSimple {
SumHATsurf += HConvIn(SurfNum) * SurfWinFrameArea(SurfNum) * (1.0 + SurfWinProjCorrFrIn(SurfNum)) * SurfWinFrameTempSurfIn(SurfNum);
}

if (SurfWinDividerArea(SurfNum) > 0.0 && SurfWinShadingFlag(SurfNum) != IntShadeOn && SurfWinShadingFlag(SurfNum) != IntBlindOn) {
if (SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(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: 2 additions & 2 deletions src/EnergyPlus/ConvectionCoefficients.cc
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ namespace ConvectionCoefficients {

if (!Surface(SurfNum).ExtWind) {
SurfWindSpeed = 0.0; // No wind exposure
} else if (Surface(SurfNum).Class == SurfaceClass::Window && SurfWinShadingFlag(SurfNum) == ExtShadeOn) {
} else if (Surface(SurfNum).Class == SurfaceClass::Window && SurfWinShadingFlag(SurfNum) == WinShadingType::ExtShade) {
SurfWindSpeed = 0.0; // Assume zero wind speed at outside glass surface of window with exterior shade
} else {
SurfWindSpeed = Surface(SurfNum).WindSpeed;
Expand Down Expand Up @@ -4713,7 +4713,7 @@ namespace ConvectionCoefficients {

if (!Surface(SurfNum).ExtWind) {
SurfWindSpeed = 0.0; // No wind exposure
} else if (Surface(SurfNum).Class == SurfaceClass::Window && SurfWinShadingFlag(SurfNum) == ExtShadeOn) {
} else if (Surface(SurfNum).Class == SurfaceClass::Window && SurfWinShadingFlag(SurfNum) == WinShadingType::ExtShade) {
SurfWindSpeed = 0.0; // Assume zero wind speed at outside glass surface of window with exterior shade
} else {
SurfWindSpeed = Surface(SurfNum).WindSpeed;
Expand Down
58 changes: 4 additions & 54 deletions src/EnergyPlus/DataSurfaces.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,57 +237,6 @@ namespace DataSurfaces {
int const InConvWinLoc_WindowBelowThis(4); // this is a wall with window below it
int const InConvWinLoc_LargePartOfExteriorWall(5); // this is a big window taking up most of wall

// Parameters for window shade status
int const NoShade(-1);
int const ShadeOff(0);
int const IntShadeOn(1); // Interior shade on
int const SwitchableGlazing(2);
int const ExtShadeOn(3); // Exterior shade on
int const ExtScreenOn(4); // Exterior screen on
int const IntBlindOn(6); // Interior blind on
int const ExtBlindOn(7); // Exterior blind on
int const BGShadeOn(8); // Between-glass shade on
int const BGBlindOn(9); // Between-glass blind on
int const IntShadeConditionallyOff(10);
int const GlassConditionallyLightened(20);
int const ExtShadeConditionallyOff(30);
int const IntBlindConditionallyOff(60);
int const ExtBlindConditionallyOff(70);

// WindowShadingControl Shading Types
int const WSC_ST_NoShade(0);
int const WSC_ST_InteriorShade(1);
int const WSC_ST_SwitchableGlazing(2);
int const WSC_ST_ExteriorShade(3);
int const WSC_ST_InteriorBlind(4);
int const WSC_ST_ExteriorBlind(5);
int const WSC_ST_BetweenGlassShade(6);
int const WSC_ST_BetweenGlassBlind(7);
int const WSC_ST_ExteriorScreen(8);

// WindowShadingControl Control Types
int const WSCT_AlwaysOn(1); // AlwaysOn
int const WSCT_AlwaysOff(2); // AlwaysOff
int const WSCT_OnIfScheduled(3); // OnIfScheduleAllows
int const WSCT_HiSolar(4); // OnIfHighSolarOnWindow
int const WSCT_HiHorzSolar(5); // OnIfHighHorizontalSolar
int const WSCT_HiOutAirTemp(6); // OnIfHighOutsideAirTemp
int const WSCT_HiZoneAirTemp(7); // OnIfHighZoneAirTemp
int const WSCT_HiZoneCooling(8); // OnIfHighZoneCooling
int const WSCT_HiGlare(9); // OnIfHighGlare
int const WSCT_MeetDaylIlumSetp(10); // MeetDaylightIlluminanceSetpoint
int const WSCT_OnNightLoOutTemp_OffDay(11); // OnNightIfLowOutsideTemp/OffDay
int const WSCT_OnNightLoInTemp_OffDay(12); // OnNightIfLowInsideTemp/OffDay
int const WSCT_OnNightIfHeating_OffDay(13); // OnNightIfHeating/OffDay
int const WSCT_OnNightLoOutTemp_OnDayCooling(14); // OnNightIfLowOutsideTemp/OnDayIfCooling
int const WSCT_OnNightIfHeating_OnDayCooling(15); // OnNightIfHeating/OnDayIfCooling
int const WSCT_OffNight_OnDay_HiSolarWindow(16); // OffNight/OnDayIfCoolingAndHighSolarOnWindow
int const WSCT_OnNight_OnDay_HiSolarWindow(17); // OnNight/OnDayIfCoolingAndHighSolarOnWindow
int const WSCT_OnHiOutTemp_HiSolarWindow(18); // OnIfHighOutsideAirTempAndHighSolarOnWindow
int const WSCT_OnHiOutTemp_HiHorzSolar(19); // OnIfHighOutsideAirTempAndHighHorizontalSolar
int const WSCT_OnHiZoneTemp_HiSolarWindow(20); // OnIfHighZoneAirTempAndHighSolarOnWindow
int const WSCT_OnHiZoneTemp_HiHorzSolar(21); // OnIfHighZoneAirTempAndHighHorizontalSolar

// WindowShadingControl Slat Angle Control for Blinds
int const WSC_SAC_FixedSlatAngle(1);
int const WSC_SAC_ScheduledSlatAngle(2);
Expand Down Expand Up @@ -511,13 +460,13 @@ namespace DataSurfaces {
Array1D<Real64> SurfWinProfileAngHor; // Horizontal beam solar profile angle (degrees)
Array1D<Real64> SurfWinProfileAngVert; // Vertical beam solar profile angle (degrees)

Array1D<int> SurfWinShadingFlag; // -1: window has no shading device
Array1D<WinShadingType> SurfWinShadingFlag; // -1: window has no shading device
Array1D<bool> SurfWinShadingFlagEMSOn; // EMS control flag, true if EMS is controlling ShadingFlag with ShadingFlagEMSValue
Array1D<int> SurfWinShadingFlagEMSValue; // EMS control value for Shading Flag
Array1D<Real64> SurfWinShadingFlagEMSValue; // EMS control value for Shading Flag
Array1D<int> SurfWinStormWinFlag; // -1: Storm window not applicable; 0: Window has storm window but it is off 1: Window has storm window and it is on
Array1D<int> SurfWinStormWinFlagPrevDay; // Previous time step value of StormWinFlag
Array1D<Real64> SurfWinFracTimeShadingDeviceOn; // For a single time step, = 0.0 if no shading device or shading device is off = 1.0 if shading device is on; For time intervals longer than a time step, = fraction of time that shading device is on.
Array1D<int> SurfWinExtIntShadePrevTS; // 1 if exterior or interior blind or shade in place previous time step;0 otherwise
Array1D<WinShadingType> SurfWinExtIntShadePrevTS; // 1 if exterior or interior blind or shade in place previous time step;0 otherwise
Array1D<bool> SurfWinHasShadeOrBlindLayer; // mark as true if the window construction has a shade or a blind layer
Array1D<bool> SurfWinSurfDayLightInit; // surface has been initialized for following 5 arrays
Array1D<int> SurfWinDaylFacPoint; // Pointer to daylight factors for the window
Expand Down Expand Up @@ -608,6 +557,7 @@ namespace DataSurfaces {
bool AnyHeatBalanceInsideSourceTerm(false); // True if any SurfaceProperty:HeatBalanceSourceTerm inside face used
bool AnyHeatBalanceOutsideSourceTerm(false); // True if any SurfaceProperty:HeatBalanceSourceTerm outside face used


// SUBROUTINE SPECIFICATIONS FOR MODULE DataSurfaces:

// Object Data
Expand Down

5 comments on commit e003a91

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

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2351 of 2351 tests passed, 0 test warnings)

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.

develop (mjwitte) - x86_64-MacOS-10.15-clang-11.0.0: OK (2331 of 2331 tests passed, 0 test warnings)

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.

develop (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2304 of 2304 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.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1607 of 1607 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.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (726 of 727 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 726
  • Timeout: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.