Conversation
There was a problem hiding this comment.
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 withSolver/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.
| 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. |
There was a problem hiding this comment.
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.
| >>> solver_session = pyfluent.Solver.from_install() | ||
| >>> # <insert some PyFluent solver actions> | ||
| >>> # solver is exited at the end of the function |
There was a problem hiding this comment.
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).
| >>> 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 |
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
session.rst.Rationale
Impact
Affects user-facing documentation only.