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

Refactoring of interpolation functions for blinds Prof and Slat Angle #8591

Merged
merged 30 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2532651
partial commit
xuanluo113 Mar 4, 2021
57aa34f
slat angle
xuanluo113 Mar 5, 2021
04c0cbe
merge conflicts
xuanluo113 Mar 5, 2021
8e8c211
test remote
xuanluo113 Mar 6, 2021
34957ce
profile ang
xuanluo113 Mar 7, 2021
1d74547
prof-slat angle
xuanluo113 Mar 7, 2021
c100766
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 9, 2021
242f33c
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 11, 2021
30c6570
merge
xuanluo113 Mar 16, 2021
5cd3283
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 17, 2021
8a1a02b
floating point
xuanluo113 Mar 18, 2021
7a17319
merge
xuanluo113 Mar 18, 2021
40e7d68
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 19, 2021
c8c506d
more functions cleaning up
xuanluo113 Mar 19, 2021
e15f581
array ordering
xuanluo113 Mar 20, 2021
1c3f2e5
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 20, 2021
75cb7f1
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 20, 2021
0bb86d5
merge
xuanluo113 Mar 20, 2021
a0adce1
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 21, 2021
4bf5a48
debug and clean up
xuanluo113 Mar 22, 2021
c155311
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 22, 2021
00ec6a3
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into int…
xuanluo113 Mar 22, 2021
1e9f393
constexpr
xuanluo113 Mar 22, 2021
230c5ef
clean up
xuanluo113 Mar 23, 2021
66b0ee8
clean up
xuanluo113 Mar 23, 2021
ade8f89
merge
xuanluo113 Mar 23, 2021
c96898b
Merge remote-tracking branch 'remotes/NRELEnergyPlus/develop' into in…
mjwitte Mar 24, 2021
01c3e0b
merge cleanup
mjwitte Mar 25, 2021
4b5e824
Merge remote-tracking branch 'remotes/NRELEnergyPlus/develop' into in…
mjwitte Mar 25, 2021
57070ce
address comments
xuanluo113 Mar 25, 2021
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
95 changes: 66 additions & 29 deletions src/EnergyPlus/DataSurfaces.hh
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,6 @@
#define BITF(B) (1 << (int(B)))
#define BITF_TEST_ANY(V, B) (((V) & (B)) != 0)

// IS_SHADED is the flag to indicate window has no shading device or shading device is off, and no daylight glare control
// original expression: SHADE_FLAG == ShadeOff || SHADE_FLAG == ShadeOff
#define NOT_SHADED(SHADE_FLAG) BITF_TEST_ANY(BITF(SHADE_FLAG), BITF(WinShadingType::NoShade) | BITF(WinShadingType::ShadeOff))

// IS_SHADED is the flag to indicate window has shade on or temporarily off but may be triggered on later to control daylight glare
// original expression: SHADE_FLAG > ShadeOff
#define IS_SHADED(SHADE_FLAG) !NOT_SHADED(SHADE_FLAG)

// IS_SHADED_NO_GLARE is the flag to indicate window has shade and no daylight glare control
// original expression: IntShade <= SHADE_FLAG <= BGBlind
#define IS_SHADED_NO_GLARE_CTRL(SHADE_FLAG) \
BITF_TEST_ANY(BITF(SHADE_FLAG), \
BITF(WinShadingType::IntShade) | BITF(WinShadingType::SwitchableGlazing) | BITF(WinShadingType::ExtShade) | \
BITF(WinShadingType::ExtScreen) | BITF(WinShadingType::IntBlind) | BITF(WinShadingType::ExtBlind) | \
BITF(WinShadingType::BGShade) | BITF(WinShadingType::BGBlind))

// ANY_SHADE: if SHADE_FLAG is any of the shading types including interior, exterior or between glass shades
#define ANY_SHADE(SHADE_FLAG) \
BITF_TEST_ANY(BITF(SHADE_FLAG), BITF(WinShadingType::IntShade) | BITF(WinShadingType::ExtShade) | BITF(WinShadingType::BGShade))
#define ANY_SHADE_SCREEN(SHADE_FLAG) \
BITF_TEST_ANY(BITF(SHADE_FLAG), \
BITF(WinShadingType::IntShade) | BITF(WinShadingType::ExtShade) | BITF(WinShadingType::BGShade) | BITF(WinShadingType::ExtScreen))
#define ANY_BLIND(SHADE_FLAG) \
BITF_TEST_ANY(BITF(SHADE_FLAG), BITF(WinShadingType::IntBlind) | BITF(WinShadingType::ExtBlind) | BITF(WinShadingType::BGBlind))
#define ANY_INTERIOR_SHADE_BLIND(SHADE_FLAG) BITF_TEST_ANY(BITF(SHADE_FLAG), BITF(WinShadingType::IntShade) | BITF(WinShadingType::IntBlind))
#define ANY_EXTERIOR_SHADE_BLIND_SCREEN(SHADE_FLAG) \
BITF_TEST_ANY(BITF(SHADE_FLAG), BITF(WinShadingType::ExtShade) | BITF(WinShadingType::ExtBlind) | BITF(WinShadingType::ExtScreen))
#define ANY_BETWEENGLASS_SHADE_BLIND(SHADE_FLAG) BITF_TEST_ANY(BITF(SHADE_FLAG), BITF(WinShadingType::BGShade) | BITF(WinShadingType::BGBlind))

