Update maximum sensible heat ratio calculation#11031
Conversation
…mall temperature diff to avoid CBF = 1.
|
|
|
| Real64 ADiff = -A0 / AirMassFlow; | ||
| if (ADiff >= DataPrecisionGlobals::EXP_LowerLimit) { | ||
| CBF = std::exp(ADiff); | ||
| } else { | ||
| CBF = 0.0; | ||
| } |
There was a problem hiding this comment.
When the bypass factor is 0, set the adjusted bypass factor to 0. Current code would calculate A0 = 0 and CBF = std::exp(ADiff) would be 1.
src/EnergyPlus/DXCoils.cc
Outdated
| Real64 enthalpyMaxADP = InletAirEnthalpy - DeltaH; | ||
| Real64 tempADPMax = PsyTsatFnHPb(state, enthalpyMaxADP, DataEnvironment::StdPressureSeaLevel, CallingRoutine); | ||
| Real64 humRatADP = PsyWFnTdbH(state, tempADPMax, enthalpyMaxADP, CallingRoutine); | ||
| Real64 enthalpyTempinHumRatADP = PsyHFnTdbW(RatedInletAirTemp, humRatADP); | ||
| Real64 shrADPMax = min(1.0, (enthalpyTempinHumRatADP - enthalpyMaxADP) / (InletAirEnthalpy - enthalpyMaxADP)); |
There was a problem hiding this comment.
Calculate the SHR corresponding to the apparatus dewpoint temperature based on the enthalpy difference that corresponds to the ratio of rated capacity to mass flow rate. Use this value as the "maximum" SHR.
| DeltaH = TotCap / AirMassFlow; | ||
| InletAirEnthalpy = PsyHFnTdbW(RatedInletAirTemp, RatedInletAirHumRat); |
There was a problem hiding this comment.
Move these outside of the while so they are only calculated once.
| TEST_F(EnergyPlusFixture, DXCoil_ValidateADPFunctionAlone) | ||
| { | ||
| state->init_state(*state); | ||
| // Define coil parameters | ||
| Real64 constexpr RatedInletAirTemp(26.666699999999999); | ||
| Real64 constexpr RatedInletAirHumRat(0.011184700000000001); | ||
| state->dataDXCoils->DXCoil.allocate(1); | ||
| state->dataDXCoils->DXCoil(1).DXCoilType = "Coil:Cooling:DX:SingleSpeed"; | ||
| state->dataDXCoils->DXCoil(1).Name = "Test Coil"; | ||
| state->dataDXCoils->DXCoil(1).RatedTotCap(1) = 4480.6580719394560; | ||
| state->dataDXCoils->DXCoil(1).RatedAirVolFlowRate(1) = 0.23519298920287324; | ||
| state->dataDXCoils->DXCoil(1).RatedSHR(1) = 0.75045855035287490; | ||
| std::string const CallingRoutine("DXCoil_ValidateADPFunctionAlone"); | ||
|
|
||
| // Calculate new SHR | ||
| Real64 newSHR = ValidateADP(*state, | ||
| state->dataDXCoils->DXCoil(1).DXCoilType, | ||
| state->dataDXCoils->DXCoil(1).Name, | ||
| RatedInletAirTemp, | ||
| RatedInletAirHumRat, | ||
| state->dataDXCoils->DXCoil(1).RatedTotCap(1), | ||
| state->dataDXCoils->DXCoil(1).RatedAirVolFlowRate(1), | ||
| state->dataDXCoils->DXCoil(1).RatedSHR(1), | ||
| CallingRoutine); | ||
|
|
||
| // Make sure that the outlet conditions are below the saturation | ||
| Real64 airMassFlowRate = | ||
| state->dataDXCoils->DXCoil(1).RatedAirVolFlowRate(1) * | ||
| Psychrometrics::PsyRhoAirFnPbTdbW(*state, DataEnvironment::StdPressureSeaLevel, RatedInletAirTemp, RatedInletAirHumRat, CallingRoutine); | ||
| Real64 deltaH = state->dataDXCoils->DXCoil(1).RatedTotCap(1) / airMassFlowRate; | ||
| Real64 inletAirEnthalpy = Psychrometrics::PsyHFnTdbW(RatedInletAirTemp, RatedInletAirHumRat); | ||
| Real64 hTinHumRatOut = inletAirEnthalpy - (1.0 - newSHR) * deltaH; | ||
| Real64 outletAirHumRat = Psychrometrics::PsyWFnTdbH(*state, RatedInletAirTemp, hTinHumRatOut); // 0.0098703703931385892 | ||
| Real64 outletAirEnthalpy = inletAirEnthalpy - deltaH; // 38853.039955973931 | ||
| Real64 outletAirTemp = Psychrometrics::PsyTdbFnHW(outletAirEnthalpy, outletAirHumRat); // 13.846750113203081 | ||
| Real64 dewPointTempOutHumRat = Psychrometrics::PsyTdpFnWPb(*state, outletAirHumRat, DataEnvironment::StdPressureSeaLevel); | ||
| ASSERT_TRUE(dewPointTempOutHumRat < outletAirTemp); | ||
| } | ||
|
|
There was a problem hiding this comment.
New unit test that reproduces the defect file conditions.
| EXPECT_ENUM_EQ(AutoSizingResultType::NoError, sizer.errorType); | ||
| EXPECT_TRUE(sizer.wasAutoSized); | ||
| EXPECT_NEAR(0.7763, sizedValue, 0.000001); | ||
| EXPECT_NEAR(0.776167, sizedValue, 0.000001); |
There was a problem hiding this comment.
Changes in the SHR calculation has marginally impacted several unit test such as this one.
| if (SlopeAtConds > 0) { | ||
| Error = (Slope - SlopeAtConds) / SlopeAtConds; | ||
| } else { | ||
| Error = 0; // SHR = 1 |
There was a problem hiding this comment.
if SlopeAtConds == 0 then SHR = 1 hence we want to keep the initial guess, the dew point temperature at the coil outlet humidity ratio.
|
The diffs do not include any additional psychometrics related warning or error that I could see. On the contrary, the proposed changes remove existing psychometrics related warnings in all the following files:
The warnings were as follows: |
| bStillValidating = false; // have to stop somewhere, this is the upper limit of SHR empirical model (see Autosizing/CoolingSHRSizing) | ||
| if (SHR > shrADPMax) { | ||
| SHR = shrADPMax; | ||
| bStillValidating = false; |
There was a problem hiding this comment.
This all looks good. I think it would be a good idea to report a severe that describes why the user inputs, or I guess autosized inputs, cause the outlet condition to exceed the saturation curve. A warning the shows the supply air T, w and the DP at saturation(w) that shows the outlet T is left of the saturation curve. At least then the user will know what caused the design failure and a warning will be available to help correct the initial problem. This input issue might be happening more than we know.
There was a problem hiding this comment.
Sure! I'll push some changes.
|
|
@lymereJ @Myoldmopar it has been 33 days since this pull request was last updated. |
|
@lymereJ @Myoldmopar it has been 34 days since this pull request was last updated. |
|
@lymereJ @Myoldmopar it has been 38 days since this pull request was last updated. |
|
@lymereJ @Myoldmopar it has been 28 days since this pull request was last updated. |
|
@lymereJ I have reviewed and this looks ready to merge. There are conflicts that must be resolved before that can happen. |
|
Last call for any final review comments here. |
|
|
Pull request overview
Description of the purpose of this PR
When calculating a coil bypass factor, prevent coil outlet temperature to be lower than dew point temperature at the same humidity ratio and avoid negative bypass factor.
Pull Request Author
Reviewer