-
Notifications
You must be signed in to change notification settings - Fork 396
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
Fix #10665 - HeatPump:AirToWater:FuelFired:Heating was not using Outside air temperatures to evaluate curves #10682
Conversation
``` [ RUN ] EnergyPlusFixture.GAHP_AirSource_CurveEval /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5650: Failure Expected equality of these values: oaTemp Which is: 3 oaTempforCurve Which is: 43.0859 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5658: Failure Expected equality of these values: oaTemp Which is: 3 oaTempforCurve Which is: 43.0859 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5664: Failure Expected equality of these values: oaTemp Which is: 3 oaTempforCurve Which is: 3.33333 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5693: Failure Expected equality of these values: oaTemp Which is: 3 oaTempforCurve Which is: 43.0859 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5701: Failure Expected equality of these values: oaTemp Which is: 3 oaTempforCurve Which is: 43.0859 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5736: Failure Expected equality of these values: oaWetbulb Which is: -4.36026 oaTempforCurve Which is: 15.7288 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5744: Failure Expected equality of these values: oaWetbulb Which is: -4.36026 oaTempforCurve Which is: 15.7288 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5750: Failure Expected equality of these values: oaWetbulb Which is: -4.36026 oaTempforCurve Which is: 3.33333 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5778: Failure Expected equality of these values: oaWetbulb Which is: -4.36026 oaTempforCurve Which is: 17.0828 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc:5786: Failure Expected equality of these values: oaWetbulb Which is: -4.36026 oaTempforCurve Which is: 17.0828 [ FAILED ] EnergyPlusFixture.GAHP_AirSource_CurveEval (900 ms) ```
…ide air temperatures to evaluate curves
"HeatPump:AirToWater:FuelFired:Heating,", | ||
" FuelFired GAHP Heating, !- Name", | ||
" Node 3, !- Water Inlet Node Name", | ||
" Node 7, !- Water Outlet Node Name", | ||
" FuelFired GAHP Heating OA Node, !- Air Source Node Name", | ||
" FuelFired GAHP Cooling, !- Companion Cooling Heat Pump Name", | ||
" NaturalGas, !- Fuel Type", | ||
" GAHP, !- End-Use Subcategory", | ||
" 3000, !- Nominal Heating Capacity {W}", | ||
" 1.5, !- Nominal COP {W/W}", | ||
" 0.005, !- Design Flow Rate {m3/s}", | ||
" 60, !- Design Supply Temperature {C}", | ||
" 11.1, !- Design Temperature Lift {deltaC}", | ||
" 1, !- Sizing Factor", | ||
" NotModulated, !- Flow Mode", | ||
" DryBulb, !- Outdoor Air Temperature Curve Input Variable", | ||
" EnteringCondenser, !- Water Temperature Curve Input Variable", | ||
" CapCurveFuncTemp, !- Normalized Capacity Function of Temperature Curve Name", | ||
" EIRCurveFuncTemp, !- Fuel Energy Input Ratio Function of Temperature Curve Name", | ||
" EIRCurveFuncPLR, !- Fuel Energy Input Ratio Function of PLR Curve Name", | ||
" 0.1, !- Minimum Part Load Ratio", | ||
" 1, !- Maximum Part Load Ratio", | ||
" OnDemand, !- Defrost Control Type", | ||
" 0, !- Defrost Operation Time Fraction", | ||
" EIRDefrostFoTCurve, !- Fuel Energy Input Ratio Defrost Adjustment Curve Name", | ||
" 0, !- Resistive Defrost Heater Capacity {W}", | ||
" 5, !- Maximum Outdoor Dry-bulb Temperature for Defrost Operation {C}", | ||
" CRFCurve, !- Cycling Ratio Factor Curve Name", | ||
" 500, !- Nominal Auxiliary Electric Power {W}", | ||
" auxElecEIRCurveFuncTempCurve, !- Auxiliary Electric Energy Input Ratio Function of Temperature Curve Name", | ||
" auxElecEIRFoPLRCurve, !- Auxiliary Electric Energy Input Ratio Function of PLR Curve Name", | ||
" 20; !- Standby Electric Power {W}", | ||
|
||
"OutdoorAir:Node,", | ||
" FuelFired GAHP Heating OA Node; !- Name", | ||
|
||
"HeatPump:AirToWater:FuelFired:Cooling,", | ||
" FuelFired GAHP Cooling, !- Name", | ||
" FuelFired GAHP Cooling Water Inlet Node, !- Water Inlet Node Name", | ||
" FuelFired GAHP Cooling Water Outlet Node, !- Water Outlet Node Name", | ||
" FuelFired GAHP Cooling OA Node, !- Air Source Node Name", | ||
" FuelFired GAHP Heating, !- Companion Heating Heat Pump Name", | ||
" NaturalGas, !- Fuel Type", | ||
" GAHP, !- End-Use Subcategory", | ||
" 4000, !- Nominal Cooling Capacity {W}", | ||
" 2, !- Nominal COP {W/W}", | ||
" 0.006, !- Design Flow Rate {m3/s}", | ||
" 7, !- Design Supply Temperature {C}", | ||
" 11.1, !- Design Temperature Lift {deltaC}", | ||
" 1, !- Sizing Factor", | ||
" NotModulated, !- Flow Mode", | ||
" DryBulb, !- Outdoor Air Temperature Curve Input Variable", | ||
" EnteringEvaporator, !- Water Temperature Curve Input Variable", | ||
" CapCurveFuncTemp, !- Normalized Capacity Function of Temperature Curve Name", | ||
" EIRCurveFuncTemp, !- Fuel Energy Input Ratio Function of Temperature Curve Name", | ||
" EIRCurveFuncPLR, !- Fuel Energy Input Ratio Function of PLR Curve Name", | ||
" 0.1, !- Minimum Part Load Ratio", | ||
" 1, !- Maximum Part Load Ratio", | ||
" CRFCurve, !- Cycling Ratio Factor Curve Name", | ||
" 500, !- Nominal Auxiliary Electric Power {W}", | ||
" auxElecEIRCurveFuncTempCurve, !- Auxiliary Electric Energy Input Ratio Function of Temperature Curve Name", | ||
" auxElecEIRFoPLRCurve, !- Auxiliary Electric Energy Input Ratio Function of PLR Curve Name", | ||
" 20; !- Standby Electric Power {W}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prepare a unit test with a HeatPump:AirToWater:FuelFired:Heating
and HeatPump:AirToWater:FuelFired:Cooling
object, having all curves defined.
// This is not the case, even though the E+ I/O Documentation says it should | ||
constexpr bool isLoadSideHeatTransferNegativeForCooling = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note...
thisHeatingPLHP->onInitLoopEquip(*state, myHeatingLoadLocation); | ||
{ | ||
EXPECT_ENUM_EQ(EIRFuelFiredHeatPump::OATempCurveVar::DryBulb, thisHeatingPLHP->oaTempCurveInputVar); | ||
EXPECT_ENUM_EQ(EIRFuelFiredHeatPump::WaterTempCurveVar::EnteringCondenser, thisHeatingPLHP->waterTempCurveInputVar); | ||
|
||
bool firstHVAC = true; | ||
Real64 curLoad = 800; | ||
bool runFlag = true; | ||
Real64 const calculatedLoadInletTemp = specifiedLoadSetpoint - curLoad / (expectedLoadMassFlowRate * expectedCp); | ||
|
||
state->dataLoopNodes->Node(thisHeatingPLHP->loadSideNodes.inlet).Temp = calculatedLoadInletTemp; | ||
state->dataLoopNodes->Node(thisHeatingPLHP->loadSideNodes.outlet).TempSetPoint = specifiedLoadSetpoint; | ||
state->dataLoopNodes->Node(thisHeatingPLHP->sourceSideNodes.inlet).Temp = oaTemp; | ||
|
||
thisHeatingPLHP->simulate(*state, myHeatingLoadLocation, firstHVAC, curLoad, runFlag); | ||
// expect it to meet setpoint and have some pre-evaluated conditions | ||
// EXPECT_NEAR(specifiedLoadSetpoint, thisHeatingPLHP->loadSideOutletTemp, 0.001); | ||
EXPECT_NEAR(curLoad, thisHeatingPLHP->loadSideHeatTransfer, 0.001); | ||
{ | ||
ASSERT_GT(thisHeatingPLHP->capFuncTempCurveIndex, 0); | ||
auto const *thisCurve = state->dataCurveManager->PerfCurve(thisHeatingPLHP->capFuncTempCurveIndex); | ||
Real64 const waterTempforCurve = thisCurve->inputs[0]; | ||
Real64 const oaTempforCurve = thisCurve->inputs[1]; | ||
EXPECT_EQ(calculatedLoadInletTemp, waterTempforCurve); | ||
EXPECT_EQ(oaTemp, oaTempforCurve); | ||
} | ||
{ | ||
ASSERT_GT(thisHeatingPLHP->powerRatioFuncTempCurveIndex, 0); | ||
auto const *thisCurve = state->dataCurveManager->PerfCurve(thisHeatingPLHP->powerRatioFuncTempCurveIndex); | ||
Real64 const waterTempforCurve = thisCurve->inputs[0]; | ||
Real64 const oaTempforCurve = thisCurve->inputs[1]; | ||
EXPECT_EQ(calculatedLoadInletTemp, waterTempforCurve); | ||
EXPECT_EQ(oaTemp, oaTempforCurve); | ||
} | ||
{ | ||
ASSERT_GT(thisHeatingPLHP->defrostEIRCurveIndex, 0); | ||
auto const *thisCurve = state->dataCurveManager->PerfCurve(thisHeatingPLHP->defrostEIRCurveIndex); | ||
Real64 const oaTempforCurve = thisCurve->inputs[0]; | ||
EXPECT_EQ(oaTemp, oaTempforCurve); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm going to do 4 calls to simulate:
- For object in "Heating", "Cooling"
- Simulate with Drybulb and Entering Condenser/Evaporator temperature
- Simulate with Welbulb and Leaving Condenser/Evaporator temperature
For each of these, I check that the curves were evaluated with the proper conditions
@@ -2549,6 +2549,7 @@ void EIRFuelFiredHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad) | |||
// will not shut down the branch | |||
auto &thisInletNode = state.dataLoopNodes->Node(this->loadSideNodes.inlet); | |||
auto &thisOutletNode = state.dataLoopNodes->Node(this->loadSideNodes.outlet); | |||
auto &thisSourceSideInletNode = state.dataLoopNodes->Node(this->sourceSideNodes.inlet); // OA Intake node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a ref
@@ -2720,10 +2721,10 @@ void EIRFuelFiredHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad) | |||
// Determine which air variable to use for GAHP: | |||
// Source (air) side variable to use | |||
// auto &thisloadsideinletnode = state.dataLoopNodes->Node(this->loadSideNodes.inlet); | |||
Real64 oaTempforCurve = thisInletNode.Temp; // state.dataLoopNodes->Node(this->loadSideNodes.inlet).Temp; | |||
Real64 oaTempforCurve = this->sourceSideInletTemp; // state.dataLoopNodes->Node(this->loadSideNodes.inlet).Temp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix one, for OA Drybulb
oaTempforCurve = Psychrometrics::PsyTwbFnTdbWPb( | ||
state, thisSourceSideInletNode.Temp, thisSourceSideInletNode.HumRat, thisSourceSideInletNode.Press, "PLFFHPEIR::doPhysics()"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix 2, If Wetbulb, evaluate it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look correct. Tested with modified example file, and can see the correct input temps for the curves.
Unit test GAHP_HeatingSimulate_AirSource_with_Defrost
is failing.
"Curve:Biquadratic,", | ||
" CapCurveFuncTemp, !- Name", | ||
" 1, !- Coefficient1 Constant", | ||
" 0, !- Coefficient2 x", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if these curves actually computed a value instead of a constant 1.0. The constant fT curves in the example file explain why there are no diffs. That would be nice to change, but not sure where to get a reasonable set of curves.
Also, this applies to both the cooling and heating side of this heat pump. |
Thanks for looking this over and noticing the failing unit test. I'm assuming the unit test was simply using the wrong numbers and things are now more correct. I can make an attempt at fixing up the unit test to get this in unless @jmarrec wants to get it running. |
@Myoldmopar @jmarrec The failing unit test needs updated results to align with this fix. Here's one of the parts that fails: EnergyPlus/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc Lines 4537 to 4542 in 2830ccc
If I set |
@Myoldmopar CI is green and happy here. In the merge queue. |
Sorry I wasn't responsive, been swamped. Thanks a lot @mjwitte for updating the test! |
Yes indeed, thanks for fixing the test @mjwitte ! I'll pull develop and double check things. |
Pull request overview
HeatPump:AirToWater:FuelFired:Heating
curves not using two independent temperature variables #10665Using PlantLoopHeatPump_Fuel-Fired.idf , before versus after, plotting the
CAPCURVEFUNCTEMP2
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.