Skip to content

Wrap ComfortViewFactorAngles - #5650

Open
joseph-robertson wants to merge 20 commits into
developfrom
comfort-view-factor-angles
Open

Wrap ComfortViewFactorAngles#5650
joseph-robertson wants to merge 20 commits into
developfrom
comfort-view-factor-angles

Conversation

@joseph-robertson

@joseph-robertson joseph-robertson commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Pull request overview

  • Closes Wrap ComfortViewFactorAngles #4412
  • This also:
    • Enables using "Mean Radiant Temperature Calculation Type" other than EnclosureAveraged
    • Moves (previously unused) "Surface Name/Angle Factor List Name" from People to People:Definition

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: Wrap ComfortViewFactorAngles OpenStudio-resources#233
  • 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 Sep 8, 2026
@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. IDDChange labels Sep 8, 2026
@joseph-robertson
joseph-robertson marked this pull request as ready for review September 8, 2026 22:21
@joseph-robertson

joseph-robertson commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

Um hang on, why is \object-list ZoneNames in the Name field? And Name needs to be \required-field, right? Also, like ZoneMRTCalculation, in addAngleFactor we need to check that "all surfaces are in the same enclosure"? And A1 jumps to A3 ... ?

ComfortViewFactorAngles,
       \memo Used to specify radiant view factors for thermal comfort calculations.
       \memo Note that the following angle factor fractions must sum up to 1.0
       \memo The number of surfaces can be expanded beyond 100, if necessary, by adding more
       \memo groups to the end of the list.
       \extensible:2
  A1 , \field Name
       \type alpha
       \reference AllHeatTranAngFacNames
       \object-list ZoneNames <--------------------------- ?
  A3 , \field Surface 1 Name
       \type object-list
       \object-list AllHeatTranSurfNames
       \begin-extensible
  N1 ; \field Angle Factor 1
       \type real
       \minimum 0.0
       \maximum 1.0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Version translation loses existing targets, and the wrapper omits valid target types while permitting inconsistent MRT state.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds model and EnergyPlus translation support for ComfortViewFactorAngles and related People MRT calculation modes.

Changes:

  • Adds the new model object and bindings.
  • Implements forward/reverse translation and tests.
  • Moves the MRT target field to PeopleDefinition with version translation.
File summaries
File Description
src/osversion/VersionTranslator.cpp Migrates People fields to 3.12.
src/osversion/test/VersionTranslator_GTest.cpp Tests People migration.
src/osversion/test/3_12_0/test_vt_People.rb Generates migration fixture.
src/osversion/test/3_12_0/test_vt_People.osm Provides 3.11 fixture data.
src/model/test/People_GTest.cpp Tests new PeopleDefinition API.
src/model/test/ComfortViewFactorAngles_GTest.cpp Tests angle-factor behavior.
src/model/PeopleDefinition.hpp Exposes MRT target API.
src/model/PeopleDefinition.cpp Implements MRT target handling.
src/model/PeopleDefinition_Impl.hpp Declares internal target methods.
src/model/People_Impl.hpp Removes obsolete TODO.
src/model/ModelGeometry.i Adds bindings.
src/model/Model.cpp Registers model constructors.
src/model/ConcreteModelObjects.hpp Includes new model types.
src/model/ComfortViewFactorAngles.hpp Defines the public model API.
src/model/ComfortViewFactorAngles.cpp Implements angle-factor logic.
src/model/ComfortViewFactorAngles_Impl.hpp Defines internal implementation API.
src/model/CMakeLists.txt Builds model sources and tests.
src/energyplus/Test/People_GTest.cpp Tests People translation modes.
src/energyplus/Test/ComfortViewFactorAngles_GTest.cpp Tests object translation.
src/energyplus/ReverseTranslator/ReverseTranslatePeople.cpp Imports MRT targets.
src/energyplus/ReverseTranslator/ReverseTranslateComfortViewFactorAngles.cpp Imports angle-factor lists.
src/energyplus/ReverseTranslator.hpp Declares reverse translation.
src/energyplus/ReverseTranslator.cpp Dispatches reverse translation.
src/energyplus/ForwardTranslator/ForwardTranslatePeople.cpp Exports People MRT settings.
src/energyplus/ForwardTranslator/ForwardTranslateComfortViewFactorAngles.cpp Exports angle-factor lists.
src/energyplus/ForwardTranslator.hpp Declares forward translation.
src/energyplus/ForwardTranslator.cpp Dispatches forward translation.
src/energyplus/CMakeLists.txt Builds translator sources and tests.
resources/model/OpenStudio.idd Adds and relocates model fields.
resources/energyplus/ProposedEnergy+.idd Updates the EnergyPlus schema.
Review details

