Skip to content

Commit

Permalink
Merge pull request #7487 from NREL/4397-AsymPropsIZSurfaceCheck
Browse files Browse the repository at this point in the history
Correction of Reversed Interzone Construction Check for Asymmetric Material Layers
  • Loading branch information
mjwitte committed Sep 19, 2019
2 parents 81001c5 + ae62139 commit 65479e0
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 7 deletions.
Expand Up @@ -520,6 +520,10 @@ \subsection{Surface(s)}\label{surfaces}
Note that heat transfer surfaces are fully represented with each description. As stated earlier in the Construction description, materials in the construction (outside to inside) are included but film coefficients neither inside nor outside are used in the description -- these are automatically calculated during the EnergyPlus run. Interzone surfaces which do not have a symmetrical construction (such as a ceiling/floor) require two Construction objects with the layers in reverse order. For example, CEILING with carpet, concrete, ceiling tile and FLOOR with ceiling tile, concrete, carpet. If interzone surfaces have a symmetrical construction, the specification for the two surfaces can reference the same Construction. When a surface is connected as the outside boundary condition for another surface, the two surfaces may be in the same plane, or they may be separated to imply thickness.
\end{callout}

\begin{callout}
Note also that if interzone constructions include either \hyperref[windowmaterialglazing]{WindowMaterial:Glazing} or \hyperref[windowmaterialglazingequivalentlayer]{WindowMaterial:Glazing:EquivalentLayer} then the materials properties of layers consisting of those material types will have front and back side values that may differ from one another. So, if using such materials in the definition of an interzone construction, reversed materials must also have their front and back properties inverted so as to match in reverse order. For example, if there is a single layer of glass of type \hyperref[windowmaterialglazing]{WindowMaterial:Glazing} defined for an interzone construction and the front and back properties differ, the user must define two materials with equivalent properties except that the front and back values must be reversed. This means that one material used for the definition on one side might have a front side solar reflectance at normal incidence of 0.35 and a back side solar reflectance at normal incidence of 0.25. The material used for the other side of the interzone construction must then have a front side solar reflectance at normal incidence of 0.25 and a back side solar reflectance at normal incidence of 0.35 to match properly in reverse. EnergyPlus checks for all of the user input properties for single and multiple layer interzone constructions that use these two material types to confirm that this has been done correctly so that the simulation accurately reflects the properties of the materials on each side.
\end{callout}

