-
Notifications
You must be signed in to change notification settings - Fork 396
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
User Defined Plant Component Refactor #7649
Conversation
Ready for review |
I merged develop in and addressed the tiny conflict along the way, I'll review the code now and let CI work on it overnight to make sure my conflict resolution wasn't 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.
Everything looks good on the code side.
@@ -1440,6 +1441,7 @@ namespace EnergyPlus { | |||
this_comp.TypeOf_Num = TypeOf_PlantComponentUserDefined; | |||
this_comp.GeneralEquipType = GenEquipTypes_PlantComponent; | |||
this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; | |||
this_comp.compPtr = UserDefinedComponents::UserPlantComponentStruct::factory(CompNames(CompNum)); |
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.
Simple enough.
sim_component.OptLoad = OptLoad; | ||
sim_component.CompNum = EquipNum; | ||
} | ||
sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag); |
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.
All good here.
@@ -464,6 +466,7 @@ void EnergyPlusFixture::clear_all_states() | |||
UnitarySystems::clear_state(); | |||
UnitHeater::clear_state(); | |||
UnitVentilator::clear_state(); | |||
UserDefinedComponents::clear_state(); |
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.
Excellent!
|
||
void initialize(int LoopNum, Real64 MyLoad); | ||
|
||
void report(int LoopNum); | ||
}; |
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.
Nicely done with clean function names. 👍
{ | ||
// Process the input data | ||
if (GetPlantCompInput) { | ||
GetUserDefinedPlantComponents(); |
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.
Right, just getting plant objects, great.
if (calledFromLocation.loopNum != this->Loop(loop).LoopNum) continue; | ||
if (calledFromLocation.loopSideNum != this->Loop(loop).LoopSideNum) continue; | ||
thisLoop = loop; | ||
} |
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 "feels" like an odd way to do this, but I'm sure it's just pulled from the original code, so no need to change anything, just unusual. 🤷♂️
DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidIndex, | ||
RoutineName); | ||
this->Loop(loop).InletTemp = DataLoopNode::Node(this->Loop(loop).InletNodeNum).Temp; | ||
this->Loop(loop).InletMassFlowRate = DataLoopNode::Node(this->Loop(loop).InletNodeNum).MassFlowRate; |
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 all a nice cleanup.
If CI is happy, this can merge in the morning. Thanks, @mitchute |
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.