Skip to content

Adjust SurfaceProperty:XXX IDD and fix/improve sunlit fraction schedule checks#11445

Open
joseph-robertson wants to merge 26 commits intodevelopfrom
surfprop-idd
Open

Adjust SurfaceProperty:XXX IDD and fix/improve sunlit fraction schedule checks#11445
joseph-robertson wants to merge 26 commits intodevelopfrom
surfprop-idd

Conversation

@joseph-robertson
Copy link
Copy Markdown
Collaborator

Pull request overview

Description of the purpose of this PR

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • 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
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@joseph-robertson joseph-robertson self-assigned this Mar 3, 2026
@joseph-robertson joseph-robertson added the Defect Includes code to repair a defect in EnergyPlus label Mar 3, 2026
Comment on lines 1814 to +1816
SurfaceGeometry::SetupZoneGeometry(state, ErrorsFound);

SolarShading::GetShadowingInput(state);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This PR inadvertently moved GetShadowingInput before SetupZoneGeometry. But we need it after so that surface data is read first. The existing relevant unit test didn't catch this because of this reason.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@RKStrand Are you OK with this change? I believe the only regression implication is to change the order of a few lines in the EIO file.

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.

@joseph-robertson Um, yeah, as long as it doesn't trip any weird things in the unit tests, I'm guessing it will be okay. I seem to vaguely remember some recent work here and there were some issues with order dependence on some of the calls in this area of the code. I think I couldn't move something up as high as I thought because it caused other crashes because stuff wasn't read in yet. Anyway, if you move it an there are no unit test or test suite issues that pop up, then it's probably fine.

}
}

void checkNotScheduledSurfacePresent(EnergyPlusData &state)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

New method for issuing a warning when a surface has a sunlit fraction schedule but the ShadowCalculation object has Shading Calculation Method != Scheduled. This is the contrapositive (?!) to checkScheduledSurfacePresent.

Comment on lines +5286 to +5288
surfData->Surface(6).Class = SurfaceClass::Window;
surfData->Surface(6).SurfSchedExternalShadingFrac = false;
surfData->Surface(6).Name = "WINDOW2NOTOK";
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Just improving the existing unit test -- we should see an additional warning line for a second valid surface without sunlit fraction schedule.

EXPECT_TRUE(compare_err_stream(error_string, true));
}

TEST_F(EnergyPlusFixture, SolarShadingTest_checkNotScheduledSurfacePresent)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

New unit test, much like the existing unit test, for checking the new checkNotScheduledSurfacePresent method.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 1496723

Regression Summary
  • EIO: 811

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

⚠️ Regressions detected on macos-14 for commit 1496723

Regression Summary
  • EIO: 807

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit f707897

Regression Summary
  • EIO: 811

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

⚠️ Regressions detected on macos-14 for commit f707897

Regression Summary
  • EIO: 807

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 8bba3d3

Regression Summary
  • EIO: 811

@joseph-robertson
Copy link
Copy Markdown
Collaborator Author

There are technically IDD changes in this PR; however, they don't involve adding/removing/renaming any fields. Would it therefore be OK to merge this to be included in v26.1.0, but post IOFreeze?

@mitchute @rraustad @RKStrand

@mitchute
Copy link
Copy Markdown
Collaborator

mitchute commented Mar 3, 2026

I think the \object-list change is likely to only affect IDF Editor. The others are less clear to me, but even so, seem like they may be OK to admit at this point.

A2, \field Exterior Surface Name
\type object-list
\object-list SurfaceNames
\object-list AllHeatTranSurfNames
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I assume this change was made to include FenestrationSurface:Detailed in the list of object names in the IDF Editor. However, AllHeatTranSurfNames (and SurfaceNames) also includes objects that should not show up in that list provided by the IDF Editor. It may also be that the IO Ref description below does not include all valid surface types but I did not check that. The fix would be to add a new reference to the valid objects and use that here instead?

1.11.28 SurfaceProperty:LocalEnvironment
The object links to an exterior surface object BuildingSurface:Detailed or an exterior fenestration object
FenestrationSurface:Detailed and is used when ...

FenestrationSurface:Detailed,
   \memo Allows for detailed entry of subsurfaces
   \memo (windows, doors, glass doors, tubular daylighting devices).
   \min-fields 18
   \format vertices
A1 , \field Name
   \required-field
   \type alpha
   \reference SubSurfNames
   \reference GlazedExtSubSurfNames
   \reference SurfAndSubSurfNames
   \reference AllHeatTranSurfNames

For example, what good would it do to use SurfaceProperty:LocalEnvironment with an adiabatic floor? Maybe I am overthinking this and this change is sufficient to at least include the relevant objects.

