Skip to content

Conversation

Gobot1234
Copy link
Collaborator

Definitely needs testing cause it was a big find and replace job

Comment on lines 560 to 566
###############################################################################
# Confirm and update boundaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.

meshing_session.workflow.TaskObject["Update Boundaries"].Execute()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
###############################################################################
# Confirm and update boundaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.
meshing_session.workflow.TaskObject["Update Boundaries"].Execute()

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.

meshing_session.workflow.TaskObject["Update Boundaries"].Execute()
Copy link
Collaborator Author

@Gobot1234 Gobot1234 Oct 6, 2025

Choose a reason for hiding this comment

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

This looked sus (moving the code around)

Suggested change
meshing_session.workflow.TaskObject["Update Boundaries"].Execute()
###############################################################################
# Confirm and update boundaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Confirm and update the boundaries.
meshing_session.workflow.TaskObject["Update Boundaries"].Execute()


pyfluent.config.print_search_results = False
results = pyfluent.search("local*", api_path="<solver_session>.setup")
results = pyfluent.search("local*", api_path="<solver_session>.setup.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
results = pyfluent.search("local*", api_path="<solver_session>.setup.")
results = pyfluent.search("local*", api_path="<solver_session>.setup")

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 09:52
Copy link
Contributor

@Copilot Copilot AI left a comment

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 fixes access to solver session settings throughout the test suite and examples. The changes update all references from direct access patterns (e.g., solver.setup.models) to the correct settings-based access pattern (e.g., solver.settings.setup.models). This is a comprehensive update ensuring consistent API usage across the entire codebase.

  • Updates solver session settings access pattern in tests and examples
  • Adds missing .settings prefix to all solver session attribute access
  • Minor formatting improvements and code cleanup

Reviewed Changes

Copilot reviewed 69 out of 70 changed files in this pull request and generated 6 comments.

File Description
tests/*.py Updated solver session settings access to use .settings prefix
examples/*.py Updated solver session settings access pattern in all examples
src/ansys/fluent/core/*.py Updated settings access in core modules
doc/source/*.rst Updated documentation examples to use correct settings API

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

solver.fields.reduction.area(
locations=[solver.setup.boundary_conditions.velocity_inlet]
locations=[
solver.settings.setup.gs.setup.boundary_conditions.velocity_inlet
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

There's an incorrect duplicate 'setup' path segment in this line. Should be solver.settings.setup.boundary_conditions.velocity_inlet instead of solver.settings.setup.gs.setup.boundary_conditions.velocity_inlet.

Suggested change
solver.settings.setup.gs.setup.boundary_conditions.velocity_inlet
solver.settings.setup.boundary_conditions.velocity_inlet

Copilot uses AI. Check for mistakes.

def test_parameters_list_function(static_mixer_settings_session):
solver = static_mixer_settings_session
solver.tui.define.parameters.enable_in_TUI("yes")
solver.tui.define.settings.parameters.enable_in_TUI("yes")
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The TUI path is incorrect. It should be solver.tui.define.parameters.enable_in_TUI("yes") without the .settings segment, as TUI commands don't use the settings API.

Suggested change
solver.tui.define.settings.parameters.enable_in_TUI("yes")
solver.tui.define.parameters.enable_in_TUI("yes")

Copilot uses AI. Check for mistakes.

outlet_vel_avg.surface_names = ["outlet"]

create_output_param = solver.tui.define.parameters.output_parameters.create
create_output_param = solver.tui.define.settings.parameters.output_parameters.create
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The TUI path is incorrect. It should be solver.tui.define.parameters.output_parameters.create without the .settings segment, as TUI commands don't use the settings API.

Suggested change
create_output_param = solver.tui.define.settings.parameters.output_parameters.create
create_output_param = solver.tui.define.parameters.output_parameters.create

Copilot uses AI. Check for mistakes.

def test_parameters_list_function(static_mixer_settings_session):
solver = static_mixer_settings_session
solver.tui.define.parameters.enable_in_TUI("yes")
solver.tui.define.settings.parameters.enable_in_TUI("yes")
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The TUI path is incorrect. It should be solver.tui.define.parameters.enable_in_TUI("yes") without the .settings segment, as TUI commands don't use the settings API.

Suggested change
solver.tui.define.settings.parameters.enable_in_TUI("yes")
solver.tui.define.parameters.enable_in_TUI("yes")

Copilot uses AI. Check for mistakes.

outlet_vel_avg.surface_names = ["outlet"]

create_output_param = solver.tui.define.parameters.output_parameters.create
create_output_param = solver.tui.define.settings.parameters.output_parameters.create
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The TUI path is incorrect. It should be solver.tui.define.parameters.output_parameters.create without the .settings segment, as TUI commands don't use the settings API.

Suggested change
create_output_param = solver.tui.define.settings.parameters.output_parameters.create
create_output_param = solver.tui.define.parameters.output_parameters.create

Copilot uses AI. Check for mistakes.

@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 16:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 68 out of 69 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

solver.solution.initialization.hybrid_initialize()
# After reading the static-mixer case in Fluent, case-modified? flag is somehow True
solver.settings.solution.initialization.hybrid_initialize()
# After reading the static-mixer case in Fluent, case-modifed? flag is somehow True
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'modifed' to 'modified'.

Suggested change
# After reading the static-mixer case in Fluent, case-modifed? flag is somehow True
# After reading the static-mixer case in Fluent, case-modified? flag is somehow True

Copilot uses AI. Check for mistakes.

solver_session = pyfluent.launch_fluent(
dimension=3,
precision="double",
processor_count=4,
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The removed dimension=3 parameter should be restored as it explicitly specifies the 3D solver mode for this ablation modeling example.

Suggested change
processor_count=4,
processor_count=4,
dimension=3,

Copilot uses AI. Check for mistakes.

# ---------------------------------------------------------------

session = pyfluent.launch_fluent(precision="double", processor_count=2, version="3d")
session = pyfluent.launch_fluent(precision="double", processor_count=2, dimension=3)
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The parameter name has been changed from 'version' to 'dimension', but the comment on line 74 still mentions 'version'. Consider updating the comment to reflect the correct parameter name.

Copilot uses AI. Check for mistakes.

mode="meshing",
dimension=3,
precision="double",
processor_count=4,
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The removed dimension=3 parameter should be restored as it's needed to specify 3D meshing mode for this conjugate heat transfer example.

Suggested change
processor_count=4,
processor_count=4,
dimension=3,

Copilot uses AI. Check for mistakes.

)

meshing_session.upload(wing_intermediary_file)
geo_import.Execute()
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The removed line 'meshing_session.upload(wing_intermediary_file)' should be restored as it's needed to upload the geometry file before executing the import operation.

Copilot uses AI. Check for mistakes.

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Import the CAD geometry file (``exhaust_system.fmd``) and selectively manage some
# parts.

Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The removed line 'meshing_session.upload(import_file_name)' should be restored as it's needed to upload the CAD file before calling InputFileChanged.

Suggested change
meshing_session.upload(import_file_name)

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants