Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/5373.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content updated
217 changes: 12 additions & 205 deletions doc/source/getting_started/faqs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,213 +3,28 @@
Frequently asked questions
==========================

What is PyAnsys?
----------------
PyAnsys is a set of open source technologies that allow you to interface with Ansys
Fluent, Mechanical APDL, AEDT, and other Ansys products via Python. You can use PyAnsys
libraries within a Python environment of your choice in conjunction with external Python
libraries.

.. image:: ../_static/PyAnsys_overview.png
:width: 800
:alt: PyAnsys overview

What is PyFluent?
-----------------
PyFluent provides Python access to Ansys Fluent. Its features enable the seamless use of
Fluent within the Python ecosystem and broad access to native Fluent features for performing
actions such as these:

- Launch Fluent using a local Ansys installation.
- Connect to a Fluent instance running on a remote machine.
- TODO

PyFluent is bundled with the Fluent installation. You can also download and install PyFluent
separately. For more information, see :ref:`faqs_install`, which appears later on this page.

PyFluent has no GUI (graphical user interface). You interact with PyFluent through the Python
environment of your choice.

How does PyFluent compare to Fluent user defined functions?
-----------------------------------------------------------
PyFluent is conceptually aligned with Fluent TUI console commands and
journaling rather than with user defined functions (UDFs). In other words,
PyFluent is primarily used for automation rather than modifying the solver
behavior.

UDFs continue to be written in C and remain important elements of Fluent
simulations.

While you cannot write UDFs in Python, you can execute PyFluent commands to
compile and load UDFs, similar to how you use TUI commands.

Who should use PyFluent?
------------------------
PyFluent users include engineers, product designers, consultants, and academia.

.. image:: ../_static/who_why_use_PyFluent.png
:width: 800
:alt: PyFluent users and objectives


- Enhance productivity with customized scripts.
- Automate multi-product workflows.
- Extend CFD simulations to a wider audience by creating vertical apps.
- Create comprehensive workflows inspired by Python's increasingly broad offerings
in these areas of scientific computing:

- Computer vision
- ML (machine learning)
- AI (artificial intelligence)
- Data processing and visualization
- Optimization

- Use widely accepted libraries and notations to compute
multi-dimensional arrays in the Python environment.


.. image:: ../_static/libraries_notations.png
:width: 800
:alt: Widely accepted libraries and notations


What can you do with PyFluent?
------------------------------
You can use PyFluent to do tasks such as these:

- Integrate Fluent as a solver seamlessly in your in-house design tools.
- Customize postprocessing, perhaps by using Python's vast external library to
extend postprocessing capabilities or by automatically generating a PowerPoint
presentation to show simulation results.
- Use a web app to access jobs running on a cluster, monitor convergence, and
generate graphs.
- Leverage Python machine learning and artificial intelligence modules,
especially for models that are solved quickly but can be improved as
additional knowledge is acquired and applied.
- Use Python to couple different Ansys products together.


Which version of Python should you use?
---------------------------------------
PyFluent supports Python 3.10 through Python 3.14 on Windows and Linux. Python
3.10 is shipped with Ansys 2024 R2 and later. For example, in a 2025 R2 Windows
installation, the executable file Python 3.10 is typically located at:
``C:\Program Files\ANSYS Inc\v252\commonfiles\CPython\3_10\winx64\Release\python.exe``.
If you're using Python from Ansys installation, make sure to install PyFluent
within a Python virtual environment to prevent any possible conflicts with
Ansys Python packages.

Alternatively, you can download any compatible version of Python directly from
the `Downloads page <https://www.python.org/downloads/>`_ of the Python web
site.

In either case, run the Python executable file as an administrator, selecting
the **Add Python 3.10 to PATH** checkbox on the first wizard page before
proceeding with the installation. On the last wizard page, which indicates that
Python is installed successfully, follow the instructions for disabling the path
length limit if you have long file paths.

