session#
Fluent session classes for meshing, solving, and file-based workflows.
The session classes are organized by responsibility:
BaseSessionandFileSessionare defined inansys.fluent.core.execution.session.sessionandansys.fluent.core.execution.session.file, respectively.
- Solver sessions are defined in modules under
- Meshing sessions are defined in modules under
The refactor moved the session implementations into these execution, solver, and meshing packages; their inheritance relationships are unchanged. The public hierarchy is:
BaseSession (execution.session.session)
├── Solver (solver.session.solver)
│ ├── SolverAero (solver.session.solver_aero)
│ ├── SolverIcing (solver.session.solver_icing)
│ ├── SolverLite (solver.session.solver_lite)
│ └── PrePost (solver.session.solver_pre_post)
└── BaseMeshing (meshing.session.base_meshing; internal base class)
├── PureMeshing (meshing.session.pure_meshing)
└── Meshing (meshing.session.meshing)
FileSession is a separate file-based reader, not a live Fluent session and
not a subclass of BaseSession. It is defined in
ansys.fluent.core.execution.session.file.
This package re-exports the concrete solver, meshing, and file-session classes
for convenience. Their defining modules are listed above; BaseSession is
available from ansys.fluent.core.execution.session.session.
Classes:
|
File session to read case and data file. |
|
Fluent meshing session with the ability to switch to a solver. |
|
Fluent pre-post session. |
|
Fluent meshing session without solver-switching capability. |
|
Fluent solver session. |
|
Fluent solver session with the Aero add-on loaded. |
|
Fluent solver session with the Icing add-on loaded. |
|
Lightweight Fluent solver session. |
- class ansys.fluent.core.execution.session.FileSession(case_file_name=None, data_file_name=None)#
Bases:
objectFile session to read case and data file.
Methods:
__init__([case_file_name, data_file_name])__init__ method of FileSession class.
read_case(case_file_name)Read Case file.
read_data(data_file_name)Read Data file.
Attributes:
Fluent field data on surfaces.
Provides access to Fluent field information.
- __init__(case_file_name=None, data_file_name=None)#
__init__ method of FileSession class.
- property field_data#
Fluent field data on surfaces.
- property field_info#
Provides access to Fluent field information.
- read_case(case_file_name)#
Read Case file.
- read_data(data_file_name)#
Read Data file.
- class ansys.fluent.core.execution.session.Meshing(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#
Bases:
BaseMeshingFluent meshing session with the ability to switch to a solver.
Extends
BaseMeshingby addingswitch_to_solver(), which transitions the running Fluent process from meshing mode to solver mode and returns aSolverinstance.All attributes and workflow factory methods of
BaseMeshingare available here. Afterswitch_to_solver()is called this object is deactivated and must not be used.Methods:
Switch to solver mode and return a solver session object.
- class ansys.fluent.core.execution.session.PrePost(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#
Bases:
SolverFluent pre-post session.
All public API is provided by
Solver.
- class ansys.fluent.core.execution.session.PureMeshing(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#
Bases:
BaseMeshingFluent meshing session without solver-switching capability.
Designed for deployments where meshing and solving run as separate processes (e.g. containerised pipelines). All public API is provided by
BaseMeshing.Use
Meshingwhen you also needswitch_to_solver().
- class ansys.fluent.core.execution.session.Solver(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#
Bases:
BaseSession,objectFluent solver session.
Provides access to Fluent’s full solver capabilities: settings tree, TUI commands, solution monitors, field data, workflows, and more.
- Attributes:
settingssettings_rootSettings root handle.
tuimain_menuInstance of
main_menuon which Fluent’s SolverTUI methods can be executed.workflowClassicWorkflowDatamodel root for workflow.
preferencespreferences_rootDatamodel root of preferences.
- fields
Fields Field data container (
solution_variable_info,solution_variable_data,reduction,field_data).- monitors
MonitorsManager Residual and report-definition monitors; auto-refreshed on solution events. See the monitors API for details.
system_couplingSystemCouplingSystem coupling object.
- scheme
SchemeInterpreter Direct access to Fluent’s Scheme interpreter. See the scheme interpreter API for details.
application_runtimeApplicationRuntimeProvides access to the Fluent application runtime.
- journal
Journal Fluent journal recorder; call
start()/stop().- transcript
TranscriptStreaming Fluent console transcript; call
.start()/.stop().- events
EventsManager 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 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 mode and return a meshing session object.
Attributes:
Datamodel root of preferences.
Reductionhandle.Settings root handle.
System coupling object.
Instance of
main_menuon which Fluent's SolverTUI methods can be executed.Datamodel root for workflow.
- __init__(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#
Solver session.
- Parameters:
- fluent_connection
FluentConnection Encapsulates a
FluentConnection.- scheme_eval: SchemeInterpreter
Instance of
SchemeInterpreterto execute Fluent’s scheme code on.- file_transfer_service
Optional 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 theSessionobject.
- fluent_connection
- classmethod from_http(url, token)#
Create a solver session connected via REST (HTTP) transport.
Returns an
HttpSolverinstance - a standalone REST-backed session that is independent of the gRPC infrastructure.- Parameters:
- Returns:
HttpSolverA 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_name
str Case file name
- file_name
- property reduction#
Reductionhandle.
- 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:
- Raises:
AttributeErrorIf beta features are not enabled in Fluent.
- property system_coupling: SystemCoupling#
System coupling object.
- property tui: main_menu#
Instance of
main_menuon 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.execution.session.SolverAero(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#
Bases:
SolverFluent solver session with the Aero add-on loaded.
Extends
Solverby loading theaeroScheme add-on at construction time and exposing the Aero project and simulation management API. All attributes ofSolverare available here.- Attributes:
aeroInstance 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:
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_connection
FluentConnection Encapsulates a
FluentConnection.- scheme_eval: SchemeInterpreter
Instance of
SchemeInterpreterto execute Fluent’s scheme code on.- file_transfer_service
Optional 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 theSessionobject.
- fluent_connection
- 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.execution.session.SolverIcing(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#
Bases:
SolverFluent solver session with the Icing add-on loaded.
Extends
Solverby loading theflicingdatamodel module and exposing the Icing application object. All attributes ofSolverare available here. See the flicing datamodel for its complete hierarchy and operations.- Attributes:
icingInstance of icing (Case.App) -> root datamodel object.
Methods:
__init__(fluent_connection, scheme_eval[, ...])SolverIcing session.
Attributes:
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_connection
FluentConnection Encapsulates a
FluentConnection.- scheme_eval: SchemeInterpreter
Instance of
SchemeInterpreterto execute Fluent’s scheme code on.- file_transfer_service
Optional 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 theSessionobject.
- fluent_connection
- property icing#
Instance of icing (Case.App) -> root datamodel object.
- class ansys.fluent.core.execution.session.SolverLite(fluent_connection=None, scheme_eval=None, start_transcript=True, launcher_args=None)#
Bases:
SolverLightweight Fluent solver session.
Currently provides the same interface as
Solverplusswitch_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
Solverin a future release.Methods:
__init__([fluent_connection, scheme_eval, ...])SolverLite session.
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_connection
FluentConnection Encapsulates a
FluentConnection.- scheme_eval: SchemeEval
Instance of
SchemeInterpreterto 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 theSessionobject.
- fluent_connection
- switch_to_full_solver()#
A switch to move to the full-solver session from solver-lite.