session#

Solver session classes for full, add-on, and specialized Fluent workflows.

The Solver session provides the standard Fluent solver API and inherits from BaseSession. The SolverAero, SolverIcing, SolverLite, and PrePost session classes specialize Solver for their respective workflows. These concrete session classes are re-exported by ansys.fluent.core.execution.session and the top-level ansys.fluent.core package.

Classes:

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

Fluent pre-post session.

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

Fluent solver session.

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

Fluent solver session with the Aero add-on loaded.

SolverIcing(fluent_connection, scheme_eval)

Fluent solver session with the Icing add-on loaded.

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

Lightweight Fluent solver session.

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

Bases: Solver

Fluent pre-post session.

All public API is provided by Solver.

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

Bases: BaseSession, object

Fluent solver session.

Provides access to Fluent’s full solver capabilities: settings tree, TUI commands, solution monitors, field data, workflows, and more.

Attributes:
settingssettings_root

Settings root handle.

tuimain_menu

Instance of main_menu on which Fluent’s SolverTUI methods can be executed.

workflowClassicWorkflow

Datamodel root for workflow.

preferencespreferences_root

Datamodel root of preferences.

fieldsFields

Field data container (solution_variable_info, solution_variable_data, reduction, field_data).

monitorsMonitorsManager

Residual and report-definition monitors; auto-refreshed on solution events. See the monitors API for details.

system_couplingSystemCoupling

System coupling object.

schemeSchemeInterpreter

Direct access to Fluent’s Scheme interpreter. See the scheme interpreter API for details.

application_runtimeApplicationRuntime

Provides access to the Fluent application runtime.

journalJournal

Fluent journal recorder; call start() / stop().

transcriptTranscriptStreaming

Fluent console transcript; call .start() / .stop().

eventsEventsManager

Subscribe to solver events (SolverEvent). See the events API for details.

Methods:

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

Solver session.

from_http(url, token)

Create a solver session connected via REST (HTTP) transport.

get_state()

Get the state of the object.

read_case_lightweight(file_name)

Read a case file using light IO mode.

set_state([state])

Set the state of the object.

switch_to_meshing()

Switch to meshing mode and return a meshing session object.

Attributes:

preferences

Datamodel root of preferences.

reduction

Reduction handle.

settings

Settings root handle.

system_coupling

System coupling object.

tui

Instance of main_menu on which Fluent's SolverTUI methods can be executed.

workflow

Datamodel root for workflow.

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

Solver session.

Parameters:
fluent_connectionFluentConnection

Encapsulates a FluentConnection.

scheme_eval: SchemeInterpreter

Instance of SchemeInterpreter 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.

classmethod from_http(url, token)#

Create a solver session connected via REST (HTTP) transport.

Returns an HttpSolver instance - a standalone REST-backed session that is independent of the gRPC infrastructure.

Parameters:
urlstr

REST server URL (e.g., "http://127.0.0.1:5000").

tokenstr

Authentication token for the REST server.

Returns:
HttpSolver

A new solver session connected via REST transport.

Examples

>>> solver = Solver.from_http(
...     url="http://127.0.0.1:5000",
...     token="my-token"
... )
>>> solver.settings.setup.models.energy.enabled()
get_state()#

Get the state of the object.

property preferences: Root#

Datamodel root of preferences.

See the solver preferences datamodel for the complete hierarchy of preference objects and operations.

read_case_lightweight(file_name)#

Read a case file using light IO mode.

Parameters:
file_namestr

Case file name

property reduction#

Reduction handle.

set_state(state=None, **kwargs)#

Set the state of the object.

property settings: root#

Settings root handle.

See the settings root for the complete solver settings hierarchy and available configuration objects.

switch_to_meshing()#

Switch to meshing mode and return a meshing session object. Deactivate this object’s public interface and streaming services.

Returns:
Meshing
Raises:
AttributeError

If beta features are not enabled in Fluent.

property system_coupling: SystemCoupling#

System coupling object.

property tui: main_menu#

Instance of main_menu on which Fluent’s SolverTUI methods can be executed. See the solver TUI documentation for the complete hierarchy of menus, commands, and related TUI methods.

property workflow: ClassicWorkflow#

Datamodel root for workflow.

See the solver workflow datamodel for the complete hierarchy of workflow objects and operations.

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

Bases: Solver

Fluent solver session with the Aero add-on loaded.

Extends Solver by loading the aero Scheme add-on at construction time and exposing the Aero project and simulation management API. All attributes of Solver are available here.

Attributes:
aero

Instance of aero (Case.App) -> root datamodel object.

Methods:

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

SolverAero session.

new_project(project_name)

Define a new project.

new_simulation(case_file_name)

Add a new simulation by loading a case-file.

open_project(project_name)

Open a saved project.

open_simulation(simulation_file_name)

Open a saved simulation.

Attributes:

aero

Instance of aero (Case.App) -> root datamodel object.

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

SolverAero session.

Parameters:
fluent_connectionFluentConnection

Encapsulates a FluentConnection.

scheme_eval: SchemeInterpreter

Instance of SchemeInterpreter 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.

property aero#

Instance of aero (Case.App) -> root datamodel object.

new_project(project_name)#

Define a new project.

new_simulation(case_file_name)#

Add a new simulation by loading a case-file.

open_project(project_name)#

Open a saved project.

open_simulation(simulation_file_name)#

Open a saved simulation.

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

Bases: Solver

Fluent solver session with the Icing add-on loaded.

Extends Solver by loading the flicing datamodel module and exposing the Icing application object. All attributes of Solver are available here. See the flicing datamodel for its complete hierarchy and operations.

Attributes:
icing

Instance of icing (Case.App) -> root datamodel object.

Methods:

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

SolverIcing session.

Attributes:

icing

Instance of icing (Case.App) -> root datamodel object.

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

SolverIcing session.

Parameters:
fluent_connectionFluentConnection

Encapsulates a FluentConnection.

scheme_eval: SchemeInterpreter

Instance of SchemeInterpreter 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.

property icing#

Instance of icing (Case.App) -> root datamodel object.

class ansys.fluent.core.solver.session.SolverLite(fluent_connection=None, scheme_eval=None, start_transcript=True, launcher_args=None)#

Bases: Solver

Lightweight Fluent solver session.

Currently provides the same interface as Solver plus switch_to_full_solver() to upgrade to a full solver session.

Note

This class is a work-in-progress. Its feature set is expected to differ from Solver in a future release.

Methods:

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

SolverLite session.

switch_to_full_solver()

A switch to move to the full-solver session from solver-lite.

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

SolverLite session.

Parameters:
fluent_connectionFluentConnection

Encapsulates a FluentConnection.

scheme_eval: SchemeEval

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

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.

switch_to_full_solver()#

A switch to move to the full-solver session from solver-lite.