\textbf{Shading} surfaces are used to describe aspects of the site which do not directly impact the physical interactions of the environmental parameters but may significantly shade the building during specific hours of the day or time so the year (e.g.~trees, bushes, mountains, nearby buildings which aren't being simulated as part of this facility, etc.)

\begin{callout}
Expand Down
5 changes: 5 additions & 0 deletions scripts/dev/find_byref_bool_override.py
Expand Up @@ -322,6 +322,11 @@
"CannotShade"
]
},
"SurfaceGeometry.cc": {
"CheckForReversedLayers": [
"RevLayerDiffs"
]
},
"SwimmingPool.cc": {
# This is an inverse one-way toggle (can only set it to false if true
# when passed)
Expand Down
92 changes: 85 additions & 7 deletions src/EnergyPlus/SurfaceGeometry.cc
Expand Up @@ -871,7 +871,6 @@ namespace SurfaceGeometry {
int Found; // For matching interzone surfaces
int ConstrNumFound; // Construction number of matching interzone surface
static bool NonMatch(false); // Error for non-matching interzone surfaces
int Lay; // Layer number
int MovedSurfs; // Number of Moved Surfaces (when sorting into hierarchical structure)
static bool SurfError(false); // General Surface Error, causes fatal error at end of routine
int Loop;
Expand Down Expand Up @@ -1435,17 +1434,13 @@ namespace SurfaceGeometry {
// check layers as number of layers is the same
izConstDiff = false;
// ok if same nominal U
for (Lay = 1; Lay <= TotLay; ++Lay) {
if (Construct(ConstrNum).LayerPoint(Lay) != Construct(ConstrNumFound).LayerPoint(TotLay - Lay + 1)) {
izConstDiff = true;
break; // exit when diff
}
}
CheckForReversedLayers(izConstDiff, ConstrNum, ConstrNumFound, TotLay);
if (izConstDiff && std::abs(NominalU(ConstrNum) - NominalU(ConstrNumFound)) > 0.001) {
ShowSevereError(RoutineName + "Construction " + Construct(ConstrNum).Name + " of interzone surface " +
Surface(SurfNum).Name +
" does not have the same materials in the reverse order as the construction " +
Construct(ConstrNumFound).Name + " of adjacent surface " + Surface(Found).Name);
ShowContinueError("or the properties of the reversed layers are not correct due to differing layer front and back side values");
if (!Construct(ConstrNum).ReverseConstructionLayersOrderWarning ||
!Construct(ConstrNumFound).ReverseConstructionLayersOrderWarning) {
ShowContinueError("...this problem for this pair will not be reported again.");
Expand All @@ -1458,6 +1453,7 @@ namespace SurfaceGeometry {
Surface(SurfNum).Name +
" does not have the same materials in the reverse order as the construction " +
Construct(ConstrNumFound).Name + " of adjacent surface " + Surface(Found).Name);
ShowContinueError("or the properties of the reversed layers are not correct due to differing layer front and back side values");
ShowContinueError("...but Nominal U values are similar, diff=[" +
RoundSigDigits(std::abs(NominalU(ConstrNum) - NominalU(ConstrNumFound)), 4) +
"] ... simulation proceeds.");
Expand Down Expand Up @@ -13280,6 +13276,88 @@ namespace SurfaceGeometry {
Surface(SurfNum).Width = WidthEff;
Surface(SurfNum).Height = HeightEff;
}


void CheckForReversedLayers(bool &RevLayerDiffs, // true when differences are discovered in interzone constructions
int const ConstrNum, // construction index
int const ConstrNumRev, // construction index for reversed construction
int const TotalLayers // total layers for construction definition
)
{

RevLayerDiffs = false;

for (int LayerNo = 1; LayerNo <= TotalLayers; ++LayerNo) {
auto &thisConstLayer(Construct(ConstrNum).LayerPoint(LayerNo));
auto &revConstLayer(Construct(ConstrNumRev).LayerPoint(TotalLayers - LayerNo + 1));
auto &thisMatLay(Material(thisConstLayer));
auto &revMatLay(Material(revConstLayer));
if ((thisConstLayer != revConstLayer) || // Not pointing to the same layer
(thisMatLay.Group == WindowGlass) || // Not window glass or glass equivalent layer which have
(revMatLay.Group == WindowGlass) || // to have certain properties flipped from front to back
(thisMatLay.Group == GlassEquivalentLayer) ||
(revMatLay.Group == GlassEquivalentLayer)) {
// If not point to the same layer, check to see if this is window glass which might need to have
// front and back material properties reversed.
Real64 const SmallDiff = 0.0001;
if ((thisMatLay.Group == WindowGlass) && (revMatLay.Group == WindowGlass)) {
// Both layers are window glass, so need to check to see if the properties are reversed
if ((abs(thisMatLay.Thickness - revMatLay.Thickness) > SmallDiff) ||
(abs(thisMatLay.ReflectSolBeamBack - revMatLay.ReflectSolBeamFront) > SmallDiff) ||
(abs(thisMatLay.ReflectSolBeamFront - revMatLay.ReflectSolBeamBack) > SmallDiff) ||
(abs(thisMatLay.TransVis - revMatLay.TransVis) > SmallDiff) ||
(abs(thisMatLay.ReflectVisBeamBack - revMatLay.ReflectVisBeamFront) > SmallDiff) ||
(abs(thisMatLay.ReflectVisBeamFront - revMatLay.ReflectVisBeamBack) > SmallDiff) ||
(abs(thisMatLay.TransThermal - revMatLay.TransThermal) > SmallDiff) ||
(abs(thisMatLay.AbsorpThermalBack - revMatLay.AbsorpThermalFront) > SmallDiff) ||
(abs(thisMatLay.AbsorpThermalFront - revMatLay.AbsorpThermalBack) > SmallDiff) ||
(abs(thisMatLay.Conductivity - revMatLay.Conductivity) > SmallDiff) ||
(abs(thisMatLay.GlassTransDirtFactor - revMatLay.GlassTransDirtFactor) > SmallDiff) ||
(thisMatLay.SolarDiffusing != revMatLay.SolarDiffusing) ||
(abs(thisMatLay.YoungModulus - revMatLay.YoungModulus) > SmallDiff) ||
(abs(thisMatLay.PoissonsRatio - revMatLay.PoissonsRatio) > SmallDiff)) {
RevLayerDiffs = true;
break; // exit when diff
} // If none of the above conditions is met, then these should be the same layers in reverse (RevLayersDiffs = false)
} else if ((thisMatLay.Group == GlassEquivalentLayer) && (revMatLay.Group == GlassEquivalentLayer)) {
if ((abs(thisMatLay.TausBackBeamBeam - revMatLay.TausFrontBeamBeam) > SmallDiff) ||
(abs(thisMatLay.TausFrontBeamBeam - revMatLay.TausBackBeamBeam) > SmallDiff) ||
(abs(thisMatLay.ReflBackBeamBeam - revMatLay.ReflFrontBeamBeam) > SmallDiff) ||
(abs(thisMatLay.ReflFrontBeamBeam - revMatLay.ReflBackBeamBeam) > SmallDiff) ||
(abs(thisMatLay.TausBackBeamBeamVis - revMatLay.TausFrontBeamBeamVis) > SmallDiff) ||
(abs(thisMatLay.TausFrontBeamBeamVis - revMatLay.TausBackBeamBeamVis) > SmallDiff) ||
(abs(thisMatLay.ReflBackBeamBeamVis - revMatLay.ReflFrontBeamBeamVis) > SmallDiff) ||
(abs(thisMatLay.ReflFrontBeamBeamVis - revMatLay.ReflBackBeamBeamVis) > SmallDiff) ||
(abs(thisMatLay.TausBackBeamDiff - revMatLay.TausFrontBeamDiff) > SmallDiff) ||
(abs(thisMatLay.TausFrontBeamDiff - revMatLay.TausBackBeamDiff) > SmallDiff) ||
(abs(thisMatLay.ReflBackBeamDiff - revMatLay.ReflFrontBeamDiff) > SmallDiff) ||
(abs(thisMatLay.ReflFrontBeamDiff - revMatLay.ReflBackBeamDiff) > SmallDiff) ||
(abs(thisMatLay.TausBackBeamDiffVis - revMatLay.TausFrontBeamDiffVis) > SmallDiff) ||
(abs(thisMatLay.TausFrontBeamDiffVis - revMatLay.TausBackBeamDiffVis) > SmallDiff) ||
(abs(thisMatLay.ReflBackBeamDiffVis - revMatLay.ReflFrontBeamDiffVis) > SmallDiff) ||
(abs(thisMatLay.ReflFrontBeamDiffVis - revMatLay.ReflBackBeamDiffVis) > SmallDiff) ||
(abs(thisMatLay.TausDiffDiff - revMatLay.TausDiffDiff) > SmallDiff) ||
(abs(thisMatLay.ReflBackDiffDiff - revMatLay.ReflFrontDiffDiff) > SmallDiff) ||
(abs(thisMatLay.ReflFrontDiffDiff - revMatLay.ReflBackDiffDiff) > SmallDiff) ||
(abs(thisMatLay.TausDiffDiffVis - revMatLay.TausDiffDiffVis) > SmallDiff) ||
(abs(thisMatLay.ReflBackDiffDiffVis - revMatLay.ReflFrontDiffDiffVis) > SmallDiff) ||
(abs(thisMatLay.ReflFrontDiffDiffVis - revMatLay.ReflBackDiffDiffVis) > SmallDiff) ||
(abs(thisMatLay.TausThermal - revMatLay.TausThermal) > SmallDiff) ||
(abs(thisMatLay.EmissThermalBack - revMatLay.EmissThermalFront) > SmallDiff) ||
(abs(thisMatLay.EmissThermalFront - revMatLay.EmissThermalBack) > SmallDiff) ||
(abs(thisMatLay.Resistance - revMatLay.Resistance) > SmallDiff)) {
RevLayerDiffs = true;
break; // exit when diff
} // If none of the above conditions is met, then these should be the same layers in reverse (RevLayersDiffs = false)
} else {
// Other material types do not have reversed constructions so if they are not the same layer there is a problem (RevLayersDiffs = true)
RevLayerDiffs = true;
break; // exit when diff
} // End check of whether or not these are WindowGlass
} // else: thisConstLayer is the same as revConstLayer--so there is no problem (RevLayersDiffs = false)
}
}

} // namespace SurfaceGeometry

} // namespace EnergyPlus
6 changes: 6 additions & 0 deletions src/EnergyPlus/SurfaceGeometry.hh
Expand Up @@ -389,6 +389,12 @@ namespace SurfaceGeometry {
bool isRectangle(int const ThisSurf // Current surface number
);

void CheckForReversedLayers(bool &RevLayerDiffs, // true when differences are discovered in interzone constructions
int const ConstrNum, // construction index
int const ConstrNumRev, // construction index for reversed construction
int const TotalLayers // total layers for construction definition
);

} // namespace SurfaceGeometry

} // namespace EnergyPlus
Expand Down

6 comments on commit 65479e0

@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-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build 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-custom_check: OK (11 of 11 tests passed, 0 test warnings)

Build 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.4: OK (1910 of 1910 tests passed, 0 test warnings)

Build Badge Test 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.4-UnitTestsCoverage-Debug: OK (1220 of 1220 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.4-IntegrationCoverage-Debug: OK (673 of 673 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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 (1890 of 1890 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.