Skip to content

Commit

Permalink
window control type enum
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanluo113 committed Jan 26, 2021
1 parent e7af4ec commit 1cff5a5
Show file tree
Hide file tree
Showing 10 changed files with 252 additions and 265 deletions.
23 changes: 0 additions & 23 deletions src/EnergyPlus/DataSurfaces.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,29 +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

// 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
53 changes: 28 additions & 25 deletions src/EnergyPlus/DataSurfaces.hh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,32 @@ namespace DataSurfaces {
ShadeOff = 10
};

enum WindowShadingControlType {

This comment has been minimized.

Copy link
@amirroth

amirroth Jan 26, 2021

Collaborator

Shouldn't we use class enum?

UnControlled = 0,
AlwaysOn = 1,
AlwaysOff = 2,
OnIfScheduled = 3,
HiSolar = 4,
HiHorzSolar = 5,
HiOutAirTemp = 6,
HiZoneAirTemp = 7,
HiZoneCooling = 8,
HiGlare = 9,
MeetDaylIlumSetp = 10,
OnNightLoOutTemp_OffDay = 11,
OnNightLoInTemp_OffDay = 12,
OnNightIfHeating_OffDay = 13,
OnNightLoOutTemp_OnDayCooling = 14,
OnNightIfHeating_OnDayCooling = 15,
OffNight_OnDay_HiSolarWindow = 16,
OnNight_OnDay_HiSolarWindow = 17,
OnHiOutTemp_HiSolarWindow = 18,
OnHiOutTemp_HiHorzSolar = 19,
OnHiZoneTemp_HiSolarWindow = 20,
OnHiZoneTemp_HiHorzSolar = 21

};

