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

Global DataConstruction, VariableSpeedCoils, and VentilatedSlab #8334

Merged
merged 10 commits into from
Oct 13, 2020
2 changes: 1 addition & 1 deletion src/EnergyPlus/AirflowNetworkBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6872,7 +6872,7 @@ namespace AirflowNetworkBalanceManager {
Real64 TSurfj = TH(1, 1, ZoneSurfNum);
Real64 TSurfj_K = TSurfj + KelvinConv;

Real64 ZoneSurfEmissivity = dataConstruction.Construct(Surface(ZoneSurfNum).Construction).InsideAbsorpThermal;
Real64 ZoneSurfEmissivity = state.dataConstruction->Construct(Surface(ZoneSurfNum).Construction).InsideAbsorpThermal;
Real64 ZoneSurfArea = Surface(ZoneSurfNum).Area;

Real64 DuctEmissivity = VFObj.DuctEmittance;
Expand Down
6 changes: 2 additions & 4 deletions src/EnergyPlus/Construction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@

namespace EnergyPlus {

ConstructionData dataConstruction;

namespace Construction {

void ConstructionProps::calculateTransferFunction(bool & ErrorsFound, bool & DoCTFErrorReport) {
void ConstructionProps::calculateTransferFunction(EnergyPlusData &state, bool & ErrorsFound, bool & DoCTFErrorReport) {

// SUBROUTINE INFORMATION:
// AUTHOR Russ Taylor
Expand Down Expand Up @@ -410,7 +408,7 @@ namespace Construction {
// previously this loop would go from 1..currentConstructionIndex-1
// instead of that, we'll loop through the list and stop when we get to the current construction
// should be the same behavior, we're just checking it by address
for (auto & otherConstruction : dataConstruction.Construct) {
for (auto & otherConstruction : state.dataConstruction->Construct) {
if (&otherConstruction == this) break;

// If a source or sink is present in this construction, do not allow any
Expand Down
5 changes: 1 addition & 4 deletions src/EnergyPlus/Construction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ namespace EnergyPlus {

// Forward declarations
struct EnergyPlusData;
struct ConstructionData;

namespace Construction {

Expand Down Expand Up @@ -312,7 +311,7 @@ namespace Construction {
s0.allocate(3, 4);
}

void calculateTransferFunction(bool & ErrorsFound, bool & DoCTFErrorReport);
void calculateTransferFunction(EnergyPlusData &state, bool & ErrorsFound, bool & DoCTFErrorReport);

void calculateExponentialMatrix(); // Time step of the resulting CTFs

Expand Down Expand Up @@ -341,8 +340,6 @@ namespace Construction {
}
};

extern ConstructionData dataConstruction;

} // namespace EnergyPlus

#endif
71 changes: 37 additions & 34 deletions src/EnergyPlus/ConvectionCoefficients.cc

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/EnergyPlus/ConvectionCoefficients.hh
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ namespace ConvectionCoefficients {

void GetUserConvectionCoefficients(EnergyPlusData &state);

void ApplyConvectionValue(std::string const &SurfaceTypes, std::string const &ConvectionType, int Value);
void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes, std::string const &ConvectionType, int Value);

Real64 CalcASHRAESimpExtConvectCoeff(int Roughness, // Integer index for roughness, relates to parameter array indices
Real64 SurfWindSpeed // Current wind speed, m/s
Expand Down Expand Up @@ -485,20 +485,22 @@ namespace ConvectionCoefficients {

Real64 CalcCeilingDiffuserACH(int ZoneNum);

Real64 CalcCeilingDiffuserIntConvCoeff(Real64 ACH, // [1/hr] air system air change rate
Real64 CalcCeilingDiffuserIntConvCoeff(EnergyPlusData &state,
Real64 ACH, // [1/hr] air system air change rate
Real64 Tsurf,
Real64 Tair,
Real64 cosTilt,
Real64 humRat,
Real64 height,
bool isWindow=false);

void CalcCeilingDiffuserIntConvCoeff(int ZoneNum, const Array1D<Real64> &SurfaceTemperatures); // zone number for which coefficients are being calculated
void CalcCeilingDiffuserIntConvCoeff(EnergyPlusData &state, int ZoneNum, const Array1D<Real64> &SurfaceTemperatures); // zone number for which coefficients are being calculated

// CalcCeilingDiffuserInletCorr should replace CalcCeilingDiffuser (above), if ZoneTempPredictorCorrector can
// ever be made to work correctly with the inlet air temperature.

void CalcCeilingDiffuserInletCorr(int ZoneNum, // Zone number
void CalcCeilingDiffuserInletCorr(EnergyPlusData &state,
int ZoneNum, // Zone number
Array1D<Real64> &SurfaceTemperatures // For CalcASHRAEDetailed, if called
);

Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/CostEstimateManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ namespace CostEstimateManager {
}

ThisConstructStr = state.dataCostEstimateManager->CostLineItem(Item).ParentObjName;
ThisConstructID = UtilityRoutines::FindItem(ThisConstructStr, dataConstruction.Construct);
ThisConstructID = UtilityRoutines::FindItem(ThisConstructStr, state.dataConstruction->Construct);
if (ThisConstructID == 0) { // do any surfaces have the specified construction? If not issue warning.
ShowWarningError("ComponentCost:LineItem: \"" + state.dataCostEstimateManager->CostLineItem(Item).LineName + "\" Construction=\"" +
state.dataCostEstimateManager->CostLineItem(Item).ParentObjName + "\", no surfaces have the Construction specified");
Expand Down Expand Up @@ -540,7 +540,7 @@ namespace CostEstimateManager {
} else if (SELECT_CASE_var == "CONSTRUCTION") {

ThisConstructStr = state.dataCostEstimateManager->CostLineItem(Item).ParentObjName;
ThisConstructID = UtilityRoutines::FindItem(ThisConstructStr, dataConstruction.Construct);
ThisConstructID = UtilityRoutines::FindItem(ThisConstructStr, state.dataConstruction->Construct);
// need to determine unique surfacs... some surfaces are shared by zones and hence doubled
uniqueSurfMask.dimension(TotSurfaces, true); // init to true and change duplicates to false
SurfMultipleARR.dimension(TotSurfaces, 1.0);
Expand Down
20 changes: 10 additions & 10 deletions src/EnergyPlus/DElightManagerF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ namespace DElightManagerF {
// Is this Surface exposed to the exterior?
if (surf.ExtSolar) {
// Get the index for the outside (i.e., 1st) Material Layer for this Construction
iMatlLayer = dataConstruction.Construct(iconstruct).LayerPoint(1);
iMatlLayer = state.dataConstruction->Construct(iconstruct).LayerPoint(1);
// Get the outside visible reflectance of this material layer
// (since Construct(iconstruct)%ReflectVisDiffFront always appears to == 0.0)
rExtVisRefl = 1.0 - dataMaterial.Material(iMatlLayer).AbsorpVisible;
Expand All @@ -349,7 +349,7 @@ namespace DElightManagerF {
cNameWOBlanks,
surf.Azimuth,
surf.Tilt,
dataConstruction.Construct(iconstruct).ReflectVisDiffBack,
state.dataConstruction->Construct(iconstruct).ReflectVisDiffBack,
rExtVisRefl,
surf.Sides);

Expand Down Expand Up @@ -650,14 +650,14 @@ namespace DElightManagerF {
print(delightInFile,
Format_921,
iWndoConstIndexes(iconst) + 10000,
dataConstruction.Construct(iWndoConstIndexes(iconst)).TransDiffVis,
dataConstruction.Construct(iWndoConstIndexes(iconst)).ReflectVisDiffBack,
dataConstruction.Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(1),
dataConstruction.Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(2),
dataConstruction.Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(3),
dataConstruction.Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(4),
dataConstruction.Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(5),
dataConstruction.Construct(iWndoConstIndexes(iconst)).TransVisBeamCoef(6));
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));

} // Glass Type loop

Expand Down
3 changes: 3 additions & 0 deletions src/EnergyPlus/Data/CommonIncludes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#include <EnergyPlus/ChillerIndirectAbsorption.hh>
#include <EnergyPlus/ChillerReformulatedEIR.hh>
#include <EnergyPlus/CondenserLoopTowers.hh>
#include <EnergyPlus/Construction.hh>
#include <EnergyPlus/ConvectionCoefficients.hh>
#include <EnergyPlus/CoolTower.hh>
#include <EnergyPlus/CostEstimateManager.hh>
Expand All @@ -81,6 +82,8 @@
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/Pipes.hh>
#include <EnergyPlus/PlantChillers.hh>
#include <EnergyPlus/VariableSpeedCoils.hh>
#include <EnergyPlus/VentilatedSlab.hh>
#include <EnergyPlus/WaterCoils.hh>
#include <EnergyPlus/WaterManager.hh>
#include <EnergyPlus/WaterThermalTanks.hh>
Expand Down
6 changes: 6 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ namespace EnergyPlus {
this->dataChillerIndirectAbsorption = std::unique_ptr<ChillerIndirectAbsoprtionData>(new ChillerIndirectAbsoprtionData);
this->dataChillerReformulatedEIR = std::unique_ptr<ChillerReformulatedEIRData>(new ChillerReformulatedEIRData);
this->dataCondenserLoopTowers = std::unique_ptr<CondenserLoopTowersData>(new CondenserLoopTowersData);
this->dataConstruction = std::unique_ptr<ConstructionData>(new ConstructionData);
this->dataConvectionCoefficient = std::unique_ptr<ConvectionCoefficientsData>(new ConvectionCoefficientsData);
this->dataCoolTower = std::unique_ptr<CoolTowerData>(new CoolTowerData);
this->dataCostEstimateManager = std::unique_ptr<CostEstimateManagerData>(new CostEstimateManagerData);
Expand All @@ -83,6 +84,8 @@ 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->dataVariableSpeedCoils = std::unique_ptr<VariableSpeedCoilsData>(new VariableSpeedCoilsData);
this->dataVentilatedSlab = std::unique_ptr<VentilatedSlabData>(new VentilatedSlabData);
this->dataWaterCoils = std::unique_ptr<WaterCoilsData>(new WaterCoilsData);
this->dataWaterManager = std::unique_ptr<WaterManagerData>(new WaterManagerData);
this->dataWaterThermalTanks = std::unique_ptr<WaterThermalTanksData>(new WaterThermalTanksData);
Expand Down Expand Up @@ -120,6 +123,7 @@ namespace EnergyPlus {
this->dataChillerIndirectAbsorption->clear_state();
this->dataChillerReformulatedEIR->clear_state();
this->dataCondenserLoopTowers->clear_state();
this->dataConstruction->clear_state();
this->dataConvectionCoefficient->clear_state();
this->dataCoolTower->clear_state();
this->dataCostEstimateManager->clear_state();
Expand All @@ -131,6 +135,8 @@ namespace EnergyPlus {
this->dataGlobal->clear_state();
this->dataPipes->clear_state();
this->dataPlantChillers->clear_state();
this->dataVariableSpeedCoils->clear_state();
this->dataVentilatedSlab->clear_state();
this->dataWaterCoils->clear_state();
this->dataWaterManager->clear_state();
this->dataWaterThermalTanks->clear_state();
Expand Down
6 changes: 6 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct ChillerGasAbsorptionData;
struct ChillerIndirectAbsoprtionData;
struct ChillerReformulatedEIRData;
struct CondenserLoopTowersData;
struct ConstructionData;
struct ConvectionCoefficientsData;
struct CoolTowerData;
struct CostEstimateManagerData;
Expand All @@ -92,6 +93,8 @@ struct ExteriorEnergyUseData;
struct FansData;
struct PipesData;
struct PlantChillersData;
struct VariableSpeedCoilsData;
struct VentilatedSlabData;
struct WaterCoilsData;
struct WaterManagerData;
struct WaterThermalTanksData;
Expand Down Expand Up @@ -131,6 +134,7 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<ChillerIndirectAbsoprtionData> dataChillerIndirectAbsorption;
std::unique_ptr<ChillerReformulatedEIRData> dataChillerReformulatedEIR;
std::unique_ptr<CondenserLoopTowersData> dataCondenserLoopTowers;
std::unique_ptr<ConstructionData> dataConstruction;
std::unique_ptr<ConvectionCoefficientsData> dataConvectionCoefficient;
std::unique_ptr<CoolTowerData> dataCoolTower;
std::unique_ptr<CostEstimateManagerData> dataCostEstimateManager;
Expand All @@ -143,6 +147,8 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<FansData> dataFans;
std::unique_ptr<PipesData> dataPipes;
std::unique_ptr<PlantChillersData> dataPlantChillers;
std::unique_ptr<VariableSpeedCoilsData> dataVariableSpeedCoils;
std::unique_ptr<VentilatedSlabData> dataVentilatedSlab;
std::unique_ptr<WaterCoilsData> dataWaterCoils;
std::unique_ptr<WaterManagerData> dataWaterManager;
std::unique_ptr<WaterThermalTanksData> dataWaterThermalTanks;
Expand Down
Loading