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

WindowManager Continued #10874

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/test_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ jobs:
const script = require('${{ github.workspace }}/regressions/summary.js')
console.log(script({github, context}))

- uses: lhotari/action-upterm@v1

- name: Fail on Regressions from Forked Repository
if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' && github.event.pull_request.head.repo.full_name != 'NREL/EnergyPlus'
run: |
Expand Down
34 changes: 10 additions & 24 deletions src/EnergyPlus/Construction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2025,18 +2025,6 @@ void ConstructionProps::setArraysBasedOnMaxSolidWinLayers(EnergyPlusData &state)
this->rbBareVisCoef.allocate(state.dataHeatBal->MaxSolidWinLayers);
this->afBareSolCoef.allocate(state.dataHeatBal->MaxSolidWinLayers);
this->abBareSolCoef.allocate(state.dataHeatBal->MaxSolidWinLayers);
for (int Layer = 1; Layer <= state.dataHeatBal->MaxSolidWinLayers; ++Layer) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Don't need to be allocated because they are std::arrays now.

this->AbsBeamCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->AbsBeamBackCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->tBareSolCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->tBareVisCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->rfBareSolCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->rfBareVisCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->rbBareSolCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->rbBareVisCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->afBareSolCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
this->abBareSolCoef(Layer).allocate(DataSurfaces::MaxPolyCoeff);
}

for (int Layer = 1; Layer <= state.dataHeatBal->MaxSolidWinLayers; ++Layer) {
this->AbsDiff(Layer) = 0.0;
Expand All @@ -2053,18 +2041,16 @@ void ConstructionProps::setArraysBasedOnMaxSolidWinLayers(EnergyPlusData &state)
}
}
for (int Layer = 1; Layer <= state.dataHeatBal->MaxSolidWinLayers; ++Layer) {
for (int Index = 1; Index <= DataSurfaces::MaxPolyCoeff; ++Index) {
this->AbsBeamCoef(Layer)(Index) = 0.0;
this->AbsBeamBackCoef(Layer)(Index) = 0.0;
this->tBareSolCoef(Layer)(Index) = 0.0;
this->tBareVisCoef(Layer)(Index) = 0.0;
this->rfBareSolCoef(Layer)(Index) = 0.0;
this->rfBareVisCoef(Layer)(Index) = 0.0;
this->rbBareSolCoef(Layer)(Index) = 0.0;
this->rbBareVisCoef(Layer)(Index) = 0.0;
this->afBareSolCoef(Layer)(Index) = 0.0;
this->abBareSolCoef(Layer)(Index) = 0.0;
}
std::fill(this->AbsBeamCoef(Layer).begin(), this->AbsBeamCoef(Layer).end(), 0.0);
std::fill(this->AbsBeamBackCoef(Layer).begin(), this->AbsBeamBackCoef(Layer).end(), 0.0);
std::fill(this->tBareSolCoef(Layer).begin(), this->tBareSolCoef(Layer).end(), 0.0);
std::fill(this->tBareVisCoef(Layer).begin(), this->tBareVisCoef(Layer).end(), 0.0);
std::fill(this->rfBareSolCoef(Layer).begin(), this->rfBareSolCoef(Layer).end(), 0.0);
std::fill(this->rfBareVisCoef(Layer).begin(), this->rfBareVisCoef(Layer).end(), 0.0);
std::fill(this->rbBareSolCoef(Layer).begin(), this->rbBareSolCoef(Layer).end(), 0.0);
std::fill(this->rbBareVisCoef(Layer).begin(), this->rbBareVisCoef(Layer).end(), 0.0);
std::fill(this->afBareSolCoef(Layer).begin(), this->afBareSolCoef(Layer).end(), 0.0);
std::fill(this->abBareSolCoef(Layer).begin(), this->abBareSolCoef(Layer).end(), 0.0);
}
}

Expand Down
66 changes: 31 additions & 35 deletions src/EnergyPlus/Construction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <EnergyPlus/DataWindowEquivalentLayer.hh>
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/Material.hh>
#include <EnergyPlus/WindowManager.hh>

