Skip to content

Commit

Permalink
Merge pull request #8627 from NREL/GlobalHVACManager
Browse files Browse the repository at this point in the history
Global HVACManager, HVACMultiSpeedHeatPump, and HVACDXHeatPumpSystem
  • Loading branch information
Myoldmopar authored Mar 17, 2021
2 parents 192452c + 89c83c3 commit 4449c29
Show file tree
Hide file tree
Showing 8 changed files with 3,222 additions and 2,914 deletions.
158 changes: 47 additions & 111 deletions src/EnergyPlus/HVACDXHeatPumpSystem.cc

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions src/EnergyPlus/HVACDXHeatPumpSystem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,64 @@ struct HVACDXHeatPumpSystemData : BaseGlobalStruct {
Array1D_bool CheckEquipName;
Array1D<HVACDXHeatPumpSystem::DXHeatPumpSystemStruct> DXHeatPumpSystem;

Real64 QZnReq = 0.001; // Zone load (W), input to variable-speed DX coil
Real64 QLatReq = 0.0; // Zone latent load, input to variable-speed DX coil
Real64 MaxONOFFCyclesperHour = 4.0; // Maximum cycling rate of heat pump [cycles/hr]
Real64 HPTimeConstant = 0.0; // Heat pump time constant [s]
Real64 FanDelayTime = 0.0; // Fan delay time, time delay for the HP's fan to
Real64 OnOffAirFlowRatio = 1.0; // ratio of compressor on flow to average flow over time step
bool ErrorsFound = false; // If errors detected in input
int TotalArgs = 0; // Total number of alpha and numeric arguments (max) for a certain object in the input file
bool MySetPointCheckFlag = true;
int SpeedNum = 1; // speed number of variable speed DX cooling coil
Real64 QZnReqr = 0.001; // Zone load (W), input to variable-speed DX coil
Real64 QLatReqr = 0.0; // Zone latent load, input to variable-speed DX coil
Real64 MaximumONOFFCyclesperHour = 4.0; // Maximum cycling rate of heat pump [cycles/hr]
Real64 TimeConstant = 0.0; // Heat pump time constant [s]
Real64 HeatPumpFanDelayTime = 0.0; // Fan delay time, time delay for the HP's fan to
Real64 OnandOffAirFlowRatio = 1.0; // ratio of compressor on flow to average flow over time step
Real64 SpeedRatio = 0.0; // SpeedRatio varies between 1.0 (higher speed) and 0.0 (lower speed)
int SpeedNumber = 1; // speed number of variable speed DX cooling coil
Real64 QZoneReq = 0.001; // Zone load (W), input to variable-speed DX coil
Real64 QLatentReq = 0.0; // Zone latent load, input to variable-speed DX coil
Real64 MaxONOFFCyclesperHr = 4.0; // Maximum cycling rate of heat pump [cycles/hr]
Real64 HPTimeConst = 0.0; // Heat pump time constant [s]
Real64 HPFanDelayTime = 0.0; // Fan delay time, time delay for the HP's fan to
Real64 AirFlowOnOffRatio = 1.0; // ratio of compressor on flow to average flow over time step
Real64 SpeedPartLoadRatio = 1.0; // SpeedRatio varies between 1.0 (higher speed) and 0.0 (lower speed)

void clear_state() override
{
this->GetInputFlag = true;
this->NumDXHeatPumpSystems = 0;
this->EconomizerFlag = false;
this->CheckEquipName.deallocate();
this->DXHeatPumpSystem.deallocate();
this->QZnReq = 0.001;
this->QLatReq = 0.0;
this->MaxONOFFCyclesperHour = 4.0;
this->HPTimeConstant = 0.0;
this->FanDelayTime = 0.0;
this->OnOffAirFlowRatio = 1.0;
this->ErrorsFound = false;
this->TotalArgs = 0;
this->MySetPointCheckFlag = true;
this->SpeedNum = 1;
this->QZnReq = 0.001;
this->QLatReq = 0.0;
this->MaxONOFFCyclesperHour = 4.0;
this->HPTimeConstant = 0.0;
this->FanDelayTime = 0.0;
this->OnOffAirFlowRatio = 1.0;
this->SpeedRatio = 0.0;
this->SpeedNumber = 1;
this->QZoneReq = 0.001;
this->QLatentReq = 0.0;
this->MaxONOFFCyclesperHr = 4.0;
this->HPTimeConst = 0.0;
this->HPFanDelayTime = 0.0;
this->AirFlowOnOffRatio = 1.0;
this->SpeedPartLoadRatio = 1.0;
}
};

Expand Down
4,838 changes: 2,518 additions & 2,320 deletions src/EnergyPlus/HVACManager.cc

Large diffs are not rendered by default.

45 changes: 31 additions & 14 deletions src/EnergyPlus/HVACManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,16 @@ struct EnergyPlusData;

namespace HVACManager {

// Data
// MODULE PARAMETER DEFINITIONS:
// na

// MODULE VARIABLE DECLARATIONS:

extern int HVACManageIteration; // counts iterations to enforce maximum iteration limit
extern int RepIterAir;

// SUBROUTINE SPECIFICATIONS FOR MODULE PrimaryPlantLoops
// and zone equipment simulations

// Functions
void clear_state();

void ManageHVAC(EnergyPlusData &state);

void SimHVAC(EnergyPlusData &state);

void SimSelectedEquipment(EnergyPlusData &state, bool &SimAirLoops, // True when the air loops need to be (re)simulated
void SimSelectedEquipment(EnergyPlusData &state,
bool &SimAirLoops, // True when the air loops need to be (re)simulated
bool &SimZoneEquipment, // True when zone equipment components need to be (re)simulated
bool &SimNonZoneEquipment, // True when non-zone equipment components need to be (re)simulated
bool &SimPlantLoops, // True when the main plant loops need to be (re)simulated
Expand Down Expand Up @@ -111,11 +101,38 @@ namespace HVACManager {

} // namespace HVACManager

struct HVACManagerData : BaseGlobalStruct {
struct HVACManagerData : BaseGlobalStruct
{

int HVACManageIteration = 0; // counts iterations to enforce maximum iteration limit
int RepIterAir = 0;
bool SimHVACIterSetup = false;
bool TriggerGetAFN = true;
bool ReportAirHeatBalanceFirstTimeFlag = true;
bool MyOneTimeFlag = true;
bool PrintedWarmup = false;
bool MyEnvrnFlag = true;
bool DebugNamesReported = false;
bool MySetPointInit = true;
bool MyEnvrnFlag2 = true;
bool FlowMaxAvailAlreadyReset = false;
bool FlowResolutionNeeded = false;

void clear_state() override
{

HVACManageIteration = 0;
RepIterAir = 0;
SimHVACIterSetup = false;
TriggerGetAFN = true;
ReportAirHeatBalanceFirstTimeFlag = true;
MyOneTimeFlag = true;
PrintedWarmup = false;
MyEnvrnFlag = true;
DebugNamesReported = false;
MySetPointInit = true;
MyEnvrnFlag2 = true;
FlowMaxAvailAlreadyReset = false;
FlowResolutionNeeded = false;
}
};

Expand Down
Loading

4 comments on commit 4449c29

@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 (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2314 of 2314 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.

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1619 of 1619 tests passed, 0 test warnings)

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (723 of 727 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 723
  • Timeout: 4

Build Badge Test Badge Coverage Badge

Please sign in to comment.