Skip to content

Commit

Permalink
Converted single duct remaining pieces
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Nov 16, 2020
1 parent 3c810e4 commit c007385
Show file tree
Hide file tree
Showing 13 changed files with 1,461 additions and 1,482 deletions.
1 change: 1 addition & 0 deletions src/EnergyPlus/Data/CommonIncludes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#include <EnergyPlus/PlantLoopHeatPumpEIR.hh>
#include <EnergyPlus/PlantValves.hh>
#include <EnergyPlus/SimulationManager.hh>
#include <EnergyPlus/SingleDuct.hh>
#include <EnergyPlus/SizingManager.hh>
#include <EnergyPlus/SolarCollectors.hh>
#include <EnergyPlus/SolarReflectionManager.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 @@ -87,6 +87,7 @@ namespace EnergyPlus {
this->dataPlantChillers = std::make_unique<PlantChillersData>();
this->dataPlantValves = std::make_unique<PlantValvesData>();
this->dataSimulationManager = std::make_unique<SimulationManagerData>();
this->dataSingleDuct = std::make_unique<SingleDuctData>();
this->dataSizingManager = std::make_unique<SizingManagerData>();
this->dataSolarCollectors = std::make_unique<SolarCollectorsData>();
this->dataSolarReflectionManager = std::make_unique<SolarReflectionManagerData>();
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 @@ -98,6 +98,7 @@ struct PipesData;
struct PlantChillersData;
struct PlantValvesData;
struct SimulationManagerData;
struct SingleDuctData;
struct SizingManagerData;
struct SolarCollectorsData;
struct SolarReflectionManagerData;
Expand Down Expand Up @@ -176,6 +177,7 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<PlantChillersData> dataPlantChillers;
std::unique_ptr<PlantValvesData> dataPlantValves;
std::unique_ptr<SimulationManagerData> dataSimulationManager;
std::unique_ptr<SingleDuctData> dataSingleDuct;
std::unique_ptr<SizingManagerData> dataSizingManager;
std::unique_ptr<SolarCollectorsData> dataSolarCollectors;
std::unique_ptr<SolarReflectionManagerData> dataSolarReflectionManager;
Expand Down
1,799 changes: 879 additions & 920 deletions src/EnergyPlus/SingleDuct.cc

Large diffs are not rendered by default.

50 changes: 35 additions & 15 deletions src/EnergyPlus/SingleDuct.hh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ namespace SingleDuct {

void SimVAV(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum);

void CalcOAMassFlow(EnergyPlusData &state, Real64 &SAMassFlow, Real64 &AirLoopOAFrac);
void CalcOAMassFlow(EnergyPlusData &state, Real64 &SAMassFlow, Real64 &AirLoopOAFrac) const;

void SimCBVAV(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum);

Expand All @@ -233,7 +233,7 @@ namespace SingleDuct {

void CalcOutdoorAirVolumeFlowRate(EnergyPlusData &state);

void UpdateSys();
void UpdateSys() const;

void ReportSys(EnergyPlusData &state);

Expand Down Expand Up @@ -312,7 +312,7 @@ namespace SingleDuct {

void CalcATMixer(EnergyPlusData &state, int SysNum);

void UpdateATMixer(int SysNum);
void UpdateATMixer(EnergyPlusData &state, int SysNum);

void GetATMixer(EnergyPlusData &state,
std::string const &ZoneEquipName, // zone unit name name
Expand All @@ -325,7 +325,7 @@ namespace SingleDuct {
int const &ZoneEquipOutletNode // zone equipment outlet node (used with inlet side mixers)
);

void SetATMixerPriFlow(int ATMixerNum, // Air terminal mixer index
void SetATMixerPriFlow(EnergyPlusData &state, int ATMixerNum, // Air terminal mixer index
Optional<Real64 const> PriAirMassFlowRate = _ // Air terminal mixer primary air mass flow rate [kg/s]
);

Expand All @@ -334,19 +334,39 @@ namespace SingleDuct {
int const &curZoneEqNum // current zone equipment being simulated
);

extern Array1D<SingleDuctAirTerminal> sd_airterminal;
extern Array1D<AirTerminalMixerData> SysATMixer;
extern int NumATMixers;
extern bool GetInputFlag; // Flag set to make sure you get input once
extern bool GetATMixerFlag; // Flag set to make sure you get input once
extern int NumConstVolSys;
extern Array1D_bool CheckEquipName;
extern int NumSDAirTerminal; // The Number of single duct air terminals found in the Input

void clear_state();

} // namespace SingleDuct

struct SingleDuctData : BaseGlobalStruct {

Array1D<SingleDuct::AirTerminalMixerData> SysATMixer;
Array1D<SingleDuct::SingleDuctAirTerminal> sd_airterminal;
std::unordered_map<std::string, std::string> SysUniqueNames;
Array1D_bool CheckEquipName;
int NumATMixers = 0;
int NumConstVolSys = 0;
int NumSDAirTerminal = 0; // The Number of single duct air terminals found in the Input
bool GetInputFlag = true; // Flag set to make sure you get input once
bool GetATMixerFlag = true; // Flag set to make sure you get input once
bool InitSysFlag = true; // Flag set to make sure you do begin simulation initializaztions once
bool InitATMixerFlag = true; // Flag set to make sure you do begin simulation initializaztions once for mixer
bool ZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items

void clear_state() override {
SysATMixer.deallocate();
sd_airterminal.deallocate();
SysUniqueNames.clear();
CheckEquipName.deallocate();
NumATMixers = 0;
NumConstVolSys = 0;
NumSDAirTerminal = 0;
GetInputFlag = true;
GetATMixerFlag = true;
InitSysFlag = true;
InitATMixerFlag = true;
ZoneEquipmentListChecked = false;
}
};

} // namespace EnergyPlus

#endif
Loading

0 comments on commit c007385

Please sign in to comment.