Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into global_zone_plenum
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlball committed Jun 18, 2020
2 parents 561156a + 416cd53 commit 75cbb67
Show file tree
Hide file tree
Showing 16 changed files with 108,845 additions and 259 deletions.
4 changes: 2 additions & 2 deletions cmake/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ endif()
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/release/readme.html")

install(FILES "${PROJECT_SOURCE_DIR}/bin/CurveFitTools/IceStorageCurveFitTool.xlsm" DESTINATION "PreProcess/HVACCurveFitTool/")
install(FILES "${PROJECT_SOURCE_DIR}/idd/V9-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/")
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V9-3-0-Energy+.idd" )
install(FILES "${PROJECT_SOURCE_DIR}/idd/V9-3-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/")
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V9-4-0-Energy+.idd" )

# Workflow stuff, takes about 40KB, so not worth it proposing to not install it
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/workflows/app_g_postprocess.py" DESTINATION "workflows/") # COMPONENT Workflows)
Expand Down
1 change: 1 addition & 0 deletions idd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ install( FILES "V8-9-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater" )
install( FILES "V9-0-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater" )
install( FILES "V9-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater" )
install( FILES "V9-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater" )
install( FILES "V9-3-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater" )
108,613 changes: 108,613 additions & 0 deletions idd/V9-3-0-Energy+.idd

Large diffs are not rendered by default.

232 changes: 90 additions & 142 deletions src/EnergyPlus/AirLoopHVACDOAS.cc

Large diffs are not rendered by default.

107 changes: 65 additions & 42 deletions src/EnergyPlus/AirLoopHVACDOAS.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,72 +49,66 @@
#define ENERGYPLUS_AIRLOOPHVACDOAS_HH

#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/Data/BaseData.hh>
#include <string>
#include <vector>

