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:
|
Fluent pre-post session. |
|
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.solver.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.solver.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:
Meshing
- 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.solver.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.solver.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.solver.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.