namespace EnergyPlus {

Expand Down Expand Up @@ -212,46 +213,42 @@ namespace Construction {
// Sol diffuse absorptance per glass layer with blind on
Array1D<std::array<BlindSolDfAbs, Material::MaxSlatAngs>> layerSlatBlindDfAbs;

Array1D<Real64> AbsDiffBack; // Diffuse back solar absorptance for each glass layer
Real64 AbsDiffShade = 0.0; // Diffuse solar absorptance for shade
Real64 AbsDiffBackShade = 0.0; // Diffuse back solar absorptance for shade
Real64 ShadeAbsorpThermal = 0.0; // Diffuse back thermal absorptance of shade
Array1D<Array1D<Real64>> AbsBeamCoef; // Coefficients of incidence-angle polynomial for solar
Array1D<Real64> AbsDiffBack; // Diffuse back solar absorptance for each glass layer
Real64 AbsDiffShade = 0.0; // Diffuse solar absorptance for shade
Real64 AbsDiffBackShade = 0.0; // Diffuse back solar absorptance for shade
Real64 ShadeAbsorpThermal = 0.0; // Diffuse back thermal absorptance of shade
Array1D<std::array<Real64, Window::maxPolyCoef>> AbsBeamCoef; // Coefficients of incidence-angle polynomial for solar
// absorptance for each solid glazing layer
Array1D<Array1D<Real64>> AbsBeamBackCoef; // As for AbsBeamCoef but for back-incident solar
Array1D<Real64> AbsBeamShadeCoef; // Coefficients of incidence-angle polynomial for solar
// absorptance of shade
Array1D<std::array<Real64, Window::maxPolyCoef>> AbsBeamBackCoef; // As for AbsBeamCoef but for back-incident solar
std::array<Real64, Window::maxPolyCoef> AbsBeamShadeCoef = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // Shade abs inc-angle coefs
Real64 TransDiff = 0.0; // Diffuse solar transmittance, bare glass or shade on
Real64 TransDiffVis; // Diffuse visible transmittance, bare glass or shade on
Real64 ReflectSolDiffBack = 0.0; // Diffuse back solar reflectance, bare glass or shade on
Real64 ReflectSolDiffFront = 0.0; // Diffuse front solar reflectance, bare glass or shade on
Real64 ReflectVisDiffBack = 0.0; // Diffuse back visible reflectance, bare glass or shade on
Real64 ReflectVisDiffFront = 0.0; // Diffuse front visible reflectance, bare glass or shade on
Array1D<Real64> TransSolBeamCoef; // Coeffs of incidence-angle polynomial for beam sol trans,
// bare glass or shade on
Array1D<Real64> TransVisBeamCoef; // Coeffs of incidence-angle polynomial for beam vis trans,
// bare glass or shade on
Array1D<Real64> ReflSolBeamFrontCoef; // Coeffs of incidence-angle polynomial for beam sol front refl,
// bare glass or shade on
Array1D<Real64> ReflSolBeamBackCoef; // Like ReflSolBeamFrontCoef, but for back-incident beam solar
Array1D<Array1D<Real64>> tBareSolCoef; // Isolated glass solar transmittance coeffs of inc. angle polynomial
Array1D<Array1D<Real64>> tBareVisCoef; // Isolated glass visible transmittance coeffs of inc. angle polynomial
Array1D<Array1D<Real64>> rfBareSolCoef; // Isolated glass front solar reflectance coeffs of inc. angle polynomial
Array1D<Array1D<Real64>> rfBareVisCoef; // Isolated glass front visible reflectance coeffs of inc. angle polynomial
Array1D<Array1D<Real64>> rbBareSolCoef; // Isolated glass back solar reflectance coeffs of inc. angle polynomial
Array1D<Array1D<Real64>> rbBareVisCoef; // Isolated glass back visible reflectance coeffs of inc. angle polynomial
Array1D<Array1D<Real64>> afBareSolCoef; // Isolated glass front solar absorptance coeffs of inc. angle polynomial
Array1D<Array1D<Real64>> abBareSolCoef; // Isolated glass back solar absorptance coeffs of inc. angle polynomial
Array1D<Real64> tBareSolDiff; // Isolated glass diffuse solar transmittance
Array1D<Real64> tBareVisDiff; // Isolated glass diffuse visible transmittance
Array1D<Real64> rfBareSolDiff; // Isolated glass diffuse solar front reflectance
Array1D<Real64> rfBareVisDiff; // Isolated glass diffuse visible front reflectance
Array1D<Real64> rbBareSolDiff; // Isolated glass diffuse solar back reflectance
Array1D<Real64> rbBareVisDiff; // Isolated glass diffuse visible back reflectance
Array1D<Real64> afBareSolDiff; // Isolated glass diffuse solar front absorptance
Array1D<Real64> abBareSolDiff; // Isolated glass diffuse solar back absorptance
bool FromWindow5DataFile = false; // True if this is a window construction extracted from the Window5 data file
Real64 W5FileMullionWidth = 0.0; // Width of mullion for construction from Window5 data file (m)
std::array<Real64, Window::maxPolyCoef> TransSolBeamCoef = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // beam sol trans inc-angle coefs
std::array<Real64, Window::maxPolyCoef> TransVisBeamCoef = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // beam vis trans inc-angle coefs
std::array<Real64, Window::maxPolyCoef> ReflSolBeamFrontCoef = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // beam sol ref front inc-angle coefs
std::array<Real64, Window::maxPolyCoef> ReflSolBeamBackCoef = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // beam sol ref back inc-angle coefs
Array1D<std::array<Real64, Window::maxPolyCoef>> tBareSolCoef; // Isolated glass solar transmittance coeffs of inc. angle polynomial
Array1D<std::array<Real64, Window::maxPolyCoef>> tBareVisCoef; // Isolated glass visible transmittance coeffs of inc. angle polynomial
Array1D<std::array<Real64, Window::maxPolyCoef>> rfBareSolCoef; // Isolated glass front solar reflectance coeffs of inc. angle polynomial
Array1D<std::array<Real64, Window::maxPolyCoef>> rfBareVisCoef; // Isolated glass front visible reflectance coeffs of inc. angle polynomial
Array1D<std::array<Real64, Window::maxPolyCoef>> rbBareSolCoef; // Isolated glass back solar reflectance coeffs of inc. angle polynomial
Array1D<std::array<Real64, Window::maxPolyCoef>> rbBareVisCoef; // Isolated glass back visible reflectance coeffs of inc. angle polynomial
Array1D<std::array<Real64, Window::maxPolyCoef>> afBareSolCoef; // Isolated glass front solar absorptance coeffs of inc. angle polynomial
Array1D<std::array<Real64, Window::maxPolyCoef>> abBareSolCoef; // Isolated glass back solar absorptance coeffs of inc. angle polynomial
Array1D<Real64> tBareSolDiff; // Isolated glass diffuse solar transmittance
Array1D<Real64> tBareVisDiff; // Isolated glass diffuse visible transmittance
Array1D<Real64> rfBareSolDiff; // Isolated glass diffuse solar front reflectance
Array1D<Real64> rfBareVisDiff; // Isolated glass diffuse visible front reflectance
Array1D<Real64> rbBareSolDiff; // Isolated glass diffuse solar back reflectance
Array1D<Real64> rbBareVisDiff; // Isolated glass diffuse visible back reflectance
Array1D<Real64> afBareSolDiff; // Isolated glass diffuse solar front absorptance
Array1D<Real64> abBareSolDiff; // Isolated glass diffuse solar back absorptance
bool FromWindow5DataFile = false; // True if this is a window construction extracted from the Window5 data file
Real64 W5FileMullionWidth = 0.0; // Width of mullion for construction from Window5 data file (m)
DataWindowEquivalentLayer::Orientation W5FileMullionOrientation =
DataWindowEquivalentLayer::Orientation::Invalid; // Orientation of mullion, if present, for Window5 data file construction,
Real64 W5FileGlazingSysWidth = 0.0; // Glass width for construction from Window5 data file (m)
Expand Down Expand Up @@ -325,8 +322,7 @@ namespace Construction {

// Default Constructor
ConstructionProps()
: LayerPoint(MaxLayersInConstruct, 0), AbsBeamShadeCoef(6, 0.0), TransDiffVis(0.0), TransSolBeamCoef(6, 0.0), TransVisBeamCoef(6, 0.0),
ReflSolBeamFrontCoef(6, 0.0), ReflSolBeamBackCoef(6, 0.0), tBareSolDiff(5, 0.0), tBareVisDiff(5, 0.0), rfBareSolDiff(5, 0.0),
: LayerPoint(MaxLayersInConstruct, 0), TransDiffVis(0.0), tBareSolDiff(5, 0.0), tBareVisDiff(5, 0.0), rfBareSolDiff(5, 0.0),
rfBareVisDiff(5, 0.0), rbBareSolDiff(5, 0.0), rbBareVisDiff(5, 0.0), afBareSolDiff(5, 0.0), abBareSolDiff(5, 0.0),
AbsDiffFrontEQL(DataWindowEquivalentLayer::CFSMAXNL, 0.0), AbsDiffBackEQL(DataWindowEquivalentLayer::CFSMAXNL, 0.0)
{
Expand Down
12 changes: 6 additions & 6 deletions src/EnergyPlus/DElightManagerF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -687,12 +687,12 @@ namespace DElightManagerF {
iWndoConstIndexes(iconst) + 10000,
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransDiffVis,
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).ReflectVisDiffBack,
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(1),
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(2),
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(3),
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(4),
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(5),
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(6));
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef[0],
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef[1],
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef[2],
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef[3],
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef[4],
state.dataConstruction->Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef[5]);

} // Glass Type loop

Expand Down
3 changes: 0 additions & 3 deletions src/EnergyPlus/DataSurfaces.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ namespace DataSurfaces {
using DataBSDFWindow::BSDFWindowDescript;
using DataVectorTypes::Vector;

// MODULE PARAMETER DEFINITIONS:
constexpr int MaxPolyCoeff(6);

// Not sure this is the right module for this stuff, may move it later
enum class Compass4
{
Expand Down
7 changes: 2 additions & 5 deletions src/EnergyPlus/DaylightingDevices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1328,9 +1328,6 @@ namespace Dayltg {
// Swift, P. D., and Smith, G. B. "Cylindrical Mirror Light Pipes",
// Solar Energy Materials and Solar Cells 36 (1995), pp. 159-168.

// Using/Aliasing
using General::POLYF;

// Return value
Real64 TransTDD;

Expand All @@ -1353,15 +1350,15 @@ namespace Dayltg {
// Get the transmittance of each component and of total TDD
switch (RadiationType) {
case RadType::VisibleBeam: {
transDome = POLYF(COSI, state.dataConstruction->Construct(constDome).TransVisBeamCoef);
transDome = Window::POLYF(COSI, state.dataConstruction->Construct(constDome).TransVisBeamCoef);
transPipe = InterpolatePipeTransBeam(state, COSI, state.dataDaylightingDevicesData->TDDPipe(PipeNum).PipeTransVisBeam);
transDiff = state.dataConstruction->Construct(constDiff).TransDiffVis; // May want to change to POLYF also!

TransTDD = transDome * transPipe * transDiff;

} break;
case RadType::SolarBeam: {
transDome = POLYF(COSI, state.dataConstruction->Construct(constDome).TransSolBeamCoef);
transDome = Window::POLYF(COSI, state.dataConstruction->Construct(constDome).TransSolBeamCoef);
transPipe = InterpolatePipeTransBeam(state, COSI, state.dataDaylightingDevicesData->TDDPipe(PipeNum).PipeTransSolBeam);
transDiff = state.dataConstruction->Construct(constDiff).TransDiff; // May want to change to POLYF also!

Expand Down
Loading
Loading