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

WaterToAirHeatPump statics fix #8665

Merged
merged 1 commit into from
Mar 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions src/EnergyPlus/WaterToAirHeatPumpSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2090,11 +2090,6 @@ namespace WaterToAirHeatPumpSimple {

bool LatDegradModelSimFlag; // Latent degradation model simulation flag
int NumIteration; // Iteration Counter
Real64 LoadSideInletDBTemp_Init(0); // rated conditions
Real64 LoadSideInletWBTemp_Init(0); // rated conditions
Real64 LoadSideInletHumRat_Init(0); // rated conditions
Real64 LoadSideInletEnth_Init; // rated conditions
Real64 CpAir_Init; // rated conditions
Real64 LoadSideInletDBTemp_Unit; // calc conditions for unit
Real64 LoadSideInletWBTemp_Unit; // calc conditions for unit
Real64 LoadSideInletHumRat_Unit; // calc conditions for unit
Expand All @@ -2103,13 +2098,13 @@ namespace WaterToAirHeatPumpSimple {

if (state.dataWaterToAirHeatPumpSimple->firstTime) {
// Set indoor air conditions to the rated condition
LoadSideInletDBTemp_Init = 26.7;
LoadSideInletHumRat_Init = 0.0111;
LoadSideInletEnth_Init = PsyHFnTdbW(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init);
CpAir_Init = PsyCpAirFnW(LoadSideInletHumRat_Init);
state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp_Init = 26.7;
state.dataWaterToAirHeatPumpSimple->LoadSideInletHumRat_Init = 0.0111;
state.dataWaterToAirHeatPumpSimple->LoadSideInletEnth_Init = PsyHFnTdbW(state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp_Init, state.dataWaterToAirHeatPumpSimple->LoadSideInletHumRat_Init);
state.dataWaterToAirHeatPumpSimple->CpAir_Init = PsyCpAirFnW(state.dataWaterToAirHeatPumpSimple->LoadSideInletHumRat_Init);
state.dataWaterToAirHeatPumpSimple->firstTime = false;
}
LoadSideInletWBTemp_Init = PsyTwbFnTdbWPb(state, LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init, state.dataEnvrn->OutBaroPress, RoutineName);
state.dataWaterToAirHeatPumpSimple->LoadSideInletWBTemp_Init = PsyTwbFnTdbWPb(state, state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp_Init, state.dataWaterToAirHeatPumpSimple->LoadSideInletHumRat_Init, state.dataEnvrn->OutBaroPress, RoutineName);

// LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability)

Expand Down Expand Up @@ -2168,11 +2163,11 @@ namespace WaterToAirHeatPumpSimple {
++NumIteration;
if (NumIteration == 1) {
// Set indoor air conditions to the rated conditions
state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp = LoadSideInletDBTemp_Init;
state.dataWaterToAirHeatPumpSimple->LoadSideInletHumRat = LoadSideInletHumRat_Init;
state.dataWaterToAirHeatPumpSimple->LoadSideInletWBTemp = LoadSideInletWBTemp_Init;
state.dataWaterToAirHeatPumpSimple->LoadSideInletEnth = LoadSideInletEnth_Init;
CpAir = CpAir_Init;
state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp = state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp_Init;
state.dataWaterToAirHeatPumpSimple->LoadSideInletHumRat = state.dataWaterToAirHeatPumpSimple->LoadSideInletHumRat_Init;
state.dataWaterToAirHeatPumpSimple->LoadSideInletWBTemp = state.dataWaterToAirHeatPumpSimple->LoadSideInletWBTemp_Init;
state.dataWaterToAirHeatPumpSimple->LoadSideInletEnth = state.dataWaterToAirHeatPumpSimple->LoadSideInletEnth_Init;
CpAir = state.dataWaterToAirHeatPumpSimple->CpAir_Init;
} else {
// Set indoor air conditions to the actual condition
state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp = LoadSideInletDBTemp_Unit;
Expand Down
11 changes: 11 additions & 0 deletions src/EnergyPlus/WaterToAirHeatPumpSimple.hh
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ namespace WaterToAirHeatPumpSimple {
Array1D_bool MyEnvrnFlag; // used for initializations each begin environment flag
Array1D_bool MyPlantScanFlag;

Real64 LoadSideInletDBTemp_Init= 0; // rated conditions
Real64 LoadSideInletWBTemp_Init= 0; // rated conditions
Real64 LoadSideInletHumRat_Init= 0; // rated conditions
Real64 LoadSideInletEnth_Init = 0; // rated conditions
Real64 CpAir_Init = 0; // rated conditions

void clear_state() override
{
this->NumWatertoAirHPs = 0;
Expand All @@ -313,6 +319,11 @@ namespace WaterToAirHeatPumpSimple {
this->firstTime = true;
this->MyEnvrnFlag.deallocate();
this->MyPlantScanFlag.deallocate();
this->LoadSideInletDBTemp_Init= 0;
this->LoadSideInletWBTemp_Init= 0;
this->LoadSideInletHumRat_Init= 0;
this->LoadSideInletEnth_Init = 0;
this->CpAir_Init = 0;
}

// Default Constructor
Expand Down