Where do you find source code and documentation?
------------------------------------------------
All PyAnsys public libraries are available from the `PyAnsys GitHub account
<https://github.com/pyansys>`_. The **Repositories** page displays the number of
repositories, which are searchable by name. For example, to find all PyFluent
libraries, type ``pyfluent`` in the search option.

The ``README.md`` file for the PyAnsys GitHub account lists the public PyAnsys
libraries. The links in this list are to the documentation for the respective
libraries. In addition to general usage information, the documentation for a
library includes many practical examples.

How do you launch Fluent using PyFluent?
----------------------------------------
To launch Fluent with PyFluent commands, use this code:

.. code:: python

import ansys.fluent.core as pyfluent
session=pyfluent.launch_fluent()


This example shows you how to launch a double precision Fluent session using two
processors and activate the Fluent user interface:

.. code:: python

session=pyfluent.launch_fluent(precision=pyfluent.Precision.DOUBLE, processor_count=2, ui_mode="gui")


For additional launch examples, see :ref:`ref_launch_guide`. For
descriptions of all parameters, see the :func:`launch_fluent()
<ansys.fluent.core.launcher.launcher.launch_fluent>` function.

.. _faqs_fluentloc:

How does PyFluent infer the location to launch Fluent?
------------------------------------------------------
PyFluent infers the Fluent location based on the following information, in
increasing order of precedence:

#. Value of ``product_version`` parameter passed to the :func:`launch_fluent() <ansys.fluent.core.launch_fluent>` function.

#. ``AWP_ROOT<ver>`` environment variable, which is configured on Windows system
when Fluent is installed, where ``<ver>`` is the Fluent release number such
as ``251`` for release 2025 R1. PyFluent automatically uses this environment
variable to locate the latest Fluent installation. On Linux systems configure
``AWP_ROOT<ver>`` to point to the absolute path of an Ansys installation such
as ``/apps/ansys_inc/v251``.


How do you disable PyFluent warnings shown in the console?
----------------------------------------------------------
.. code:: python

import ansys.fluent.core as pyfluent
pyfluent.set_console_logging_level("ERROR") # Disable all warning logs
pyfluent.warning.disable() # Disable all warning messages
-------------------------------------------------------------
PyFluent automates workflows rather than modifying solver behavior. UDFs, written in C,
remain important for customizing solver behavior. You cannot write UDFs in Python, but you
can use PyFluent's `solver settings objects <https://fluent.docs.pyansys.com/version/dev/user_guide/solver_settings/solver_settings_contents.html>`_ to compile and load them.


How do you learn how to use PyFluent?
-------------------------------------
Depending on how you prefer to learn, you can use any or all of these methods to
learn how to use PyFluent:

- Review the examples in the documentation, working first through those provided
in the :ref:`ref_example_gallery`, then, through those provided in the
**Examples** sections in the `PyFluent-Parametric
<https://parametric.fluent.docs.pyansys.com/>`_ and `PyFluent-Visusalization
<https://visualization.fluent.docs.pyansys.com/>`_ guides.
**Examples** sections in the `PyFluent-Visualization
<https://visualization.fluent.docs.pyansys.com/>`_ guide.
- Record a journal of your actions in Fluent and review the corresponding Python
script.
script. For comprehensive guidance on journaling, see
:ref:`ref_journal`.
- Write scripts, using:

.. note::
In Fluent 2024 R2 or later, you can record a journal of your actions in Fluent
meshing to produce a Scheme script. Within that script are embedded
Python statements corresponding to each recorded meshing workflow
action. When extracted from the Scheme script, those Python statements
are valid in the PyFluent context.


Here is a Python command recorded in Fluent:

.. code:: python

(%py-exec "workflow.TaskObject['Describe Geometry and Flow'].Arguments.setState({r'AddEnclosure': r'No',r'CloseCaps': r'Yes',r'FlowType': r'Internal flow through the object',})")


Here is the manually translated equivalent command in PyFluent syntax:

.. code:: python

