The pyfluent.py module#
Summary#
Persistent PyFluent Solver session. |
Merge caller overrides with stock launch defaults. |
Description#
PyFluent backend for the Solve leaf.
Holds a persistent ansys.fluent.core.Solver session. All live-context
work delegates to ansys.fluent.mcp.common.introspection so the logic is
generic and caller-driven. There is no hardcoded list of named-object
collections. This matches the behavior of the legacy
/fluent_get_targeted_context endpoint in aali-flowkit-python.
PyFluent is an optional dependency. Install with this command:
pip install ansys-fluent-mcp[pyfluent]
If Pyfluent is not importable, connect() returns a typed error instead
of raising at import time.
Module detail#
- pyfluent.resolve_fluent_launch_config(*, precision: str = FLUENT_LAUNCH_DEFAULTS['precision'], processor_count: int = FLUENT_LAUNCH_DEFAULTS['processor_count'], ui_mode: str = FLUENT_LAUNCH_DEFAULTS['ui_mode'], product_version: str | None = None, dimension: int | str | None = None, mode: str | None = None, gpu: bool | list[int] | str | None = None, journal_file_names: str | list[str] | None = None, case_file_name: str | None = None, case_data_file_name: str | None = None, cwd: str | None = None, fluent_path: str | None = None, env: dict[str, Any] | None = None, graphics_driver: str | None = None, scheduler_options: dict[str, Any] | None = None, start_timeout: int | None = None, cleanup_on_exit: bool | None = None, additional_arguments: str | None = None) dict[str, Any]#
Merge caller overrides with stock launch defaults.
Returns the effective configuration. What is actually launched with is echoed back to the user. Only keys the caller explicitly set (or that have non-
Nonedefaults) appear.gpustays absent for CPU unless the user opted in.- Parameters:
- precision
str Precision to supply to the function.
- processor_count
int Processor count to supply to the function.
- ui_mode
str Ui mode to supply to the function.
- product_version
Optional[str] Product version to supply to the function.
- dimension
Optional[int|str] Dimension to supply to the function.
- mode
Optional[str] Mode to supply to the function.
- gpu
Optional[bool |list[int] |str] GPU to supply to the function.
- journal_file_names
Optional[str|list[str]] Journal file names to supply to the function.
- case_file_name
Optional[str] Case file name to supply to the function.
- case_data_file_name
Optional[str] Case data file name to supply to the function.
- cwd
Optional[str] Command to supply to the function.
- fluent_path
Optional[str] Fluent path to supply to the function.
- env
Optional[dict[str,Any]] Environment mapping to read instead of the process environment.
- graphics_driver
Optional[str] Graphics driver to supply to the function.
- scheduler_options
Optional[dict[str,Any]] Scheduler options to supply to the function.
- start_timeout
Optional[int] Start timeout to supply to the function.
- cleanup_on_exit
Optional[bool] Cleanup on exit to supply to the function.
- additional_arguments
Optional[str] Additional arguments to supply to the function.
- precision
- Returns:
- pyfluent.logger#