Package: ansys-fluent-core
OverviewPyFluent provides Pythonic access to Ansys Fluent. Its features enable the seamless use of
Fluent within the Python ecosystem and broad access to native Fluent features, including the
ability to:Launch Fluent using a local Ansys installationUse Fluent’s TUI (text user interface) commands for both meshing and solver featuresUse Fluent’s built-in postprocessing capabilitiesDocumentation and issuesDocumentation for the latest stable release of PyFluent is hosted atPyFluent documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyFluent cheat sheet. This one-page reference provides syntax rules and commands
for using PyFluent.On thePyFluent Issuespage, you can create
issues to report bugs and request new features. On thePyFluent Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, emailpyansys.core@ansys.com.InstallationTheansys-fluent-corepackage supports Python 3.9 through Python
3.11 on Windows and Linux.Install the latest release fromPyPIwith:pip install ansys-fluent-coreFor developersIf you plan on doing localdevelopmentof PyFluent with Git, install
the latest release with:git clone https://github.com/ansys/pyfluent.git
cd pyfluent
pip install pip -U
pip install -e .
python codegen/allapigen.py  # Generates the API filesDependenciesYou must have a licensed copy of Ansys Fluent installed locally. PyFluent
supports Fluent 2022 R2 and later. The Windows installation of Ansys Fluent automatically
sets the required environment variables so that PyFluent can find the Ansys Fluent
installation. Using Fluent 2023 R2 (or 23.2) installed in the default directory as an
example, the installer automatically sets theAWP_ROOT232environment variable to point
toC:\ProgramFiles\ANSYS Inc\v232.On Linux, the required environment variable is not set automatically, and can be set for the
current user in the current shell session, using Fluent 2023 R1 in the default installation
directory as an example, before running PyFluent, with:export AWP_ROOT232=/usr/ansys_inc/v232For this setting to persist between different shell sessions for the current user, the same
export command can instead be added to the user’s~/.profilefile.Getting startedLaunching FluentTo launch Fluent from Python, use thelaunch_fluentmethod:importansys.fluent.coreaspyfluentsolver_session=pyfluent.launch_fluent(mode="solver")solver_session.health_check_service.is_servingBasic usageYou can use thesolver_session.tuiinterface to run all Fluent TUI commands:solver_session.tui.file.read_case('elbow.cas.h5')solver_session.tui.define.models.unsteady_2nd_order("yes")solver_session.tui.solve.initialize.initialize_flow()solver_session.tui.solve.dual_time_iterate(2,3)You can also install and use these PyFluent libraries:PyFluent Parametric, which provides
access to Fluent’s parametric workflows.PyFluent Visualization, which
provides postprocessing and visualization capabilities using thepyvistaandmatplotlibpackages.License and acknowledgmentsPyFluent is licensed under the MIT license.PyFluent makes no commercial claim over Ansys whatsoever. This library
extends the functionality of Ansys Fluent by adding a Python interface
to Fluent without changing the core behavior or license of the original
software. The use of the interactive Fluent control of PyFluent requires a
legally licensed local copy of Fluent.For more information on Fluent, see theAnsys Fluentpage on the Ansys website.