standalone_launcher#

Provides a module for launching Fluent in standalone mode.

Examples#

>>> from ansys.fluent.core.launcher.launcher import create_launcher
>>> from ansys.fluent.core.launcher.pyfluent_enums import LaunchMode, FluentMode
>>> standalone_meshing_launcher = create_launcher(LaunchMode.STANDALONE, mode=FluentMode.MESHING)
>>> standalone_meshing_session = standalone_meshing_launcher()
>>> standalone_solver_launcher = create_launcher(LaunchMode.STANDALONE)
>>> standalone_solver_session = standalone_solver_launcher()

Classes:

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

Instantiates Fluent session in standalone mode.

class ansys.fluent.core.launcher.standalone_launcher.StandaloneLauncher(mode=None, ui_mode=None, graphics_driver=None, product_version=None, dimension=None, precision=None, processor_count=None, journal_file_names=None, start_timeout=60, additional_arguments='', env=None, cleanup_on_exit=True, dry_run=False, start_transcript=True, case_file_name=None, case_data_file_name=None, lightweight_mode=None, py=None, gpu=None, cwd=None, fluent_path=None, topy=None, start_watchdog=None, file_transfer_service=None)#

Bases: object

Instantiates Fluent session in standalone mode.

Methods:

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

Launch Fluent session in standalone mode.

__init__(mode=None, ui_mode=None, graphics_driver=None, product_version=None, dimension=None, precision=None, processor_count=None, journal_file_names=None, start_timeout=60, additional_arguments='', env=None, cleanup_on_exit=True, dry_run=False, start_transcript=True, case_file_name=None, case_data_file_name=None, lightweight_mode=None, py=None, gpu=None, cwd=None, fluent_path=None, topy=None, start_watchdog=None, file_transfer_service=None)#

Launch Fluent session in standalone mode.

Parameters:
modeFluentMode

Launch mode of Fluent to point to a specific session type.

ui_modeUIMode

Fluent user interface mode. Options are the values of the UIMode enum.

graphics_driverFluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver

Graphics driver of Fluent. Options are the values of the FluentWindowsGraphicsDriver enum in Windows or the values of the FluentLinuxGraphicsDriver enum in Linux.

product_versionFluentVersion or str or float or int, optional

Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass

FluentVersion.v242, "24.2.0", "24.2", 24.2, or 242.

The default is None, in which case the newest installed version is used.

dimensionDimension or int, optional

Geometric dimensionality of the Fluent simulation. The default is None, in which case Dimension.THREE is used. Options are either the values of the Dimension enum (Dimension.TWO or Dimension.THREE) or any of 2 and 3.

precisionPrecision or str, optional

Floating point precision. The default is None, in which case Precision.DOUBLE is used. Options are either the values of the Precision enum (Precision.SINGLE or Precision.DOUBLE) or any of "double" and "single".

processor_countint, optional

Number of processors. The default is None, in which case 1 processor is used. In job scheduler environments the total number of allocated cores is clamped to value of processor_count.

journal_file_namesstr or list of str, optional

The string path to a Fluent journal file, or a list of such paths. Fluent will execute the journal(s). The default is None.

start_timeoutint, optional

Maximum allowable time in seconds for connecting to the Fluent server. The default is 60.

additional_argumentsstr, optional

Additional arguments to send to Fluent as a string in the same format they are normally passed to Fluent on the command line.

envdict[str, str], optional

Mapping to modify environment variables in Fluent. The default is None.

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 is True.

dry_runbool, optional

Defaults to False. If True, will not launch Fluent, and will instead print configuration information that would be used as if Fluent was being launched.

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() and transcript.stop() on the session object.

case_file_namestr, optional

Name of the case file to read into the Fluent session. The default is None.

case_data_file_namestr, optional

Name of the case data file. If names of both a case file and case data file are provided, they are read into the Fluent session.

lightweight_modebool, optional

Whether to run in lightweight mode. In lightweight mode, the lightweight settings are read into the current Fluent solver session. The mesh is read into a background Fluent solver session which will replace the current Fluent solver session once the mesh read is complete and the lightweight settings made by the user in the current Fluent solver session have been applied in the background Fluent solver session. This is all orchestrated by PyFluent and requires no special usage. This parameter is used only when case_file_name is provided. The default is False.

pybool, optional

If True, Fluent will run in Python mode. Default is None.

gpubool, optional

If True, Fluent will start with GPU Solver.

cwdstr, Optional

Working directory for the Fluent client.

fluent_path: str, Optional

User provided Fluent installation path.

topybool or str, optional

A boolean flag to write the equivalent Python journal(s) from the journal(s) passed. Can optionally take the file name of the new python journal file.

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_serviceoptional

File transfer service. Uploads/downloads files to/from the server.

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.