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
Ideal loads air system ems override enthalpy update correction #8519
Conversation
…e current branch. Took changes from both branches and manually revised more.
…ction down into the protection of SupplyMassFlowRate greater than 0 if condition.
After some careful consideration, I am proposing to change the code a little bit more, by moving the entire EMS supply temperature and humidity override section
down a couple more lines inside the protection of the incoming So the new code looks like this: The rationale for that is a little bit subtle in but lies in the code context and the original comments of this EMS overide should be done EnergyPlus/src/EnergyPlus/PurchasedAirManager.cc Lines 2495 to 2501 in e003a91
and here: EnergyPlus/src/EnergyPlus/PurchasedAirManager.cc Lines 2731 to 2736 in e003a91
If the SupplyEnthapy values in the above two (zero EnergyPlus/src/EnergyPlus/PurchasedAirManager.cc Lines 2867 to 2869 in e003a91
where the expected value would be the Of course, we should definitely still add the original change to include the above line, otherwise the general case of So this proposed additional change would cover both the zero or positive |
@jcyuan2020 It shouldn't make any difference in actual results to move that into the massflow>0 block, but I agree it makes sense there. Looking at this code, in the |
Also, it would be good to extend the unit test to cover both the massflow>0 and =0 cases. |
…k. Test case passed.
@mjwitte Thanks! I added the following lines near the end of the
A unit test for zero supply mass flow rate is also added. |
@mjwitte do you anticipate doing a final review with these latest changes? And I don't see an analysis of the diffs (plots, etc.), do you anticipate needing those for wrapping this? Let me know if you want me to try to wrap it up. Thanks! |
@Myoldmopar I've reviewed the code changes and agree with them. I have not looked at the diffs. @jcyuan2020 Can comment on those. |
I have updated the topmost comment of this PR. The example file EMSConstantVolumnPurchasedAir.idf is also considered the defect file for the original issue or this PR. |
@jcyuan2020 thank you so much for providing the plots. Those are some big changes on the latent (and total) heat transfer rate. From the code changes I think this is reasonable, but I will need a little time to digest. The lack of impacting other files, and the fact that this has been looked at by a couple folks makes me feel better about it. Does anyone else want to second the changes here while I go off and ponder? |
@@ -2900,6 +2901,8 @@ void CalcPurchAirLoads(EnergyPlusData &state, | |||
PurchAir(PurchAirNum).OALatOutput = 0.0; | |||
PurchAir(PurchAirNum).MixedAirTemp = Node(RecircNodeNum).Temp; | |||
PurchAir(PurchAirNum).MixedAirHumRat = Node(RecircNodeNum).HumRat; | |||
PurchAir(PurchAirNum).SupplyTemp = Node(InNodeNum).Temp; | |||
PurchAir(PurchAirNum).SupplyHumRat = Node(InNodeNum).HumRat; |
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 all looks reasonable but I am unsure of the difference between setting the supply node condition to the inlet versus the mixed node when the unit is off. @mjwitte ? And when EMS is setting the conditions, regardless if there is flow, shouldn't the supply condition reflect what EMS is writing to the node? I guess at 0 mass flow you can't have a delta T, w or H so this does make sense this way.
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.
@rraustad The supplytemp and supplyhumrat struct variables were added recently so that new output variables could be added. Since these are the conditions at the InNode, then they better have the same value. When flow is zero, the InNode conditions are set to match the zone node. That was done long ago, probably to make sure there aren't any funny noise values in the zone air balance calcs.
PurchAir(PurchAirNum).SupplyHumRat = PurchAir(PurchAirNum).EMSValueSupplyHumRat; | ||
} | ||
SupplyEnthalpy = PsyHFnTdbW(PurchAir(PurchAirNum).SupplyTemp, PurchAir(PurchAirNum).SupplyHumRat); | ||
|
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 see how setting the EMS conditions all the time to only when mass flow > 0 changes the answer. But then there are only 2 changes here so these changes certainly did something. Maybe it was the 2nd change that fixed this and this change just updates based on EMS only when there is flow. I guess that's OK (see other comment).
Thanks for reviewing this! @Myoldmopar @Myoldmopar @rraustad |
Re-posted the mysteriously missing graphs and texts for the diff analysis. |
Looks like everything is tidied up here nice and CI is pretty happy! I will build and run locally to verify while I am resolving some conflicts in another branch, but I think this will be good to go. |
OK, I had to fix a couple lines in the new unit tests, but after that this ran just fine. I'm going to go ahead and merge this. Thanks @jcyuan2020 and @mjwitte and @rraustad. |
Pull request overview
When the total loads are broken down further to sensible loads and latent loads, it is found that the sensible part does not cause the diff:
The diffs in the total load are contributed by the latent loads instead:
The other file that has similar diffs is the python plugin version of EMSConstantVolumnPurchasedAir.idf, named PythonPluginConstantVolumePurchasedAir.idf, which shares a similar EMS block that overrides the supply air temperature, humidity ratio, and mass flow rate.
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.