Floor:Adiabatic,
   \memo Allows for simplified entry of exterior floors
   \memo ignoring ground contact or interior floors.
   \memo View Factor to Ground is automatically calculated.
A1 , \field Name
   \required-field
   \type alpha
   \reference SurfaceNames
   \reference SurfAndSubSurfNames
   \reference AllHeatTranSurfNames

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point. For example currently if you open SolarShadingTest_ExternalFraction.idf in IDF Editor, the list of SurfaceProperty:LocalEnvironment objects will initially populate the Exterior Surface Name fields with:

  • Shading:Site:Detailed (invalid)
  • FenestrationSurface:Detailed (invalid)
  • BuildingSurface:Detailed (valid)

But the dropdowns don't show any Shading:Site:Detailed or FenestrationSurface:Detailed objects. If we switched SurfaceNames -> AllHeatTranSurfNames we'd still be including invalid Floor:Adiabatic in the dropdowns. So assuming the docs are correct, we'd need a reference that is shared between only FenestrationSurface:Detailed and BuildingSurface:Detailed; if one doesn't already exist, we need to add a new one.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Be careful when thinking the docs are correct. I think as a user I would expect Wall:Detailed to be the same as BuildingSurface:Detailed in the context of SurfaceProperty:LocalEnvironment. Even an exterior door should be able to use the local environment properties? I am sure you can think of other use cases for this object.

Copy link
Copy Markdown
Collaborator Author

@joseph-robertson joseph-robertson Mar 4, 2026

Choose a reason for hiding this comment

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

See 1886efe. Indeed Wall:Detailed, e.g., is a valid object (I checked locally). Based on the code, shading objects are certainly invalid. So I propose that we stick with the \object-list AllHeatTranSurfNames change (to pick up fenestration), but not get overly ambitious with a new reference as we may accidentally exclude a valid object type.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 5b18bce

Regression Summary
  • EIO: 811
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

⚠️ Regressions detected on macos-14 for commit 5b18bce

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

@joseph-robertson joseph-robertson marked this pull request as ready for review March 6, 2026 16:19
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

⚠️ Regressions detected on macos-14 for commit ac2f517

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

@mitchute mitchute added this to the EnergyPlus 26.2 IOFreeze milestone Mar 10, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 50bfe83

Regression Summary
  • EIO: 811
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 50bfe83

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

\maximum 1.0
\default 0.5
\autocalculatable
\default autocalculate
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Where do these inputs get autocalculated?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I believe right in here inside HeatBalanceSurfaceManager.cc.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think so:

    s_ipsc->cCurrentModuleObject = "SurfaceProperty:SurroundingSurfaces";
            auto &SrdSurfsProp = state.dataSurface->SurroundingSurfsProperty(Loop);

            // N1: sky view factor
            if (!s_ipsc->lNumericFieldBlanks(1)) {
                SrdSurfsProp.SkyViewFactor = s_ipsc->rNumericArgs(1);
                SrdSurfsProp.IsSkyViewFactorSet = true;
            }

Then in HeatBalanceSurfaceManager:

        if (Surface.SurfHasSurroundingSurfProperty) {
            SrdSurfsNum = Surface.SurfSurroundingSurfacesNum;
            auto &SrdSurfsProperty = state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum);
            SurfsSkyViewFactor = SrdSurfsProperty.SkyViewFactor;   <--- SkyViewFactor = -99999.0
            IsSkyViewFactorSet = SrdSurfsProperty.IsSkyViewFactorSet;
            if (SurfsSkyViewFactor > 0.0) {                             <---- SurfsSkyViewFactor = -99999.0
                SrdSurfsViewFactor += SurfsSkyViewFactor;
            }

And then you would hit the code (just below here) in your link. So something needs to be done here to "autocalculate" a view factor. Note that you added "autocalculate" to the idd so there would be no code yet to account for that. I'm not sure how you would automatically calculate a view factor. Maybe that's why this field wasn't autosizable in the first place?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My interpretation is that my link is where view factor "autocalculations" are done.

When sky view factor defined but ground view factor not defined, ground view factor = 1 - all other defined view factors.

When ground view factor defined but sky view factor not defined, sky view factor = 1 - all other defined view factors.

When neither defined, continue to use the original proportion.

I agree that the PR does not yet do anything with Constant::AutoCalculate. Maybe it should.

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 9b89512

Regression Summary
  • EIO: 809
  • ESO Small Diffs: 703
  • Table Small Diffs: 390
  • MTR Small Diffs: 523
  • Table String Diffs: 186
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 72
  • Table Big Diffs: 37
  • ERR: 14
  • MTR Big Diffs: 2
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2
  • Audit: 1

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 9b89512

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 56d0021

Regression Summary
  • EIO: 811
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

