Getting started#
To run PyFluent-Visualization, you must have a licensed copy of Ansys Fluent installed locally. PyFluent-Visualization supports Ansys Fluent 2022 R2 and later.
For more information on Fluent, visit the Fluent page on the Ansys website.
Install package#
The ansys-fluent-visualization
package supports Python 3.10 through
Python 3.12 on Windows and Linux.
Install the latest release from PyPi with:
pip install ansys-fluent-visualization
Alternatively, install the latest version from the GitHub with:
pip install git+https://github.com/ansys/pyfluent-visualization.git
If you plan on doing local development of PyFluent-Visualization with Git, install with:
git clone https://github.com/ansys/pyfluent-visualization.git
cd pyfluent-visualization
pip install -e .
Any changes that you make locally are reflected in your setup after you restart the Python kernel.
Launch Fluent#
You can launch Fluent from PyFluent using the launch_fluent
function:
import ansys.fluent.core as pyfluent
session = pyfluent.launch_fluent(precision="double", processor_count=2, mode="solver")
session.check_health()
session.start_transcript() # Streaming the transcript locally
PyFluent-Visualization provides integrations with both PyVista and Matplotlib.
If you want to interact with the Fluent graphical user interface, set the following environment variable:
set PYFLUENT_SHOW_SERVER_GUI=1 # Windows
export PYFLUENT_SHOW_SERVER_GUI=1 # Linux (bash)
If you want to print the debug information for development, set the following environment variable:
pyfluent.set_log_level('DEBUG') # for development, by default only errors are shown