session_pure_meshing#

Module containing class encapsulating Fluent connection.

Classes:

PureMeshing(fluent_connection, scheme_eval)

Encapsulates a Fluent meshing session with a meshing-only Python interface.

class ansys.fluent.core.session_pure_meshing.PureMeshing(fluent_connection, scheme_eval, file_transfer_service=None, start_transcript=True, launcher_args=None)#

Bases: BaseSession

Encapsulates a Fluent meshing session with a meshing-only Python interface.

PureMeshing is designed for workflows where meshing and solving are run as

separate stages or in different environments, such as modular or containerized deployments. It provides a clean API that focuses solely on meshing tasks.

This interface exposes:

  • workflow and meshing objects for task-based meshing operations.

  • tui for scripting via the legacy Text User Interface (when needed).

Attributes:

PMFileManagement

Datamodel root of PMFileManagement.

PartManagement

Datamodel root of PartManagement.

current_workflow

Get the current active meshing workflow.

legacy_current_workflow

Get the current active meshing workflow (legacy implementation).

meshing

Datamodel root of meshing.

meshing_utilities

Datamodel root of meshing_utilities.

meshing_workflow

Full API to meshing and meshing_workflow.

preferences

Datamodel root of preferences.

tui

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

workflow

Datamodel root of workflow.

Methods:

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

PureMeshing session.

create_workflow([legacy])

Create a new blank meshing workflow.

fault_tolerant([legacy])

Get a new fault-tolerant meshing workflow.

load_workflow(file_path[, legacy])

Load a saved meshing workflow from a file.

topology_based([legacy])

Get a new topology-based meshing workflow (beta feature).

transfer_mesh_to_solvers(solvers[, ...])

Transfer mesh to Fluent solver instances.

two_dimensional_meshing([legacy])

Get a new 2D meshing workflow.

watertight([legacy])

Get a new watertight meshing workflow.

property PMFileManagement#

Datamodel root of PMFileManagement.

property PartManagement#

Datamodel root of PartManagement.

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

PureMeshing session.

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.

create_workflow(legacy=None)#

Create a new blank meshing workflow.

Initializes an empty workflow that can be manually configured with tasks. Unlike predefined workflows (watertight, fault-tolerant), this gives you full control to build a custom task sequence from scratch.

Parameters:
legacybool, optional

If True, creates a legacy workflow implementation. If False, creates a new workflow implementation. If None (default), uses the legacy workflow implementation for Fluent versions up to 25R2 and uses the new workflow implementation for later versions (since 26R1).

Returns:
Workflow

A new empty workflow instance ready for task insertion.

property current_workflow#

Get the current active meshing workflow.

Returns the workflow instance that is currently loaded and active in the meshing session. This is the workflow you’re actively working on, whether it was created from scratch, loaded from a file, or initiated as a predefined workflow type.

Returns:
Workflow

The currently active workflow instance, or None if no workflow is loaded.

fault_tolerant(legacy=None)#

Get a new fault-tolerant meshing workflow.

Parameters:
legacybool, optional

If True, returns the legacy workflow implementation. If False, returns the new workflow implementation. If None (default), uses the legacy workflow implementation for Fluent versions up to 25R2 and uses the new workflow implementation for later versions (since 26R1).

Returns:
Workflow

A new fault-tolerant workflow instance ready for configuration and execution.

property legacy_current_workflow#

Get the current active meshing workflow (legacy implementation).

Returns the legacy implementation of the currently active workflow. This is provided for backward compatibility with code written for Fluent 25R2 and earlier versions.

load_workflow(file_path, legacy=None)#

Load a saved meshing workflow from a file.

Restores a previously saved workflow configuration, including all task settings, sizing controls, and intermediate state. This allows resuming work or reusing established workflows on new geometry.

Parameters:
file_pathstr or PathType

Path to the saved workflow file (typically with .wft extension).

legacybool, optional

If True, loads as a legacy workflow implementation. If False, loads as a new workflow implementation. If None (default), uses the legacy workflow implementation for Fluent versions up to 25R2 and uses the new workflow implementation for later versions (since 26R1).

Returns:
Workflow

The loaded workflow instance with all saved state restored.

property meshing#

Datamodel root of meshing.

property meshing_utilities#

Datamodel root of meshing_utilities.

property meshing_workflow#

Full API to meshing and meshing_workflow.

property preferences#

Datamodel root of preferences.

topology_based(legacy=None)#

Get a new topology-based meshing workflow (beta feature).

Parameters:
legacybool, optional

If True, returns the legacy workflow implementation. If False, returns the new workflow implementation. If None (default), uses the legacy workflow implementation for Fluent versions up to 25R2 and uses the new workflow implementation for later versions (since 26R1).

Returns:
Workflow

A new topology-based workflow instance ready for configuration and execution.

Raises:
BetaFeaturesNotEnabled

If beta features are not enabled in the Fluent session. Enable by launching Fluent with the -beta flag or setting the appropriate environment variable.

transfer_mesh_to_solvers(solvers, file_type='case', file_name_stem=None, num_files_to_try=1, clean_up_mesh_file=True, overwrite_previous=True)#

Transfer mesh to Fluent solver instances.

Parameters:
solversiterable

Sequence of solver instances

file_typestr, default “case”

“case” or “mesh”

file_name_stemstr

Optional file name stem

num_files_to_tryint, default 1

Optional number of files to try to write, each with a different generated name. Defaults to 1

clean_up_mesh_file: bool, default True

Whether to remove the file at the end

overwrite_previous: bool, default True

Whether to overwrite the file if it already exists

Returns
——-
None
property tui#

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

two_dimensional_meshing(legacy=None)#

Get a new 2D meshing workflow.

Parameters:
legacybool, optional

If True, returns the legacy workflow implementation. If False, returns the new workflow implementation. If None (default), uses the legacy workflow implementation for Fluent versions up to 25R2 and uses the new workflow implementation for later versions (since 26R1).

Returns:
Workflow

A new 2D meshing workflow instance ready for configuration and execution.

watertight(legacy=None)#

Get a new watertight meshing workflow.

Parameters:
legacybool, optional

If True, returns the legacy workflow implementation. If False, returns the new workflow implementation. If None (default), uses the legacy workflow implementation for Fluent versions up to 25R2 and uses the new workflow implementation for later versions (since 26R1).

Returns:
Workflow

A new watertight workflow instance ready for configuration and execution.

property workflow#

Datamodel root of workflow.