-
Notifications
You must be signed in to change notification settings - Fork 67
docs: updated the session file [skip tests] #5005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
c8832f9
042f7d4
564ade0
790f27d
1e41abd
6ad26f0
feabe97
d226da5
e96b6be
2b5d183
458c256
4401436
40fefcb
71ebf22
f9da2b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Updated the session file | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,17 +5,27 @@ | |||||
| Using PyFluent sessions | ||||||
| ======================= | ||||||
|
|
||||||
| You can obtain a PyFluent session object by calling either of the functions, :func:`launch_fluent() | ||||||
| <ansys.fluent.core.launcher.launcher.launch_fluent>` or :func:`connect_to_fluent() <ansys.fluent.core.launcher.launcher.connect_to_fluent>`. | ||||||
| The encouraged way to create a PyFluent session is to use the ``from_<...>`` class methods on a session type, for | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Alternatively, we could omit that clause and launch straight into "Create a PyFluent session using the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted. |
||||||
| example :meth:`Solver.from_install() <ansys.fluent.core.session_utilities.SessionBase.from_install>`, | ||||||
| :meth:`Solver.from_container() <ansys.fluent.core.session_utilities.SessionBase.from_container>`, | ||||||
| :meth:`Solver.from_connection() <ansys.fluent.core.session_utilities.SessionBase.from_connection>`, or | ||||||
| :meth:`Solver.from_pim() <ansys.fluent.core.session_utilities.SessionBase.from_pim>`. | ||||||
| For full details see :ref:`ref_launch_guide`. | ||||||
|
mayankansys marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| For example, to launch a solver session from a local Fluent installation: | ||||||
|
|
||||||
| .. code:: python | ||||||
|
|
||||||
| >>> import ansys.fluent.core as pyfluent | ||||||
| >>> from ansys.fluent.core.examples import download_file | ||||||
| >>> case_file_name = download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow") | ||||||
| >>> data_file_name = download_file("mixing_elbow.dat.h5", "pyfluent/mixing_elbow") | ||||||
| >>> solver_session = pyfluent.launch_fluent(case_data_file_name=case_file_name) | ||||||
| >>> solver_session = pyfluent.Solver.from_install(case_file_name=case_file_name) | ||||||
|
|
||||||
| .. note:: | ||||||
|
|
||||||
| You can also use the lower-level :func:`launch_fluent() <ansys.fluent.core.launcher.launcher.launch_fluent>` | ||||||
| and :func:`connect_to_fluent() <ansys.fluent.core.launcher.launcher.connect_to_fluent>` functions, | ||||||
| but the ``from_<...>`` class methods are recommended for new code. | ||||||
|
|
||||||
|
|
||||||
| Solution mode sessions | ||||||
|
|
@@ -51,7 +61,7 @@ session that starts a second Fluent instance and is independent of your PyFluent | |||||
| .. code:: python | ||||||
|
|
||||||
| >>> import ansys.fluent.core as pyfluent | ||||||
| >>> meshing_session = pyfluent.launch_fluent(mode=pyfluent.FluentMode.MESHING) | ||||||
| >>> meshing_session = pyfluent.Meshing.from_install() | ||||||
|
|
||||||
|
|
||||||
| A uniform interface exists across solver settings objects. For instance, | ||||||
|
|
@@ -165,7 +175,7 @@ You can also create a :obj:`~ansys.fluent.core.session_pure_meshing.PureMeshing` | |||||
| .. code:: python | ||||||
|
|
||||||
| >>> import ansys.fluent.core as pyfluent | ||||||
| >>> pure_meshing = pyfluent.launch_fluent(mode=pyfluent.FluentMode.PURE_MESHING) | ||||||
| >>> pure_meshing = pyfluent.PureMeshing.from_install() | ||||||
|
|
||||||
|
|
||||||
| The only difference between the two meshing session types is that a pure session cannot be | ||||||
|
|
@@ -208,8 +218,8 @@ within its intended scope: | |||||
| >>> from ansys.fluent.core.examples import download_file | ||||||
| >>> from ansys.fluent.core import using | ||||||
| >>> from ansys.fluent.core.solver import ReadCase, Viscous | ||||||
| >>> solver_session_1 = pyfluent.launch_fluent() | ||||||
| >>> solver_session_2 = pyfluent.launch_fluent() | ||||||
| >>> solver_session_1 = pyfluent.Solver.from_install() | ||||||
| >>> solver_session_2 = pyfluent.Solver.from_install() | ||||||
| >>> case_file = download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow") | ||||||
| >>> with using(solver_session_1): | ||||||
| ... ReadCase()(file_name=case_file) | ||||||
|
|
@@ -295,9 +305,12 @@ each session can be ended independently of the others. Calling the ``exit()`` me | |||||
|
|
||||||
|
|
||||||
| 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. | ||||||
|
Comment on lines
307
to
+313
|
||||||
|
|
||||||
| Session exiting can also happen implicitly when :ref:`Session <ref_session_guide>` objects are garbage collected. The same rules apply | ||||||
| regarding Fluent termination whether the exit is explicit via an ``<session>.exit()`` method call or implicit. | ||||||
|
|
@@ -308,7 +321,7 @@ being garbage collected: | |||||
| .. code:: python | ||||||
|
|
||||||
| >>> def run_solver(): | ||||||
| >>> solver_session = pyfluent.launch_fluent() | ||||||
| >>> solver_session = pyfluent.Solver.from_install() | ||||||
| >>> # <insert some PyFluent solver actions> | ||||||
| >>> # solver is exited at the end of the function | ||||||
|
mayankansys marked this conversation as resolved.
|
||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changelog entry is too vague to be useful in release notes. Please describe the user-visible documentation change more specifically (e.g., that session guide examples now use
<session>.from_install()/from_container()/from_connection()rather thanlaunch_fluent()), ideally as a complete sentence with a period to match nearby entries.