-
Notifications
You must be signed in to change notification settings - Fork 448
Add function to associate airloop index to variable speed coil #11243
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Walk-through:
return state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).PartLoadRatio; | ||
} | ||
|
||
void SetVarSpeedDXCoilAirLoopNumber(EnergyPlusData &state, std::string const &CoilName, int const AirLoopNum) |
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.
New function to associate airloop index to variable speed coil.
state->dataVariableSpeedCoils->GetCoilsInputFlag = false; | ||
state->dataVariableSpeedCoils->VarSpeedCoil.allocate(2); | ||
state->dataVariableSpeedCoils->VarSpeedCoil(1).Name = "Super Coil"; | ||
state->dataVariableSpeedCoils->VarSpeedCoil(2).Name = "Super Heating Coil"; | ||
|
||
state->afn->validate_distribution(); | ||
compare_err_stream(""); |
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.
Adapt existing unit test to check for the error stream.
ErrorsFound = true; | ||
} else { | ||
SetDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum); | ||
SetVarSpeedDXCoilAirLoopNumber(m_state, DisSysCompCoilData(i).name, DisSysCompCoilData(i).AirLoopNum); |
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.
Well obviously!
|
||
WhichCoil = Util::FindItemInList(CoilName, state.dataVariableSpeedCoils->VarSpeedCoil); | ||
if (WhichCoil != 0) { | ||
state.dataVariableSpeedCoils->VarSpeedCoil(WhichCoil).AirLoopNum = AirLoopNum; |
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.
Where exactly is this used? AirFlowNetwork?
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.
That's correct.
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 mean, how does the VS coil use this information? AirflowNetwork already knows the AirLoopNum and is passing that number to the coil model. Why does the coil need to know the AirLoopNum?
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 see. The DXCoil model uses that information like this. I don't see either of these variables set in the VS coil model.
state.dataAirLoop->LoopDXCoilRTF = max(thisDXCoil.CoolingCoilRuntimeFraction, thisDXCoil.HeatingCoilRuntimeFraction);
if (thisDXCoil.AirLoopNum > 0) {
state.dataAirLoop->AirLoopAFNInfo(thisDXCoil.AirLoopNum).AFNLoopDXCoilRTF =
max(thisDXCoil.CoolingCoilRuntimeFraction, thisDXCoil.HeatingCoilRuntimeFraction);
}
So the VS coil model would also have to do things like this so that AFN has that information.
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.
What is strange with these functions that set the air loop num in a coil model, is that when the coil is simulated the global state.dataSize->CurSysNum
is always set when air loops are simulated. So the coil model already knows the AirLoopNum associated with this coil. These functions aren't even needed. Now it may be tricky to internally set up this coil variable based on whether or not AFN is active but I think this could be done as a one-time check in init. Anyway, this is the way it's done now so no reason to go out of scope for this issue. I still think there is more work in the VS coil model before this would work as AFN intends (e.g., the coil model needs the code I show above). I think that's the only other thing needed in the VS coil code.


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 Airloopnum is also used for reporting the airloop name to some of the table reports (but I'm not sure it's consistent across all of the coil types).
And then there's the coil selection report that has it's own tracking of the coil airloopnum and sets this is (nearly?) every ReportCoilSelection::setCoil*
function:
c->airloopNum = curSysNum;
.
And here's some of the table output for the HeatPumpAuto example file. The first two tables don't know the airloop name, but the next one does?
And then later, we have other reports that show the airloop name
And equivalent tables for heating coils do not even report airloop name.
@rraustad I agree that every coil should simply store it's airloop num from curSysNum
at the top of its sizing function. Maybe there's a timing issue for the AFN usage?
@lymereJ Maybe we can fix the "N/A" in the "DX Heating Coils" tables in this PR by adding thisDXCoil.AirLoopNum=state.dataSize->CurSysNum
at the top of SizeDXCoil
?
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.
@lymereJ @rraustad Oh, but now I see and AirloopNum>0
is being used to tell the DX coil if it's in an AFN loop?!
Then setting AirLoopNum
could break things. That should really be a separate flag that gets set from AFN on the coil.
I'll work on a separate PR to fix the table (just use CurSysNum
instead of the coil's AirLoopNum
). And I'll check other coil types to see if any others are assuming (incorrectly) that AirLoopNum
(or equivalent) is set properly for non-AFN runs.
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.
Setting AirloopNum to know if AFN is active is kind of klunky because that data is also used for table reporting. Whatever the AFN variables are then if AFN == Active && AirloopNum > 0
would be better.
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.
Setting AirloopNum to know if AFN is active is kind of klunky because that data is also used for table reporting. Whatever the AFN variables are then
if AFN == Active && AirloopNum > 0
would be better.
Can we assume if there's AFN with distribution, then all coils are part of that. Or should the current AFN function calls to the coils be used to set a coil-specific AFN flag?
src/EnergyPlus/VariableSpeedCoils.cc
Outdated
if (varSpeedCoil.AirLoopNum > 0) { | ||
state.dataAirLoop->AirLoopAFNInfo(varSpeedCoil.AirLoopNum).AFNLoopDXCoilRTF = max(varSpeedCoil.RunFracCool, varSpeedCoil.RunFracHeat); | ||
} |
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.
Pull request overview
Description of the purpose of this PR
Pull Request Author
Reviewer