Skip to content

Commit

Permalink
Merge pull request #8665 from NREL/wahp_static_fix
Browse files Browse the repository at this point in the history
WaterToAirHeatPump statics fix
  • Loading branch information
mjwitte committed Mar 27, 2021
2 parents f56b20e + b50e2e0 commit ad764b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
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

5 comments on commit ad764b9

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (mjwitte) - x86_64-MacOS-10.15-clang-11.0.0: OK (2357 of 2357 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2377 of 2377 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 (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1633 of 1633 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.

develop (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2328 of 2328 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.

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

Failures:\n

integration Test Summary

  • Passed: 726
  • Timeout: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.