container_launcher#

Provides a module for launching Fluent in container mode.

Examples#

>>>
>>> from ansys.fluent.core.launcher.launcher import create_launcher
>>> from ansys.fluent.core.launcher.pyfluent_enums import LaunchMode, FluentMode
>>>
>>> container_meshing_launcher = create_launcher(LaunchMode.CONTAINER, mode=FluentMode.MESHING)
>>> container_meshing_session = container_meshing_launcher()
>>>
>>> container_solver_launcher = create_launcher(LaunchMode.CONTAINER)
>>> container_solver_session = container_solver_launcher()

Classes:

DockerLauncher([mode, ui_mode, ...])

Instantiates Fluent session in container mode.

class ansys.fluent.core.launcher.container_launcher.DockerLauncher(mode=None, ui_mode=None, graphics_driver=None, product_version=None, dimension=None, precision=None, processor_count=None, start_timeout=60, additional_arguments='', container_dict=None, dry_run=False, cleanup_on_exit=True, start_transcript=True, py=None, gpu=None, start_watchdog=None, file_transfer_service=None)#

Bases: object

Instantiates Fluent session in container mode.

Methods:

__init__([mode, ui_mode, graphics_driver, ...])

Launch a Fluent session in container mode.

__init__(mode=None, ui_mode=None, graphics_driver=None, product_version=None, dimension=None, precision=None, processor_count=None, start_timeout=60, additional_arguments='', container_dict=None, dry_run=False, cleanup_on_exit=True, start_transcript=True, py=None, gpu=None, start_watchdog=None, file_transfer_service=None)#

Launch a Fluent session in container mode.

Parameters:
modeFluentMode

Specifies the launch mode of Fluent to target a specific session type.

ui_modeUIMode

Defines the user interface mode for Fluent. Options correspond to values in the UIMode enum.

graphics_driverFluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver

Specifies the graphics driver for Fluent. Options are from the FluentWindowsGraphicsDriver enum (for Windows) or the FluentLinuxGraphicsDriver enum (for Linux).

product_versionFluentVersion or str or float or int, optional

Indicates the version of Ansys Fluent to launch. For example, to use version 2025 R1, pass any of FluentVersion.v251, "25.1.0", "25.1", 25.1, or 251. Defaults to None, which uses the newest installed version.

dimensionDimension or int, optional

Specifies the geometric dimensionality of the Fluent simulation. Defaults to None, which corresponds to Dimension.THREE. Acceptable values include Dimension.TWO, Dimension.THREE, or integers 2 and 3.

precisionPrecision or str, optional

Defines the floating point precision. Defaults to None, which corresponds to Precision.DOUBLE. Acceptable values include Precision.SINGLE, Precision.DOUBLE, or strings "single" and "double".

processor_countint, optional

Specifies the number of processors to use. Defaults to None, which uses 1 processor. In job scheduler environments, this value limits the total number of allocated cores.

start_timeoutint, optional

Maximum allowable time in seconds for connecting to the Fluent server. Defaults to 60 seconds.

additional_argumentsstr, optional

Additional command-line arguments for Fluent, formatted as they would be on the command line.

container_dictdict, optional

Configuration dictionary for launching Fluent inside a Docker container. See also fluent_container.

dry_runbool, optional

If True, does not launch Fluent but prints configuration information instead. If dry running a container start, this method will return the configured container_dict. Defaults to False.

cleanup_on_exitbool

Determines whether to shut down the connected Fluent session upon exit or when calling the session’s exit() method. Defaults to True.

start_transcriptbool

Indicates whether to start streaming the Fluent transcript in the client. Defaults to True; streaming can be controlled via transcript.start() and transcript.stop() methods on the session object.

pybool, optional

If True, runs Fluent in Python mode. Defaults to None.

gpubool, optional

If True, starts Fluent with GPU Solver enabled.

start_watchdogbool, optional

If True and cleanup_on_exit is True, an independent watchdog process is run to ensure that any local GUI-less Fluent sessions started by PyFluent are properly closed when the current Python process ends.

file_transfer_serviceAny, optional

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

Returns:
Meshing | PureMeshing | Solver | SolverIcing | dict

Session object or configuration dictionary if dry_run is True.

Raises:
UnexpectedKeywordArgument

If an unexpected keyword argument is provided.

Notes

In job scheduler environments (e.g., SLURM, LSF, PBS), resources and compute nodes are allocated, and core counts are queried from these environments before being passed to Fluent.