Skip to content

Add Diffuse Shading Schedule Import#11603

Open
JingwenGu wants to merge 2 commits into
NatLabRockies:developfrom
EnvironmentalSystemsLab:develop
Open

Add Diffuse Shading Schedule Import#11603
JingwenGu wants to merge 2 commits into
NatLabRockies:developfrom
EnvironmentalSystemsLab:develop

Conversation

@JingwenGu

Copy link
Copy Markdown

Pull request overview

  • Implements functionalities to import externally computed diffuse shading data.

Description of the purpose of this PR

This pull request introduces a framework for importing externally computed diffuse shading quantities into EnergyPlus. The feature enables users to override EnergyPlus internal diffuse shading calculations with timestep-resolved shading data generated by external simulation pipelines such as ray tracing, voxel-based methods, or other custom shading workflows.

The implementation is designed to improve interoperability between EnergyPlus and advanced urban-scale or geometry-heavy shading simulation systems while preserving the existing downstream energy simulation workflow.

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

@mitchute mitchute self-requested a review June 3, 2026 18:08

@mitchute mitchute left a comment

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.

@JingwenGu some comments for you on this to start with. We likely will have more once these issues are addressed.

} // TimeStep Loop
} // Hour Loop

// ESL edit start

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.

Comments like this are not necessary. That's what the git commit history is for.

@mitchute mitchute Jun 9, 2026

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.

We don't need three new example files to exercise this. Our preference would for there to be zero new IDFs and for all tests to be added as unit tests under the /tst folder. There's a resources directory in there (tst/EnergyPlus/unit/Resources) where you can add full IDFs that are required, which likely isn't the case. More likely is that you can just add the IDF objects you need to exercise your code to the unit tests directly.

Also, the resources folder would be a good place to add an example schedule file.

// Write data row with only the 4 attributes per surface
csvOut << iHour << ":" << iTimeStep;
for (int SurfNum : s_surf->AllExtSolAndShadingSurfaceList) {
auto &surface = s_surf->Surface(SurfNum);

@mitchute mitchute Jun 9, 2026

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.

This variable is unused, which we treat as an error on some platforms. You'll need to remove this and any others out before linux builds will be successful.

Comment thread README.md
Comment on lines +68 to +83

```bash
git clone https://github.com/NREL/EnergyPlus

mkdir build

cd build

cmake ..

cmake -S . -B build -DBUILD_TESTING=ON

cmake --build build --config Release -j

./build/Products/Release/energyplus.exe -w ./weather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw -d out_run ./testfiles/DirDiffShadingOverrideTestIdf_25_2.idf
``` No newline at end of file

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.

Remove this

Comment on lines +953 to +962

// ASSERT_TRUE(process_idf(idf_objects_scheduled));
// state->init_state(*state);

// FoundError = false;

// HeatBalanceManager::GetProjectControlData(*state, FoundError);
// // EXPECT_FALSE(FoundError);

// HeatBalanceManager::SetPreConstructionInputParameters(*state);

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.

The unit tests should be cleaned up and not have large blocks commented out without some reason.

@mitchute mitchute added the NewFeature Includes code to add a new feature to EnergyPlus label Jun 9, 2026
@mitchute mitchute changed the title NewFeature: diffuse shading schedule import Add Diffuse Shading Schedule Import Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NewFeature Includes code to add a new feature to EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants