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:
|
An enumeration over supported Fluent versions. |
|
Enumerates over supported Fluent launch modes. |
Functions:
|
Parses the parameters listed below, and sets up the container configuration file. |
|
Use the factory function to create a launcher for supported launch modes. |
|
Get the path for the Fluent executable file. |
|
Launch Fluent remotely using PyPIM <https://pypim.docs.pyansys.com>. |
|
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:
EnumAn enumeration over supported Fluent versions.
Examples
FluentVersion(“25.2.0”) == FluentVersion.v252
FluentVersion.v252.number == 252
FluentVersion.v252.awp_var == ‘AWP_ROOT252’
Attributes:
Get the Fluent version in AWP environment variable format.
Get the Fluent version as a Docker image tag.
Get the Fluent version as a plain integer.
Methods:
Return the version member of the current development version.
Return the version member of the current release.
Get the path for the Fluent executable file.
Return the version member corresponding to the most recent, available ANSYS installation.
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:
FluentVersionFluentVersion member corresponding to the latest development version.
- classmethod current_release()#
Return the version member of the current release.
- Returns:
FluentVersionFluentVersion 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:
PathFluent executable path.
- Raises:
FileNotFoundErrorIf the corresponding
AWP_ROOTnnnenvironment 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:
FluentVersionFluentVersion member corresponding to the newest Fluent version.
- Raises:
FileNotFoundErrorIf an Ansys version cannot be found.
- classmethod minimum_supported()#
Return the version member of the minimum supported version.
- Returns:
FluentVersionFluentVersion 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:
FluentEnumEnumerates 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:
- args
List[str] List of Fluent launch arguments.
- mount_source
str|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_target
str|Path,optional Path inside the container where
mount_sourcewill be mounted. This will be the working directory path visible to the Fluent process running inside the container.- timeout
int,optional Time limit for the Fluent container to start, in seconds.
- port
int,optional Port for Fluent container to use.
- license_server
str,optional License server for Ansys Fluent to use.
- container_server_info_file
str|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_image
str,optional Specifies full image name for Docker container run, with the format
"image_name:image_tag".image_tagandimage_nameare ignored iffluent_imagehas been specified.- image_name
str,optional Ignored if
fluent_imagehas been specified.- image_tag
str,optional Ignored if
fluent_imagehas been specified.- file_transfer_service
optional Supports file upload and download.
- compose_config
ComposeConfig,optional Configuration for Docker Compose, if using Docker Compose to launch the container.
- certificates_folder
str,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.
- args
- Returns:
- Raises:
LicenseServerNotSpecifiedIf license server is not specified through an environment variable or in
container_dict.ServerInfoFileErrorIf server info file is specified through both a command-line argument inside
container_dictand thecontainer_server_info_fileparameter.FluentImageNameTagNotSpecifiedIf
fluent_imageorimage_tagandimage_nameare 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".- kwargs
Any 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.
product_versionparameter passed with thelaunch_fluentmethod.The latest Ansys version from
AWP_ROOTnnn`environment variables.
- Returns:
PathFluent 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_configuredmethod 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_version
str,optional Version of Ansys Fluent to launch. Default is
Nonefor the newest version.- cleanup_on_exitbool,
optional Whether to clean up and exit Fluent when Python exits. Default is
True.- mode
FluentMode,optional Launch Fluent in meshing mode. Default is
FluentMode.SOLVER.- dimensionality
Dimension|int Geometric dimensionality of the Fluent simulation. Default is Dimension.THREE.
- file_transfer_service
optional Service for uploading/downloading files to/from the server.
- launcher_args
Any Launcher arguments.
- Returns:
Meshing|PureMeshing|Solver|SolverIcing|SolverAeroSession object.
- Raises:
TimeoutErrorIf 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:
- args
List[str] List of Fluent launch arguments.
- container_dict
dict,optional Dictionary with Docker container configuration.
- start_timeout
int,optional Timeout in seconds for the container to start. If not specified, it defaults to 100 seconds.
- compose_config
ComposeConfig,optional Configuration for Docker Compose, if using Docker Compose to launch the container.
- args
- Returns:
- Raises:
TimeoutErrorIf Fluent container launch reaches timeout.
Notes
Uses
configure_container_dict()to parse the optionalcontainer_dictconfiguration.This function should usually not be called directly, it is automatically used by
launch_fluent().