-
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
Apply Direct solution in new dx coil #7899
Conversation
Add 3 test files by adding an object: The original 3 examples files are |
Well, CI is perfectly green, and the branch isn't conflicted, so we are off to a good review start. I'll look at the code changes now. |
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 major issues, a couple typos and then I'd like you to confirm my understanding of the implementation and comment on the last section so I know its purpose.
@@ -1045,6 +1045,13 @@ \subsection{PerformancePrecisionTradeoffs}\label{performanceprecisiontradeoffs} | |||
\end{longtable} | |||
|
|||
Note: The choice of Load in the Control Type of the AirLoopHVAC:UnitarySystem object is required for all coils listed in the above table. | |||
In addition, when Coil:Cooling:DX is specified under AirLoopHVAC:UnitarySystem, the following coil configurations are supported for Direct Solution: | |||
|
|||
Single speed mode at Norminal Speed Number = 1 in the Coil:Cooling:DX:CurveFit:OperatingMode |
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.
Typo: Norminal
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.
@Myoldmopar Corrected at Nominal. Thanks
@@ -4542,6 +4542,10 @@ namespace UnitarySystems { | |||
} | |||
} | |||
|
|||
if (DataGlobals::DoCoilDirectSolutions && thisSys.m_NumOfSpeedCooling > 1) { | |||
thisSys.FullOutput.resize(thisSys.m_NumOfSpeedCooling + 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.
OK, so we start by allocating the full output array to the number of cooling speeds + 1.
@@ -6678,7 +6682,7 @@ namespace UnitarySystems { | |||
thisSys.m_HeatMassFlowRate.resize(thisSys.m_NumOfSpeedHeating + 1); | |||
thisSys.m_HeatVolumeFlowRate.resize(thisSys.m_NumOfSpeedHeating + 1); | |||
thisSys.m_MSHeatingSpeedRatio.resize(thisSys.m_NumOfSpeedHeating + 1); | |||
if (DataGlobals::DoCoilDirectSolutions) { | |||
if (DataGlobals::DoCoilDirectSolutions && thisSys.m_NumOfSpeedCooling < thisSys.m_NumOfSpeedHeating) { | |||
thisSys.FullOutput.resize(thisSys.m_NumOfSpeedHeating + 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.
Then we just increase the size in case heating is larger.
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.
@Myoldmopar Yes.
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 (DataGlobals::DoCoilDirectSolutions && this->m_CoolingCoilType_Num == DataHVACGlobals::CoilDX_MultiSpeedCooling) { | ||
if (DataGlobals::DoCoilDirectSolutions && | ||
(this->m_CoolingCoilType_Num == DataHVACGlobals::CoilDX_MultiSpeedCooling || | ||
(this->m_CoolingCoilType_Num == DataHVACGlobals::CoilDX_Cooling && this->m_NumOfSpeedCooling > 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.
This is just adding the new coil to this section.
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.
@Myoldmopar Yes.
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 just filling this->FullOutput[SpeedNum] variable for the new DX cooling coil.
HXUnitOn, | ||
HeatCoilLoad, | ||
SupHeaterLoad, | ||
CompressorONFlag); |
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 first you call to run with cooling PLR of 1.0 to get the full output.
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.
@Myoldmopar Yes, in order to get full outputs at PLR = 1.0.
HeatCoilLoad, | ||
SupHeaterLoad, | ||
CompressorONFlag); | ||
CoolPLR = (ZoneLoad - SensOutputOff) / (SensOutputOn - SensOutputOff); |
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.
Then calculate a new cooling PLR using a simple 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.
@Myoldmopar Yes.
HXUnitOn, | ||
HeatCoilLoad, | ||
SupHeaterLoad, | ||
CompressorONFlag); |
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.
Then just recalculate the system performance at that PLR, and take what it gets.
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.
@Myoldmopar Yes.
HeatCoilLoad, | ||
SupHeaterLoad, | ||
CompressorONFlag); | ||
PartLoadRatio = CoolPLR; |
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.
Of course handle the single speed case here too.
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.
@Myoldmopar Yes for a single speed coil.
HeatCoilLoad, | ||
SupHeaterLoad, | ||
CompressorONFlag); | ||
PartLoadRatio = CoolPLR; |
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.
How does this extra section fit into the grand scheme?
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.
@Myoldmopar The extra code is used for a multiple speed coil to recalculate output based on cycleratio (SpeedNumber = 1) or SpeedRatio (SpeedNumber>1) using Direct solution results.
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.
@lgu1234 This is not part of this change but wanted to understand that CoolingCycRatio and CoolingSpeedRatio are passed as CoolPLR to calcUnitarySystemToLoad() function. So, the calcUnitarySystemToLoad() handles the difference between the two variables?
Built and ran with develop pulled into the branch. All unit tests passed. @lgu1234 If you reply to my comment regarding FullOutput array resizing, this branch will be ready for merging. |
@Nigusse Where is your comment of FullOutput? I am not able to locate it. |
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 branch is ready for merging pending @lgu1234 addressing the review comments about array re-sizing.
@@ -1056,7 +1056,7 @@ \subsection{PerformancePrecisionTradeoffs}\label{performanceprecisiontradeoffs} | |||
\midrule | |||
\endfirsthead | |||
|
|||
AirLoopHVAC:UnitarySystem & Coil:Cooling:DX:SingleSpeed, Coil:Heating:DX:SingleSpeed, Coil:Heating:Electric, Coil:Heating:Fuel, Coil:Heating:DX:MultiSpeed\tabularnewline | |||
AirLoopHVAC:UnitarySystem & Coil:Cooling:DX:SingleSpeed, Coil:Heating:DX:SingleSpeed, Coil:Heating:Electric, Coil:Heating:Fuel, Coil:Heating:DX:MultiSpeed, Coil:Cooling:DX\tabularnewline |
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.
Updated I/O ref documentation; added the new DX cooling coil type Coil:Cooling:DX.
|
||
Multi speed mode at Nominal Speed Number > 1 in the Coil:Cooling:DX:CurveFit:OperatingMode | ||
|
||
Single speed SubcoolReheat mode. The SubcoolReheat mode requires all inputs of 3 fields in the Coil:Cooling:DX:CurveFit:Performance: Base Operating Mode, Alternative Operating Mode 1, and Alternative Operating Mode 2. |
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.
Updated I/O ref documentation; Coil:Cooling:DX coil model in AirLoopHVAC:UnitarySystem supports Direct Solution for load based control of Single Speed, Multi Speed and Single Speed SubcoolReheat operating modes.
ShowContinueError( | ||
"Setpoint control is not available for SubcoolReheat cooling coil. Load control is forced. Simulation continues."); | ||
ShowContinueError("Setpoint control is not available for SubcoolReheat cooling coil. Load control is forced. " | ||
"Simulation continues."); |
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 the Coil:Cooling:DX coil type operating mode specified is SubcoolReheat operating mode and the UnitarySystem is SetPoint control, then the UnitarySystem control type is reset to Load. Because SubcoolReheat operating mode is supported in Load based control only.
@@ -6678,7 +6682,7 @@ namespace UnitarySystems { | |||
thisSys.m_HeatMassFlowRate.resize(thisSys.m_NumOfSpeedHeating + 1); | |||
thisSys.m_HeatVolumeFlowRate.resize(thisSys.m_NumOfSpeedHeating + 1); | |||
thisSys.m_MSHeatingSpeedRatio.resize(thisSys.m_NumOfSpeedHeating + 1); | |||
if (DataGlobals::DoCoilDirectSolutions) { | |||
if (DataGlobals::DoCoilDirectSolutions && thisSys.m_NumOfSpeedCooling < thisSys.m_NumOfSpeedHeating) { | |||
thisSys.FullOutput.resize(thisSys.m_NumOfSpeedHeating + 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.
if (DataGlobals::DoCoilDirectSolutions && this->m_CoolingCoilType_Num == DataHVACGlobals::CoilDX_MultiSpeedCooling) { | ||
if (DataGlobals::DoCoilDirectSolutions && | ||
(this->m_CoolingCoilType_Num == DataHVACGlobals::CoilDX_MultiSpeedCooling || | ||
(this->m_CoolingCoilType_Num == DataHVACGlobals::CoilDX_Cooling && this->m_NumOfSpeedCooling > 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.
This is just filling this->FullOutput[SpeedNum] variable for the new DX cooling coil.
HeatCoilLoad, | ||
SupHeaterLoad, | ||
CompressorONFlag); | ||
PartLoadRatio = CoolPLR; |
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.
@lgu1234 This is not part of this change but wanted to understand that CoolingCycRatio and CoolingSpeedRatio are passed as CoolPLR to calcUnitarySystemToLoad() function. So, the calcUnitarySystemToLoad() handles the difference between the two variables?
latOut); | ||
EXPECT_NEAR(thisSys->m_CycRatio, 1.000, 0.001); | ||
EXPECT_NEAR(thisSys->m_SpeedRatio, 0.238771, 0.02); | ||
EXPECT_NEAR(sensOut, -11998.0, 210.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.
The unit tests Direct and Iterative solution methods results are identical. The unit test demonstrates the new method very well.
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.
👍
@Myoldmopar @lgu1234 I ran the UnitarySystem_MultiSpeedDX.idf and UnitarySystem_MultiSpeedDX_DirectSolution.idf example files provided. The only difference between these two files is that the later has PerformancePrecisionTradeoffs object set to Yes. And I see diffs based on two days of RunPeriods weather file simulation. See below the minimum and maximum diffs observed for a selected variables. Is this acceptable diffs? |
Most of them look acceptable, but the sys 5 heating rate is the obvious outlier. Can you show a profile of the difference in that variable over the course of the simulation? Or show the annual energy difference? |
@Nigusse Yes. You are correct. The only difference in these files is Yes or No. I compared zone air temperature. If energy use is compared, it is better to compare sum, instead of timestep comparison. |
The Linux diffs appear to be because the branch was out of date when that ran. I will pull develop into here and look it over. |
Built and ran fine with develop pulled in locally, we'll let CI verify. I'll also take a final pass over the code now. |
Code changes look fine to me. If CI is also happy I assume this will drop in shortly. If anyone wants to look it over, have at it. |
Regressions are all gone, this is clean and good to go. I'll give it a few minutes and wait for the unit test and windows to finish but then merge. Thanks @lgu1234 |
All good, merging. |
Pull request overview
This PR will apply DirectSolution to Coil:Cooling:DX with single speed and multiple speeds.
issue #8216
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.