-
Notifications
You must be signed in to change notification settings - Fork 460
Correct desuperheater reclaimed heat calculation and fix its delivery to tank source side #7627
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
Conversation
|
Cooling coil source side energy is now balanced for gshp + stratified tank + desuperheater test file. For a gshp model with This first commit fixed (Cooling Coil Electric Energy + Cooling Coil Total Cooling Energy) to be equal to Cooling Coil Source Side Heat Transfer Energy. Its annual energy impact: |
|
@rraustad Looking at these comments, it makes me confused if multiple desuperheater users are desired scenarios: https://github.com/NREL/EnergyPlus/blob/develop/src/EnergyPlus/HeatingCoils.cc#L1108-L1110
The current stage looks to be designed for at least scenario 2 or scenario 3 because it decremented available reclaimed heat capacity across namespaces. |
|
Well, that error checking was added so that there was no more than 1 desuperheater per source. The reason is that a desuperheater can condense refrigerant which would change the performance of the source. If you run the hot gas off a compressor to 2 desuperheaters, and each consumed 30% of the available heat reclaim energy, it is likely that the refrigerant would condense (either in the desuperheater or the refrigeration condenser) and the refrigeration system would have extra sub-cooling and result in extra cooling on the air-side of the refrigeration system at the cooling coil. It's also likely that 1 desuperheater would condense refrigerant but this would be a small (model assumption) amount of sub-cooling if max heat reclaim is limited and not grossly affect the refrigeration system performance. I couldn't find in the IDD (and did not look at the code) where a max reclaim efficiency is used (i.e., which input limits max reclaim energy). I recall 30% when this object was originally added to E+. You have looked at the code and might know how limits to recovered heat is addressed. You are right that if 2 desuperheaters consumed no more than 30% of the total available heat reclaim energy then that should be OK (i.e., same as 1 desuperheater consuming 30%). Since the energy bucket is decremented each time it is used then more than 1 desuperheater per source should be OK, but would the user be aware if the 2nd desuperheater did not having enough heat available to do the job expected? So using more than 1 desuperheater per source does push the envelope. I do like allowing users to model whatever they like, but we can't allow users to provide extra sub-cooling without including that sub-cooling in the cooling coil model (which we do not do now and only a component model could handle this without additional inputs from the user). I do like your items number 2 and 3 and we have to be sure to model these correctly so that we do not do something that would impact cooling coil performance without accounting for the change in performance. I hope this clarifies a few things as you move forward. |
…fficiency limitation.
| Real64 WaterHeatingDesuperheaterReclaimedHeatTotal; // total reclaimed heat by water heating desuperheater coils | ||
| Real64 HVACDesuperheaterReclaimedHeatTotal; // total reclaimed heat by water heating desuperheater coils | ||
| Array1D<Real64> WaterHeatingDesuperheaterReclaimedHeat; // heat reclaimed by water heating desuperheater coils | ||
| Array1D<Real64> HVACDesuperheaterReclaimedHeat; // heat reclaimed by water heating desuperheater coils |
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 waste heat user arrays to track them separately. Use this instead of decrementing AvailCapacity to avoid repeatedly extract heat in iterations and to keep data consistent through namespaces.
| extern Array1D<HeatReclaimDXCoilData> HeatReclaimDXCoil; | ||
| extern Array1D<HeatReclaimDXCoilData> HeatReclaimVS_DXCoil; | ||
| extern Array1D<HeatReclaimHPCoilData> HeatReclaimSimple_WAHPCoil; | ||
| extern Array1D<HeatReclaimDataBase> HeatReclaimDXCoil; |
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.
Don't need so many data structs. Base struct is now good for all these types except for condenser.
| if (lNumericBlanks(1)) { | ||
| HeatingCoil(CoilNum).Efficiency = 0.25; | ||
| } else { | ||
| HeatingCoil(CoilNum).Efficiency = Numbers(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.
Move this part ahead to use efficiency number later to check total reclaim efficiency (by multiple users, from the same source coil) not exceeding limitation.
| } else if (HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_COOLING || | ||
| HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_MULTISPEED || | ||
| HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_MULTIMODE) { | ||
| HeatReclaimDXCoil(SourceID).AvailCapacity -= HeatingCoilLoad; |
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.
If bug successfully fixed in these lines, CI results should reflect large diffs in desuperheaters connected with DX coils, the same applying to water heating desuperheaters + DX coils.
|
Desuperheater was now using reclaimed heat and saved tank source side outlet temperature(temp from last time step) to calculate tank source side inlet temperature for current time step, then called tank calculation functions. But later tank calculation function was using timestep-averaged tank tamperature to recalculate source side heat transfer. This caused energy discrepancy between desuperheater heater rate and tank source side heat transfer rate. I think desuperheater should be called multiple times using updated tank temperature to ensure reclaimed heat was correctly fed into the tank source side (achieve some convergence).
|
|
@rraustad Do you mind taking a look at this? It's pretty close to completion, looks like it has fixed all targeted bugs. Some tests showed large diffs due to Qsource fix, another few due to desuperheater fixes. Any suggestion to improve these changes will be greatly appreciated! |
src/EnergyPlus/WaterThermalTanks.cc
Outdated
| NewTankTemp = WaterThermalTank(WaterThermalTankNum).TankTemp; | ||
| } else { | ||
| // Calculate twice for consistency of desuperheater and tank source side energy transfer | ||
| for (int i = 0; i < 2; i++){ |
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.
Looping twice is not enough. Should use some label to indicate convergence.
…rgence flag for iterations.
…uperheater_remain_issues
|
@yzhou601 I don't use VS all that much. However, I believe you have to add the ClangFormat VS Extension, then run the commands as shown. |
|
Actually, clang is built-in with VS2017, but there are options to activate clang, and to format automatically or manually. I use manual and apply as needed to avoid excess formatting diffs. If you go with manual formatting, then apply it from Edit - Advanced - Format Selection. |
|
@mjwitte Thanks! So this manual method is applied to each file, right? Is there any way to run clang on the entire solution? For example, after making changes or resolving merge conflicts from different files, it will be great if I can run clang once across all source code files before push them up, and ci clang check won't be a concern. |
|
@yzhou601 At most, only run it on the main files you have modified. If you have added a line or two in other files, do not run it there. If you run it across the entire code base, you're likely to cause merge conflicts with most of the dev team. |
Oh ok, I thought other files are already formatted with the same clang. Good to know, then I think I'm fine so far. |
|
@mitchute Do you mind starting looking at this PR whenever you're available. I was kind of stuck not knowing what's the next step. If there's any issue, let me know and we can talk about how to address. I'm kind of overwhelmed by getting CI results the same as before pulling in new Master branch, I think they're looking much closer now. This PR solves following issues:
|
|
Oh yeah, I was going to look at this but had forgotten. Thanks for the reminder. For starters, could you come up with a better PR title? This one appears to have come straight from the GitHub default, which is the initial git commit message on this branch. The PR titles get summarized on the changelog for each release, as shown here for example: https://github.com/NREL/EnergyPlus/releases/tag/v9.2.0 I'll work on the review. |
|
@yzhou601 are the example files linked over on #7251 still valid test cases for this issue? See files linked here: #7251 (comment) |
|
There's one unit test failure after pulling in develop, however, I can't replicate it on mac or linux. Let's see what happens after CI has a chance to run again. |
|
Not sure what's going on here. I've run the failing unit test on Mac and Linux in debug and release modes and I don't see any problems. I guess I'll look at the rest of the results for now. |
Yes this is what's supposed to be fixed here. So the example files are valid to test. |
I ran with Windows debug mode, it also passed. |
|
I've checked the The heat reclaimed now matches what is being specified in the IDF.
Previously, the Annual energy between the two were also off by about 8%. This now appears to be fixed by adding some additional iterations between these components and the results look much better. Annual energy totals also match up more closely. I also compared As noted, there are going to be diffs due to changes during the warmup periods, and there are a few other assorted power diffs, but overall, they look reasonable. As far as CI results go, this looks good with the exception of the I'm going to pull in develop one more time in hopes of that being fixed. We will look into it after that if it still fails. |
|
@Myoldmopar @mjwitte @rraustad would one of you take a look at this when you get a minute? The numeric diffs appear to be justified. However, I want to get a second look at the err diffs. Most of the err diffs are related to changes to the number of times the plant loop temperature limits are exceeded. Admittedly, most of these errors were there before, but now the number of occurrences for most of these errors has gone up, say, for example from 6 to 15. And then there's this error message from Huh??? Sub absolute zero temperatures and we don't fatal out? I'm going to hold off on this until we can take a little closer look at it. |
|
Hmm, those numbers hint that a large amount of heat is being extracted from a small flow rate. The question is whether that's coming from the desuperheater portion of the simulation, or elsewhere that's unrelated to this fix. |
|
The only thing I can suggest is to break at the warning and then use the call stack to see what calculation/condition caused the issue. |
|
@mitchute The |
|
@Myoldmopar any last thoughts before this goes in? Numeric diffs all look justified. The only one that I'm not sure about is the |
|
I have no issues with this going in. I'm looking at the convection issue again, and don't worry about that other failure -- it's nothing related to this. Merge at will. |









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.