Fixes source side sizing calculation for HeatPump:PlantLoop:EIR:Heating issue#10382
Fixes source side sizing calculation for HeatPump:PlantLoop:EIR:Heating issue#10382Myoldmopar merged 5 commits intodevelopfrom
Conversation
Nigusse
left a comment
There was a problem hiding this comment.
Code changes walk through:
- source side capacity and fluid flow rate calc changed for the heating coil only
- cleaned up function names as an argument in several places
| state.dataLoopNodes->Node(this->loadSideNodes.inlet).Temp, | ||
| thisLoadPlantLoop.FluidIndex, | ||
| "PLHPEIR::simulate()"); | ||
| "EIRPlantLoopHeatPump::doPhysics()"); |
There was a problem hiding this comment.
Updated function names used as an argument in several places.
| auto &thisSourcePlantLoop = state.dataPlnt->PlantLoop(this->sourceSidePlantLoc.loopNum); | ||
| CpSrc = FluidProperties::GetSpecificHeatGlycol( | ||
| state, thisSourcePlantLoop.FluidName, this->sourceSideInletTemp, thisSourcePlantLoop.FluidIndex, "PLHPEIR::simulate()"); | ||
| state, thisSourcePlantLoop.FluidName, this->sourceSideInletTemp, thisSourcePlantLoop.FluidIndex, "EIRPlantLoopHeatPump::doPhysics()"); |
There was a problem hiding this comment.
Updated function names used as an argument.
| loadSideInitTemp, | ||
| state.dataPlnt->PlantLoop(this->loadSidePlantLoc.loopNum).FluidIndex, | ||
| "EIRPlantLoopHeatPump::size()"); | ||
| "EIRPlantLoopHeatPump::sizeLoadSide()"); |
There was a problem hiding this comment.
The same change here.
| this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRCooling ? Constant::HWInitConvTemp : Constant::CWInitConvTemp, | ||
| state.dataPlnt->PlantLoop(compLoopNum).FluidIndex, | ||
| "EIRPlantLoopHeatPump::size()"); | ||
| "EIRPlantLoopHeatPump::sizeLoadSide()"); |
There was a problem hiding this comment.
The same change here.
| this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpEIRCooling ? Constant::HWInitConvTemp : Constant::CWInitConvTemp, | ||
| state.dataPlnt->PlantLoop(compLoopNum).FluidIndex, | ||
| "EIRPlantLoopHeatPump::size()"); | ||
| "EIRPlantLoopHeatPump::sizeLoadSide()"); |
There was a problem hiding this comment.
The same change here.
| Constant::CWInitConvTemp, | ||
| state.dataPlnt->PlantLoop(compLoopNum).FluidIndex, | ||
| "EIRPlantLoopHeatPump::size()"); | ||
| "EIRPlantLoopHeatPump::sizeLoadSide()"); |
There was a problem hiding this comment.
The same change here.
| sourceSideInitTemp, | ||
| state.dataPlnt->PlantLoop(this->loadSidePlantLoc.loopNum).FluidIndex, | ||
| "EIRPlantLoopHeatPump::size()"); | ||
| "EIRPlantLoopHeatPump::sizeSrcSideWSHP()"); |
There was a problem hiding this comment.
The same change here.
| sourceSideInitTemp, | ||
| state.dataPlnt->PlantLoop(this->loadSidePlantLoc.loopNum).FluidIndex, | ||
| "EIRPlantLoopHeatPump::size()"); | ||
| "EIRPlantLoopHeatPump::sizeSrcSideWSHP()"); |
There was a problem hiding this comment.
The same change here.
| designSourceSideHeatTransfer = tmpCapacity * (1 - 1 / this->referenceCOP); | ||
| } else { | ||
| designSourceSideHeatTransfer = tmpCapacity * (1 + 1 / this->referenceCOP); | ||
| } |
There was a problem hiding this comment.
For the heating coil, the source side design capacity is basically the evaporator capacity (heat transfer). Derivation of the above equation for heating coil leads to minus sign. The previous equation is valid for cooling coil only. This fix is for water-source HP.
| designSourceSideHeatTransfer = tmpCapacity * (1 - 1 / this->referenceCOP); | ||
| } else { | ||
| designSourceSideHeatTransfer = tmpCapacity * (1 + 1 / this->referenceCOP); | ||
| } |
There was a problem hiding this comment.
This change is the same as the previous, but for the air-source HP.
|
Sample diffs. Only the heating coil source side flow rate was impacted as expected. |
| designSourceSideHeatTransfer = tmpCapacity * (1 - 1 / this->referenceCOP); | ||
| } else { | ||
| designSourceSideHeatTransfer = tmpCapacity * (1 + 1 / this->referenceCOP); | ||
| } |
There was a problem hiding this comment.
This should be tmpCapacity / (1 + 1 / this->referenceCOP) for heating. I tried both ways and don't get the same answer.
designSourceSideHeatTransfer = Hcap * (1 - 1/COP) = 1000 * (1 - 1/3) = 667
designSourceSideHeatTransfer = Hcap / (1 + 1/COP) = 1000 / (1 + 1/3) = 750
And as a test, if the cooling and heating EIR HP capacity is hardsized and the heating capacity is 1 + 1/COP the size of the cooling capacity (and the COPs are the same), then the autosized load side water flow rate on the cooling EIR HP should be the same size as the autosized source side water flow rate of the heating EIR HP.
There was a problem hiding this comment.
The above formulations are based on the first-law energy balance equations and COP definition as shown below:
Qcond = Qevap + Power; COPc = Qevap / Power; COPh = Qcond / Power
You can derive them from these three equations. The heat transfer should not be the same even if the COP are equal because the heat transfer at the condenser includes the power input while the heat transfer at the evaporator doesn't.
There was a problem hiding this comment.
Ah, that's what I was missing, the COPs are different:
COPh = COPc * (1 + 1/COPc) = 3 * (1 + 1/3) = 4 <-- is this COP conversion correct?
designSourceSideHeatTransfer = Hcap * (1 - 1/COPh) = 1000 * (1 - 1/4) = 750
designSourceSideHeatTransfer = Ccap * (1 + 1/COPc) = 750 * (1 + 1/3) = 1000
I think there are places where the divide by (1 + 1/COP) is used. Maybe those are wrong also.
There was a problem hiding this comment.
The correct relationship is COPh = COPc + 1.
There was a problem hiding this comment.
The only places that needed to be changed were in source side sizing calculation functions: sizeSrcSideASHP() and sizeSrcSideWSHP().
There was a problem hiding this comment.
@rraustad I searched for (1 + 1/COP) and (1.0 + 1.0 / this->referenceCOP) but did not find any.
There was a problem hiding this comment.
Thanks for working through this description, it's helpful.
|
Diffs are expected only if the |
|
The two example files shown below are expected to have diffs: |
|
Modified three unit tests failed due to this fix. |
Nigusse
left a comment
There was a problem hiding this comment.
Modified failed unit tests.
| thisCoolingPLHP->sourceSideDesignVolFlowRate = expectedSourceFlow; | ||
| thisCoolingPLHP->referenceCapacity = expectedCapacity; | ||
| Real64 const designSourceSideHeatTransfer = expectedCapacity * (1 + 1 / thisHeatingPLHP->referenceCOP); | ||
| Real64 const designSourceSideHeatTransfer = expectedCapacity * (1 - 1 / thisHeatingPLHP->referenceCOP); |
There was a problem hiding this comment.
For heating coil, the source side heat transfer calc expression updated to match the correct expression in the code.
| Real64 expectedSourceCp = 1004.0; | ||
| Real64 expectedSourceRho = 1.2; | ||
| Real64 expectedSourceCp = Psychrometrics::PsyCpAirFnW(sourceSideHumRat); | ||
| Real64 expectedSourceRho = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->StdBaroPress, sourceSideInitTemp, sourceSideHumRat); |
There was a problem hiding this comment.
Needed to match the sizing calculation assumptions to remove diffs.
| thisCoolingPLHP->referenceCapacity = expectedCapacity; | ||
| expectedCapacity = expectedLoadRho * expectedLoadFlow * expectedLoadCp * plantSizingLoadDeltaT; | ||
| expectedSourceLoad = expectedCapacity * (1 + 1 / COP); | ||
| expectedSourceLoad = expectedCapacity * (1 - 1 / thisHeatingPLHP->referenceCOP); |
There was a problem hiding this comment.
For heating coil, the source side heat transfer calc expression updated to match the correct expression in the code.
| " Autosize,", | ||
| " Autosize,", | ||
| " 1.0,", | ||
| " 2.0,", |
There was a problem hiding this comment.
Changed the heating coil COP to 2.0 from 1.0 to avoid zero source side flow rate.
There was a problem hiding this comment.
I have seen users set COP=1 on DX equipment for various reasons, mostly for ideal simulations. If a user sets COPh = 1 the new equation calculates 0 source heat transfer. If COPh < 1 then there is negative source side heat transfer and there would be heating on the load and source side. I'm not sure what that means or what the limit of COPh=1 represents other than non-DX equipment. If COPc = 1 you get twice the source heat transfer as the load side. It seems for an ideal run then COPh=2, as you have shown here. I am tempted to change all these COP limits in the idd to >=1 for cooling or >=2 for heating. Not for this issue but for clarity of operation for users.
HeatPump:PlantLoop:EIR:Heating,
N4, \field Reference Coefficient of Performance
\type real
\minimum> 0.0
\units W/W
\default 3.0
There was a problem hiding this comment.
If the heating coil (heating mode) design COPh is 1.0, it means the source side COPc is 0.0, i.e., there is no heat transfer at the evaporator coil. Also, it means the heat dissipated at the condenser is the same as the power input at the system (compressor). Can this operating condition be possible in the actual machine? To me, this implies the refrigeration cycle will not be complete; hence, it is not possible.
|
|
||
| Real64 expectedClgSourceFlow = 86.71; | ||
| Real64 expectedHtgSourceFlow = 86.71; | ||
| Real64 expectedHtgSourceFlow = 21.68; // changed from 86.71 due to issue#10381; |
There was a problem hiding this comment.
The source side flow rate is now divided by 4 because of this fix and COP value assumption change.
|
Uploaded defect file. |
|
Demonstration of change in Develop: Branch: The ratio between these flow rates is |
|
In the eio diffs I see that the source side volume flow rate did change due to your code correction so that's good. This is an air-source HP so the volume flow rates on the load and source side seem resonable (rho different by about 1000). I don't see any other issues. |
rraustad
left a comment
There was a problem hiding this comment.
This change seems straight-forward and correct.
Myoldmopar
left a comment
There was a problem hiding this comment.
This seems like a fine change. I'll build and test locally.
| state.dataLoopNodes->Node(this->loadSideNodes.inlet).Temp, | ||
| thisLoadPlantLoop.FluidIndex, | ||
| "PLHPEIR::simulate()"); | ||
| "EIRPlantLoopHeatPump::doPhysics()"); |
| designSourceSideHeatTransfer = tmpCapacity * (1 - 1 / this->referenceCOP); | ||
| } else { | ||
| designSourceSideHeatTransfer = tmpCapacity * (1 + 1 / this->referenceCOP); | ||
| } |
There was a problem hiding this comment.
Thanks for working through this description, it's helpful.
|
I'm seeing only the same two regression diffs locally, and otherwise things are happy. Merging this. Thanks @Nigusse |
Pull request overview
HeatPump:PlantLoop:EIR:HeatingCoils. This change impacts theSource Side Reference Flow Ratefield only when it is auto-sized. The fix results in lower source side flow rate forAirSourceandWaterSourcecondenser types.NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE
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.