Skip to content

fix: Boolean to Allowed Strings [skip tests] - #5213

Merged
abhishekchitwar merged 14 commits into
mainfrom
fix/frozen_rotor_workflow
Jul 1, 2026
Merged

fix: Boolean to Allowed Strings [skip tests]#5213
abhishekchitwar merged 14 commits into
mainfrom
fix/frozen_rotor_workflow

Conversation

@abhishekchitwar

Copy link
Copy Markdown
Collaborator

Context

The existing implementation of wall motion used Boolean values (True/False) for the relative attribute in boundary condition setup:

impeller_hub.relative = True
inblock_shroud.relative = False

However, this approach does not align with the latest PyFluent API design. The relative field is not a Boolean, but a string-based setting with restricted allowed values. Using Booleans obscures the intended reference frame selection and can lead to incorrect or ambiguous physical interpretation in MRF/Frozen Rotor simulations.

Change Summary

Updated the relative attribute from Boolean values to their corresponding explicit API options "Define wall motion relative to adjacent cell zone."

["Relative to Adjacent Cell Zone", "Absolute"]

Rationale

The update aligns with the latest PyFluent API specification, where:

relative is defined as a String with AllowedValuesMixin
Valid values include:

"Relative to Adjacent Cell Zone"
"Absolute"

Reference: https://fluent.docs.pyansys.com/version/stable/api/solver/_autosummary/settings/relative.html#relative

Impact

✅ Removes ambiguity introduced by Boolean mapping, earlier not transparent.
✅ Makes the code consistent with Fluent GUI terminology.
✅ Improves readability and maintainability.
✅ Prevents incorrect interpretation of reference frames in rotating machinery simulations.

@github-actions github-actions Bot added documentation Documentation related (improving, adding, etc) examples Publishing PyFluent examples labels Jun 24, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@abhishekchitwar abhishekchitwar linked an issue Jun 24, 2026 that may be closed by this pull request

Copilot AI left a comment

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.

Pull request overview

This PR updates the frozen-rotor example to match the current PyFluent settings API by replacing boolean wall-motion relative assignments with explicit allowed string values, making the reference-frame intent unambiguous.

Changes:

  • Replaced impeller_hub.relative = True with impeller_hub.relative = "Relative to Adjacent Cell Zone".
  • Replaced inblock_shroud.relative = False with inblock_shroud.relative = "Absolute".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@prmukherj prmukherj changed the title [Fix] Boolean to Allowed Strings fix: Boolean to Allowed Strings Jun 24, 2026
@github-actions github-actions Bot added the bug Issue, problem or error in PyFluent label Jun 24, 2026
@prmukherj

Copy link
Copy Markdown
Collaborator

@abhishekchitwar, did you check for backwards-compatibility?

@prmukherj prmukherj changed the title fix: Boolean to Allowed Strings fix: Boolean to Allowed Strings [skip tests] Jun 24, 2026
@abhishekchitwar

Copy link
Copy Markdown
Collaborator Author

@abhishekchitwar, did you check for backwards-compatibility?

Verified for backward compatibility with version 2024 R2. The concerned API functions correctly without issues.

However, the momentum boundary condition lacks the velocity_spec attribute, which was introduced in later versions. Additionally, there are some API signature changes, particularly related to the turbo mesh interface.

Kindly note that the example runs with versions 2025 R2 and 2026 R2, as expected with the updates mentioned with PR.

A note has been added to the example to inform users accordingly.

Comment thread examples/00-fluent/frozen_rotor_workflow.py Outdated
updated the clear message regarding supported versions.
@abhishekchitwar
abhishekchitwar merged commit 00ec59f into main Jul 1, 2026
36 checks passed
@abhishekchitwar
abhishekchitwar deleted the fix/frozen_rotor_workflow branch July 1, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue, problem or error in PyFluent documentation Documentation related (improving, adding, etc) examples Publishing PyFluent examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frozen_rotor_workflow incorrect boolean assignment

6 participants