launcher#

Launch and connect to Ansys Fluent.

This package provides launch configuration for local Fluent processes, Fluent containers, and remote Fluent instances. It also includes launch-mode options, container setup helpers, remote launch support, executable discovery, and the Fluent version information used by launchers.

Classes:

FluentVersion(value[, names, module, ...])

An enumeration over supported Fluent versions.

LaunchMode(value[, names, module, qualname, ...])

Enumerates over supported Fluent launch modes.

Functions:

configure_container_dict(args[, ...])

Parses the parameters listed below, and sets up the container configuration file.

create_launcher([fluent_launch_mode])

Use the factory function to create a launcher for supported launch modes.

get_fluent_exe_path(**launch_argvals)

Get the path for the Fluent executable file.

launch_remote_fluent(session_cls, ...[, ...])

Launch Fluent remotely using PyPIM <https://pypim.docs.pyansys.com>.

start_fluent_container(args[, ...])

Start a Fluent container.

class ansys.fluent.core.execution.launcher.FluentVersion(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

An enumeration over supported Fluent versions.

Examples

FluentVersion(“25.2.0”) == FluentVersion.v252

FluentVersion.v252.number == 252

FluentVersion.v252.awp_var == ‘AWP_ROOT252’

Attributes:

awp_var

Get the Fluent version in AWP environment variable format.

docker_image_tag

Get the Fluent version as a Docker image tag.

number

Get the Fluent version as a plain integer.

v242

v251

v252

v261

v271

v272

Methods:

current_dev()

Return the version member of the current development version.

current_release()

Return the version member of the current release.

get_fluent_exe_path()

Get the path for the Fluent executable file.

get_latest_installed()

Return the version member corresponding to the most recent, available ANSYS installation.

minimum_supported()

Return the version member of the minimum supported version.

property awp_var#

Get the Fluent version in AWP environment variable format.

classmethod current_dev()#

Return the version member of the current development version.

Returns:
FluentVersion

FluentVersion member corresponding to the latest development version.

classmethod current_release()#

Return the version member of the current release.

Returns:
FluentVersion

FluentVersion member corresponding to the latest release.

property docker_image_tag#

Get the Fluent version as a Docker image tag.

get_fluent_exe_path()#

Get the path for the Fluent executable file.

Returns:
Path

Fluent executable path.

Raises:
FileNotFoundError

If the corresponding AWP_ROOTnnn environment variable is unset or invalid, or if the Fluent executable path derived from it does not exist.

classmethod get_latest_installed()#

Return the version member corresponding to the most recent, available ANSYS installation.

Returns:
FluentVersion

FluentVersion member corresponding to the newest Fluent version.

Raises:
FileNotFoundError

If an Ansys version cannot be found.

classmethod minimum_supported()#

Return the version member of the minimum supported version.

Returns:
FluentVersion

FluentVersion member corresponding to the minimum supported version.

property number#

Get the Fluent version as a plain integer.

v242 = '24.2.0'#
v251 = '25.1.0'#
v252 = '25.2.0'#
v261 = '26.1.0'#
v271 = '27.1.0'#
v272 = '27.2.0'#
class ansys.fluent.core.execution.launcher.LaunchMode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: FluentEnum

Enumerates over supported Fluent launch modes.

Attributes:

Methods:

__new__(value)

CONTAINER = 'container'#
PIM = 'pim'#
SLURM = 'slurm'#
STANDALONE = 'standalone'#
__new__(value)#
ansys.fluent.core.execution.launcher.configure_container_dict(args, mount_source=None, mount_target=None, timeout=None, port=None, license_server=None, container_server_info_file=None, remove_server_info_file=True, fluent_image=None, image_name=None, image_tag=None, file_transfer_service=None, compose_config=None, certificates_folder=None, **container_dict)#

Parses the parameters listed below, and sets up the container configuration file.

Parameters:
argsList[str]

List of Fluent launch arguments.

mount_sourcestr | Path, optional

Path on the host system to mount into the container. This directory will serve as the working directory for the Fluent process inside the container. If not specified, PyFluent’s current working directory will be used.

mount_targetstr | Path, optional

Path inside the container where mount_source will be mounted. This will be the working directory path visible to the Fluent process running inside the container.

timeoutint, optional

Time limit for the Fluent container to start, in seconds.

portint, optional

Port for Fluent container to use.

license_serverstr, optional

License server for Ansys Fluent to use.

container_server_info_filestr | Path, optional

Name of the server information file for Fluent to write on the mount_source.

remove_server_info_filebool, optional

Defaults to True, and automatically deletes the server information file after PyFluent has finished using it.

fluent_imagestr, optional

Specifies full image name for Docker container run, with the format "image_name:image_tag". image_tag and image_name are ignored if fluent_image has been specified.

image_namestr, optional

Ignored if fluent_image has been specified.

image_tagstr, optional

Ignored if fluent_image has been specified.

file_transfer_serviceoptional

Supports file upload and download.

compose_configComposeConfig, optional

Configuration for Docker Compose, if using Docker Compose to launch the container.

certificates_folderstr, optional

Path to the folder containing TLS certificates for Fluent’s gRPC server.

**container_dict

Additional keyword arguments can be specified, they will be treated as Docker container run options to be passed directly to the Docker run execution. See examples below and Docker run documentation.

Returns:
container_dictdict
timeoutint | None
portint
host_server_info_filePath
container_server_info_filePurePosixPath
remove_server_info_filebool
Raises:
LicenseServerNotSpecified

If license server is not specified through an environment variable or in container_dict.

ServerInfoFileError

If server info file is specified through both a command-line argument inside container_dict and the container_server_info_file parameter.

FluentImageNameTagNotSpecified

If fluent_image or image_tag and image_name are not specified.

Notes

This function should usually not be called directly, it is automatically used by launch_fluent().

For a list of additional Docker container run configuration options that can also be specified using container_dict, see Docker run documentation.

See also start_fluent_container().

ansys.fluent.core.execution.launcher.create_launcher(fluent_launch_mode=LaunchMode.STANDALONE, **kwargs)#

Use the factory function to create a launcher for supported launch modes.

Parameters:
fluent_launch_mode: LaunchMode

Supported Fluent launch modes. Options are "LaunchMode.CONTAINER", "LaunchMode.PIM", "LaunchMode.SLURM", and "LaunchMode.STANDALONE". The default is "LaunchMode.STANDALONE".

kwargsAny

Keyword arguments.

Returns
——-
DockerLauncher | PIMLauncher | SlurmLauncher | StandaloneLauncher

Session launcher.

Raises
——
ValueError

If an unknown Fluent launch mode is passed.

ansys.fluent.core.execution.launcher.get_fluent_exe_path(**launch_argvals)#

Get the path for the Fluent executable file. The search for the path is performed in the following order.

  1. product_version parameter passed with the launch_fluent method.

  2. The latest Ansys version from AWP_ROOTnnn` environment variables.

Returns:
Path

Fluent executable path

ansys.fluent.core.execution.launcher.launch_remote_fluent(session_cls, start_transcript, product_version=None, cleanup_on_exit=True, mode=FluentMode.SOLVER, dimensionality=Dimension.THREE, launcher_args=None, file_transfer_service=None)#

Launch Fluent remotely using PyPIM <https://pypim.docs.pyansys.com>.

Ensure that you are in an environment where PyPIM is configured. Use the pypim.is_configured method to verify that PyPIM is configured.

Parameters:
session_cls: type(Meshing) | type(PureMeshing) | type(Solver) | type(SolverIcing) | type(SolverAero)

Session type.

start_transcript: bool

Whether to start streaming the Fluent transcript in the client.

product_versionstr, optional

Version of Ansys Fluent to launch. Default is None for the newest version.

cleanup_on_exitbool, optional

Whether to clean up and exit Fluent when Python exits. Default is True.

modeFluentMode, optional

Launch Fluent in meshing mode. Default is FluentMode.SOLVER.

dimensionalityDimension | int

Geometric dimensionality of the Fluent simulation. Default is Dimension.THREE.

file_transfer_serviceoptional

Service for uploading/downloading files to/from the server.

launcher_argsAny

Launcher arguments.

Returns:
Meshing | PureMeshing | Solver | SolverIcing | SolverAero

Session object.

Raises:
TimeoutError

If unable to download the server info file after multiple retries.

ansys.fluent.core.execution.launcher.start_fluent_container(args, container_dict=None, start_timeout=100, compose_config=None)#

Start a Fluent container.

Parameters:
argsList[str]

List of Fluent launch arguments.

container_dictdict, optional

Dictionary with Docker container configuration.

start_timeoutint, optional

Timeout in seconds for the container to start. If not specified, it defaults to 100 seconds.

compose_configComposeConfig, optional

Configuration for Docker Compose, if using Docker Compose to launch the container.

Returns:
int

Fluent gPRC server port exposed from the container.

str

Fluent gPRC server password exposed from the container.

Raises:
TimeoutError

If Fluent container launch reaches timeout.

Notes

Uses configure_container_dict() to parse the optional container_dict configuration.

This function should usually not be called directly, it is automatically used by launch_fluent().