pim_launcher#
Provides a module for launching Fluent in pim mode.
Examples#
>>> from ansys.fluent.core.launcher.launcher import create_launcher
>>> from ansys.fluent.core.launcher.pyfluent_enums import LaunchMode, FluentMode
>>> pim_meshing_launcher = create_launcher(LaunchMode.PIM, mode=FluentMode.MESHING)
>>> pim_meshing_session = pim_meshing_launcher()
>>> pim_solver_launcher = create_launcher(LaunchMode.PIM)
>>> pim_solver_session = pim_solver_launcher()
Classes:
|
Instantiates Fluent session in PIM mode. |
Functions:
|
Create a Fluent connection. |
|
Create a Fluent instance based on mode and dimensionality. |
Get the file transfer service. |
|
|
Launch Fluent remotely using PyPIM <https://pypim.docs.pyansys.com>. |
- class ansys.fluent.core.launcher.pim_launcher.PIMLauncher(mode=None, graphics_driver=None, product_version=None, dimension=None, precision=None, processor_count=None, start_timeout=60, additional_arguments='', cleanup_on_exit=True, start_transcript=True, gpu=None, start_watchdog=None, file_transfer_service=None)#
Bases:
object
Instantiates Fluent session in PIM mode.
Methods:
__init__
([mode, graphics_driver, ...])- __init__(mode=None, graphics_driver=None, product_version=None, dimension=None, precision=None, processor_count=None, start_timeout=60, additional_arguments='', cleanup_on_exit=True, start_transcript=True, gpu=None, start_watchdog=None, file_transfer_service=None)#
Launch a Fluent session in PIM mode.
- Parameters:
- mode
FluentMode
Specifies the launch mode of Fluent for targeting a specific session type.
- graphics_driver
FluentWindowsGraphicsDriver
orFluentLinuxGraphicsDriver
Specifies the graphics driver for Fluent. Options are from the
FluentWindowsGraphicsDriver
enum (for Windows) or theFluentLinuxGraphicsDriver
enum (for Linux).- product_version
FluentVersion
orstr
orfloat
orint
,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
, or251
. Defaults toNone
, which uses the newest installed version.- dimension
Dimension
orint
,optional
Specifies the geometric dimensionality of the Fluent simulation. Defaults to
None
, which corresponds toDimension.THREE
. Acceptable values includeDimension.TWO
,Dimension.THREE
, or integers2
and3
.- precision
Precision
orstr
,optional
Defines the floating point precision. Defaults to
None
, which corresponds toPrecision.DOUBLE
. Acceptable values includePrecision.SINGLE
,Precision.DOUBLE
, or strings"single"
and"double"
.- processor_count
int
,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_timeout
int
,optional
Maximum allowable time in seconds for connecting to the Fluent server. Defaults to 60 seconds.
- additional_arguments
str
,optional
Additional command-line arguments for Fluent, formatted as they would be on the command line.
- 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.
- 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_service
Any
,optional
Service for uploading/downloading files to/from the server.
- mode
- Returns:
Union
[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.
- ansys.fluent.core.launcher.pim_launcher.create_fluent_connection(channel, cleanup_on_exit, instance, launcher_args)#
Create a Fluent connection.
- ansys.fluent.core.launcher.pim_launcher.create_fluent_instance(pim, mode, dimensionality, product_version)#
Create a Fluent instance based on mode and dimensionality.
- ansys.fluent.core.launcher.pim_launcher.get_file_transfer_service(file_transfer_service, fluent_connection)#
Get the file transfer service.
- ansys.fluent.core.launcher.pim_launcher.launch_remote_fluent(session_cls, start_transcript, product_version=None, cleanup_on_exit=True, mode=FluentMode.SOLVER, dimensionality=None, 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)
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
None
for 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
str
,optional
Geometric dimensionality of the Fluent simulation. Default is
None
(3D).- file_transfer_service
optional
Service for uploading/downloading files to/from the server.
- launcher_args
Any
Launcher arguments.
- Returns:
Meshing
|PureMeshing
|Solver
|SolverIcing
Session object.