Skip to content

Commit

Permalink
Correction of negative cooling reporting
Browse files Browse the repository at this point in the history
Bug that was resulting in cooling being negative in output.  The
cooling is not negative—it was simply picking up the fact that the
cooling panel has a heat removal impact on zones.  However, all the
output variables are clearly cooling so these should not show up as
negative.  This commit fixes that and adds a unit test.
  • Loading branch information
RKStrand committed Nov 15, 2017
1 parent 4e68abd commit 6b205de
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/EnergyPlus/ChilledCeilingPanelSimple.cc
Expand Up @@ -1630,6 +1630,16 @@ namespace CoolingPanelSimple {

using DataHVACGlobals::TimeStepSys;

// All of the power numbers are negative for cooling. This is because they will have a negative
// or cooling impact on the surfaces/zones. However, the output variables are noted as cooling.
// So, their sign should be positive if actually cooling and we need to reverse the sign here.
// This should not have an impact on any of the internal variables or the heat balances because
// those use other variables.
this->TotPower = -this->TotPower;
this->Power = -this->Power;
this->ConvPower = -this->ConvPower;
this->RadPower = -this->RadPower;

this->TotEnergy = this->TotPower * TimeStepSys * SecInHour;
this->Energy = this->Power * TimeStepSys * SecInHour;
this->ConvEnergy = this->ConvPower * TimeStepSys * SecInHour;
Expand Down
23 changes: 23 additions & 0 deletions tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc
Expand Up @@ -161,4 +161,27 @@ namespace EnergyPlus {
EXPECT_EQ( SizeCoolingPanelUASuccess, false );

}

TEST_F( EnergyPlusFixture, ReportCoolingPanel )
{
int CoolingPanelNum; // Cooling panel number

CoolingPanelNum = 1;

CoolingPanelSimple::CoolingPanel.allocate( CoolingPanelNum );

// Test the new output for running the values through the Report subroutine
CoolingPanel( CoolingPanelNum ).TotPower = -10.0;
CoolingPanel( CoolingPanelNum ).Power = -9.0;
CoolingPanel( CoolingPanelNum ).ConvPower = -4.0;
CoolingPanel( CoolingPanelNum ).RadPower = -5.0;
CoolingPanel( CoolingPanelNum ).ReportCoolingPanel( );
EXPECT_NEAR( CoolingPanel( CoolingPanelNum ).TotPower, 10.0, 1.0 );
EXPECT_NEAR( CoolingPanel( CoolingPanelNum ).Power, 9.0, 1.0 );
EXPECT_NEAR( CoolingPanel( CoolingPanelNum ).ConvPower, 4.0, 1.0 );
EXPECT_NEAR( CoolingPanel( CoolingPanelNum ).RadPower, 5.0, 1.0 );

}

}

8 comments on commit 6b205de

@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.

150945455-Cooling-Panel-Mods (RKStrand) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)

Build 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.

150945455-Cooling-Panel-Mods (RKStrand) - i386-Windows-7-VisualStudio-14: OK (2792 of 2792 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.

150945455-Cooling-Panel-Mods (RKStrand) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (1566 of 1566 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@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.

150945455-Cooling-Panel-Mods (RKStrand) - x86_64-MacOS-10.9-clang: OK (2788 of 2792 tests passed, 0 test warnings)

Messages:

  • 4 tests had: ESO big diffs.
  • 4 tests had: MTR big diffs.
  • 4 tests had: Table big diffs.

Failures:

regression Test Summary

  • Passed: 608
  • Failed: 4

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

150945455-Cooling-Panel-Mods (RKStrand) - Win64-Windows-7-VisualStudio-14: OK (2788 of 2792 tests passed, 0 test warnings)

Messages:

  • 4 tests had: ESO big diffs.
  • 4 tests had: MTR big diffs.
  • 4 tests had: Table big diffs.

Failures:

regression Test Summary

  • Passed: 608
  • Failed: 4

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.

150945455-Cooling-Panel-Mods (RKStrand) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (2183 of 2183 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.

150945455-Cooling-Panel-Mods (RKStrand) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)

Build 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.

150945455-Cooling-Panel-Mods (RKStrand) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (2828 of 2832 tests passed, 0 test warnings)

  • 4 tests had: ESO big diffs.
  • 4 tests had: MTR big diffs.
  • 4 tests had: Table big diffs.

Build Badge Test Badge

Please sign in to comment.