Skip to content

Commit

Permalink
Add heater curve code in Coil:Cooling:DX:CurveFit:Performance
Browse files Browse the repository at this point in the history
  • Loading branch information
yujiex committed Jun 1, 2023
1 parent 717a341 commit f624b7b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
// calculate crankcase heater operation
if (state.dataEnvrn->OutDryBulbTemp < this->maxOutdoorDrybulbForBasin) {
this->crankcaseHeaterPower = this->crankcaseHeaterCap;
if (this->crankcaseHeaterCapacityCurveIndex > 0) {
this->crankcaseHeaterPower = Curve::CurveValue(state, this->crankcaseHeaterCapacityCurveIndex, state.dataEnvrn->OutDryBulbTemp);
}
} else {
this->crankcaseHeaterPower = 0.0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@
#include <gtest/gtest.h>

// EnergyPlus Headers
#include "../Coils/CoilCoolingDXFixture.hh"
#include <EnergyPlus/Coils/CoilCoolingDX.hh>
#include <EnergyPlus/CurveManager.hh>
#include <EnergyPlus/DataEnvironment.hh>
#include <EnergyPlus/DataSizing.hh>
#include <EnergyPlus/OutputReportPredefined.hh>
#include <EnergyPlus/OutputReportTabular.hh>

#include "../Coils/CoilCoolingDXFixture.hh"

using namespace EnergyPlus;

TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitModeInput)
Expand Down Expand Up @@ -244,7 +245,7 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitCrankcaseHeaterCurve)
"heaterCapCurve, !- Name",
"10.0, !- Coefficient1 Constant",
"2., !- Coefficient2 x",
"10.0, !- Minimum Value of x",
"-10.0, !- Minimum Value of x",
"70; !- Maximum Value of x",

"Coil:Cooling:DX:CurveFit:OperatingMode,",
Expand All @@ -265,8 +266,35 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitCrankcaseHeaterCurve)
idf_objects += this->getSpeedObjectString("Coil Cooling DX Curve Fit Speed 1");
EXPECT_TRUE(process_idf(idf_objects, false));
int coilIndex = CoilCoolingDX::factory(*state, "Coil Cooling DX 1");
auto const &thisCoil(state->dataCoilCooingDX->coilCoolingDXs[coilIndex]);
auto &thisCoil(state->dataCoilCooingDX->coilCoolingDXs[coilIndex]);
EXPECT_EQ("COIL COOLING DX 1", thisCoil.name);
EXPECT_EQ("COIL COOLING DX CURVE FIT PERFORMANCE 1", thisCoil.performance.name);
EXPECT_EQ("HEATERCAPCURVE", Curve::GetCurveName(*state, thisCoil.performance.crankcaseHeaterCapacityCurveIndex));

int useAlternateMode = DataHVACGlobals::coilNormalMode;
Real64 PLR = 1.0;
int speedNum = 1;
Real64 speedRatio = 1.0;
int fanOpMode = 1;
bool singleMode = false;
state->dataEnvrn->OutDryBulbTemp = 1.0;
// thisCoil.simulate(*state, useAlternateMode, PLR, speedNum, speedRatio, fanOpMode, singleMode);
auto &evapInletNode = state->dataLoopNodes->Node(thisCoil.evapInletNodeIndex);
auto &evapOutletNode = state->dataLoopNodes->Node(thisCoil.evapOutletNodeIndex);
auto &condInletNode = state->dataLoopNodes->Node(thisCoil.condInletNodeIndex);
auto &condOutletNode = state->dataLoopNodes->Node(thisCoil.condOutletNodeIndex);
Real64 LoadSHR = 0.0;
thisCoil.performance.simulate(*state,
evapInletNode,
evapOutletNode,
useAlternateMode,
PLR,
speedNum,
speedRatio,
fanOpMode,
condInletNode,
condOutletNode,
singleMode,
LoadSHR);
EXPECT_EQ(thisCoil.performance.crankcaseHeaterPower, 12.0);
}

5 comments on commit f624b7b

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

crankcaseHeater (yujiex) - Win64-Windows-10-VisualStudio-16: OK (2658 of 2658 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.

crankcaseHeater (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3473 of 3473 tests passed, 0 test warnings)

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

crankcaseHeater (yujiex) - x86_64-MacOS-10.17-clang-13.0.0: OK (3432 of 3432 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.

crankcaseHeater (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1884 of 1884 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.

crankcaseHeater (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (777 of 778 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 777
  • Failed: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.