Suppressed comments (1)

src/model/PeopleDefinition.cpp:286

  • This rejects valid direct targets supported by EnergyPlus. Surface Name/Angle Factor List Name uses AllHeatTranAngFacNames, which includes fenestration and internal-mass objects as well as base surfaces and angle-factor lists (see resources/energyplus/ProposedEnergy+.idd:7191-7193,8022-8023,11971-11973). Consequently reverse translation silently loses a valid SubSurface or InternalMass target. Support the full target set rather than only Surface and ComfortViewFactorAngles.
      if (modelObject.optionalCast<Surface>()) {
        mrtType = "SurfaceWeighted";
      } else if (modelObject.optionalCast<ComfortViewFactorAngles>()) {
        mrtType = "AngleFactor";
      } else {
        LOG(Error, "Surface Name/Angle Factor List Name must reference a Surface or ComfortViewFactorAngles object.");
  • Files reviewed: 30/30 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +10347 to +10348
} else if (i > 6) {
newObject.setString(i - 1, value.get());

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.

Comment thread resources/model/OpenStudio.idd Outdated
\reference AllHeatTranAngFacNames
A3, \field Surface 1 Name
\type object-list
\object-list SurfaceNames

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.

Comment thread src/model/ComfortViewFactorAngles.cpp Outdated
Comment on lines +263 to +264
if (result && istringEqual(mrtType, "EnclosureAveraged")) {
resetSurfaceNameAngleFactorListName();

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.

@jmarrec

jmarrec commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Moves (previously unused) "Surface Name/Angle Factor List Name" from People to People:Definition

Why? I think the specific surfaces are instance specific rather than definition-level, don't you?

(Note: I didn't review the changes yet as I'm on a mobile device)


As far as the IDD inconsistencies, that should be fixed upstream on EnergyPlus with a quick PR

Base automatically changed from v26.2.0-IOFreeze-ZoneMRTCalc to develop September 10, 2026 08:44
Require a name, declare the minimum field count, and document the enclosure requirement for referenced surfaces.
Validate surface space and thermal-zone assignments before adding angle factors, reject cross-zone lists, and align extensible-group update handling with ZoneMRTCalculation.
Revalidate every referenced surface's thermal zone before generating the EnergyPlus object and cover stale surface assignments in the forward-translator tests.
Reject non-finite angle factors and clear the MRT target when resetting the calculation type, with model regression coverage.
Move unambiguous 3.11 People MRT targets to PeopleDefinition during version translation, report shared-definition conflicts, and cover the migrated surface target.
Accept Surface, SubSurface, and InternalMass targets from AllHeatTranSurfNames, preserve same-zone validation, and cover model and EnergyPlus translation behavior.
@jmarrec
jmarrec force-pushed the comfort-view-factor-angles branch from 0b23e76 to f940f2e Compare September 10, 2026 08:45
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Results Dashboard

Summary

Metric Value
Total Tests 0
Passed 0
Failed 0
Errors 0
Skipped 0
Success Rate 0.0%
Generated 2026-09-10 08:45:36 UTC

❌ Significant Test Failures

📊 Test Run Information

Run XML File Status
- No XML files found ❌ Missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IDDChange 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.

Wrap ComfortViewFactorAngles

3 participants