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:
|
Launch Fluent remotely using PyPIM <https://pypim.docs.pyansys.com>. |
- class ansys.fluent.core.launcher.pim_launcher.PIMLauncher(mode=None, ui_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, py=None, gpu=None, start_watchdog=None, file_transfer_service=None)#
Bases:
object
Instantiates Fluent session in PIM mode.
Methods:
__init__
([mode, ui_mode, graphics_driver, ...])- __init__(mode=None, ui_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, py=None, gpu=None, start_watchdog=None, file_transfer_service=None)#
Launch Fluent session in PIM mode.
- Parameters:
- mode
FluentMode
Launch mode of Fluent to point to a specific session type.
- ui_mode
UIMode
Fluent user interface mode. Options are the values of the
UIMode
enum.- graphics_driver
FluentWindowsGraphicsDriver
orFluentLinuxGraphicsDriver
Graphics driver of Fluent. Options are the values of the
FluentWindowsGraphicsDriver
enum in Windows or the values of theFluentLinuxGraphicsDriver
enum in Linux.- product_version
FluentVersion
orstr
orfloat
orint
,optional
Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass
FluentVersion.v242
,"24.2.0"
,"24.2"
,24.2
, or242
.The default is
None
, in which case the newest installed version is used.
- dimension
Dimension
orint
,optional
Geometric dimensionality of the Fluent simulation. The default is
None
, in which caseDimension.THREE
is used. Options are either the values of theDimension
enum (Dimension.TWO
orDimension.THREE
) or any of2
and3
.- precision
Precision
orstr
,optional
Floating point precision. The default is
None
, in which casePrecision.DOUBLE
is used. Options are either the values of thePrecision
enum (Precision.SINGLE
orPrecision.DOUBLE
) or any of"double"
and"single"
.- processor_count
int
,optional
Number of processors. The default is
None
, in which case1
processor is used. In job scheduler environments the total number of allocated cores is clamped to value ofprocessor_count
.- start_timeout
int
,optional
Maximum allowable time in seconds for connecting to the Fluent server. The default is
60
.- additional_arguments
str
,optional
Additional arguments to send to Fluent as a string in the same format they are normally passed to Fluent on the command line.
- cleanup_on_exitbool,
optional
Whether to shut down the connected Fluent session when PyFluent is exited, or the
exit()
method is called on the session instance, or if the session instance becomes unreferenced. The default isTrue
.- start_transcriptbool,
optional
Whether to start streaming the Fluent transcript in the client. The default is
True
. You can stop and start the streaming of the Fluent transcript subsequently via the method calls,transcript.start()
andtranscript.stop()
on the session object.- pybool,
optional
If True, Fluent will run in Python mode. Default is None.
- gpubool,
optional
If True, Fluent will start with GPU Solver.
- start_watchdogbool,
optional
When
cleanup_on_exit
is True,start_watchdog
defaults to True, which means an independent watchdog process is run to ensure that any local GUI-less Fluent sessions started by PyFluent are properly closed (or killed if frozen) when the current Python process ends.- file_transfer_service
optional
File transfer service. Uploads/downloads files to/from the server.
- mode
- Returns:
Union
[Meshing
,PureMeshing
,Solver
,SolverIcing
,dict
]Session object or configuration dictionary if
dry_run = True
.
- Raises:
UnexpectedKeywordArgument
If an unexpected keyword argument is provided.
Notes
Job scheduler environments such as SLURM, LSF, PBS, etc. allocates resources / compute nodes. The allocated machines and core counts are queried from the scheduler environment and passed to Fluent.
- 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>.
When calling this method, you must ensure that you are in an environment where PyPIM is configured. You can use the :func: pypim.is_configured <ansys.platform.instancemanagement.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. The default is
True
. You can stop and start the streaming of the Fluent transcript subsequently via method calls on the session object.- product_version
str
,optional
Version of Ansys Fluent to launch. Use
"242"
for 2024 R2. The default isNone
, in which case the newest installed version is used.- cleanup_on_exitbool,
optional
Whether to clean up and exit Fluent when Python exits or when garbage is collected for the Fluent Python instance. The default is
True
.- mode
FluentMode
,optional
Whether to launch Fluent remotely in meshing mode. The default is
FluentMode.SOLVER
.- dimensionality
str
,optional
Geometric dimensionality of the Fluent simulation. The default is
None
, in which case"3d"
is used. Options are"3d"
and"2d"
.- file_transfer_service
optional
File transfer service for uploading or downloading files to or from the server.
- launcher_args
Any
Launcher arguments.
- Returns:
Union
[Meshing
,PureMeshing
,Solver
,SolverIcing
]Session object.