Skip to content

Commit

Permalink
convert SolarReflectionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlball committed Oct 17, 2020
1 parent 5656d4d commit 09c0997
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 211 deletions.
1 change: 1 addition & 0 deletions src/EnergyPlus/Data/CommonIncludes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/Pipes.hh>
#include <EnergyPlus/PlantChillers.hh>
#include <EnergyPlus/SolarReflectionManager.hh>
#include <EnergyPlus/SolarShading.hh>
#include <EnergyPlus/SplitterComponent.hh>
#include <EnergyPlus/SteamBaseboardRadiator.hh>
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ namespace EnergyPlus {
this->dataGlobal = std::unique_ptr<DataGlobal>(new DataGlobal);
this->dataPipes = std::unique_ptr<PipesData>(new PipesData);
this->dataPlantChillers = std::unique_ptr<PlantChillersData>(new PlantChillersData);
this->dataSolarReflectionManager = std::unique_ptr<SolarReflectionManagerData>(new SolarReflectionManagerData);
this->dataSolarShading = std::unique_ptr<SolarShadingData>(new SolarShadingData);
this->dataSplitterComponent = std::unique_ptr<SplitterComponentData>(new SplitterComponentData);
this->dataSteamBaseboardRadiator = std::unique_ptr<SteamBaseboardRadiatorData>(new SteamBaseboardRadiatorData);
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ struct ExteriorEnergyUseData;
struct FansData;
struct PipesData;
struct PlantChillersData;
struct SolarReflectionManagerData;
struct SolarShadingData;
struct SplitterComponentData;
struct SteamBaseboardRadiatorData;
Expand Down Expand Up @@ -162,6 +163,7 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<FansData> dataFans;
std::unique_ptr<PipesData> dataPipes;
std::unique_ptr<PlantChillersData> dataPlantChillers;
std::unique_ptr<SolarReflectionManagerData> dataSolarReflectionManager;
std::unique_ptr<SolarShadingData> dataSolarShading;
std::unique_ptr<SplitterComponentData> dataSplitterComponent;
std::unique_ptr<SteamBaseboardRadiatorData> dataSteamBaseboardRadiator;
Expand Down
31 changes: 7 additions & 24 deletions src/EnergyPlus/DaylightingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3400,26 +3400,9 @@ namespace DaylightingManager {
// METHODOLOGY EMPLOYED:
// switch as need to serve both reference points and map points based on calledFrom

// REFERENCES:
// na

// Using/Aliasing
using DataSystemVariables::DetailedSkyDiffuseAlgorithm;
using General::BlindBeamBeamTrans;
using General::POLYF;
using SolarReflectionManager::SolReflRecSurf;

// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:

// SUBROUTINE PARAMETER DEFINITIONS:
// na

// INTERFACE BLOCK SPECIFICATIONS:
// na

// DERIVED TYPE DEFINITIONS:
// na

if (SUNCOSHR(iHour, 3) < SunIsUpValue) return;

Expand Down Expand Up @@ -3892,10 +3875,10 @@ namespace DaylightingManager {
// Receiving surface number corresponding this window
RecSurfNum = Surface(IWin2).ShadowSurfRecSurfNum;
if (RecSurfNum > 0) { // interior windows do not apply
if (SolReflRecSurf(RecSurfNum).NumPossibleObs > 0) {
if (state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).NumPossibleObs > 0) {
// This window has associated obstructions that could reflect beam onto the window
for (int loop = 1, loop_end = SolReflRecSurf(RecSurfNum).NumPossibleObs; loop <= loop_end; ++loop) {
ReflSurfNum = SolReflRecSurf(RecSurfNum).PossibleObsSurfNums(loop);
for (int loop = 1, loop_end = state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).NumPossibleObs; loop <= loop_end; ++loop) {
ReflSurfNum = state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).PossibleObsSurfNums(loop);
ReflSurfNumX = ReflSurfNum;
// Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction.
// The following gets the correct side of a shadowing surface for reflection.
Expand Down Expand Up @@ -3928,8 +3911,8 @@ namespace DaylightingManager {
ReflDistance = std::sqrt(ReflDistanceSq);
// Is ray from ref. pt. to reflection point (HitPtRefl) obstructed?
hitObsRefl = false;
for (int loop2 = 1, loop2_end = SolReflRecSurf(RecSurfNum).NumPossibleObs; loop2 <= loop2_end; ++loop2) {
int const ObsSurfNum = SolReflRecSurf(RecSurfNum).PossibleObsSurfNums(loop2);
for (int loop2 = 1, loop2_end = state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).NumPossibleObs; loop2 <= loop2_end; ++loop2) {
int const ObsSurfNum = state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).PossibleObsSurfNums(loop2);
if (ObsSurfNum == ReflSurfNum || ObsSurfNum == Surface(ReflSurfNum).BaseSurf) continue;
PierceSurface(ObsSurfNum, RREF2, SunVecMir, ReflDistance, HitPtObs, hitObs); // ReflDistance cutoff added
if (hitObs) { // => Could skip distance check (unless < vs <= ReflDistance really matters)
Expand All @@ -3949,8 +3932,8 @@ namespace DaylightingManager {
ReflSurfRecNum = Surface(ReflSurfNum).ShadowSurfRecSurfNum;
if (ReflSurfRecNum > 0) {
// Loop over possible obstructions for this reflecting window
for (int loop2 = 1, loop2_end = SolReflRecSurf(ReflSurfRecNum).NumPossibleObs; loop2 <= loop2_end; ++loop2) {
int const ObsSurfNum = SolReflRecSurf(ReflSurfRecNum).PossibleObsSurfNums(loop2);
for (int loop2 = 1, loop2_end = state.dataSolarReflectionManager->SolReflRecSurf(ReflSurfRecNum).NumPossibleObs; loop2 <= loop2_end; ++loop2) {
int const ObsSurfNum = state.dataSolarReflectionManager->SolReflRecSurf(ReflSurfRecNum).PossibleObsSurfNums(loop2);
PierceSurface(ObsSurfNum, HitPtRefl, RAYCOS, HitPtObs, hitObs);
if (hitObs) break;
}
Expand Down
Loading

5 comments on commit 09c0997

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

global_SteamCoils (brianlball) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3024 of 3024 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.

global_SteamCoils (brianlball) - x86_64-MacOS-10.15-clang-11.0.0: OK (2984 of 2984 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.

global_SteamCoils (brianlball) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1548 of 1548 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.

global_SteamCoils (brianlball) - Win64-Windows-10-VisualStudio-16: OK (2240 of 2240 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.

global_SteamCoils (brianlball) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (722 of 722 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.