PyFluent provides Pythonic access to Ansys Fluent
Project description
Overview
PyFluent 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 installation
Use Fluent’s TUI (text user interface) commands for both meshing and solver features
Use Fluent’s built-in postprocessing capabilities
Documentation and issues
Documentation for the latest stable release of PyFluent is hosted at PyFluent 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 also view or download the PyFluent cheat sheet. This one-page reference provides syntax rules and commands for using PyFluent.
On the PyFluent Issues page, you can create issues to report bugs and request new features. On the PyFluent Discussions page or the Discussions page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.
To reach the project support team, email pyansys.core@ansys.com.
Installation
The ansys-fluent-core package supports Python 3.9 through Python 3.12 on Windows and Linux.
Install the latest release from PyPI with:
pip install ansys-fluent-core
For developers
If you plan on doing local development of 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 files
Dependencies
You 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 the AWP_ROOT232 environment variable to point to C:\Program Files\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/v232
For this setting to persist between different shell sessions for the current user, the same export command can instead be added to the user’s ~/.profile file.
Getting started
Launching Fluent
To launch Fluent from Python, use the launch_fluent method:
import ansys.fluent.core as pyfluent
solver_session = pyfluent.launch_fluent(mode="solver")
solver_session.health_check.is_serving
Basic usage
You can use the solver_session.tui interface 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 the pyvista and matplotlib packages.
License and acknowledgments
PyFluent 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 the Ansys Fluent page on the Ansys website.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ansys_fluent_core-0.25.dev1.tar.gz
.
File metadata
- Download URL: ansys_fluent_core-0.25.dev1.tar.gz
- Upload date:
- Size: 9.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6297a90947b1486723b3e6044f77f0932d0252dcf24bb0438ea5385944c418c3 |
|
MD5 | d0b3d3348d12f1eb2c2541d197fa0ee8 |
|
BLAKE2b-256 | 4f6e2dc91b596cd799a83411929a95d4592d61df8a04029c2c514e4ef4ef6869 |
File details
Details for the file ansys_fluent_core-0.25.dev1-py3-none-any.whl
.
File metadata
- Download URL: ansys_fluent_core-0.25.dev1-py3-none-any.whl
- Upload date:
- Size: 36.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be561a2f0e7e3b37f887eb0e6fd88fbbf0f0f8482037cf790aab08b1b1a58561 |
|
MD5 | 3845cbf421e653418f5f19b61e35c5ff |
|
BLAKE2b-256 | d581bfe77fd8fa5bf1e1ae60886af47962cb4c111fe4755807165837511be981 |