SolverMode#

class ansys.fluent.mcp.solve.lib.active_path.SolverMode#

A snapshot of the live solver mode facets that gate path selection.

Every field defaults to the “simplest” value (standard namespace, steady, pressure-based, segregated, single-phase, energy off) so a partially-known mode still resolves deterministically.

Overview#

from_state

Build a SolverMode from a live state snapshot dict.

from_backend_state

Build a SolverMode from the raw backend.get_state() output.

coupled

True when the pressure-velocity scheme is a coupled-family one.

pressure_based

True when the solver type is pressure-based (opposite of density-based).

multiphase

True when any multiphase model is active.

Import detail#

from ansys.fluent.mcp.solve.lib.active_path import SolverMode

Property detail#

property SolverMode.coupled: bool#

True when the pressure-velocity scheme is a coupled-family one.

property SolverMode.pressure_based: bool#

True when the solver type is pressure-based (opposite of density-based).

property SolverMode.multiphase: bool#

True when any multiphase model is active.

Attribute detail#

SolverMode.utl: bool = False#
SolverMode.transient: bool = False#
SolverMode.density_based: bool = False#
SolverMode.flow_scheme: str | None = None#
SolverMode.pseudo_transient: bool = False#
SolverMode.multiphase_model: str | None = None#
SolverMode.phases: tuple[str, Ellipsis] = ()#
SolverMode.turbulence_model: str | None = None#
SolverMode.energy: bool = False#
SolverMode.nita: bool = False#
SolverMode.radiation_model: str | None = None#

Method detail#

classmethod SolverMode.from_state(state: Mapping[str, Any] | None, *, utl: bool | None = None, phases: tuple[str, Ellipsis] = ()) SolverMode#

Build a SolverMode from a live state snapshot dict.

state is a flat {path: value} mapping as returned by backend.get_state([...]). utl is passed separately because UTL detection is a dedicated probe (detect_utl_mode), not a plain settings read. phases (ordered phase keys) is likewise supplied by the caller when known (it comes from list_named_objects on setup.models.multiphase.phases).

classmethod SolverMode.from_backend_state(state: Mapping[str, Any] | None, *, utl: bool | None = None, phases: tuple[str, Ellipsis] = ()) SolverMode#

Build a SolverMode from the raw backend.get_state() output.

The Fluent PyFluent backend returns a nested dict of dicts keyed by slash-separated node paths (e.g. "setup/general/ solver" -> {"time": "steady", "type": "pressure-based", ...}), NOT the flat dotted mapping from_state() expects. This adapter flattens the shape the backend uses onto the flat dotted mapping from_state() consumes so callers don’t have to reimplement the translation.

Silently tolerant of missing keys — a partial or empty state still produces a valid SolverMode populated with the “simplest” defaults. Only the specific facets from_state() cares about are extracted; other backend-state keys are ignored.