Skip to content

docs: updated the session file#5005

Draft
mayankansys wants to merge 2 commits intomainfrom
docs/session_rst_out_dated_4945
Draft

docs: updated the session file#5005
mayankansys wants to merge 2 commits intomainfrom
docs/session_rst_out_dated_4945

Conversation

@mayankansys
Copy link
Collaborator

Context

The session user guide was outdated.

It still showed launch_fluent() as the main way to create sessions, while the recommended style is now <session-type>.from_<...>(...).

Change Summary

  • Updated the session documentation to use the newer session creation style in examples and explanations.
  • Also fixed related wording in the session exit section so it matches current API behavior.
  • Changes were made in session.rst.

Rationale

  • This keeps the docs aligned with current best practice and reduces confusion for new users.
  • Users now see the recommended API first, with older lower-level functions shown as alternatives.

Impact

Affects user-facing documentation only.

Copilot AI review requested due to automatic review settings March 20, 2026 06:42
@mayankansys mayankansys marked this pull request as draft March 20, 2026 06:42
@github-actions github-actions bot added the documentation Documentation related (improving, adding, etc) label Mar 20, 2026
@mayankansys mayankansys changed the title updated the session file docs: updated the session file Mar 20, 2026
Copy link
Contributor

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

Updates the PyFluent “Using sessions” user guide to reflect the recommended session-creation pattern (<session-type>.from_<...>(...)) rather than primarily documenting launch_fluent().

Changes:

  • Replaced launch_fluent()-based examples with Solver/Meshing/PureMeshing.from_install() examples.
  • Added guidance that launch_fluent() / connect_to_fluent() are lower-level alternatives and clarified exit/cleanup behavior.
  • Updated multi-session and garbage-collection examples to use the newer APIs.

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

Comment on lines 307 to +313
Each Fluent session terminates in this scenario because both PyFluent :ref:`Session <ref_session_guide>` objects were obtained by
calling the :func:`launch_fluent() <ansys.fluent.core.launcher.launcher.launch_fluent>` function. If the :func:`connect_to_fluent() <ansys.fluent.core.launcher.launcher.connect_to_fluent>` function were used instead, the
Fluent session would terminate upon the ``exit()`` method call if and only if the :func:`connect_to_fluent() <ansys.fluent.core.launcher.launcher.connect_to_fluent>`
function were called with the argument value ``cleanup_on_exit=True``.
using a ``from_<...>`` launch method (for example, :meth:`from_install() <ansys.fluent.core.session_utilities.SessionBase.from_install>`).
If :meth:`from_connection() <ansys.fluent.core.session_utilities.SessionBase.from_connection>` were used instead, the
Fluent session would not be terminated upon ``exit()`` by default.
For configurable cleanup behavior when attaching to an existing Fluent process,
use :func:`connect_to_fluent() <ansys.fluent.core.launcher.launcher.connect_to_fluent>`
directly with its ``cleanup_on_exit`` parameter.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This paragraph clarifies that from_connection() / connect_to_fluent() (default cleanup_on_exit=False) won’t terminate Fluent on exit(), but the preceding sentence in this section still states that calling exit() terminates the connected Fluent sessions. Consider adjusting that earlier sentence to avoid implying termination is unconditional, and instead describe termination as dependent on cleanup_on_exit / launch method.

Copilot uses AI. Check for mistakes.
Comment on lines +324 to 326
>>> solver_session = pyfluent.Solver.from_install()
>>> # <insert some PyFluent solver actions>
>>> # solver is exited at the end of the function
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

In this interactive prompt-style example, the indented lines inside def run_solver(): should use the continuation prompt (...) rather than >>>. As written, this won’t reflect valid REPL input; update the prompts/indentation (or switch to a non-interactive .. code-block:: python example).

Suggested change
>>> solver_session = pyfluent.Solver.from_install()
>>> # <insert some PyFluent solver actions>
>>> # solver is exited at the end of the function
... solver_session = pyfluent.Solver.from_install()
... # <insert some PyFluent solver actions>
... # solver is exited at the end of the function

Copilot uses AI. Check for mistakes.
@mayankansys mayankansys linked an issue Mar 20, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation related (improving, adding, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session.rst is out of date wrt session creation

3 participants