fix: Boolean to Allowed Strings [skip tests] - #5213
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
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 = Truewithimpeller_hub.relative = "Relative to Adjacent Cell Zone". - Replaced
inblock_shroud.relative = Falsewithinblock_shroud.relative = "Absolute".
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@abhishekchitwar, did you check for backwards-compatibility? |
…s/pyfluent into fix/frozen_rotor_workflow
…s/pyfluent into fix/frozen_rotor_workflow
Added note regarding recommendation to run the example with Ansys Fluent Version 2026R1.
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. |
…s/pyfluent into fix/frozen_rotor_workflow
updated the clear message regarding supported versions.
Context
The existing implementation of wall motion used Boolean values (True/False) for the relative attribute in boundary condition setup:
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.