-
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
Support Electric Heating Coil with ASHRAE90VariableFan Capacity Control #8101
Conversation
Plots below show zone air temperature and electric heating coil heating rate for develop and the branch for the fix. The branch shows that the zone air temperature during heating and cooling is properly controlled. The electric heating coil heating rate is also modulated to provide the required heating rate. |
The CI run for this branch shows the unit test "Test_UnitaryHybridAirConditioner_Unittest" failed but when I run this unit test locally it passes. Is there known issue about this unit test? @Myoldmopar |
This has been failing intermittently on my machine as well, but I can't get it to repeat consistently so I have never gotten to the bottom of the issue. |
@mitchute Thanks. |
// load is larger than capacity, thus run the fancoil unit at full capacity | ||
PLR = 1.0; | ||
} | ||
Calc4PipeFanCoil(state, FanCoilNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, PLR); | ||
PowerMet = QUnitOut; |
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 else if logic to capture a condition when the heating or cooling load is larger than the maximum equipment capacity and sets the PLR to 1.0 since we calling Cal4PipeFanCoil() function with the optional argument PLR.
PowerMet = QUnitOut; | ||
AirMassFlow = Node(InletNode).MassFlowRate; | ||
// CR9155 Remove specific humidity calculations | ||
SpecHumOut = Node(OutletNode).HumRat; | ||
SpecHumIn = Node(InletNode).HumRat; | ||
// Latent rate (kg/s), dehumid = negative | ||
LatOutputProvided = AirMassFlow * (SpecHumOut - SpecHumIn); | ||
FanCoil(FanCoilNum).PLR = PLR; |
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.
Needed to set it here for 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.
This is the one thing that stands out to me from your walkthrough. Fixing it for the unit test just feels odd. Can you clarify what impact this has on the simulation itself?
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.
PLR was not reported/updated for ASHRAE90VariableFan capacity control method. If you look at other capacity control methods PLR value is set to FanCoil.PLR for reporting purpose. In this fix I'm passing PLR as argument to Calc4PipeFanCoil() function here and setting PLR value to 1.0 when the load exceeds the capacity here. There is not other place where a value is set to FanCoil.PLR for this capacity control 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.
OK, I'll accept that, sounds good.
@@ -86,6 +86,7 @@ namespace SZVAVModel { | |||
|
|||
// MODULE PARAMETER DEFINITIONS | |||
static std::string const BlankString; | |||
int const HCoil_Water(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.
Added heating coil type variable for identification.
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilWaterFlowResidual, 0.0, 1.0, Par); | ||
} else { | ||
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilLoadResidual, 0.0, 1.0, Par); | ||
} | ||
outletTemp = DataLoopNode::Node(OutletNode).Temp; |
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 SolveRoot() function calling for electric heating coil part-load ratio calculation using a different residual function.
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilAirAndWaterFlowResidual, 0.0, 1.0, Par); | ||
if (SolFlag < 0) { | ||
MessagePrefix = "Step 2b: "; | ||
} |
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 SolveRoot() function calling for electric heating coil part-load ratio calculation using a different residual function.
state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilAirAndWaterFlowResidual, 0.0, 1.0, Par); | ||
} else { | ||
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilLoadResidual, 0.0, 1.0, Par); | ||
} |
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 SolveRoot() function calling for electric heating coil part-load ratio calculation using a different residual function.
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilWaterFlowResidual, 0.0, 1.0, Par); | ||
} else { | ||
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilLoadResidual, 0.0, 1.0, Par); | ||
} | ||
if (SolFlag < 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.
Same change as above new SolveRoot() function calling.
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilAirAndWaterFlowResidual, 0.0, 1.0, Par); | ||
} else { | ||
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilLoadResidual, 0.0, 1.0, Par); | ||
} |
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.
Same change as above new SolveRoot() function calling.
@@ -76,7 +76,7 @@ namespace SZVAVModel { | |||
// parts of the simulation. | |||
|
|||
// MODULE PARAMETER DEFINITIONS | |||
// na | |||
extern int const HCoil_Water; |
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 heating coil type variable for identification.
Your results are very encouraging, I am sure this is done or nearly done. I'll do a code review next. |
Yes, this is done and ready for review. I was just updating the branch since it had merge conflict. |
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 changes are likely fine. I'd like a little clarification on the logic used to switch between residuals. Also, a unit test file appears to have just been emptied? Or something happened?
@@ -3096,15 +3096,19 @@ namespace FanCoilUnits { | |||
PLR, | |||
CompressorOnFlag); | |||
} | |||
} | |||
Calc4PipeFanCoil(state, FanCoilNum, ControlledZoneNum, FirstHVACIteration, QUnitOut); | |||
} else if ((CoolingLoad && QUnitOutMax > QZnReq && QZnReq < 0.0) || (HeatingLoad && QUnitOutMax < QZnReq && QZnReq > 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.
Seems like a straightforward check for calculating the desired operating PLR for the fan coil.
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 had to check for condition where the load is greater than the available capacity and set PLR to 1.0. Previously Calc4PipeFanCoil() was run with out the PLR argument and you do have to worry when load exceed the capacity because the default value of PLR is 1.
@@ -772,8 +773,11 @@ namespace SZVAVModel { | |||
Par(9) = lowWaterMdot; // minCoilFluidFlow - low fan speed water flow rate > 0 if SAT limited | |||
Par(12) = AirMassFlow; // sets air flow rate used when iterating on coil capacity | |||
Par(13) = 0.0; // other than 0 means to iterate on SA temperature | |||
|
|||
TempSolveRoot::SolveRoot(state, 0.001, MaxIter, SolFlag, PartLoadRatio, FanCoilUnits::CalcFanCoilWaterFlowResidual, 0.0, 1.0, Par); | |||
if (SZVAVModel.HCoilType_Num == HCoil_Water || !HeatingLoad) { |
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 arguments in this IF check are a difficult to fully grok. Anytime there is not a heating load it goes into the original residual function? Could you just clarify?
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.
(Though it's used many times in here so it's probably fine, but still clarifying the logic would help make it digestable)
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 residual function FanCoilUnits::CalcFanCoilWaterFlowResidual() varies the water flow rate to meet the heating load for hot water heating coil. The other residual function CalcFanCoilLoadResidual() varies PLR to meet the heating load for electric heating coils. We cannot use the same residual function. The former residual function is used for both cooling and heating modes of operation. Chilled water cooled coil flow rate is varied to meet the cooling load using the same residual function and is captured with "!HeatingLoad" case.
@@ -1,4375 +0,0 @@ | |||
// EnergyPlus, Copyright (c) 1996-2020, The Board of Trustees of the University of Illinois, |
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.
Any reason why this whole file got deleted? Or something?
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 did resolve unit tests conflict, tested locally and every thing was fine. May be I did something inadvertently. I will fix that.
Recovered the deleted file, tested the unit tests locally, and merged in develop. This should resolve the deleted file issue. |
This all looks good. Thank you for the clarifications. CI is happy, your unit tests are good. I'm going to build and run it locally a little but if anyone else has any thoughts just speak up. |
Actually, I guess running it locally would mean I'd have to set up my own file. Can you modify an existing IDF, or add a new one, that demonstrates this? You already have it in the unit tests, so I'm guessing it wouldn't take much. |
The defect file has a combination of one electric heating coil and hot water heating coils. One of the FancoilUnit uses electric heating coil and two other FancoilUnits use hot water heating coil. I can clean the defect file and add it. This defect file is also based on existing example file. So, do you prefer electric only heating coil or a combination is fine? |
@Nigusse honestly either is fine, as long as the file clearly demonstrates the use of the new feature in at least one unit. I would suggest leaving it as a combination as that is less effort. Thanks! |
@Myoldmopar Added new example with for FanCoilUnit with ASHRAE90VariableFan capacity control method and electric and hot water heating coils. |
Thanks @Nigusse! Building and testing now. |
@Nigusse the file wasn't running initially because of a case-sensitive file name issue. I addressed that in d14936c and was able to run the test file. Clean error file and results look good. I think I'll risk a tiny bit and go ahead and merge this in without waiting on CI results. Thanks for adding the test file. Good to go. |
Well this inadvertently left a tab character in the IDF so develop has a minor issue. I should've waited on CI ... 🙃 |
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.