Skip to main content

Pythonic interface to Ansys Fluent

Project description

PyAnsys PyPI GH-CI codecov MIT Black pre-commit.ci status

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

For comprehensive information on PyFluent, see the latest release documentation.

On the PyFluent Issues page, you can create issues to submit questions, report bugs, and request new features. To reach the project support team, email pyansys.core@ansys.com.

Installation

The ansys-fluent-core package supports Python 3.8 through Python 3.11 on Windows and Linux.

Install the latest release from PyPI with:

pip install ansys-fluent-core

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 R1 (or 23.1) installed in the default directory as an example, the installer automatically sets the AWP_ROOT231 environment variable to point to C:\Program Files\ANSYS Inc\v231.

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_ROOT231=/usr/ansys_inc/v231

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_service.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:

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

ansys-fluent-core-0.15.dev1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

ansys_fluent_core-0.15.dev1-py3-none-any.whl (3.9 MB view details)

Uploaded Python 3

File details

Details for the file ansys-fluent-core-0.15.dev1.tar.gz.

File metadata

  • Download URL: ansys-fluent-core-0.15.dev1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for ansys-fluent-core-0.15.dev1.tar.gz
Algorithm Hash digest
SHA256 b609bff8cba460c36bb34e45f4e7397116e8a10426c40764ca264def36d4570c
MD5 338d0a65ae97a1aa6544daec870818f4
BLAKE2b-256 1357d1e2890a8ca9007c53e378c86d3e1862058a8f87ba7f348d0fa589a1c897

See more details on using hashes here.

File details

Details for the file ansys_fluent_core-0.15.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for ansys_fluent_core-0.15.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b475759916567237f8d2802d29ee9785d5e67acc292711b0a1a41f063bdb731
MD5 4d2e5a6c6b13f6066fcb9e2bb7b03c99
BLAKE2b-256 6029223f9c75333994e78a3526a6bcd8a952312144ac1153dbea4a242e20fbb0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page