namespace EnergyPlus {

// Forward declarations
Expand All @@ -110,6 +81,7 @@ namespace DataSurfaces {

// MODULE PARAMETER DEFINITIONS:
constexpr int MaxSlatAngs(19);
constexpr int MaxProfAngs(37);

// Parameters to indicate surface shape for use with the Surface
// derived type (see below):
Expand Down Expand Up @@ -284,6 +256,59 @@ namespace DataSurfaces {
}
}

// IS_SHADED is the flag to indicate window has no shading device or shading device is off, and no daylight glare control
// original expression: SHADE_FLAG == ShadeOff || SHADE_FLAG == ShadeOff
constexpr bool NOT_SHADED(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag), BITF(WinShadingType::NoShade) | BITF(WinShadingType::ShadeOff));
}

// IS_SHADED is the flag to indicate window has shade on or temporarily off but may be triggered on later to control daylight glare
// original expression: SHADE_FLAG > ShadeOff
constexpr bool IS_SHADED(WinShadingType const ShadingFlag) {
return !NOT_SHADED(ShadingFlag);
}

// IS_SHADED_NO_GLARE is the flag to indicate window has shade and no daylight glare control
// original expression: IntShade <= SHADE_FLAG <= BGBlind
constexpr bool IS_SHADED_NO_GLARE_CTRL(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag),
BITF(WinShadingType::IntShade) | BITF(WinShadingType::SwitchableGlazing) |
BITF(WinShadingType::ExtShade) | BITF(WinShadingType::ExtScreen) |
BITF(WinShadingType::IntBlind) | BITF(WinShadingType::ExtBlind) |
BITF(WinShadingType::BGShade) | BITF(WinShadingType::BGBlind));
}

// ANY_SHADE: if SHADE_FLAG is any of the shading types including interior, exterior or between glass shades
constexpr bool ANY_SHADE(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag),
BITF(WinShadingType::IntShade) | BITF(WinShadingType::ExtShade) | BITF(WinShadingType::BGShade));
}

constexpr bool ANY_SHADE_SCREEN(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag),
BITF(WinShadingType::IntShade) | BITF(WinShadingType::ExtShade) | BITF(WinShadingType::BGShade) | BITF(WinShadingType::ExtScreen));
}

constexpr bool ANY_BLIND(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag),
BITF(WinShadingType::IntBlind) | BITF(WinShadingType::ExtBlind) | BITF(WinShadingType::BGBlind));
}

constexpr bool ANY_INTERIOR_SHADE_BLIND(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag),
BITF(WinShadingType::IntShade) | BITF(WinShadingType::IntBlind));
}

constexpr bool ANY_EXTERIOR_SHADE_BLIND_SCREEN(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag),
BITF(WinShadingType::ExtShade) | BITF(WinShadingType::ExtBlind) | BITF(WinShadingType::ExtScreen));
}

constexpr bool ANY_BETWEENGLASS_SHADE_BLIND(WinShadingType const ShadingFlag) {
return BITF_TEST_ANY(BITF(ShadingFlag),
BITF(WinShadingType::BGShade) | BITF(WinShadingType::BGBlind));
}

// Parameters for classification of outside face of surfaces
constexpr int OutConvClass_WindwardVertWall(101);
constexpr int OutConvClass_LeewardVertWall(102);
Expand Down Expand Up @@ -1513,6 +1538,12 @@ struct SurfacesData : BaseGlobalStruct
Array1D<bool> SurfWinSlatAngThisTSDegEMSon; // flag that indicate EMS system is actuating SlatAngThisTSDeg
Array1D<Real64> SurfWinSlatAngThisTSDegEMSValue; // value that EMS sets for slat angle in degrees
Array1D<bool> SurfWinSlatsBlockBeam; // True if blind slats block incident beam solar
Array1D<int> SurfWinSlatsAngIndex;
Copy link
Contributor

Choose a reason for hiding this comment

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

6 new SurfWin* arrays to avoid recomputing values.

Array1D<Real64> SurfWinSlatsAngInterpFac;
Array1D<Real64> SurfWinProfileAng;
Array1D<int> SurfWinProfAngIndex;
Array1D<Real64> SurfWinProfAngInterpFac;
Array1D<Real64> SurfWinBlindBmBmTrans;
Array1D<Real64> SurfWinBlindAirFlowPermeability; // Blind air-flow permeability for calculation of convective flow in gap between blind and glass
Array1D<Real64> SurfWinTotGlazingThickness; // Total glazing thickness from outside of outer glass to inside of inner glass (m)
Array1D<Real64> SurfWinTanProfileAngHor; // Tangent of horizontal profile angle
Expand Down Expand Up @@ -1778,6 +1809,12 @@ struct SurfacesData : BaseGlobalStruct
this->SurfWinSlatAngThisTSDegEMSon.deallocate();
this->SurfWinSlatAngThisTSDegEMSValue.deallocate();
this->SurfWinSlatsBlockBeam.deallocate();
this->SurfWinSlatsAngIndex.deallocate();
this->SurfWinSlatsAngInterpFac.deallocate();
this->SurfWinProfileAng.deallocate();
this->SurfWinProfAngIndex.deallocate();
this->SurfWinProfAngInterpFac.deallocate();
this->SurfWinBlindBmBmTrans.deallocate();
this->SurfWinBlindAirFlowPermeability.deallocate();
this->SurfWinTotGlazingThickness.deallocate();
this->SurfWinTanProfileAngHor.deallocate();
Expand Down
Loading