Skip to content

Commit

Permalink
Merge pull request #8393 from NREL/global_dataDaylighting
Browse files Browse the repository at this point in the history
Global Daylighting
  • Loading branch information
mitchute committed Nov 30, 2020
2 parents c1905e6 + 2f24359 commit 734af19
Show file tree
Hide file tree
Showing 43 changed files with 2,503 additions and 3,171 deletions.
4 changes: 0 additions & 4 deletions src/EnergyPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,11 @@ SET( SRC
DataBranchNodeConnections.hh
DataComplexFenestration.hh
DataContaminantBalance.hh
DataConvergParams.cc
DataConvergParams.hh
DataConversions.cc
DataConversions.hh
DataDElight.cc
DataDElight.hh
DataDaylighting.cc
DataDaylighting.hh
DataDaylightingDevices.cc
DataDaylightingDevices.hh
DataDefineEquip.cc
DataDefineEquip.hh
Expand Down
8 changes: 3 additions & 5 deletions src/EnergyPlus/CostEstimateManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ namespace CostEstimateManager {
using DataPhotovoltaics::PVarray;
using DataSurfaces::Surface;
using DXCoils::DXCoil;
using namespace DataDaylighting;
using HeatingCoils::HeatingCoil;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Expand Down Expand Up @@ -385,7 +384,7 @@ namespace CostEstimateManager {
} else {
ThisZoneID = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone);
if (ThisZoneID > 0) {
state.dataCostEstimateManager->CostLineItem(Item).Qty = ZoneDaylight(ThisZoneID).TotalDaylRefPoints;
state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataDaylightingData->ZoneDaylight(ThisZoneID).TotalDaylRefPoints;
} else {
ShowSevereError(state, "ComponentCost:LineItem: \"" + state.dataCostEstimateManager->CostLineItem(Item).LineName +
"\", Daylighting:Controls, need to specify a valid zone name");
Expand Down Expand Up @@ -500,7 +499,6 @@ namespace CostEstimateManager {
using DataSurfaces::TotSurfaces;
using DXCoils::DXCoil;
using DXCoils::NumDXCoils;
using namespace DataDaylighting;
using HeatingCoils::HeatingCoil;
using HeatingCoils::NumHeatingCoils;

Expand Down Expand Up @@ -708,11 +706,11 @@ namespace CostEstimateManager {
} else if (SELECT_CASE_var == "DAYLIGHTING:CONTROLS") {

if (state.dataCostEstimateManager->CostLineItem(Item).ParentObjName == "*") { // wildcard, apply to all such components
state.dataCostEstimateManager->CostLineItem(Item).Qty = sum(ZoneDaylight, &ZoneDaylightCalc::TotalDaylRefPoints);
state.dataCostEstimateManager->CostLineItem(Item).Qty = sum(state.dataDaylightingData->ZoneDaylight, &DataDaylighting::ZoneDaylightCalc::TotalDaylRefPoints);
} else if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) {
ThisZoneID = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone);
if (ThisZoneID > 0) {
state.dataCostEstimateManager->CostLineItem(Item).Qty = ZoneDaylight(ThisZoneID).TotalDaylRefPoints;
state.dataCostEstimateManager->CostLineItem(Item).Qty = state.dataDaylightingData->ZoneDaylight(ThisZoneID).TotalDaylRefPoints;
}
}

Expand Down
28 changes: 12 additions & 16 deletions src/EnergyPlus/DElightManagerF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ namespace DElightManagerF {
using namespace DataEnvironment; // Gives access to Site data
using namespace DataSurfaces; // Gives access to Surface data
using namespace DataStringGlobals; // Gives access to Program Path and Current Time/Date
using namespace DataDaylighting;

using InternalHeatGains::CheckLightsReplaceableMinMaxForZone;
using InternalHeatGains::GetDesignLightingLevelForZone;

Expand Down Expand Up @@ -230,8 +228,8 @@ namespace DElightManagerF {
SinBldgRelNorth = std::sin(-BuildingAzimuth * DataGlobalConstants::DegToRadians());

// Loop through the Daylighting:Controls objects that use DElight checking for a host Zone
for (auto &znDayl : ZoneDaylight) {
if (znDayl.DaylightMethod == DElightDaylighting) {
for (auto &znDayl : state.dataDaylightingData->ZoneDaylight) {
if (znDayl.DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) {

// Register Error if 0 DElight RefPts have been input for valid DElight object
if (znDayl.TotalDaylRefPoints == 0) {
Expand Down Expand Up @@ -266,8 +264,8 @@ namespace DElightManagerF {

// Loop through the Daylighting:DElight objects searching for a match to the current Zone

for (auto &znDayl : ZoneDaylight) {
if (znDayl.DaylightMethod == DElightDaylighting) {
for (auto &znDayl : state.dataDaylightingData->ZoneDaylight) {
if (znDayl.DaylightMethod == DataDaylighting::iDaylightingMethod::DElightDaylighting) {
int const izone = UtilityRoutines::FindItemInList(znDayl.ZoneName, Zone);
if (izone != 0) {

Expand Down Expand Up @@ -382,7 +380,7 @@ namespace DElightManagerF {

// Loop through all Doppelganger Surface Names to ignore these Windows
lWndoIsDoppelganger = false;
for (auto &cfs : DElightComplexFene) {
for (auto &cfs : state.dataDaylightingData->DElightComplexFene) {

// Is the current Window Surface a Doppelganger?
if (wndo.Name == cfs.wndwName) {
Expand Down Expand Up @@ -416,7 +414,7 @@ namespace DElightManagerF {
// Loop through all Doppelganger Surface Names to ignore these Windows
lWndoIsDoppelganger = false;

for (auto &cfs : DElightComplexFene) {
for (auto &cfs : state.dataDaylightingData->DElightComplexFene) {

// Is the current Window Surface a Doppelganger?
if (wndo2.Name == cfs.wndwName) {
Expand Down Expand Up @@ -470,7 +468,7 @@ namespace DElightManagerF {
iHostedCFS = 0;

// Loop through the input CFS objects searching for a match to the current Opaque Bounding Surface
for (auto &cfs : DElightComplexFene) {
for (auto &cfs : state.dataDaylightingData->DElightComplexFene) {

// Does the current Opaque Bounding Surface host the current CFS object?
if (surf.Name == cfs.surfName) {
Expand All @@ -483,7 +481,7 @@ namespace DElightManagerF {

// Now write each of the hosted CFS data
// Loop through the input CFS objects searching for a match to the current Opaque Bounding Surface
for (auto &cfs : DElightComplexFene) {
for (auto &cfs : state.dataDaylightingData->DElightComplexFene) {

// Does the current Opaque Bounding Surface host the current CFS object?
if (surf.Name == cfs.surfName) {
Expand Down Expand Up @@ -538,7 +536,7 @@ namespace DElightManagerF {
print(delightInFile, Format_912, znDayl.TotalDaylRefPoints);

// Loop through the Daylighting:DElight:Reference Point objects checking for the current DElight Zone host
for (auto &refPt : DaylRefPt) {
for (auto &refPt : state.dataDaylightingData->DaylRefPt) {

// Is this RefPt hosted by current DElight Zone?
if (izone == refPt.ZoneNum) {
Expand Down Expand Up @@ -692,7 +690,6 @@ namespace DElightManagerF {
// Glazer - July 2016

using namespace DataIPShortCuts; // Gives access to commonly dimensioned field names, etc for getinput
using namespace DataDaylighting;
using DataSurfaces::Surface;

int NumAlpha;
Expand All @@ -702,9 +699,9 @@ namespace DElightManagerF {

constexpr auto cCurrentModuleObject("Daylighting:DELight:ComplexFenestration");

TotDElightCFS = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
DElightComplexFene.allocate(TotDElightCFS);
for (auto &cfs : DElightComplexFene) {
state.dataDaylightingData->TotDElightCFS = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
state.dataDaylightingData->DElightComplexFene.allocate(state.dataDaylightingData->TotDElightCFS);
for (auto &cfs : state.dataDaylightingData->DElightComplexFene) {
inputProcessor->getObjectItem(state,
cCurrentModuleObject,
++CFSNum,
Expand Down Expand Up @@ -757,7 +754,6 @@ namespace DElightManagerF {
// USE STATEMENTS:
// Using/Aliasing
using namespace DataIPShortCuts;
using DataDaylighting::ZoneDaylight;
using DataSurfaces::AspectTransform;
using DataSurfaces::WorldCoordSystem;

Expand Down
5 changes: 5 additions & 0 deletions src/EnergyPlus/Data/CommonIncludes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,14 @@
#include <EnergyPlus/DataBranchNodeConnections.hh>
#include <EnergyPlus/DataBSDFWindow.hh>
#include <EnergyPlus/DataContaminantBalance.hh>
#include <EnergyPlus/DataConvergParams.hh>
#include <EnergyPlus/DataDaylighting.hh>
#include <EnergyPlus/DataDaylightingDevices.hh>
#include <EnergyPlus/DaylightingManager.hh>
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/DataWater.hh>
#include <EnergyPlus/DataTimings.hh>
#include <EnergyPlus/DaylightingDevices.hh>
#include <EnergyPlus/ExteriorEnergyUse.hh>
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/Pipes.hh>
Expand Down
10 changes: 10 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@ namespace EnergyPlus {
this->dataConstruction = std::make_unique<ConstructionData>();
this->dataContaminantBalance = std::make_unique<ContaminantBalanceData>();
this->dataConvectionCoefficient = std::make_unique<ConvectionCoefficientsData>();
this->dataConvergeParams = std::make_unique<ConvergParamsData>();
this->dataCoolTower = std::make_unique<CoolTowerData>();
this->dataCostEstimateManager = std::make_unique<CostEstimateManagerData>();
this->dataCrossVentMgr = std::make_unique<CrossVentMgrData>();
this->dataCTElectricGenerator = std::make_unique<CTElectricGeneratorData>();
this->dataCurveManager = std::make_unique<CurveManagerData>();
this->dataDaylightingData = std::make_unique<DaylightingData>();
this->dataDaylightingDevicesData = std::make_unique<DataDaylightingDevicesData>();
this->dataDaylightingDevices = std::make_unique<DaylightingDevicesData>();
this->dataDaylightingManager = std::make_unique<DaylightingManagerData>();
this->dataEIRPlantLoopHeatPump = std::make_unique<EIRPlantLoopHeatPumpsData>();
this->dataExteriorEnergyUse = std::make_unique<ExteriorEnergyUseData>();
this->dataFans = std::make_unique<FansData>();
Expand Down Expand Up @@ -162,11 +167,16 @@ namespace EnergyPlus {
this->dataConstruction->clear_state();
this->dataContaminantBalance->clear_state();
this->dataConvectionCoefficient->clear_state();
this->dataConvergeParams->clear_state();
this->dataCoolTower->clear_state();
this->dataCostEstimateManager->clear_state();
this->dataCrossVentMgr->clear_state();
this->dataCTElectricGenerator->clear_state();
this->dataCurveManager->clear_state();
this->dataDaylightingData->clear_state();
this->dataDaylightingDevicesData->clear_state();
this->dataDaylightingDevices->clear_state();
this->dataDaylightingManager->clear_state();
this->dataEIRPlantLoopHeatPump->clear_state();
this->dataExteriorEnergyUse->clear_state();
this->dataFans->clear_state();
Expand Down
10 changes: 10 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct CondenserLoopTowersData;
struct ConstructionData;
struct ContaminantBalanceData;
struct ConvectionCoefficientsData;
struct ConvergParamsData;
struct CoolTowerData;
struct CostEstimateManagerData;
struct CrossVentMgrData;
Expand All @@ -96,6 +97,10 @@ struct DataBranchAirLoopPlantData;
struct DataGlobal;
struct DataTimingsData;
struct DataWaterData;
struct DaylightingData;
struct DataDaylightingDevicesData;
struct DaylightingDevicesData;
struct DaylightingManagerData;
struct EIRPlantLoopHeatPumpsData;
struct ExteriorEnergyUseData;
struct FansData;
Expand Down Expand Up @@ -173,6 +178,7 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<ConstructionData> dataConstruction;
std::unique_ptr<ContaminantBalanceData> dataContaminantBalance;
std::unique_ptr<ConvectionCoefficientsData> dataConvectionCoefficient;
std::unique_ptr<ConvergParamsData> dataConvergeParams;
std::unique_ptr<CoolTowerData> dataCoolTower;
std::unique_ptr<CostEstimateManagerData> dataCostEstimateManager;
std::unique_ptr<CrossVentMgrData> dataCrossVentMgr;
Expand All @@ -181,6 +187,10 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<DataAirLoopData> dataAirLoop;
std::unique_ptr<DataGlobal> dataGlobal;
std::unique_ptr<DataWaterData> dataWaterData;
std::unique_ptr<DaylightingData> dataDaylightingData;
std::unique_ptr<DataDaylightingDevicesData> dataDaylightingDevicesData;
std::unique_ptr<DaylightingDevicesData> dataDaylightingDevices;
std::unique_ptr<DaylightingManagerData> dataDaylightingManager;
std::unique_ptr<EIRPlantLoopHeatPumpsData> dataEIRPlantLoopHeatPump;
std::unique_ptr<ExteriorEnergyUseData> dataExteriorEnergyUse;
std::unique_ptr<FansData> dataFans;
Expand Down
Loading

8 comments on commit 734af19

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2297 of 2297 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.

develop (mitchute) - x86_64-MacOS-10.15-clang-11.0.0: OK (2277 of 2277 tests passed, 0 test warnings)

Build Badge Test 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 (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1558 of 1558 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 (mitchute) - Win64-Windows-10-VisualStudio-16: OK (2250 of 2250 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 (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: Coverage Too Low

Build Badge Test Badge Coverage 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.

fix_documentation_gh-actions (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3034 of 3034 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.

fix_documentation_gh-actions (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1558 of 1558 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

fix_documentation_gh-actions (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: Tests Failed (0 of 0 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.