Skip to content
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

Addresses #4403, add Sql helper methods to retrieve U-factors, SHGC, or VT for glazing systems #4550

Merged
merged 14 commits into from
Mar 23, 2022

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Mar 10, 2022

Pull request overview

Checklist:

  • On SubSurface:
    • assembly<type>()
    • getFenestrationValue(std::string <type>) (on ModelObject)
    • new test in src/model/test/SubSurface_GTest.cpp
  • On SqlFile:
    • assembly<type>(std::string name)
    • assembly<type>TotalorAverage()?
    • assembly<type>NorthTotalorAverage()?
    • assembly<type>NonNorthTotalorAverage()?
    • new test in src/utilities/sql/Test/SqlFile_GTest.cpp
  • In resources/energyplus:
    • add FrameAndDivider/in.idf (copied from os-resources window_property_frame_and_divider.rb)

for UFactor, SHGC, VisibleTransmittance.

Questions:

  • Can we somehow combine getFenestrationValue methods from SqlFile and SubSurface so that we don't duplicate code?
  • Look in TableName=Exterior Fenestration, then TableName=Interior Fenestration? Update: Interior Fenestration wasn't implemented.
  • How to test new assembly<type>() methods on SubSurface? Update: Use new FrameAndDivider; reverse translate in.idf and attach eplusout.sql to model.

image

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

@joseph-robertson joseph-robertson self-assigned this Mar 10, 2022
@joseph-robertson joseph-robertson changed the base branch from develop to v22.1.0-IOFreeze March 10, 2022 17:42
@joseph-robertson joseph-robertson added Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Mar 11, 2022
@@ -1531,3 +1534,34 @@ TEST_F(ModelFixture, Issue_4361_Multi_Subsurfaces_Overlapping) {
windowWallRatio = surface.windowToWallRatio();
EXPECT_NEAR(windowWallRatio, 0.2742, 0.01);
}

TEST_F(ModelFixture, 4403_FenestrationAssembly) {
// Test for #4403 - Add Sql helper methods to retrieve U-factors, SHGC, or VT for glazing systems
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like the test

(Side note: I'm not a big fan on relying on the ReverseTranslator though. Would be better with an OSM directly, but that's probably a non issue)

Copy link
Collaborator

Choose a reason for hiding this comment

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

it makes sense to use RUN_ENERGYPLUS to keep current, so I actually like this solution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see pros/cons both ways. The con, as I see it, with OSM directly is that OSM/IDF get out of sync in FrameAndDivider.

Copy link
Collaborator

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

At the very least, move the method from Modelobject to SubSurface, but perhaps delete it?

Comment on lines 379 to 381
/** Gets the fenestration value from the sql file **/
boost::optional<double> ModelObject_Impl::getFenestrationValue(std::string columnName) const {
boost::optional<double> result;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unless there is another class that will need this, this shouldn't be on ModelObject, but just on the SubSurface

Copy link
Collaborator

Choose a reason for hiding this comment

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

I find this method a bit confusing. Do we need this in addition to the better named assemblyUFactor etc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm using getAutosizedValue as a guide, where you can pass in the appropriate columnName.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah but in that case it makes sense because lots of child classes get to use that method. Here that doesn't seem to be the case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't see the harm - it reduces duplicated code. Should we rename the method to something other than getFenestrationValue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed it to getExteriorFenestrationValue so that it aligns with TableName=Exterior Fenestration.

@@ -1531,3 +1534,34 @@ TEST_F(ModelFixture, Issue_4361_Multi_Subsurfaces_Overlapping) {
windowWallRatio = surface.windowToWallRatio();
EXPECT_NEAR(windowWallRatio, 0.2742, 0.01);
}

TEST_F(ModelFixture, 4403_FenestrationAssembly) {
// Test for #4403 - Add Sql helper methods to retrieve U-factors, SHGC, or VT for glazing systems
Copy link
Collaborator

Choose a reason for hiding this comment

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

it makes sense to use RUN_ENERGYPLUS to keep current, so I actually like this solution.

Copy link
Collaborator

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

/** @name Queries */
//@{

/** Gets the fenestration value from the sql file **/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe a comment here or in the implementation explaining that it only reports for exterior fenestration (and not interior fenestration, and unlike the original NFP) would be helpful.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh ok, my bad, the name actually is spot on, getExteriorFenestrationValue. LGTM!

Base automatically changed from v22.1.0-IOFreeze to develop March 23, 2022 16:40
@jmarrec jmarrec merged commit 6640698 into develop Mar 23, 2022
@jmarrec jmarrec deleted the issue-4403 branch March 23, 2022 16:41
jmarrec added a commit that referenced this pull request Mar 24, 2022
HotFix #4550 - Remove getExteriorFenestrationValue from public API
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
component - Utilities Other Enhancement Request Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Sql helper methods to retrieve U-factors, SHGC, or VT for glazing systems
3 participants