-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Implementation of On-Off Control Capabilities for the Variable Flow and Electric Low Temperature Radiant Systems #8113
Conversation
This commit implements the possibility of on/off control for variable flow and electric radiant system. It includes code changes as well as changes to two IDF files to show that on/off control is working.
Addition of the unit test to verify that the new on-off control subroutine is working properly.
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'd like to discuss whether those minimum throttling checks should be removed or not.
@@ -44069,7 +44069,7 @@ ZoneHVAC:LowTemperatureRadiant:VariableFlow, | |||
\type node | |||
N7 , \field Heating Control Throttling Range | |||
\units deltaC | |||
\minimum 0.5 | |||
\minimum 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.
Makes sense, users can now have zero range to give on/off control.
@@ -668,7 +668,7 @@ namespace LowTempRadiantSystem { | |||
|
|||
thisRadSys.HotThrottlRange = Numbers(7); | |||
if (thisRadSys.HotThrottlRange < MinThrottlingRange) { | |||
ShowWarningError("ZoneHVAC:LowTemperatureRadiant:VariableFlow: Heating throttling range too small, reset to 0.5"); | |||
ShowWarningError("ZoneHVAC:LowTemperatureRadiant:VariableFlow: Heating throttling range too small, reset to 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.
I'm not convinced this needs to be here. If I'm reading it right, these minimum throttling range blocks should just be removed entirely.
} else if (temperatureDifference >= throttlingRange) { | ||
return 1.0; // Throttling range non-zero and temperature difference greater than the throttling range--turn it full on | ||
} else { | ||
return temperatureDifference/throttlingRange; // Temperature difference is non-zero and less than the throttling range--calculate the operation fraction |
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 should be a space before and after the division operator.
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.
Will fix this when we resolve the minimum throttling range issue.
@@ -5092,6 +5090,21 @@ namespace LowTempRadiantSystem { | |||
} | |||
} | |||
|
|||
Real64 RadiantSystemBaseData::calculateOperationalFraction(Real64 const offTemperature, Real64 const controlTemperature, Real64 const throttlingRange) |
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.
Hooray for a base class method!
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.
Let's just say I had a great teacher! I was definitely following examples from the previous radiant work. Glad to be doing things in a way that heads E+ in the right direction.
HeatFrac = (OffTemp - ControlTemp) / this->ThrottlRange; | ||
if (HeatFrac < 0.0) HeatFrac = 0.0; | ||
if (HeatFrac > 1.0) HeatFrac = 1.0; | ||
HeatFrac = this->calculateOperationalFraction(OffTemp, ControlTemp, this->ThrottlRange); |
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 reuse! w00t!
Nothing significant found in code review, but I would like to resolve a couple comments. There is one minor formatting change to make that I wouldn't worry about, but this branch has a conflict to resolve anyway, so might as well fix that up at the same time, even if nothing else changes. I'm a little surprised to see so many diffs. I would've thought that any file that had a throttling range >= 5 would have zero diffs. Perhaps the changes are due to the branch being out of date. The conflict is extremely small, just accepting your changes in a header file. Once we have resolution on the error checking blocks, I'm happy to pull develop in and resolve it if needed. Then perhaps another round of CI results will be cleaner. Or perhaps I'll just understand why those diffs are there. |
Thanks, @Myoldmopar for looking at this PR! I can fix the formatting issue--that's not a problem, especially given that I think you want some other changes. I too was surprised by the number of diffs. I wasn't able to look at them yesterday, but I am hoping to look at that today. There are a couple of files that should have diffs, but this extended beyond that and I'm not sure why. Maybe there was something else that was done in develop that caused the problem, but it seemed like the diffs were all in radiant file. So, I'm not sure that another change in develop is causing this problem. What I did see in some files over the weekend was that a small change in a temperature at some point tripped the system on when in develop it might still have been off (or vice versa). That resulted in the radiant system running in the new vs not in develop. I'm not sure that explains all of the diffs though. Admittedly, I put in the PR thinking this would go smoothly. Should have waited for the results--my apologies. I hope to be looking at this more this afternoon. As for the checks for the minimum throttling range, I am happy to take them out. My thinking was that a negative throttling range would not make any sense and technically someone could change their IDD to allow for a negative throttling range. Of course, I trap that case in the new subroutine and would treat that as a zero throttling range. I was trying to be as "controlling" as possible with my code--I guess sort of like my recent excessive use of parenthesis. Nevertheless, I'm happy to change things to whatever you want. So, what would you like to see done? |
@Myoldmopar Also, I'm not sure why this is showing as having a "conflict". It seems like I just added a line to LowTempRadiantSystem.hh. Why did GitHub get confused here? Or is there some character that got changed that I am missing? |
That's very reasonable, however, in those cases, the MTR file diffs should be small or zero. The timestep-by-timestep values can certainly change, but the overall energy impact should be minimal or nonexistent. If the MTR file still shows big diffs in unexpected files after you merge develop then that is more suspicious.
EnergyPlus doesn't actually read the IDD at runtime anymore. It is embedded inside the EnergyPlus exe file, and making changes to the IDD will not be reflected in a simulation. Your restriction on the value being >= zero will be enforced by the input processor before your code sees it. So my suggestion is to just remove those checks.
It's a little hard to grok, but I think it is because you added a function to a blank line and in develop a blank line was added to that same blank line. Or something like that. The conflict resolution is just to accept your new function declaration and delete the other side of the conflict marker. |
@Myoldmopar Ok, I've merged current develop into this branch and I've eliminated the conflict. I'll get rid of the checks as requested and push that up as well. Hopefully the diffs disappear, but if they don't I'll work on hunting them down. I'll let you know when I think everything is resolved and ready for re-review. |
This commit includes changes to the code to eliminate checks on the throttling range that are already made in the IDD.
8 big meter diffs are still there. I can run a test suite of those locally if that would be helpful. I wonder if you could isolate the exact changes which caused the diffs. That would be helpful in justifying them. Otherwise I would just do the old fashioned "build develop and run the files with both branches and show a bunch of plots with the differences on this PR" route. |
Yeah not sure. I may have to go the old fashioned route. There was only one commit for the actual code changes. So there were no intermediate commits 🙁. Just not sure why there were so many diffs. Might also look at the IDFs and see if there is any pattern that can be discerned. One file had almost all very small diffs in everything except purchased heating and those diffs were big. Not sure what would cause that because you’d think if purchased heating was very different everything else would be off too. The only thing that might be an issue is that I sort of fixed a bug along the way. The code was actually allowing a fraction of flow that could be greater than the theoretical 100% for the variable flow system. I eliminated that but didn’t think it would cause massive diffs. I could potentially rebug the code and see if that explains things? |
I highly suggest rebugging, at least locally, and see if that clears things up with local test. You are welcome to rebug and push the commit up to let CI verify for you, too. |
This commit unfixes a "bug" that was discovered during the implementation of on-off control for radiant systems. The bug is that the variable flow radiant system the old code allowed for the maximum flow fraction to be greater than 1.0. Unfixing this to see if the surprising number of output file diffs were caused by this fix.
Thanks for the heads up, @Myoldmopar! I was just about to post something here but got temporarily distracted. So, the commit has a description of the "bug" that I put back in the code. I say "bug" in quotes because there is potentially an argument that could be made that perhaps it isn't a bug. I'll document it here and if rebugging the code gets rid of the extra diffs in the output, then we can decide what we want to do. In the variable flow radiant system, the code calculates a flow fraction based on the temperature difference between the controlled temperature and its current setpoint and the throttling range. It's a simple ratio: flowFrac = tempDiff/throttlingRange (see I even used C++ naming here 😀). If tempDiff is greater than throttlingRange, then this comes back as greater than 1.0. It multiplies the flowFrac by the user's maximum flow rate so in theory flowFrac shouldn't be greater than 1.0. However, the code before this work didn't flag that case--it just let things proceed with a value greater than 1.0. Perhaps the assumption was that the plant flow resolver would allow this if flow available, but that seems dubious. And I'll be honest--I simply don't remember if I did this intentionally or on purpose. Hence, I am not 100% sure whether this is officially a bug or not. I personally think it is, but then why not allow flowFrac to be greater than 1.0 if more flow is available and not being used. In contract, the electric radiant system has always had code to avoid going over heatFrac of 1.0 since the user system capacity should be a strict limit. The questions are:
So, if this "bug" ends up being the cause of the other diffs (there are three files that will have big diffs because their IDFs changed), how do we proceed? |
Running locally, comparing develop to the rebugged version, I tested these 13 files which were showing the bulk of diffs above:
RadLoTempHydrHeatCool is the only one that shows diffs. Note that I didn't run diffs on At this point CI is probably almost done so we'll see if it confirms. Again there will be a ton of table diffs unrelated to this change. |
Thanks, @Myoldmopar! Would it be worth merging in develop so we can make a clean compare? |
No, ESO and MTR results have not moved in develop, just table diffs. This set of CI results should show whether the MTR and ESO diffs are cleaned up by your rebugging and then we'll decide where to go next. |
One more point--the two files that I would expect big diffs in the output are: RadLoTempHydrHeatCool and RadLoTempElecCtrlOpt2.idf. Everything else I would expect to be identical or very very small diffs. So, it sounds like rebugging the code "fixes" the problem, correct? |
And boom. Ignore the table diffs, and just focus on this:
Looks like your rebugging got things back to where you expect? The dashboard hasn't rebuilt yet, but I can see the two files with big ESO diffs are:
Once the dashboard rebuilds in a few minutes you can inspect the diffs there to verify. Looks like your bug fix is indeed the culprit. |
Oh sweet--that is just awesome and confirmation that the "bug fix" is the culprit. Those two files that are showing diffs should have big diffs because the IDFs changed (I changed some of the systems in those IDFs to on-off control from throttled control). With nothing else showing a diff, this is exactly what I would expect in the results. So, we have an answer. Now, how should we proceed? We can leave as is and merge this. Or I can refix the "bug" and do another commit and then it could be merged. So, what are your thoughts on: Do you agree that the fix is correct? If yes, do we incorporate that fix with this PR or separate it out into a new issue? I can easily refix the issue (is there a way to revert a commit or back it out?). If you think the fix may not be appropriate, then I think we should just move forward with what we currently have. Anyway, let me know what you think and I'll get this taken care of as soon as I can. |
Let's leave this as-is and fix it in a follow-up issue. |
@Myoldmopar 👍 So, if you are happy with where things are, then I think this is ready go in. I can add a new issue describing the problem. |
Go for it. I'll let CI wrap up and then take a final peek, but yeah, I think it's likely ready to go. |
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.
Good to go!
ShowWarningError("ZoneHVAC:LowTemperatureRadiant:VariableFlow: Heating throttling range too small, reset to 0.5"); | ||
ShowContinueError("Occurs in Radiant System=" + thisRadSys.Name); | ||
thisRadSys.HotThrottlRange = MinThrottlingRange; | ||
} |
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.
Yay gone!
virtual void calculateLowTemperatureRadiantSystem(ZoneTempPredictorCorrectorData &dataZoneTempPredictorCorrector, Real64 &LoadMet) = 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.
Your editor left some trailing white space on this line, no worries for now, but I'd check to see if you can tell it to remove them upon saving the file.
Pull request overview
Other notes:
No documentation changes are needed for this enhancement (the lower limit on the throttling range was an IDD limit), but another upcoming PR will enhance the I/O documentation to clarify the throttling range parameter and will address the zero throttling range situation that is now allowed.
As the two IDF files have changed, it is expected that the output from these two files will also be different enough to result in "big diff" notifications. This is to be anticipated. Other files may show very slight changes but these are not expected to be very significant as the changes are algorithm neutral.
The new feature proposal was included as part of the work that was added with PR#8016 that had the information regarding the on-off control work included in this PR: https://github.com/NREL/EnergyPlus/pull/8016
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.