⚠️ Regressions detected on macos-14 for commit 56d0021

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

SurfsSkyViewFactor = SrdSurfsProperty.SkyViewFactor;
IsSkyViewFactorSet = SrdSurfsProperty.IsSkyViewFactorSet;
if (SurfsSkyViewFactor > 0.0) {
if (SurfsSkyViewFactor != DataSizing::AutoSize) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Somewhere there needs to be:

if (SrdSurfsProperty.SkyViewFactor == DataSizing::AutoSize) {
    SrdSurfsProperty.SkyViewFactor = `some calculation`;
    SrdSurfsProperty.IsSkyViewFactorSet = true;
}

Copy link
Copy Markdown
Collaborator

@rraustad rraustad Apr 2, 2026

Choose a reason for hiding this comment

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

I looked at your link again. I think your right. If these factors are not yet set then they will get set around lines 9904 - 9942. Usually there would be a report in the eio for autosized/autocalculated fields.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@rraustad Looking at some of the outputs for these view factors, I'm running into some confusing issues. For example if you look at the HeatTransfer Surface table in eplustbl.htm for testfile SurfacePropGroundSurfaces_LWR.idf, you see ViewFactorToSky=1.0 for Surface Name="Zn003:Roof001". But clearly in the IDF file the attached SurfaceProperty:SurroundingSurfaces object shows field Sky View Factor=0.0. Table entry ViewFactorToSky-IR=0.0 looks correct.

Looks like OutputReports.cc reports thisSurface.ViewFactorSky whereas HeatBalanceSurfaceManager.cc deals with Surface.SkyViewFactor (note the ViewFactorSky vs SkyViewFactor difference). Is this intentional, or a bug? Any insight here on how these variables are all related?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know what the difference is but I see this:

struct SurfaceData
{
    Real64 ViewFactorGround;      // View factor to the ground from the exterior of the surface for diffuse solar radiation
    Real64 ViewFactorSky;         // View factor to the sky from the exterior of the surface for diffuse solar radiation
    Real64 ViewFactorGroundIR;    // View factor to the ground and shadowing surfaces from the exterior of the surface for IR radiation
    Real64 ViewFactorSkyIR; // View factor to the sky from the exterior of the surface for IR radiation Special/optional other side coefficients

struct SurroundingSurfacesProperty
{
    // Members
    std::string Name;
    Real64 SkyViewFactor = 0.0;                 // sky view factor
    Real64 GroundViewFactor = 0.0;              // ground view factor

Copy link
Copy Markdown
Collaborator Author

@joseph-robertson joseph-robertson Apr 3, 2026

Choose a reason for hiding this comment

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

Ah ok. So ViewFactorGround seems to come from BuildingSurface:Detailed's "View Factor to Ground" field. Note 1 in here describes where the view factor to sky comes from. Note 2 in the same link comments that the corresponding IR view factors are calculated based on the optional SurfaceProperty:SurroundingSurfaces and SurfaceProperty:GroundSurfaces objects that are involved in this PR.

Neither the eplustbl.html or eplusout.eio file seems to list any SurfaceProperty:SurroundingSurfaces or SurfaceProperty:GroundSurfaces objects. So I don't think there are any reporting considerations to be made for their autosized/autocalculated fields.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

⚠️ Regressions detected on macos-14 for commit 5099810

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 5099810

Regression Summary
  • EIO: 811
  • ESO Small Diffs: 705
  • Table Small Diffs: 390
  • MTR Small Diffs: 523
  • Table String Diffs: 187
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 72
  • Table Big Diffs: 37
  • ERR: 14
  • MTR Big Diffs: 2
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2
  • Audit: 1

@joseph-robertson
Copy link
Copy Markdown
Collaborator Author

This PR includes regressions in eplusout.eio files for several (maybe all?) testfiles. But I believe it's just a slight re-ordering of lines with no actual content changes. For example,

image

I want to say this happens because of this change in the order of method calls, where SolarShading::GetShadowingInput(state) is now called after SurfaceGeometry::SetupZoneGeometry(state, ErrorsFound).

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

⚠️ Regressions detected on macos-14 for commit 655abee

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 655abee

Regression Summary
  • EIO: 811
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit a2f72bc

Regression Summary
  • EIO: 811
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

⚠️ Regressions detected on macos-14 for commit a2f72bc

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit b47bdb8

Regression Summary
  • EIO: 811
  • Audit: 1
  • Table Big Diffs: 1

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit b47bdb8

Regression Summary
  • EIO: 807
  • Audit: 1
  • Table Big Diffs: 1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SurfaceProperty:LocalEnvironment and SurfaceProperty:SurroundingSurfaces: IDD adjustments

5 participants