// Parameters to indicate exterior boundary conditions for use with
// the Surface derived type (see below):
// Note: Positive values correspond to an interzone adjacent surface
Expand Down Expand Up @@ -266,29 +292,6 @@ namespace DataSurfaces {
extern int const InConvWinLoc_WindowBelowThis; // this is a wall with window below it
extern int const InConvWinLoc_LargePartOfExteriorWall; // this is a big window taking up most of wall

// WindowShadingControl Control Types
extern int const WSCT_AlwaysOn; // AlwaysOn
extern int const WSCT_AlwaysOff; // AlwaysOff
extern int const WSCT_OnIfScheduled; // OnIfScheduleAllows
extern int const WSCT_HiSolar; // OnIfHighSolarOnWindow
extern int const WSCT_HiHorzSolar; // OnIfHighHorizontalSolar
extern int const WSCT_HiOutAirTemp; // OnIfHighOutsideAirTemp
extern int const WSCT_HiZoneAirTemp; // OnIfHighZoneAirTemp
extern int const WSCT_HiZoneCooling; // OnIfHighZoneCooling
extern int const WSCT_HiGlare; // OnIfHighGlare
extern int const WSCT_MeetDaylIlumSetp; // MeetDaylightIlluminanceSetpoint
extern int const WSCT_OnNightLoOutTemp_OffDay; // OnNightIfLowOutsideTemp/OffDay
extern int const WSCT_OnNightLoInTemp_OffDay; // OnNightIfLowInsideTemp/OffDay
extern int const WSCT_OnNightIfHeating_OffDay; // OnNightIfHeating/OffDay
extern int const WSCT_OnNightLoOutTemp_OnDayCooling; // OnNightIfLowOutsideTemp/OnDayIfCooling
extern int const WSCT_OnNightIfHeating_OnDayCooling; // OnNightIfHeating/OnDayIfCooling
extern int const WSCT_OffNight_OnDay_HiSolarWindow; // OffNight/OnDayIfCoolingAndHighSolarOnWindow
extern int const WSCT_OnNight_OnDay_HiSolarWindow; // OnNight/OnDayIfCoolingAndHighSolarOnWindow
extern int const WSCT_OnHiOutTemp_HiSolarWindow; // OnIfHighOutsideAirTempAndHighSolarOnWindow
extern int const WSCT_OnHiOutTemp_HiHorzSolar; // OnIfHighOutsideAirTempAndHighHorizontalSolar
extern int const WSCT_OnHiZoneTemp_HiSolarWindow; // OnIfHighZoneAirTempAndHighSolarOnWindow
extern int const WSCT_OnHiZoneTemp_HiHorzSolar; // OnIfHighZoneAirTempAndHighHorizontalSolar

// WindowShadingControl Slat Angle Control for Blinds
extern int const WSC_SAC_FixedSlatAngle;
extern int const WSC_SAC_ScheduledSlatAngle;
Expand Down Expand Up @@ -1114,7 +1117,7 @@ namespace DataSurfaces {
// ExteriorShade,BetweenGlassShade,InteriorBlind,ExteriorBlind,BetweenGlassBlind,
// ExteriorScreen;
// this must be a Material:WindowShade, Material:WindowScreen, or Material:WindowBlind
int ShadingControlType; // Takes one of the following values that specifies type of shading control
WindowShadingControlType ShadingControlType; // Takes one of the following values that specifies type of shading control
// CHARACTER(len=60) :: ShadingControlType =' ' ! Takes one of the following values that specifies type of shading control
// (control is active only when schedule value = 1; if no schedule
// specified, schedule value defaults to 1)
Expand Down Expand Up @@ -1188,7 +1191,7 @@ namespace DataSurfaces {

// Default Constructor
WindowShadingControlData()
: ZoneIndex(0), SequenceNumber(0), ShadingType(WinShadingType::NoShade), getInputShadedConstruction(0), ShadingDevice(0), ShadingControlType(0),
: ZoneIndex(0), SequenceNumber(0), ShadingType(WinShadingType::NoShade), getInputShadedConstruction(0), ShadingDevice(0), ShadingControlType(UnControlled),
Schedule(0), SetPoint(0.0), SetPoint2(0.0), ShadingControlIsScheduled(false), GlareControlIsActive(false), SlatAngleSchedule(0),
SlatAngleControlForBlinds(0), DaylightControlIndex(0), MultiSurfaceCtrlIsGroup(false), FenestrationCount(0)
{
Expand Down
14 changes: 7 additions & 7 deletions src/EnergyPlus/DaylightingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4357,7 +4357,7 @@ namespace EnergyPlus::DaylightingManager {
}
}

if (WindowShadingControl(Surface(SurfNum).activeWindowShadingControl).ShadingControlType == WSCT_MeetDaylIlumSetp) {
if (WindowShadingControl(Surface(SurfNum).activeWindowShadingControl).ShadingControlType == MeetDaylIlumSetp) {
// Error if window has ShadingControlType = MeetDaylightingIlluminanceSetpoint &
// but is not in a Daylighting:Detailed zone
if (thisSurfEnclosure.TotalEnclosureDaylRefPoints == 0) {
Expand Down Expand Up @@ -6529,7 +6529,7 @@ namespace EnergyPlus::DaylightingManager {
int IWin = state.dataDaylightingData->ZoneDaylight(ZoneNum).DayltgExtWinSurfNums(loop);
ICtrl = Surface(IWin).activeWindowShadingControl;
if (Surface(IWin).HasShadeControl && ISWFLG == 0) {
if (WindowShadingControl(ICtrl).ShadingControlType == WSCT_MeetDaylIlumSetp &&
if (WindowShadingControl(ICtrl).ShadingControlType == MeetDaylIlumSetp &&
SurfWinShadingFlag(IWin) == WinShadingType::SwitchableGlazing && SurfWinGlareControlIsActive(IWin))
ISWFLG = 1;
}
Expand Down Expand Up @@ -6584,7 +6584,7 @@ namespace EnergyPlus::DaylightingManager {
int IS = findWinShadingIndex(IWin);
if (Surface(IWin).HasShadeControl) {
if (SurfWinShadingFlag(IWin) == WinShadingType::SwitchableGlazing && SurfWinGlareControlIsActive(IWin) &&
WindowShadingControl(ICtrl).ShadingControlType == WSCT_MeetDaylIlumSetp && !previously_shaded(loop)) {
WindowShadingControl(ICtrl).ShadingControlType == MeetDaylIlumSetp && !previously_shaded(loop)) {
DILLSW(igroup) += state.dataDaylightingData->ZoneDaylight(ZoneNum).IllumFromWinAtRefPt(loop, IS, 1);
previously_shaded(loop) = true;
} else {
Expand Down Expand Up @@ -6629,7 +6629,7 @@ namespace EnergyPlus::DaylightingManager {
continue;
}
if ((SurfWinShadingFlag(IWin) != WinShadingType::SwitchableGlazing && !SurfWinGlareControlIsActive(IWin)) ||
WindowShadingControl(ICtrl).ShadingControlType != WSCT_MeetDaylIlumSetp) {
WindowShadingControl(ICtrl).ShadingControlType != MeetDaylIlumSetp) {
continueOuterLoop = true;
continue;
}
Expand Down Expand Up @@ -6931,7 +6931,7 @@ namespace EnergyPlus::DaylightingManager {

if (GlareOK) {
if (SurfWinShadingFlag(IWin) == WinShadingType::SwitchableGlazing &&
WindowShadingControl(ICtrl).ShadingControlType == WSCT_MeetDaylIlumSetp) {
WindowShadingControl(ICtrl).ShadingControlType == MeetDaylIlumSetp) {
// Added TH 1/14/2010
// Only for switchable glazings with MeetDaylightIlluminanceSetpoint control
// The glazing is in fully dark state, it might lighten a bit to provide more daylight
Expand Down Expand Up @@ -9732,7 +9732,7 @@ namespace EnergyPlus::DaylightingManager {

ICtrl = Surface(IWin).activeWindowShadingControl;
if (Surface(IWin).HasShadeControl) {
if (WindowShadingControl(ICtrl).ShadingControlType == WSCT_MeetDaylIlumSetp &&
if (WindowShadingControl(ICtrl).ShadingControlType == MeetDaylIlumSetp &&
SurfWinShadingFlag(IWin) == WinShadingType::SwitchableGlazing) {
// switchable windows in partial or fully switched state,
// get its intermediate VT calculated in DayltgInteriorIllum
Expand Down Expand Up @@ -9766,7 +9766,7 @@ namespace EnergyPlus::DaylightingManager {

ICtrl = Surface(IWin).activeWindowShadingControl;
if (Surface(IWin).HasShadeControl) {
if (WindowShadingControl(ICtrl).ShadingControlType == WSCT_MeetDaylIlumSetp &&
if (WindowShadingControl(ICtrl).ShadingControlType == MeetDaylIlumSetp &&
SurfWinShadingFlag(IWin) == WinShadingType::SwitchableGlazing) {
// switchable windows in partial or fully switched state,
// get its intermediate VT calculated in DayltgInteriorIllum
Expand Down
44 changes: 22 additions & 22 deletions src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1074,47 +1074,47 @@ namespace HeatBalanceSurfaceManager {
}
{
auto const SELECT_CASE_var1(WindowShadingControl(curWSC).ShadingControlType);
if (SELECT_CASE_var1 == WSCT_AlwaysOn) {
if (SELECT_CASE_var1 == AlwaysOn) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "AlwaysOn");
} else if (SELECT_CASE_var1 == WSCT_AlwaysOff) {
} else if (SELECT_CASE_var1 == AlwaysOff) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "AlwaysOff");
} else if (SELECT_CASE_var1 == WSCT_OnIfScheduled) {
} else if (SELECT_CASE_var1 == OnIfScheduled) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfScheduleAllows");
} else if (SELECT_CASE_var1 == WSCT_HiSolar) {
} else if (SELECT_CASE_var1 == HiSolar) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighSolarOnWindow");
} else if (SELECT_CASE_var1 == WSCT_HiHorzSolar) {
} else if (SELECT_CASE_var1 == HiHorzSolar) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighHorizontalSolar");
} else if (SELECT_CASE_var1 == WSCT_HiOutAirTemp) {
} else if (SELECT_CASE_var1 == HiOutAirTemp) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighOutdoorAirTemperature");
} else if (SELECT_CASE_var1 == WSCT_HiZoneAirTemp) {
} else if (SELECT_CASE_var1 == HiZoneAirTemp) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighZoneAirTemperature");
} else if (SELECT_CASE_var1 == WSCT_HiZoneCooling) {
} else if (SELECT_CASE_var1 == HiZoneCooling) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighZoneCooling");
} else if (SELECT_CASE_var1 == WSCT_HiGlare) {
} else if (SELECT_CASE_var1 == HiGlare) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighGlare");
} else if (SELECT_CASE_var1 == WSCT_MeetDaylIlumSetp) {
} else if (SELECT_CASE_var1 == MeetDaylIlumSetp) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "MeetDaylightIlluminanceSetpoint");
} else if (SELECT_CASE_var1 == WSCT_OnNightLoOutTemp_OffDay) {
} else if (SELECT_CASE_var1 == OnNightLoOutTemp_OffDay) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnNightIfLowOutdoorTempAndOffDay");
} else if (SELECT_CASE_var1 == WSCT_OnNightLoInTemp_OffDay) {
} else if (SELECT_CASE_var1 == OnNightLoInTemp_OffDay) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnNightIfLowInsideTempAndOffDay");
} else if (SELECT_CASE_var1 == WSCT_OnNightIfHeating_OffDay) {
} else if (SELECT_CASE_var1 == OnNightIfHeating_OffDay) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnNightIfHeatingAndOffDay");
} else if (SELECT_CASE_var1 == WSCT_OnNightLoOutTemp_OnDayCooling) {
} else if (SELECT_CASE_var1 == OnNightLoOutTemp_OnDayCooling) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnNightIfLowOutdoorTempAndOnDayIfCooling");
} else if (SELECT_CASE_var1 == WSCT_OnNightIfHeating_OnDayCooling) {
} else if (SELECT_CASE_var1 == OnNightIfHeating_OnDayCooling) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnNightIfHeatingAndOnDayIfCooling");
} else if (SELECT_CASE_var1 == WSCT_OffNight_OnDay_HiSolarWindow) {
} else if (SELECT_CASE_var1 == OffNight_OnDay_HiSolarWindow) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OffNightAndOnDayIfCoolingAndHighSolarOnWindow");
} else if (SELECT_CASE_var1 == WSCT_OnNight_OnDay_HiSolarWindow) {
} else if (SELECT_CASE_var1 == OnNight_OnDay_HiSolarWindow) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnNightAndOnDayIfCoolingAndHighSolarOnWindow");
} else if (SELECT_CASE_var1 == WSCT_OnHiOutTemp_HiSolarWindow) {
} else if (SELECT_CASE_var1 == OnHiOutTemp_HiSolarWindow) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighOutdoorAirTempAndHighSolarOnWindow");
} else if (SELECT_CASE_var1 == WSCT_OnHiOutTemp_HiHorzSolar) {
} else if (SELECT_CASE_var1 == OnHiOutTemp_HiHorzSolar) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighOutdoorAirTempAndHighHorizontalSolar");
} else if (SELECT_CASE_var1 == WSCT_OnHiZoneTemp_HiSolarWindow) {
} else if (SELECT_CASE_var1 == OnHiZoneTemp_HiSolarWindow) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighZoneAirTempAndHighSolarOnWindow");
} else if (SELECT_CASE_var1 == WSCT_OnHiZoneTemp_HiHorzSolar) {
} else if (SELECT_CASE_var1 == OnHiZoneTemp_HiHorzSolar) {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchWscControl, surfName, "OnIfHighZoneAirTempAndHighHorizontalSolar");
}
}
Expand Down Expand Up @@ -2858,7 +2858,7 @@ namespace HeatBalanceSurfaceManager {
}
int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst;
int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast;
for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) {
for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) {
if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass::TDD_Diffuser) {
// Exclude special shading surfaces which required QRadSWOut calculations above
int RoughIndexMovInsul = 0; // Roughness index of movable insulation
Expand Down
Loading

0 comments on commit 1cff5a5

Please sign in to comment.