Skip to content

[BUG]: AttributeError when setting solver.settings.setup.models.turbulence.modelΒ #5277

Description

@cj-hodgson

βœ… Before submitting

  • I have searched the existing issues and did not find a duplicate.
  • I am using a Python virtual environment.
  • I have confirmed this is a PyFluent issue, not a problem with Ansys Fluent. See the posting issues guide.

πŸ“ Description of the bug

When I call solver.settings.setup.models.turbulence, an AttributeError is raised. This does not occur in Fluent Python console.

πŸ” Steps to reproduce

import ansys.fluent.core as pyfluent
from ansys.fluent.core.examples.downloads import download_file
solver = pyfluent.launch_fluent()
case_name = download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow")
solver.settings.file.read(file_type="case", file_name=case_name)
solver.settings.setup.models.turbulence.model = 'k-epsilon'

🎯 Expected behavior

The turbulence model should be set

πŸ’₯ Actual behavior / traceback

Traceback (most recent call last):
  File "<python-input-0>", line 13, in <module>
    solver.settings.setup.models.turbulence.model = 'k-epsilon'
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ansysdev\.pyansys_v271\Lib\site-packages\ansys\fluent\core\solver\flobject.py", line 1338, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'models' object has no attribute 'turbulence'.
The most similar names are: structure

πŸ“¦ PyFluent version

0.40.2

πŸŒ€ Ansys Fluent version

2027 R1 (27.1)

🐍 Python version

3.13

πŸ’» Operating system

Windows

πŸ“Œ Additional context

No response

Metadata

Metadata

Assignees

Labels

bugIssue, problem or error in PyFluent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions