ansys.fluent.core.session#

Module containing class encapsulating Fluent connection and the Base Session.

Classes:

BaseSession(fluent_connection, scheme_eval)

Encapsulates a Fluent session.

class ansys.fluent.core.session.BaseSession(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None, event_type=None)#

Bases: object

Encapsulates a Fluent session.

This class exposes methods for interacting with a Fluent session.

Attributes:
scheme_eval: SchemeEval

Instance of SchemeEval to execute Fluent’s scheme code on.

Methods

_create_from_server_info_file(

server_info_file_name, cleanup_on_exit, start_transcript ) Create a Session instance from server-info file

exit()

Close the Fluent connection and exit Fluent.

Methods:

__init__(fluent_connection, scheme_eval[, ...])

BaseSession.

download(file_name[, local_directory])

Download a file from the server.

execute_tui(command)

Executes a tui command.

exit(**kwargs)

Exit session.

file_exists_on_remote(file_name)

Check if remote file exists.

force_exit()

Forces the Fluent session to exit, losing unsaved progress and data.

get_fluent_version()

Gets and returns the fluent version.

start_journal(file_name)

Executes tui command to start journal.

stop_journal()

Executes tui command to stop journal.

upload(file_name[, remote_file_name])

Upload a file to the server.

Attributes:

field_data

Fluent field data on surfaces.

field_data_streaming

Field gRPC streaming service of Fluent.

field_info

Provides access to Fluent field information.

id

Return the session ID.

__init__(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None, event_type=None)#

BaseSession.

Parameters:
fluent_connection (:ref:`ref_fluent_connection`):

Encapsulates a Fluent connection.

scheme_eval: SchemeEval

Instance of SchemeEval to execute Fluent’s scheme code on.

file_transfer_serviceOptional

Service for uploading and downloading files.

start_transcriptbool, optional

Whether to start the Fluent transcript in the client. The default is True, in which case the Fluent transcript can be subsequently started and stopped using method calls on the Session object.

event_typeEnum, optional

Event enumeration specific to the session type.

download(file_name, local_directory='.')#

Download a file from the server.

Parameters:
file_namestr

Name of the file to download from the server.

local_directorystr, optional

Local destination directory. The default is the current working directory.

execute_tui(command)#

Executes a tui command.

exit(**kwargs)#

Exit session.

property field_data#

Fluent field data on surfaces.

property field_data_streaming#

Field gRPC streaming service of Fluent.

property field_info#

Provides access to Fluent field information.

file_exists_on_remote(file_name)#

Check if remote file exists.

Parameters:
file_name: str

File name.

Returns:
Whether file exists.
force_exit()#

Forces the Fluent session to exit, losing unsaved progress and data.

get_fluent_version()#

Gets and returns the fluent version.

property id: str#

Return the session ID.

start_journal(file_name)#

Executes tui command to start journal.

stop_journal()#

Executes tui command to stop journal.

upload(file_name, remote_file_name=None)#

Upload a file to the server.

Parameters:
file_namestr

Name of the local file to upload to the server.

remote_file_namestr, optional

remote file name, by default None