launch_fluent#
- ansys.fluent.core.launcher.launcher.launch_fluent(product_version=None, version=None, precision=None, processor_count=None, journal_filename=None, start_timeout=100, additional_arguments='', env=None, start_instance=None, ip=None, port=None, cleanup_on_exit=True, start_transcript=True, show_gui=None, case_filepath=None, mode=None, server_info_filepath=None, password=None, py=None, cwd=None, topy=None, **kwargs)#
Launch Fluent locally in server mode or connect to a running Fluent server instance.
- Parameters:
- product_version
str
,optional
Version of Fluent to use in the numeric format (such as
"23.1.0"
for 2023 R1). The default isNone
, in which case the active version or latest installed version is used.- version
str
,optional
Dimensions for modeling. The default is
None
, in which case"3d"
is used. Options are"3d"
and"2d"
.- precision
str
,optional
Floating point precision. The default is
None
, in which case"double"
is used. Options are"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 this value.- journal_filename
str
,optional
Name of the journal file to read. The default is
None
.- start_timeout
int
,optional
Maximum allowable time in seconds for connecting to the Fluent server. The default is
100
.- additional_arguments
str
,optional
Additional arguments to send to Fluent. The default is
""
.- env
dict
[str
,str
],optional
Mapping to modify environment variables in Fluent. The default is
None
.- start_instancebool,
optional
Whether to connect to an existing Fluent instance at a specified IP address on a specified port. The default is
None
, in which case a local instance of Fluent is started. WhenFalse
, use the next two parameters to specify the IP address and port. You can also use the environment variablePYFLUENT_START_INSTANCE=<0 or 1>
to set this parameter.- ip
str
,optional
IP address for connecting to an existing Fluent instance. This parameter is used only when
start_instance
isFalse
. Otherwise, the IP address defaults to"127.0.0.1"
. You can also use the environment variablePYFLUENT_FLUENT_IP=<ip>
to set this parameter.- port
int
,optional
Port to listen on for an existing Fluent instance. This parameter is used only when
start_instance
isFalse
. You can use the environment variablePYFLUENT_FLUENT_PORT=<port>
to set a default value.- 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. 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 method calls on the session object.- show_guibool,
optional
Whether to display the Fluent GUI when
start_instance
is set to ‘’True``. The default isNone
so that explicitFalse
settings can be detected. This is because you can use also use the environment variablePYFLUENT_SHOW_SERVER_GUI=<0 or 1>
to set this parameter. Theshow-gui
parameter overrides the PYFLUENT_SHOW_SERVER_GUI environment variable. For example, if PYFLUENT_SHOW_SERVER_GUI is set to1
and theshow-gui
parameter is set toFalse
, the GUI is hidden.- case_filepath
str
,optional
If provided, reads a fluent case file and sets the required settings in the fluent session
- mode
str
,optional
Launch mode of Fluent to point to a specific session type. The default value is
None
. Options are"meshing"
,"pure-meshing"
and"solver"
.- server_info_filepath: str
Path to server-info file written out by Fluent server. The default is
None
.- password
str
,optional
Password to connect to existing Fluent instance.
- pybool,
optional
Passes
"-py"
as an additional_argument to launch fluent in python mode. The default isNone
.- cwd: str, Optional
Path to specify current working directory to launch fluent from the defined directory as current working directory.
- topy: str or list, optional
Automates scheme to python journal creation.
- product_version
- Returns:
ansys.fluent.session.Session
Fluent session.
Notes
In job scheduler environments such as SLURM, LSF, PBS, etc… the allocated machines and core counts are queried from the scheduler environment and passed to Fluent.
- Return type:
_BaseSession