-
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
Address HSPF2 calculation problems for multispeed DX system #10618
Conversation
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 change walkthrough:
- the code change now match the 2023 AHRI Standard
// Equation 11.199 AHRI-2023 | ||
q_full = q_H3_full + (q_H1_full - q_H3_full) * t_ratio; | ||
// Equation 11.200 AHRI-2023 | ||
p_full = p_H3_full + (p_H1_full - p_H3_full) * t_ratio; | ||
} |
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.
The current code for Case III looks incorrect based on the review of the AHRI 2023 (2020) Standard for Performance Rating of Unitary Air-conditioning & Air-source Heat Pump Equipment. This code change matches the AHRI standard and corrects the logic flaws.
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.
Thanks @Nigusse
tst/EnergyPlus/unit/DXCoils.unit.cc
Outdated
@@ -4656,7 +4656,7 @@ TEST_F(EnergyPlusFixture, TestMultiSpeedCoilsAutoSizingOutput) | |||
! <DX Heating Coil Standard Rating Information>, Component Type, Component Name, High Temperature Heating (net) Rating Capacity {W}, Low Temperature Heating (net) Rating Capacity {W}, HSPF {Btu/W-h}, Region Number | |||
DX Heating Coil Standard Rating Information, Coil:Heating:DX:MultiSpeed, ASHP HTG COIL, 34415.4, 20666.4, 6.56, 4 | |||
! <DX Heating Coil AHRI 2023 Standard Rating Information>, Component Type, Component Name, High Temperature Heating (net) Rating Capacity {W}, Low Temperature Heating (net) Rating Capacity {W}, HSPF2 {Btu/W-h}, Region Number | |||
DX Heating Coil AHRI 2023 Standard Rating Information, Coil:Heating:DX:MultiSpeed, ASHP HTG COIL, 34697.2, 20948.1, 5.34, 4 | |||
DX Heating Coil AHRI 2023 Standard Rating Information, Coil:Heating:DX:MultiSpeed, ASHP HTG COIL, 34697.2, 20948.1, 5.35, 4 |
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.
Modified a failed unit test.
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 change walkthrough for additional issues identified while working on the original defect.
Real64 q_H1_full = Q_H1_Full(spnum + 1); | ||
Real64 q_H2_full = Q_H2_Full(spnum + 1); | ||
Real64 q_H3_full = Q_H3_Full(spnum + 1); | ||
Real64 q_H4_full = Q_H4_Full(spnum + 1); |
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.
The full heating capacity must be evaluated at the next available speed, not at the current speed. It should be different from the low speed.
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 makes sense, and I believe you, but it would be great to get a second opinion on it. Anyone have thoughts on this?
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.
I don't know the standard but what will these values be used for? i.e., these would be used in some equation, so show the equation to support this change. For example, q_H1_full looks to be the capacity at speed 1 so why would we use speed 2 capacity?
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.
These capacities (H1, 2, 3, 4) are used to estimate the full capacity at a specified outdoor a condition through interpolation. The full capacity is then used to bracket the building load
to get a speed level of the machine that matches the building load
.
Real64 p_H1_full = P_H1_Full(spnum + 1); | ||
Real64 p_H2_full = P_H2_Full(spnum + 1); | ||
Real64 p_H3_full = P_H3_Full(spnum + 1); | ||
Real64 p_H4_full = P_H4_Full(spnum + 1); |
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.
The full electric power input must be evaluated at the next available speed, not at the current speed. It should be different from the low speed.
// Equation 11.177 AHRI-2023 | ||
//?? (replaced 62 with 35) in Ratio expression // (t=>35-47/62-47) | ||
Real64 q_35_low = // q_H1_low + (q_H0_low - q_H1_low) * ((t - (8.33)) / (1.66 - (8.33))); | ||
q_H1_low + (q_H0_low - q_H1_low) * ((1.67 - (8.33)) / (16.67 - (8.33))); | ||
|
||
// Equation 11.191 AHRI-2023 | ||
Real64 N_Hq = min(1.0, (q_H2_int - q_35_low) / (q_H2_full - q_35_low)); | ||
Real64 N_Hq = (q_H2_full != q_35_low) ? min(1.0, (q_H2_int - q_35_low) / (q_H2_full - q_35_low)) : 0.0; |
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.
Modified to allow evaluation of the HSPF2 with flat heating capacity modifier curves function of temperature.
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.
This fixes #10651
FWIW, and this looks like undefined behavior, but I was finding that in a release build with no floating point exceptions enabled, when you had the same Cap FT / Fflow curves, N_Hq was 0 but N_HE was 1.
src/EnergyPlus/StandardRatings.cc
Outdated
// Equation 11.178 AHRI - 2023 | ||
//?? (replaced 62 with 35) in Ratio expression (t=>35 F-47/35-47) | ||
Real64 p_35_low = // p_H1_low + (p_H0_low - p_H1_low) * ((t - (8.33)) / (1.66 - (8.33))); | ||
p_H1_low + (p_H0_low - p_H1_low) * ((1.67 - (8.33)) / (16.67 - (8.33))); | ||
|
||
// Equation 11.194 AHRI-2023 | ||
Real64 N_HE = min(1.0, (p_H2_int - p_35_low) / (p_H2_full - p_35_low)); | ||
Real64 N_HE = (p_H2_int != p_35_low) ? min(1.0, (p_H2_int - p_35_low) / (p_H2_full - p_35_low)) : 0.0; |
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 was modified to allow the evaluation of the HSPF2 with flat heating capacity modifier curves function of temperature.
// equation 11.181 | ||
q_low = Q_H2_Int(spnum); | ||
// equation 11.184 | ||
p_low = P_H2_Int(spnum); |
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 was modified the equations used to calculate delivered heat and energy input at the Low Speed
to match the 2023 AHRI Standard 210/240.
// equation 11.199 | ||
q_hs = Q_H3_Full(spnum + 1) + ((Q_H1_Full(spnum + 1) - Q_H3_Full(spnum + 1)) * ratio); | ||
// equation 11.200 | ||
p_hs = P_H3_Full(spnum + 1) + ((P_H1_Full(spnum + 1) - P_H3_Full(spnum + 1)) * ratio); | ||
} |
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.
Modified the equations used to calculate delivered heat and energy input at the High Speed
to match the 2023 AHRI Standard 210/240.
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.
OK, so here I see the equations. I still don't know if Q_H1_Full should be the "full" capacity at the speed being evaluated or the full capacity at the next highest speed. What in the standard prompted this change?
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.
My understanding is that the next higher speed level should be used to get the full speed capacity that bounds the current building load
.
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.
But if PLR at speed x is < 1 then the full capacity at that same speed would bound the current building load. So where in the standard does it say to use the next highest speed level?
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.
In the standard, different sections may apply to this code: one for a two-speed (two-capacity) machine and another one for a variable-speed machine. They are not an exact match for a discrete-speed machine with more than the two-speed. The HSPF2 calculation is based on the variable speed section of the standard, and it requires some interpretation to fit the discrete multispeed DX heating coil model we have in EnergyPlus. It requires some judgment on how to account for the difference between the EnergyPlus model and the variable speed machine procedure in the AHRI standard. Simply, it needs interpretation of the procedure for implementation in EnergyPlus.
In a variable-speed machine, you have just one full speed, like the two-speed DX cooling coil model in EnergyPlus. In the multispeed DX heating coil, your full speed is a moving target, and depending on your load, it is the next available higher-speed capacity. Let's say a given load is bound between two-speed levels; the full load should point to the higher speed level, not the lower speed. This is my interpretation of how it should be. The current full capacity assignment was to the current speed, so I changed it to the next higher-speed capacity.
@@ -4656,7 +4656,7 @@ TEST_F(EnergyPlusFixture, TestMultiSpeedCoilsAutoSizingOutput) | |||
! <DX Heating Coil Standard Rating Information>, Component Type, Component Name, High Temperature Heating (net) Rating Capacity {W}, Low Temperature Heating (net) Rating Capacity {W}, HSPF {Btu/W-h}, Region Number | |||
DX Heating Coil Standard Rating Information, Coil:Heating:DX:MultiSpeed, ASHP HTG COIL, 34415.4, 20666.4, 6.56, 4 | |||
! <DX Heating Coil AHRI 2023 Standard Rating Information>, Component Type, Component Name, High Temperature Heating (net) Rating Capacity {W}, Low Temperature Heating (net) Rating Capacity {W}, HSPF2 {Btu/W-h}, Region Number | |||
DX Heating Coil AHRI 2023 Standard Rating Information, Coil:Heating:DX:MultiSpeed, ASHP HTG COIL, 34697.2, 20948.1, 5.34, 4 | |||
DX Heating Coil AHRI 2023 Standard Rating Information, Coil:Heating:DX:MultiSpeed, ASHP HTG COIL, 34697.2, 20948.1, 5.76, 4 |
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.
Modified the HSPF2 values unit test to match latest results. Now the difference between HSPF and HSPF2 reduced to 12.2% from 18.6%.
|
||
EXPECT_TRUE(compare_eio_stream(htg_coil_eio_output, true)); | ||
} | ||
|
||
} // namespace EnergyPlus |
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.
Added three unit tests. These unit tests evaluate HSPF values for various compressor operation control minimum outdoor air temperature and fan power inputs. The unit tests demonstrate that the HSPF2 values are now closer to the HSPF values.
See below comparison of the HSPF2 calculation intermediate outputs for develop and this branch: The delivered heating rate is 4979.8W, the same for development and this branch. However, the total electric power input (compressor electric power + electric resistance heater power) decreased to 2389.0W from 2690.4W, resulting in an increased HSPF2 value. Note that the electric resistance heater power input has decreased more than the compressor electric power input increase. |
Attached is a test file used to generate sample results demonstrating the fix. |
The regression test results show that 18 example files have diffs in the HSPF2 values. All these 18 example files have Multispeed DX Heating Coils. We found only six unique HSPF2 values since the inputs are similar in multiple example files. Below is a summary of the results based on the six files. The absolute diffs range 0.07 – 0.4 Btu/W-h, and the percent diffs range 1.0% - 8.1%. All the 18 example files with Multispeed DX heating coils in the branch showed increased HSPF2 values. However, they are less than the HSPF values. These results are consistent with the expectations. |
This branch is ready for review. |
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.
This is fine to me, and I know you've done your due diligence in these changes. I'd like another review opinion on the changes to speed lookups and such, but if not, it's OK.
Real64 q_H1_full = Q_H1_Full(spnum + 1); | ||
Real64 q_H2_full = Q_H2_Full(spnum + 1); | ||
Real64 q_H3_full = Q_H3_Full(spnum + 1); | ||
Real64 q_H4_full = Q_H4_Full(spnum + 1); |
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 makes sense, and I believe you, but it would be great to get a second opinion on it. Anyone have thoughts on this?
// Equation 11.199 AHRI-2023 | ||
q_full = q_H3_full + (q_H1_full - q_H3_full) * t_ratio; | ||
// Equation 11.200 AHRI-2023 | ||
p_full = p_H3_full + (p_H1_full - p_H3_full) * t_ratio; | ||
} |
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.
Thanks @Nigusse
@Nigusse I was going to merge this in, but during local testing I found 3 tests failing. I spent about 30 minutes trying to diagnose the issue, looking at other changes made recently that might interact, but couldn't solve it quick enough. While doing that I also found like 20+ variables in SizeDXCoil that were simply unused. (Assigned but never accessed) So I removed them just because. If these 3 tests still fail, and you are able to look at them, that would be great. If not, I'll have to do some further testing to figure out what I need to do to the unit tests to get them to work. Extra info:
Anyway, I'm going to move on to other PRs for now. |
@Myoldmopar I will update the branch. If the failed unit tests are the new unit tests added, then I know what the problem is. I will look at it later today. |
@Myoldmopar The failed unit test must have impacted by changes somewhere else. Now, the heating capacity is sized to zero. Maybe these unit tests need to be modified. |
This commit includes the fix to the problem for both condensers operating even when the operation scheme said that one of them should not be operating. It fixes this for all of the cooling tower models that were not set up to look at this. Results now should that the towers are operating when they are supposed to.
@Myoldmopar Resolved the conflict and the 18 example files diffs are expected per the original fix. |
…multispeed_DX_Htg_Coil_HSPF2
@@ -7549,22 +7487,19 @@ void SizeDXCoil(EnergyPlusData &state, int const DXCoilNum) | |||
PrintFlag = true; | |||
state.dataSize->DataTotCapCurveIndex = thisDXCoil.CCapFTemp(Mode); | |||
if (thisDXCoil.DXCoilType_Num == HVAC::CoilDX_CoolingTwoStageWHumControl) { | |||
SizingMethod = HVAC::CoolingCapacitySizing; |
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.
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 looks like cleaning up unused information. I guess this can be done here as long as diffs show only for HSPF calculations.
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.
No. I did not make this change.
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.
@Nigusse @rraustad Are these changes to DXCoils.cc supposed to be in this PR?
I think, @Myoldmopar might have made sizing related cleanup.
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.
Ah, ok, I see that commit.
|
No conflicts here 🎉 , but I'll still pull develop in locally to check nothing broke with the big refactor that just merged. |
( You should be able to just click the Details tab and choose to re run the Jobs on the right side: Anyway, pulled and it's all happy, merging this in. Thanks for your patience @Nigusse |
Pull request overview
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.