From edaf80042e311dbc4d0b7c310fbe39fd8257cf99 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee <109645853+prmukherj@users.noreply.github.com> Date: Sat, 8 Jun 2024 13:51:34 +0530 Subject: [PATCH] refactor: Include 'version' and 'precision' into enums. (#2913) * refactor: Include 'version' and 'precision' into enums. * Refactor for testing. * version -> dimension. * fix version. * Clean up. * Update src/ansys/fluent/core/launcher/pyfluent_enums.py * Refactor. * Update test. * Update logic. * Update docstring. * Update tests/test_launcher.py * Update tests/test_launcher.py * Update tests/util/fixture_fluent.py * Update tests/util/fixture_fluent.py * Update dimension check for gpu launch. * Support int in dimension. * Update documentation. * Update docstrings. * Update tests. * Update deprecated arg string. * Update docstrings. --------- Co-authored-by: Harshal Pohekar <106588300+hpohekar@users.noreply.github.com> --- .../user_guide/launching_ansys_fluent.rst | 14 ++++---- src/ansys/fluent/core/__init__.py | 2 ++ .../core/launcher/container_launcher.py | 18 ++++++---- .../launcher/fluent_launcher_options.json | 24 ------------- src/ansys/fluent/core/launcher/launcher.py | 33 ++++++++++++++---- .../fluent/core/launcher/pim_launcher.py | 20 ++++++----- .../core/launcher/process_launch_string.py | 14 +++++++- .../fluent/core/launcher/pyfluent_enums.py | 34 ++++++++++++++++--- .../fluent/core/launcher/slurm_launcher.py | 18 ++++++---- .../core/launcher/standalone_launcher.py | 18 ++++++---- src/ansys/fluent/core/utils/deprecate_args.py | 6 ++-- tests/test_launcher.py | 6 ++-- tests/util/fixture_fluent.py | 12 ++++--- 13 files changed, 137 insertions(+), 82 deletions(-) diff --git a/doc/source/user_guide/launching_ansys_fluent.rst b/doc/source/user_guide/launching_ansys_fluent.rst index 27496f91031..c0de552e1ae 100644 --- a/doc/source/user_guide/launching_ansys_fluent.rst +++ b/doc/source/user_guide/launching_ansys_fluent.rst @@ -61,7 +61,7 @@ modeling dimension: .. code:: python - solver = pyfluent.launch_fluent(precision="double", version="2d", mode="solver") + solver = pyfluent.launch_fluent(precision="double", dimension=2, mode="solver") Local parallel ~~~~~~~~~~~~~~ @@ -71,7 +71,7 @@ number of processors for local parallel execution: .. code:: python solver = pyfluent.launch_fluent( - precision="double", version="2d", processor_count=2, mode="solver" + precision="double", dimension=2, processor_count=2, mode="solver" ) Distributed parallel @@ -83,7 +83,7 @@ distributed across more than one machine: solver = pyfluent.launch_fluent( precision="double", - version="3d", + dimension=3, processor_count=16, mode="solver", additional_arguments="-cnf=m1:8,m2:8", @@ -153,7 +153,7 @@ machines and cores: .. code:: python - solver = pyfluent.launch_fluent(precision="double", version="3d", mode="solver") + solver = pyfluent.launch_fluent(precision="double", dimension=3, mode="solver") If you want to clamp the number of cores that Fluent is launched on, you can pass the ``processor_count`` parameter: @@ -161,7 +161,7 @@ pass the ``processor_count`` parameter: .. code:: python solver = pyfluent.launch_fluent( - precision="double", version="3d", processor_count=16, mode="solver" + precision="double", dimension=3, processor_count=16, mode="solver" ) Passing the ``processor_count`` parameter like this forces execution of Fluent on 16 @@ -179,7 +179,7 @@ argument: .. code:: python solver = pyfluent.launch_fluent( - precision="double", version="3d", mode="solver", additional_arguments="-t16" + precision="double", dimension=3, mode="solver", additional_arguments="-t16" ) For distributed parallel processing, you usually pass both parameters: @@ -188,7 +188,7 @@ For distributed parallel processing, you usually pass both parameters: solver = pyfluent.launch_fluent( precision="double", - version="3d", + dimension=3, mode="solver", additional_arguments="-t16 -cnf=m1:8,m2:8", ) diff --git a/src/ansys/fluent/core/__init__.py b/src/ansys/fluent/core/__init__.py index e1366d1e508..374ea090f1d 100644 --- a/src/ansys/fluent/core/__init__.py +++ b/src/ansys/fluent/core/__init__.py @@ -22,9 +22,11 @@ launch_fluent, ) from ansys.fluent.core.launcher.pyfluent_enums import ( # noqa: F401 + Dimension, FluentLinuxGraphicsDriver, FluentMode, FluentWindowsGraphicsDriver, + Precision, UIMode, ) from ansys.fluent.core.services.batch_ops import BatchOps # noqa: F401 diff --git a/src/ansys/fluent/core/launcher/container_launcher.py b/src/ansys/fluent/core/launcher/container_launcher.py index 80db74a22f3..05706226157 100644 --- a/src/ansys/fluent/core/launcher/container_launcher.py +++ b/src/ansys/fluent/core/launcher/container_launcher.py @@ -26,9 +26,11 @@ _build_fluent_launch_args_string, ) from ansys.fluent.core.launcher.pyfluent_enums import ( + Dimension, FluentLinuxGraphicsDriver, FluentMode, FluentWindowsGraphicsDriver, + Precision, UIMode, _get_argvals_and_session, ) @@ -51,8 +53,8 @@ def __init__( FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver, str, None ] = None, product_version: Union[FluentVersion, str, float, int] = None, - version: Optional[str] = None, - precision: Optional[str] = None, + dimension: Union[Dimension, int, None] = None, + precision: Union[Precision, str, None] = None, processor_count: Optional[int] = None, start_timeout: int = 60, additional_arguments: Optional[str] = "", @@ -81,12 +83,14 @@ def __init__( Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass any of ``FluentVersion.v242``, ``"24.2.0"``, ``"24.2"``, ``24.2``, or ``242``. The default is ``None``, in which case the newest installed version is used. - version : str, optional + dimension : Dimension or int, optional Geometric dimensionality of the Fluent simulation. The default is ``None``, - in which case ``"3d"`` is used. Options are ``"3d"`` and ``"2d"``. - precision : str, optional - Floating point precision. The default is ``None``, in which case ``"double"`` - is used. Options are ``"double"`` and ``"single"``. + in which case ``Dimension.THREE`` is used. Options are either the values of the + ``Dimension`` enum (``Dimension.TWO`` or ``Dimension.THREE``) or any of ``2`` and ``3``. + precision : Precision or str, optional + Floating point precision. The default is ``None``, in which case ``Precision.DOUBLE`` + is used. Options are either the values of the ``Precision`` enum (``Precision.SINGLE`` + or ``Precision.DOUBLE``) or any of ``"double"`` and ``"single"``. processor_count : int, optional Number of processors. The default is ``None``, in which case ``1`` processor is used. In job scheduler environments the total number of diff --git a/src/ansys/fluent/core/launcher/fluent_launcher_options.json b/src/ansys/fluent/core/launcher/fluent_launcher_options.json index 33dd36b15b8..77ca51b17fc 100644 --- a/src/ansys/fluent/core/launcher/fluent_launcher_options.json +++ b/src/ansys/fluent/core/launcher/fluent_launcher_options.json @@ -1,28 +1,4 @@ { - "version": { - "type": "str", - "allowed_values": [ - "3d", - "2d" - ], - "default": "3d", - "fluent_required": true, - "fluent_format": " {}" - }, - "precision": { - "type": "str", - "allowed_values": [ - "single", - "double" - ], - "default": "double", - "fluent_required": true, - "fluent_map": { - "single": "", - "double": "dp" - }, - "fluent_format": "{}" - }, "fluent_debug": { "type": "bool", "fluent_map": { diff --git a/src/ansys/fluent/core/launcher/launcher.py b/src/ansys/fluent/core/launcher/launcher.py index 29ab0117775..77d57e3da7d 100644 --- a/src/ansys/fluent/core/launcher/launcher.py +++ b/src/ansys/fluent/core/launcher/launcher.py @@ -14,10 +14,12 @@ from ansys.fluent.core.launcher.launcher_utils import _confirm_watchdog_start from ansys.fluent.core.launcher.pim_launcher import PIMLauncher from ansys.fluent.core.launcher.pyfluent_enums import ( + Dimension, FluentLinuxGraphicsDriver, FluentMode, FluentWindowsGraphicsDriver, LaunchMode, + Precision, UIMode, _get_fluent_launch_mode, _get_running_session_mode, @@ -68,6 +70,15 @@ def create_launcher(fluent_launch_mode: LaunchMode = None, **kwargs): return SlurmLauncher(**kwargs) +def _version_to_dimension(old_arg_val): + if old_arg_val == "2d": + return Dimension.TWO + elif old_arg_val == "3d": + return Dimension.THREE + else: + return None + + # pylint: disable=unused-argument @deprecate_argument( old_arg="show_gui", @@ -75,10 +86,16 @@ def create_launcher(fluent_launch_mode: LaunchMode = None, **kwargs): converter=lambda old_arg_val: UIMode.GUI if old_arg_val is True else None, deprecation_class=PyFluentDeprecationWarning, ) +@deprecate_argument( + old_arg="version", + new_arg="dimension", + converter=_version_to_dimension, + deprecation_class=PyFluentDeprecationWarning, +) def launch_fluent( product_version: Union[FluentVersion, str, float, int, None] = None, - version: Optional[str] = None, - precision: Optional[str] = None, + dimension: Union[Dimension, int, None] = None, + precision: Union[Precision, str, None] = None, processor_count: Optional[int] = None, journal_file_names: Union[None, str, list[str]] = None, start_timeout: Optional[int] = None, @@ -114,12 +131,14 @@ def launch_fluent( Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass any of ``FluentVersion.v242``, ``"24.2.0"``, ``"24.2"``, ``24.2``or ``242``. The default is ``None``, in which case the newest installed version is used. - version : str, optional + dimension : Dimension or int, optional Geometric dimensionality of the Fluent simulation. The default is ``None``, - in which case ``"3d"`` is used. Options are ``"3d"`` and ``"2d"``. - precision : str, optional - Floating point precision. The default is ``None``, in which case ``"double"`` - is used. Options are ``"double"`` and ``"single"``. + in which case ``Dimension.THREE`` is used. Options are either the values of the + ``Dimension`` enum (``Dimension.TWO`` or ``Dimension.THREE``) or any of ``2`` and ``3``. + precision : Precision or str, optional + Floating point precision. The default is ``None``, in which case ``Precision.DOUBLE`` + is used. Options are either the values of the ``Precision`` enum (``Precision.SINGLE`` + or ``Precision.DOUBLE``) or any of ``"double"`` and ``"single"``. processor_count : int, optional Number of processors. The default is ``None``, in which case ``1`` processor is used. In job scheduler environments the total number of diff --git a/src/ansys/fluent/core/launcher/pim_launcher.py b/src/ansys/fluent/core/launcher/pim_launcher.py index 5f2c5394e71..dc80ccda7d5 100644 --- a/src/ansys/fluent/core/launcher/pim_launcher.py +++ b/src/ansys/fluent/core/launcher/pim_launcher.py @@ -19,9 +19,11 @@ from ansys.fluent.core.fluent_connection import FluentConnection from ansys.fluent.core.launcher.pyfluent_enums import ( + Dimension, FluentLinuxGraphicsDriver, FluentMode, FluentWindowsGraphicsDriver, + Precision, UIMode, _get_argvals_and_session, ) @@ -49,8 +51,8 @@ def __init__( FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver, str, None ] = None, product_version: Union[FluentVersion, str, float, int] = None, - version: Optional[str] = None, - precision: Optional[str] = None, + dimension: Union[Dimension, int, None] = None, + precision: Union[Precision, str, None] = None, processor_count: Optional[int] = None, start_timeout: int = 60, additional_arguments: Optional[str] = "", @@ -77,12 +79,14 @@ def __init__( Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass ``FluentVersion.v242``, ``"24.2.0"``, ``"24.2"``, ``24.2``, or ``242``. The default is ``None``, in which case the newest installed version is used. - version : str, optional + dimension : Dimension or int, optional Geometric dimensionality of the Fluent simulation. The default is ``None``, - in which case ``"3d"`` is used. Options are ``"3d"`` and ``"2d"``. - precision : str, optional - Floating point precision. The default is ``None``, in which case ``"double"`` - is used. Options are ``"double"`` and ``"single"``. + in which case ``Dimension.THREE`` is used. Options are either the values of the + ``Dimension`` enum (``Dimension.TWO`` or ``Dimension.THREE``) or any of ``2`` and ``3``. + precision : Precision or str, optional + Floating point precision. The default is ``None``, in which case ``Precision.DOUBLE`` + is used. Options are either the values of the ``Precision`` enum (``Precision.SINGLE`` + or ``Precision.DOUBLE``) or any of ``"double"`` and ``"single"``. processor_count : int, optional Number of processors. The default is ``None``, in which case ``1`` processor is used. In job scheduler environments the total number of @@ -166,7 +170,7 @@ def __call__(self): product_version=fluent_product_version, cleanup_on_exit=self.argvals["cleanup_on_exit"], mode=self.argvals["mode"], - dimensionality=self.argvals["version"], + dimensionality=self.argvals["dimension"], launcher_args=self.argvals, file_transfer_service=self.file_transfer_service, ) diff --git a/src/ansys/fluent/core/launcher/process_launch_string.py b/src/ansys/fluent/core/launcher/process_launch_string.py index e01d5783c7b..8321e39a27d 100644 --- a/src/ansys/fluent/core/launcher/process_launch_string.py +++ b/src/ansys/fluent/core/launcher/process_launch_string.py @@ -6,7 +6,12 @@ import ansys.fluent.core as pyfluent from ansys.fluent.core.launcher import launcher_utils -from ansys.fluent.core.launcher.pyfluent_enums import FluentMode, UIMode +from ansys.fluent.core.launcher.pyfluent_enums import ( + Dimension, + FluentMode, + Precision, + UIMode, +) from ansys.fluent.core.scheduler import build_parallel_options, load_machines from ansys.fluent.core.utils.fluent_version import FluentVersion @@ -26,6 +31,13 @@ def _build_fluent_launch_args_string(**kwargs) -> str: with open(_OPTIONS_FILE, encoding="utf-8") as fp: all_options = json.load(fp) launch_args_string = "" + dimension = kwargs.get("dimension") + launch_args_string += f" {Dimension(dimension).value[0]}" + precision = kwargs.get("precision") + if precision is None: + launch_args_string += f"{Precision.DOUBLE.value[0]}" + else: + launch_args_string += f"{Precision(precision).value[0]}" for k, v in all_options.items(): argval = kwargs.get(k) default = v.get("default") diff --git a/src/ansys/fluent/core/launcher/pyfluent_enums.py b/src/ansys/fluent/core/launcher/pyfluent_enums.py index 5eedc4bee76..07c3f5860f9 100644 --- a/src/ansys/fluent/core/launcher/pyfluent_enums.py +++ b/src/ansys/fluent/core/launcher/pyfluent_enums.py @@ -122,6 +122,32 @@ class UIMode(FluentEnum): GUI = ("",) +class Dimension(FluentEnum): + """Geometric dimensionality of the Fluent simulation.""" + + TWO = ("2d",) + THREE = ("3d",) + + @classmethod + def _missing_(cls, value: int): + if value is None: + return cls.THREE + for member in cls: + if int(member.value[0][0]) == value: + return member + raise ValueError( + f"The specified value '{value}' is not a supported value of {cls.__name__}." + f""" The supported values are: '{"', '".join((member.value[0][0]) for member in cls)}'.""" + ) + + +class Precision(FluentEnum): + """Floating point precision.""" + + SINGLE = ("",) + DOUBLE = ("dp",) + + class FluentWindowsGraphicsDriver(FluentEnum): """Provides supported graphics driver of Fluent in Windows.""" @@ -275,22 +301,22 @@ def _get_ui_mode( return ui_mode -def _validate_gpu(gpu: Union[bool, list], version: str): +def _validate_gpu(gpu: Union[bool, list], dimension: int): """Raise an exception if the GPU Solver is unsupported. Parameters ---------- gpu : bool or list, optional This option will start Fluent with the GPU Solver. - version : str, optional + dimension : int, optional Geometric dimensionality of the Fluent simulation. """ - if version == "2d" and gpu: + if Dimension(dimension) == Dimension.TWO and gpu: raise exceptions.GPUSolverSupportError() def _get_argvals_and_session(argvals): - _validate_gpu(argvals["gpu"], argvals["version"]) + _validate_gpu(argvals["gpu"], argvals["dimension"]) argvals["graphics_driver"] = _get_graphics_driver(argvals["graphics_driver"]) argvals["mode"] = _get_mode(argvals["mode"]) del argvals["self"] diff --git a/src/ansys/fluent/core/launcher/slurm_launcher.py b/src/ansys/fluent/core/launcher/slurm_launcher.py index 2fa8b49a9a7..b02b7bd9e56 100644 --- a/src/ansys/fluent/core/launcher/slurm_launcher.py +++ b/src/ansys/fluent/core/launcher/slurm_launcher.py @@ -54,9 +54,11 @@ ) from ansys.fluent.core.launcher.process_launch_string import _generate_launch_string from ansys.fluent.core.launcher.pyfluent_enums import ( + Dimension, FluentLinuxGraphicsDriver, FluentMode, FluentWindowsGraphicsDriver, + Precision, UIMode, _get_argvals_and_session, _get_ui_mode, @@ -209,8 +211,8 @@ def __init__( FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver, str, None ] = None, product_version: Union[FluentVersion, str, float, int, None] = None, - version: Optional[str] = None, - precision: Optional[str] = None, + dimension: Union[Dimension, int, None] = None, + precision: Union[Precision, str, None] = None, processor_count: Optional[int] = None, journal_file_names: Union[None, str, list[str]] = None, start_timeout: int = -1, @@ -245,12 +247,14 @@ def __init__( Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass ``FluentVersion.v242``, ``"24.2.0"``, ``"24.2"``, ``24.2``, or ``242``. The default is ``None``, in which case the newest installed version is used. - version : str, optional + dimension : Dimension or int, optional Geometric dimensionality of the Fluent simulation. The default is ``None``, - in which case ``"3d"`` is used. Options are ``"3d"`` and ``"2d"``. - precision : str, optional - Floating point precision. The default is ``None``, in which case ``"double"`` - is used. Options are ``"double"`` and ``"single"``. + in which case ``Dimension.THREE`` is used. Options are either the values of the + ``Dimension`` enum (``Dimension.TWO`` or ``Dimension.THREE``) or any of ``2`` and ``3``. + precision : Precision or str, optional + Floating point precision. The default is ``None``, in which case ``Precision.DOUBLE`` + is used. Options are either the values of the ``Precision`` enum (``Precision.SINGLE`` + or ``Precision.DOUBLE``) or any of ``"double"`` and ``"single"``. processor_count : int, optional Number of processors. The default is ``None``, in which case ``1`` processor is used. In job scheduler environments the total number of diff --git a/src/ansys/fluent/core/launcher/standalone_launcher.py b/src/ansys/fluent/core/launcher/standalone_launcher.py index 6112c48f6f4..3f7bf8912c9 100644 --- a/src/ansys/fluent/core/launcher/standalone_launcher.py +++ b/src/ansys/fluent/core/launcher/standalone_launcher.py @@ -32,9 +32,11 @@ ) from ansys.fluent.core.launcher.process_launch_string import _generate_launch_string from ansys.fluent.core.launcher.pyfluent_enums import ( + Dimension, FluentLinuxGraphicsDriver, FluentMode, FluentWindowsGraphicsDriver, + Precision, UIMode, _get_argvals_and_session, _get_standalone_launch_fluent_version, @@ -61,8 +63,8 @@ def __init__( FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver, str, None ] = None, product_version: Union[FluentVersion, str, float, int, None] = None, - version: Optional[str] = None, - precision: Optional[str] = None, + dimension: Union[Dimension, int, None] = None, + precision: Union[Precision, str, None] = None, processor_count: Optional[int] = None, journal_file_names: Union[None, str, list[str]] = None, start_timeout: int = 60, @@ -96,12 +98,14 @@ def __init__( Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass ``FluentVersion.v242``, ``"24.2.0"``, ``"24.2"``, ``24.2``, or ``242``. The default is ``None``, in which case the newest installed version is used. - version : str, optional + dimension : Dimension or int, optional Geometric dimensionality of the Fluent simulation. The default is ``None``, - in which case ``"3d"`` is used. Options are ``"3d"`` and ``"2d"``. - precision : str, optional - Floating point precision. The default is ``None``, in which case ``"double"`` - is used. Options are ``"double"`` and ``"single"``. + in which case ``Dimension.THREE`` is used. Options are either the values of the + ``Dimension`` enum (``Dimension.TWO`` or ``Dimension.THREE``) or any of ``2`` and ``3``. + precision : Precision or str, optional + Floating point precision. The default is ``None``, in which case ``Precision.DOUBLE`` + is used. Options are either the values of the ``Precision`` enum (``Precision.SINGLE`` + or ``Precision.DOUBLE``) or any of ``"double"`` and ``"single"``. processor_count : int, optional Number of processors. The default is ``None``, in which case ``1`` processor is used. In job scheduler environments the total number of diff --git a/src/ansys/fluent/core/utils/deprecate_args.py b/src/ansys/fluent/core/utils/deprecate_args.py index 2e8b6731eac..b449df866a8 100644 --- a/src/ansys/fluent/core/utils/deprecate_args.py +++ b/src/ansys/fluent/core/utils/deprecate_args.py @@ -4,7 +4,7 @@ import logging import warnings -from ansys.fluent.core.launcher.pyfluent_enums import FluentEnum +from ansys.fluent.core.launcher.pyfluent_enums import Dimension, FluentEnum from ansys.fluent.core.warnings import PyFluentDeprecationWarning logger = logging.getLogger("pyfluent.general") @@ -18,7 +18,9 @@ def deprecate_argument( def _str_repr(var): """Converts a string or FluentEnum variable to quoted string representation.""" - if isinstance(var, (str, FluentEnum)): + if isinstance(var, Dimension): + return 2 if var == Dimension.TWO else 3 + elif isinstance(var, (str, FluentEnum)): return f'"{var}"' else: return var diff --git a/tests/test_launcher.py b/tests/test_launcher.py index 146c12da1ac..1296c2dd716 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -39,7 +39,7 @@ def test_gpu_version_error(): with pytest.raises(GPUSolverSupportError) as msg: pyfluent.launch_fluent( mode="meshing", - version="2d", + dimension=2, precision="single", processor_count=5, ui_mode="gui", @@ -47,7 +47,7 @@ def test_gpu_version_error(): ) pyfluent.setup_for_fluent( mode="meshing", - version="2d", + dimension=2, precision="single", processor_count=5, ui_mode="gui", @@ -324,7 +324,7 @@ def test_fluent_launchers(): ui_mode=kwargs["ui_mode"], graphics_driver=kwargs["graphics_driver"], product_version=None, - version=None, + dimension=None, precision=None, processor_count=None, start_timeout=None, diff --git a/tests/util/fixture_fluent.py b/tests/util/fixture_fluent.py index 888bad1a612..034b4ab1a6f 100644 --- a/tests/util/fixture_fluent.py +++ b/tests/util/fixture_fluent.py @@ -109,15 +109,17 @@ def launch_fluent_solver_2ddp(): container_dict = {"host_mount_path": pyfluent.USER_DATA_PATH} file_transfer_service = RemoteFileTransferStrategy() solver_session = pyfluent.launch_fluent( - version="2d", - precision="double", + dimension=pyfluent.Dimension.TWO, + precision=pyfluent.Precision.DOUBLE, mode="solver", container_dict=container_dict, file_transfer_service=file_transfer_service, ) else: solver_session = pyfluent.launch_fluent( - version="2d", precision="double", mode="solver" + dimension=pyfluent.Dimension.TWO, + precision=pyfluent.Precision.DOUBLE, + mode="solver", ) yield solver_session solver_session.exit() @@ -129,7 +131,7 @@ def launch_fluent_solver_2ddp_t2(): container_dict = {"host_mount_path": pyfluent.USER_DATA_PATH} file_transfer_service = RemoteFileTransferStrategy() solver_session = pyfluent.launch_fluent( - version="2d", + dimension=2, precision="double", processor_count=2, mode="solver", @@ -138,7 +140,7 @@ def launch_fluent_solver_2ddp_t2(): ) else: solver_session = pyfluent.launch_fluent( - version="2d", precision="double", processor_count=2, mode="solver" + dimension=2, precision="double", processor_count=2, mode="solver" ) yield solver_session solver_session.exit()