session.meshing.workflow.TaskObject['Describe Geometry and Flow'].Arguments.setState(({r'AddEnclosure': r'No',r'CloseCaps': r'Yes',r'FlowType': r'Internal flow through the object’,})


- Write scripts, using capabilities such as these:

- IntelliSense to show available options for any given command. For example,
in `JupyterLab <https://jupyter.org/>`_, press the tab key.
- Standard Python or PyAnsys tooling to print options related to a specified
object. For example, use ``dir (<object>)`` or ``help (<object>)``.
- Autocompletion features in your Python environment or IDE to show available options
for any given command. For example, in `JupyterLab <https://jupyter.org/>`_, press the
tab key.


How to set up JupyterLab to get a better code completion for the API code in PyFluent?
Expand All @@ -225,14 +40,6 @@ along with a Python language server like
within your JupyterLab environment .


How do you get help for PyFluent?
---------------------------------
Because PyFluent libraries are open source, support for issues, bugs, and
feature requests are available in their respective GitHub repositories.

- To log an issue for PyFluent, use the `PyFluent Issues page <https://github.com/ansys/pyfluent/issues>`_.
- To start a discussion, use the `PyFluent Discussions page <https://github.com/ansys/pyfluent/discussions>`_.

For discussions about developer tools, engineering simulation, and physics for
Ansys software, visit the `Ansys Developer portal
<https://developer.ansys.com/>`_. The `Ansys Discuss
Expand Down
83 changes: 7 additions & 76 deletions doc/source/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,92 +51,23 @@ Then, install PyFluent in the virtual environment with:

Development Installation
------------------------
The PyFluent source repository is available on GitHub. You can clone the repository and set up for local
development with the following commands:
The PyFluent source repository is available on GitHub. Clone it and set up a virtual
environment as described above, then install PyFluent in editable mode:

.. code:: console

git clone https://github.com/ansys/pyfluent.git
cd pyfluent

Use the following commands to create and activate a virtual environment:

.. code:: console

python -m venv .venv


On Windows:

.. code:: console

.venv\Scripts\activate


On Linux and Mac OS:

.. code:: console

source .venv/bin/activate


Then, install PyFluent within the virtual environment in editable mode with:

.. code:: console

pip install pip -U
pip install -e .
python codegen/allapigen.py # Generates the API files or
python codegen/allapigen.py -v # Pass -v or --verbose to display the paths of the generated API files

Step-by-step explanation
~~~~~~~~~~~~~~~~~~~~~~~~

Clone the repository
++++++++++++++++++++

.. code:: console

git clone https://github.com/ansys/pyfluent.git
cd pyfluent

These commands clone the PyFluent repository from GitHub to your local machine and navigate into
the repository directory.

Upgrade pip
+++++++++++

.. code:: console

pip install pip -U

This command upgrades pip to the latest version to ensure compatibility with the latest packages.

Install PyFluent in editable mode
+++++++++++++++++++++++++++++++++

.. code:: console

pip install -e .

Installing with the -e option (editable mode) creates a symbolic link to the repository in the
``site-packages`` directory of your Python installation. This means any changes you make to the
PyFluent code are automatically reflected when you use PyFluent.

Generate required API classes
+++++++++++++++++++++++++++++

.. code:: console

python codegen/allapigen.py # Generates the API files or
python codegen/allapigen.py -v # Pass -v or --verbose to display the paths of the generated API files

The full PyFluent package includes some required API classes that are auto-generated rather
than maintained under version control. This command runs the auto-generation script included
in the repository. Note that this step requires an Ansys Fluent installation.

By following these steps, you can set up PyFluent for local development, ensuring that any changes
you make to the source code are immediately usable without needing to reinstall the package.
Installing with the ``-e`` option (editable mode) creates a symbolic link to the repository in
your Python installation's ``site-packages`` directory, so changes to the PyFluent source are
reflected immediately without reinstalling. The ``codegen/allapigen.py`` script generates API
classes that aren't tracked under version control; this step requires a licensed Ansys Fluent
installation.

Fluent Installation
-------------------
Expand Down
Loading
Loading