session#

Module containing class encapsulating Fluent connection and the Base Session.

Classes:

BaseSession(fluent_connection, scheme_eval)

Encapsulates a Fluent session.

Fields(_session[, get_zones_info])

Container for field and solution variables.

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

Bases: object

Encapsulates a Fluent session.

This class exposes methods for interacting with a Fluent session.

Attributes:
scheme: 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.

chdir(path)

Change Fluent working directory.

download(file_name[, local_directory])

Download a file from the server.

enable_beta_features()

Enable access to Fluent beta-features

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.

is_active()

Whether the current session is active.

is_server_healthy()

Whether the current session is healthy (i.e. The server is 'SERVING').

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.

health_check

Provides access to Health Check service.

id

Return the session ID.

scheme_eval

Provides access to Fluent field information.

__init__(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None, event_type=None, get_zones_info=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.

chdir(path)#

Change Fluent working directory.

Parameters:
pathstr

Path of the directory to change.

download(file_name, local_directory=None)#

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.

enable_beta_features()#

Enable access to Fluent beta-features

execute_tui(command)#

Executes a tui command.

exit(**kwargs)#

Exit session.

property field_data#

Fluent field data on surfaces.

Deprecated since version 0.20.dev9: Use session.fields.field_data.

property field_data_streaming#

Field gRPC streaming service of Fluent.

Deprecated since version 0.20.dev9: Use session.fields.field_data_streaming.

property field_info#

Provides access to Fluent field information.

Deprecated since version 0.20.dev9: Use session.fields.field_info.

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 health_check#

Provides access to Health Check service.

Deprecated since version 0.32: Use session.is_server_healthy.

property id: str#

Return the session ID.

is_active()#

Whether the current session is active.

is_server_healthy()#

Whether the current session is healthy (i.e. The server is ‘SERVING’).

property scheme_eval#

Provides access to Fluent field information.

Deprecated since version 0.32: Use session.scheme.

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

class ansys.fluent.core.session.Fields(_session, get_zones_info=None)#

Bases: object

Container for field and solution variables.

Methods:

__init__(_session[, get_zones_info])

Initialize Fields.

__init__(_session, get_zones_info=None)#

Initialize Fields.