Skip to content

Conversation

@RKStrand
Copy link
Contributor

Pull request overview

Description of the purpose of this PR

A user noted that there are some differences between the current EnergyPlus code and ASHRAE Standard 55/ISO 7730 in the calculation of the clothing factor and the clothing surface temperature. It appears that there have been some updates in how the standard calculates these two parameters since this was implemented in EnergyPlus. Changes were made to the code to bring the EnergyPlus algorithm back into alignment with the current version of ASHRAE Standard 55/ISO 7730. A unit test was also created to test the Fanger PMV calculation function as well as a minor addition to the Engineering Reference documentation. Small differences differences in the PMV/PPD output are anticipated for any IDF that reports these values for the Fanger Thermal Comfort Model. There should be no differences in the other simulation variable results or in files that do not include these two key outputs of the Fanger model.

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

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

RKStrand added 2 commits July 10, 2025 13:45
Corrected some equations where ASHRAE Standard 55/ISO 7730 have changed since the original implementation of thermal comfort in E+.  Also updated some of the unit tests to reflect the fact that the PMV and/or PPD has changed slightly as a result of the updated equations.  Might see some diffs in results, but these should be fairly minor and limited to files that report Fanger results.
This commit includes a unit test to verify that the updated version of the Fanger PMV calculation is working properly.  In addition, a statement was added to the Engineering Reference to clearly state that the method used to calculate clothing surface temperature matches the current version of ASHRAE Standard 55/ISO 7730.
@RKStrand RKStrand added this to the EnergyPlus 25.2 milestone Jul 10, 2025
@RKStrand RKStrand self-assigned this Jul 10, 2025
@RKStrand RKStrand added the Defect Includes code to repair a defect in EnergyPlus label Jul 10, 2025
@RKStrand RKStrand requested review from Myoldmopar and mjwitte July 10, 2025 19:35
@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit 83d43de

Regression Summary
  • ESO Small Diffs: 16
  • ESO Big Diffs: 34
  • EIO: 1
  • MTR Small Diffs: 1
  • Table Big Diffs: 1

@RKStrand
Copy link
Contributor Author

Initial output results show that the only differences (over 50% of diff files checked) were in PMV except in the case of a file that uses Comfort Controls. In the one file that has comfort controls that was looked at, the differences are reasonable given that controls were impacted directly by the change in PMV. All in all, the differences seem reasonable in my opinion given the changes to the PMV calculation.

if (stdICL < 0.078) {
state.dataThermalComforts->CloBodyRat = 1.0 + 1.29 * stdICL;
} else {
state.dataThermalComforts->CloBodyRat = 1.05 + 0.645 * stdICL;
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous method used an older standard? If so, would there be any reason to allow the user to choose either method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the case of the CloBodyRat calculated here, I am not 100% sure where the "old" formulation came from since it's more of a change. I'm guessing since I implemented this module 20+ years ago that it was based on an older version of ASHRAE Standard 55. In the case of the other equation, it looks like there were typos in the formulation that got corrected in the standard. I personally don't think there is any value in keeping either old formulation. Users want to know that the calculation is in line with the current standard. If a researcher wants to make a comparison, I wouldn't even mess with E+. I'd program a separate little program to see what the impact was. In results that I saw, there wasn't a huge difference in PMV before and after the change. But again, this got flagged because a user saw that the code didn't match the current standard. So, I felt like the best way forward was to get this up to the standard and not worry about the past. Thoughts?

Copy link
Contributor

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

Ran DynamicClothing with debug build, no problems. Unit tests all succeed. A couple of quick cleanups then this will be ready to go.

\label{eq:FangerQr}
\end{equation}

It should be noted that the calculation of the clothing surface temperature in the previous two equations is based on the current version of ASHRAE Standard 55/ISO 7730. The equations and iterative algorithm used by EnergyPlus to calculate the clothing surface temperature variables are equivalent to ASHRAE Standard 55/ISO 7730.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the latest commit.

// Compute the Corresponding Clothed Body Ratio
state.dataThermalComforts->CloBodyRat = 1.05 + 0.1 * CloUnit; // The ratio of the surface area of the clothed body
// to the surface area of nude body
Real64 stdICL = 0.155 * CloUnit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment somewhere in this function that references the specific standards with years.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also fixed in the latest commit.

Modified the documentation and added a comment to the code to properly note which standard (rather than "current") EnergyPlus is using as its basis.  This is in response to comments received during review.
@RKStrand RKStrand requested review from mjwitte and rraustad July 28, 2025 11:54
Clang complained about a couple of extra spaces that Xcode threw into a file.
@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit c29730f

Regression Summary
  • ESO Small Diffs: 16
  • ESO Big Diffs: 34
  • EIO: 1
  • MTR Small Diffs: 1
  • Table Big Diffs: 1

@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit e97b5a1

Regression Summary
  • ESO Small Diffs: 16
  • ESO Big Diffs: 34
  • EIO: 1
  • MTR Small Diffs: 1
  • Table Big Diffs: 1

Copy link
Contributor

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

@RKStrand Thanks for adding the years for the standards. One last question: the equations in the engineering ref are ok as-is?

@RKStrand
Copy link
Contributor Author

@mjwitte That's a good question. Interestingly, the Engineering Reference does not cover the equations that were updated because it does not talk about the process for iterating to find the clothing surface temperature. So, as it currently stands, the Engineering Reference does not need to be modified unless there is a need for adding information on this process. It appears that the current documentation focuses on the "big picture" equations but avoids getting "too deep in the weeds". If you feel like this is important enough to cover, I can definitely add additional text/equations.

@mjwitte
Copy link
Contributor

mjwitte commented Jul 29, 2025

@RKStrand Thanks for the explanation. Merging.

@mjwitte mjwitte merged commit 7b4af82 into develop Jul 29, 2025
9 checks passed
@mjwitte mjwitte deleted the 11112FangerPMVCalculationIssues branch July 29, 2025 14:40
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.

Fanger Thermal Comfort Operative Temperature and Clothing Temperature Issues

6 participants