fluent_adapter#

Resilient-mode adapter for Fluent solver sessions.

This module holds every Fluent-specific detail used by resilient mode: the session’s error state and health check, Fluent’s read-only settings exception, the clean stop of an interrupted solve, case and data files as checkpoints, and launch_fluent for standby sessions.

Classes:

FluentAdapter()

Resilient-mode adapter for Fluent solver sessions.

class ansys.fluent.core.resilient.fluent_adapter.FluentAdapter#

Bases: ResilientAdapter

Resilient-mode adapter for Fluent solver sessions.

Methods:

can_checkpoint(session)

Return whether a case is loaded.

checkpoint_artifacts(file_path, *, include_data)

Return the case file and, with data, the companion data file.

error_classes()

Return Fluent's read-only settings exception class.

fatal_details(session)

Return the details of Fluent's fatal error, if any.

invalidate_settings_cache(session)

Drop the cached settings root of a solver session.

is_fatal(session)

Return whether Fluent reported a fatal error for the session.

is_interrupt(err)

Return whether err is the clean stop of an interrupted solve.

is_server_healthy(session)

Return whether the Fluent server answers its health check.

launch(**kwargs)

Launch a Fluent session with launch_fluent.

read_checkpoint(session, file_path, *, ...)

Read the case (and data) written by write_checkpoint().

register_exit_callback(session, callback)

Run callback when the session's Fluent connection is finalized.

shares_client_filesystem(session)

Return whether Fluent runs locally, outside a container.

standby_launcher(session)

Return a launcher that repeats the launch of a local or container session.

write_checkpoint(session, file_path, *, ...)

Write the case, and the data when it exists, to file_path.

Attributes:

checkpoint_suffix

File suffix of a checkpoint artifact.

interruptible_commands

Commands for which the clean-stop sentinel is a benign interrupt.

irreversible_commands

Command names that cannot be undone by setting values (a checkpoint is written before them when auto_checkpoint is enabled).

non_replayable_commands

Commands that are recorded but never replayed onto a standby session.

non_replayable_prefixes

Command-name prefixes that are recorded but never replayed (for example commands that only write output files).

path_prefixes

Dotted prefixes a user may prepend to a settings path.

product_name

Product name used in messages.

server_name_attr

Attribute holding the server-side name of a settings object.

can_checkpoint(session)#

Return whether a case is loaded.

checkpoint_artifacts(file_path, *, include_data)#

Return the case file and, with data, the companion data file.

checkpoint_suffix: str = '.cas.h5'#

File suffix of a checkpoint artifact.

error_classes()#

Return Fluent’s read-only settings exception class.

fatal_details(session)#

Return the details of Fluent’s fatal error, if any.

interruptible_commands: frozenset[str] = frozenset({'calculate', 'dual_time_iterate', 'iterate'})#

Commands for which the clean-stop sentinel is a benign interrupt.

invalidate_settings_cache(session)#

Drop the cached settings root of a solver session.

irreversible_commands: frozenset[str] = frozenset({'calculate', 'dual_time_iterate', 'iterate', 'read', 'read_case', 'read_case_data', 'read_data', 'read_mesh', 'replace', 'replace_mesh'})#

Command names that cannot be undone by setting values (a checkpoint is written before them when auto_checkpoint is enabled).

is_fatal(session)#

Return whether Fluent reported a fatal error for the session.

is_interrupt(err)#

Return whether err is the clean stop of an interrupted solve.

Fluent ends an interrupted iterate or calculate with RuntimeError("()").

is_server_healthy(session)#

Return whether the Fluent server answers its health check.

launch(**kwargs)#

Launch a Fluent session with launch_fluent.

non_replayable_commands: frozenset[str] = frozenset({'interrupt'})#

Commands that are recorded but never replayed onto a standby session.

non_replayable_prefixes: tuple[str, ...] = ('write', 'export', 'save', 'print', 'display')#

Command-name prefixes that are recorded but never replayed (for example commands that only write output files).

path_prefixes: tuple[str, ...] = ('solver.settings.', 'settings.')#

Dotted prefixes a user may prepend to a settings path.

product_name: str = 'Fluent'#

Product name used in messages.

read_checkpoint(session, file_path, *, include_data)#

Read the case (and data) written by write_checkpoint().

The case and the data are read separately: after a floating point exception, Fluent reads the case of a combined case and data read but skips the data.

Raises:
RuntimeError

If Fluent did not load the data.

register_exit_callback(session, callback)#

Run callback when the session’s Fluent connection is finalized.

server_name_attr: str = 'fluent_name'#

Attribute holding the server-side name of a settings object.

shares_client_filesystem(session)#

Return whether Fluent runs locally, outside a container.

standby_launcher(session)#

Return a launcher that repeats the launch of a local or container session.

Sessions launched by PyFluent on the client machine, directly or in a container, are supported. A container standby is another container started with the same arguments, so it mounts the same host folder. For PIM, remote, or file-transfer sessions, pass PoolConfig(launch_kwargs=...).

write_checkpoint(session, file_path, *, include_data)#

Write the case, and the data when it exists, to file_path.