namespace EnergyPlus {

namespace AirLoopHVACDOAS {

void clear_state();
// forward declarations
struct EnergyPlusData;

extern int numAirLoopDOAS;
namespace AirLoopHVACDOAS {

void CheckConvergence();
void CheckConvergence(EnergyPlusData &state);

struct AirLoopMixer
{

public:
AirLoopMixer(); // constructor
~AirLoopMixer() // destructor
{
}

std::string name;
static AirLoopMixer *factory(int object_type_of_num, std::string const objectName);
static AirLoopMixer *factory(EnergyPlusData &state, int object_type_of_num, std::string const &objectName);
int numOfInletNodes;

// private:
int m_AirLoopMixer_Num;
int OutletNodeNum;
std::string OutletNodeName;
std::vector<std::string> InletNodeName;
std::vector<int> InletNodeNum;
Real64 OutletTemp;

static void getAirLoopMixer();
// default constructor
AirLoopMixer() : numOfInletNodes(0), m_AirLoopMixer_Num(0), OutletNodeNum(0), OutletTemp(0.0)
{
}

~AirLoopMixer() = default; // destructor

static void getAirLoopMixer(EnergyPlusData &state);
void CalcAirLoopMixer();
};

struct AirLoopSplitter
{

public:
AirLoopSplitter(); // constructor
~AirLoopSplitter() // destructor
{
}

std::string name;
static AirLoopSplitter *factory(int object_type_of_num, std::string const objectName);
static AirLoopSplitter *factory(EnergyPlusData &state, int object_type_of_num, std::string const &objectName);
int numOfOutletNodes;

// private:
int m_AirLoopSplitter_Num;
std::string InletNodeName;
std::vector<std::string> OutletNodeName;
std::vector<int> OutletNodeNum;
Real64 InletTemp;

static void getAirLoopSplitter();
// default constructor
AirLoopSplitter() : numOfOutletNodes(0), m_AirLoopSplitter_Num(0), InletTemp(0.0)
{
}

~AirLoopSplitter() = default; // destructor

static void getAirLoopSplitter(EnergyPlusData &state);
void CalcAirLoopSplitter(Real64 Temp, Real64 Humrat);
};

struct AirLoopDOAS
{

// friend class AirLoopMixer and AirLoopSplitter;
// members
Real64 SumMassFlowRate;
Expand Down Expand Up @@ -175,34 +169,63 @@ namespace AirLoopHVACDOAS {
int CWCompNum;
int CWCtrlNodeNum;

// private:
// private members not initialized in constructor
// default constructor
AirLoopDOAS() // constructor
: SumMassFlowRate(0.0), PreheatTemp(-999.0), PrecoolTemp(-999.0), PreheatHumRat(-999.0), PrecoolHumRat(-999.0), SizingMassFlow(0.0),
SizingCoolOATemp(-999.0), SizingCoolOAHumRat(-999.0), HeatOutTemp(0.0), HeatOutHumRat(0.0), m_AirLoopDOASNum(0), m_OASystemNum(0),
m_AvailManagerSchedPtr(0), m_AirLoopMixerIndex(-1), m_AirLoopSplitterIndex(-1), NumOfAirLoops(0), m_InletNodeNum(0), m_OutletNodeNum(0),
m_FanIndex(-1), m_FanInletNodeNum(0), m_FanOutletNodeNum(0), m_FanTypeNum(0), m_HeatCoilNum(0), m_CoolCoilNum(0), ConveCount(0),
ConveIndex(0), m_HeatExchangerFlag(false), SizingOnceFlag(true), DXCoilFlag(false), FanBlowTroughFlag(false),
m_CompPointerAirLoopMixer(nullptr), m_CompPointerAirLoopSplitter(nullptr), HWLoopNum(0), HWLoopSide(0), HWBranchNum(0), HWCompNum(0),
HWCtrlNodeNum(0), CWLoopNum(0), CWLoopSide(0), CWBranchNum(0), CWCompNum(0), CWCtrlNodeNum(0)

public:
AirLoopDOAS(); // constructor

~AirLoopDOAS() // destructor
{
}

~AirLoopDOAS() = default; // destructor

static void getAirLoopDOASInput(EnergyPlusData &state);

void SimAirLoopHVACDOAS(EnergyPlusData &state, bool const firstHVACIteration, int &CompIndex);
void SimAirLoopHVACDOAS(EnergyPlusData &state, bool firstHVACIteration, int &CompIndex);

void initAirLoopDOAS(EnergyPlusData &state, bool const FirstHVACIteration);
void initAirLoopDOAS(EnergyPlusData &state, bool FirstHVACIteration);

void CalcAirLoopDOAS(EnergyPlusData &state, bool const FirstHVACIteration);
void CalcAirLoopDOAS(EnergyPlusData &state, bool FirstHVACIteration);

void SizingAirLoopDOAS(EnergyPlusData &state);

void GetDesignDayConditions();
};

extern std::vector<AirLoopDOAS> airloopDOAS;
int getAirLoopMixerIndex(std::string const &objectName);
int getAirLoopSplitterIndex(std::string const &objectName);
int getAirLoopMixerIndex(EnergyPlusData &state, std::string const &objectName);
int getAirLoopSplitterIndex(EnergyPlusData &state, std::string const &objectName);
void getAirLoopHVACDOASInput(EnergyPlusData &state);
extern bool GetInputOnceFlag;

} // namespace AirLoopHVACDOAS

struct AirLoopHVACDOASData : BaseGlobalStruct
{
bool GetInputOnceFlag = true;
bool getAirLoopMixerInputOnceFlag = true;
bool getAirLoopSplitterInputOnceFlag = true;

int numAirLoopDOAS = 0;

std::vector<AirLoopHVACDOAS::AirLoopDOAS> airloopDOAS;
std::vector<AirLoopHVACDOAS::AirLoopMixer> airloopMixer;
std::vector<AirLoopHVACDOAS::AirLoopSplitter> airloopSplitter;

void clear_state() override
{
GetInputOnceFlag = true;
getAirLoopMixerInputOnceFlag = true;
getAirLoopSplitterInputOnceFlag = true;
numAirLoopDOAS = 0;
airloopDOAS.clear();
airloopMixer.clear();
airloopSplitter.clear();
}
};

} // namespace EnergyPlus
#endif // ENERGYPLUS_AIRLOOPHVACDOAS_HH
4 changes: 4 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/EnergyPlus.hh>

#include <EnergyPlus/AirLoopHVACDOAS.hh>
#include <EnergyPlus/BaseboardElectric.hh>
#include <EnergyPlus/BaseboardRadiator.hh>
#include <EnergyPlus/Boilers.hh>
Expand All @@ -79,6 +80,8 @@ namespace EnergyPlus {

struct EnergyPlusData : BaseGlobalStruct {
// module globals

AirLoopHVACDOASData dataAirLoopHVACDOAS;
BaseboardRadiatorData dataBaseboardRadiator;
BaseboardElectricData dataBaseboardElectric;
BoilersData dataBoilers;
Expand Down Expand Up @@ -115,6 +118,7 @@ namespace EnergyPlus {

// all clear states
void clear_state() override {
dataAirLoopHVACDOAS.clear_state();
dataBaseboardElectric.clear_state();
dataBaseboardRadiator.clear_state();
dataBoilers.clear_state();
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ namespace HeatBalanceManager {
ManageEMS(emsCallFromEndZoneTimestepAfterZoneReporting, anyRan); // EMS calling point

UpdateEMSTrendVariables();
EnergyPlus::PluginManagement::pluginManager->updatePluginValues();
EnergyPlus::PluginManagement::PluginManager::updatePluginValues();

if (WarmupFlag && EndDayFlag) {

Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/PluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ namespace PluginManagement {
{
#if LINK_WITH_PYTHON == 1
// we'll need the program directory for a few things so get it once here at the top and sanitize it
std::string programPath = FileSystem::getProgramPath();
std::string programPath = FileSystem::getAbsolutePath(FileSystem::getProgramPath());
std::string programDir = FileSystem::getParentDirectoryPath(programPath);
std::string sanitizedProgramDir = PluginManager::sanitizedPath(programDir);

Expand Down
18 changes: 9 additions & 9 deletions src/EnergyPlus/PluginManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ namespace PluginManagement {
static int numActiveCallbacks();
static void addToPythonPath(const std::string& path, bool userDefinedPath);
static std::string sanitizedPath(std::string path); // intentionally not a const& string
void setupOutputVariables();
static void setupOutputVariables();

int maxGlobalVariableIndex = -1;
void addGlobalVariable(const std::string& name);
Expand All @@ -153,16 +153,16 @@ namespace PluginManagement {
static void setGlobalVariableValue(int handle, Real64 value);

int maxTrendVariableIndex = -1;
int getTrendVariableHandle(const std::string& name);
Real64 getTrendVariableValue(int handle, int timeIndex);
static int getTrendVariableHandle(const std::string& name);
static Real64 getTrendVariableValue(int handle, int timeIndex);
static size_t getTrendVariableHistorySize(int handle);
Real64 getTrendVariableAverage(int handle, int count);
Real64 getTrendVariableMin(int handle, int count);
Real64 getTrendVariableMax(int handle, int count);
Real64 getTrendVariableSum(int handle, int count);
Real64 getTrendVariableDirection(int handle, int count);
static Real64 getTrendVariableAverage(int handle, int count);
static Real64 getTrendVariableMin(int handle, int count);
static Real64 getTrendVariableMax(int handle, int count);
static Real64 getTrendVariableSum(int handle, int count);
static Real64 getTrendVariableDirection(int handle, int count);

void updatePluginValues();
static void updatePluginValues();

static int getLocationOfUserDefinedPlugin(std::string const &programName);
static void runSingleUserDefinedPlugin(int index);
Expand Down
Loading

6 comments on commit 75cbb67

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

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

global_zone_plenum (brianlball) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (13 of 13 tests passed, 0 test warnings)

Build Badge

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

global_zone_plenum (brianlball) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 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.

global_zone_plenum (brianlball) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1433 of 1433 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_zone_plenum (brianlball) - Win64-Windows-10-VisualStudio-16: OK (2116 of 2116 tests passed, 0 test warnings)

Build Badge Test Badge

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

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

Build Badge Test Badge Coverage Badge

Please # to comment.