Skip to content

Change remaining Coil:Heating:Gas to Fuel plus cleanups on new coil sizing reports#6500

Merged
Myoldmopar merged 21 commits intodevelopfrom
CoilSizingFollowup
Mar 18, 2018
Merged

Change remaining Coil:Heating:Gas to Fuel plus cleanups on new coil sizing reports#6500
Myoldmopar merged 21 commits intodevelopfrom
CoilSizingFollowup

Conversation

@mjwitte
Copy link
Copy Markdown
Contributor

@mjwitte mjwitte commented Feb 26, 2018

Pull request overview

Part 2 of new coil sizing reports, completing #6454.

  • Fix plant index errors
  • Add design document
  • Finish documentation
  • Add unit tests
  • Refine units in column headings - use standard units enums or equivalent?
  • Add timestamp tag to date/time columns

Also . . .

  • Fixed lingering occurrences of Coil:Heating:Gas --> Fuel, which actually were discovered by one of these new unit tests (Coil:Heating:Fuel wasn't being recognized as a heating coil)
  • Noted ip-units conversion warnings for table outputs and fixed units in the Surface Convection Parameters eio output header.
  • Partially addresses Additional Terminal Unit Sizing Issues #6481

Work Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • At least one of the following appropriate labels must be added to this PR to be consumed into the changelog:
    • Defect: This pull request repairs a github defect issue. The github issue should be referenced in the PR description
    • Refactoring: This pull request includes code changes that don't change the functionality of the program, just perform refactoring
    • NewFeature: This pull request includes code to add a new feature to EnergyPlus
    • Performance: This pull request includes code changes that are directed at improving the runtime performance of EnergyPlus
    • DoNoPublish: This pull request includes changes that shouldn't be included in the changelog

Review Checklist

This will not be exhaustively relevant to every PR.

  • Code style (parentheses padding, variable names)
  • Functional code review (it has to work!)
  • If defect, results of running current develop vs this branch should exhibit the fix
  • CI status: all green or justified
  • Performance: CI Linux results include performance check -- verify this
  • Unit Test(s)
  • C++ checks:
    • Argument types
    • If any virtual classes, ensure virtual destructor included, other things
  • IDD changes:
    • Verify naming conventions and styles, memos and notes and defaults
    • Open windows IDF Editor with modified IDD to check for errors
    • If transition, add rules to spreadsheet
    • If transition, add transition source
    • If transition, update idfs
  • If new idf included, locally check the err file and other outputs
  • Documentation changes in place
  • Changed docs build successfully
  • ExpandObjects changes?
  • If output changes, including tabular output structure, add to output rules file for interfaces

@mjwitte mjwitte added NewFeature Includes code to add a new feature to EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze) labels Feb 26, 2018
Copy link
Copy Markdown
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good. I had a question about the unit tests. Let me know what you think there and we'll get it approved.

)
{
int index = getIndexForOrCreateDataObjFromCoilName( coilName,coilType );
auto & c( coilSelectionDataObjs[ index ] );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if ( c->waterLoopNum > 0 && c->pltSizNum > 0 ) {
c->plantLoopName = DataPlant::PlantLoop( c->waterLoopNum ).Name;
if ( DataSizing::PlantSizData( c->pltSizNum ).LoopType != DataSizing::SteamLoop ) {
c->rhoFluid = FluidProperties::GetDensityGlycol( DataPlant::PlantLoop( c->waterLoopNum ).FluidName, DataGlobals::InitConvTemp, DataPlant::PlantLoop( c->waterLoopNum ).FluidIndex, "ReportCoilSelection::setCoilWaterFlow" );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for being explicit on the scope of these functions and not using using statements!

if ( isAutoSized ) {
c->coilWaterFlowAutoMsg = "Yes" ;
} else {
c->coilWaterFlowAutoMsg = "No" ;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So easy to read all this with the c reference variable.

Real64 const totalHeatingCap, // {W} coil Heating capacity
bool const isAutoSize, // true if value was autosized
int const dataPltSizNum, // plant sizing structure index
int const DataPltSizNum, // plant sizing structure index
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason for capitalizing this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, don't remember changing that.

Real64 airVdot ( 0.052 ); // air flow rate in m3/s
bool isAutoSized ( false ); // true if air flow was autosized

coilSelectionReportObj->setCoilAirFlow( coilName, coilType, airVdot, isAutoSized );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So concise. Are you adding more unit tests or is this the extent of your testing?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the coverage results it looks like the code that isn't covered by this test is mostly the erroneous code paths and the steam loop calculations. However there is a section in the setCoilWaterFlowNodeNums function where c->waterLoopNum > 0 && c->pltSizNum > 0 and that block doesn't get hit. What do you think about adding some coverage there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only half-baked. Will add more. The functions themselves are all from @EnergyArchmage so I can't take credit for how they're written. I just made copies of them to make two flavors for some.



private: // data
public: // data
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Myoldmopar @EnergyArchmage I couldn't get the unit tests to work without making this public. Is there a better way?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/questions/2396370/how-to-make-google-test-classes-friends-with-my-classes

I think make it public. Or better yet make your class a struct and just make things private that are definitely not needed anywhere else even in unit tests.

@mjwitte mjwitte added this to the EnergyPlus 8.9.0 milestone Mar 2, 2018
coilSelectionReportObj->setCoilAirFlow( coil1Name, coil1Type, airVdot, isAutoSized );
auto & c1 ( coilSelectionReportObj->coilSelectionDataObjs[ 0 ] );
EXPECT_EQ( coil1Name, c1->coilName_ );
EXPECT_EQ( coil1Type, c1->coilObjName );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Myoldmopar This works here and I can query c1 and see that's filled where it should be. But later on after coil 2 is created, c1 becomes undefined. What needs to be different here when declaring c1 to make it stick later?

// First with no plant sizing objects defined
isAutoSized = false; // true if autosized
coilSelectionReportObj->setCoilWaterFlowNodeNums( coil1Name, coil1Type, waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum );
EXPECT_EQ( -999, c1->pltSizNum );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c1 is still ok here.

std::string coil2Type ( "Coil:Cooling:Water" ); // idf input object class name of coil
int pltSizNum = -999;
coilSelectionReportObj->setCoilWaterFlowPltSizNum( coil2Name, coil2Type, waterVdot, isAutoSized, pltSizNum, loopNum );
auto & c2 ( coilSelectionReportObj->coilSelectionDataObjs[ 1 ] );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But here after a second coilSelectionDataObjs is created, c1 is undefined.

DataSizing::PlantSizData( 1 ).PlantLoopName = "Chilled Water Loop";
isAutoSized = true; // true if autosized
coilSelectionReportObj->setCoilWaterFlowNodeNums( coil1Name, coil1Type, waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum );
auto & c1b ( coilSelectionReportObj->coilSelectionDataObjs[ 0 ] );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, here for now, creating a new c1b to point to the first coil.

change zone weighting to supply-air-flow-rate from zone volume, traps to
not overwrite values set directly
@EnergyArchmage EnergyArchmage added the DoNotPublish Includes changes that shouldn't be reported in the changelog label Mar 15, 2018
@mjwitte mjwitte mentioned this pull request Mar 15, 2018
20 tasks
@mjwitte mjwitte removed the NewFeature Includes code to add a new feature to EnergyPlus label Mar 15, 2018
@Myoldmopar
Copy link
Copy Markdown
Member

This looks really good. I am happy to see the plant index errors gone. Looking at the diffs, they seem to be only in the table, and spot checking those I see differences in coil sizes that are relatively small, but numerically significant for throwing diffs. I have no issue with this. Were you planning on doing anything else on here? If not I'll merge.

@mjwitte
Copy link
Copy Markdown
Contributor Author

mjwitte commented Mar 16, 2018

@Myoldmopar Just about finished with expanded unit tests and still want to clean up some units in the table headers. Should be up within the hour.

@Myoldmopar
Copy link
Copy Markdown
Member

👍

@mjwitte mjwitte requested a review from Myoldmopar March 16, 2018 14:39
@mjwitte mjwitte added Defect Includes code to repair a defect in EnergyPlus and removed DoNotPublish Includes changes that shouldn't be reported in the changelog labels Mar 16, 2018
@mjwitte mjwitte changed the title New Coil Sizing Reports - Part 2 Fix lingering occurrences of Coil:Heating:Gas --> Fuel plus New Coil Sizing Reports Followup Mar 16, 2018
@mjwitte
Copy link
Copy Markdown
Contributor Author

mjwitte commented Mar 16, 2018

@Myoldmopar Note change in labels, title and new items in overview.

@Myoldmopar
Copy link
Copy Markdown
Member

Thanks for covering this so well @mjwitte. I'm going to avoid merging for a little while and let CI have a few hours to check on diffs in this and a couple others that are basically ready to go. If this is clean it'll go in.

@mjwitte
Copy link
Copy Markdown
Contributor Author

mjwitte commented Mar 16, 2018

@Myoldmopar Arrrgh. Tablediff is failing now.
(diff, which) = hdict[h][i]
KeyError: u'Date/Time at Sensible Ideal Loads Peak'

//results from regular zone and system sizing calcs, "At Ideal Loads Peak"
pdch2CoilDDnameSensIdealPeak = newPreDefColumn( pdst2CoilSummaryCoilSelection, "Design Day Name at Sensible Ideal Loads Peak" );
pdch2CoilDateTimeSensIdealPeak = newPreDefColumn( pdst2CoilSummaryCoilSelection, "Date/Time at Sensible Ideal Loads Peak" );
pdch2CoilDateTimeSensIdealPeak = newPreDefColumn( pdst2CoilSummaryCoilSelection, "Date/Time at Sensible Ideal Loads Peak {TIMESTAMP}" );
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonGlazer So, adding {TIMESTAMP} here is causing TableDiff to crash. Can you see anything wrong here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing jumps out as to why this would cause a problem.


Real64 zoneHeatingLatentLoad = 4321.0;
coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak( zoneNum, zoneHeatingLatentLoad );
// Expect zero because doZoneEqSetup isn't currently executed
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EnergyArchmage I noticed that all calls to coilSelectionReportObj->doZoneEqSetup are currently commented out. Is that your intent at this point?

@Myoldmopar
Copy link
Copy Markdown
Member

Hmm....looks like it's still failing with TableDiff?

@mjwitte
Copy link
Copy Markdown
Contributor Author

mjwitte commented Mar 16, 2018

@JasonGlazer What the . . . can TableDiff no handle any change in a column heading?

@mjwitte
Copy link
Copy Markdown
Contributor Author

mjwitte commented Mar 16, 2018

One more time . . . hope TableDiff is happy now.

@mjwitte mjwitte changed the title Fix lingering occurrences of Coil:Heating:Gas --> Fuel plus New Coil Sizing Reports Followup Change remaining Coil:Heating:Gas to Fuel plus cleanups on new coil sizing reports Mar 16, 2018
@Myoldmopar
Copy link
Copy Markdown
Member

Back to tablediffs, not tablediff failures! Ready to go once CI continues a bit more?

@Myoldmopar
Copy link
Copy Markdown
Member

Pulled in the latest develop; letting CI run overnight and we'll merge in the morning.

@Myoldmopar
Copy link
Copy Markdown
Member

Clang was not pleased with this last commit, but it could be a fluke. I just deleted those results and we'll see if Marvin is happier on another try.

@Myoldmopar
Copy link
Copy Markdown
Member

I merged in a couple more PRs so I went ahead and pulled develop in and pushed it back up. With the drastically reduced number of branches CI is watching, it should get done with a full set of diffs relatively soon this morning.

@Myoldmopar
Copy link
Copy Markdown
Member

This looks to be good to go but I'm going to hold off from merging so the diffs don't get intermingled over on #6498. I'll merge this once the base Linux CI over there is done. Then we'll be nearly done...

@Myoldmopar Myoldmopar merged commit 004ca8e into develop Mar 18, 2018
@Myoldmopar Myoldmopar deleted the CoilSizingFollowup branch March 18, 2018 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Defect Includes code to repair a defect in EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants