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 HVACManager, HVACMultiSpeedHeatPump, and HVACDXHeatPumpSystem #8627

Merged
merged 14 commits into from
Mar 17, 2021
Merged
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