ansys-fluent-core 0.35.dev1__py3-none-any.whl → 0.36.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansys-fluent-core might be problematic. Click here for more details.
- ansys/fluent/core/__init__.py +2 -2
- ansys/fluent/core/codegen/__init__.py +1 -0
- ansys/fluent/core/codegen/datamodelgen.py +13 -2
- ansys/fluent/core/codegen/settingsgen.py +4 -0
- ansys/fluent/core/docker/docker_compose.py +30 -1
- ansys/fluent/core/examples/downloads.py +3 -4
- ansys/fluent/core/fluent_connection.py +2 -3
- ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
- ansys/fluent/core/generated/datamodel_231/flicing.py +25 -25
- ansys/fluent/core/generated/datamodel_231/meshing.py +202 -202
- ansys/fluent/core/generated/datamodel_232/flicing.py +25 -25
- ansys/fluent/core/generated/datamodel_232/meshing.py +161 -161
- ansys/fluent/core/generated/datamodel_241/flicing.py +30 -30
- ansys/fluent/core/generated/datamodel_241/meshing.py +241 -241
- ansys/fluent/core/generated/datamodel_242/flicing.py +45 -45
- ansys/fluent/core/generated/datamodel_242/meshing.py +318 -318
- ansys/fluent/core/generated/datamodel_242/part_management.py +9 -9
- ansys/fluent/core/generated/datamodel_251/flicing.py +25 -25
- ansys/fluent/core/generated/datamodel_251/meshing.py +395 -395
- ansys/fluent/core/generated/datamodel_251/part_management.py +6 -6
- ansys/fluent/core/generated/datamodel_252/flicing.py +45 -45
- ansys/fluent/core/generated/datamodel_252/meshing.py +394 -394
- ansys/fluent/core/generated/datamodel_252/part_management.py +5 -5
- ansys/fluent/core/generated/datamodel_261/flicing.py +20 -20
- ansys/fluent/core/generated/datamodel_261/meshing.py +500 -493
- ansys/fluent/core/generated/datamodel_261/meshing_workflow.py +61694 -0
- ansys/fluent/core/generated/datamodel_261/part_management.py +5 -5
- ansys/fluent/core/generated/datamodel_261/preferences.py +28 -0
- ansys/fluent/core/generated/datamodel_261/solver_workflow.py +14 -0
- ansys/fluent/core/generated/fluent_version_261.py +3 -3
- ansys/fluent/core/generated/meshing/tui_261.py +388 -10
- ansys/fluent/core/generated/solver/settings_261.py +8273 -3465
- ansys/fluent/core/generated/solver/settings_261.pyi +5805 -2181
- ansys/fluent/core/generated/solver/tui_261.py +1049 -335
- ansys/fluent/core/launcher/container_launcher.py +12 -3
- ansys/fluent/core/launcher/fluent_container.py +5 -3
- ansys/fluent/core/launcher/launch_options.py +2 -2
- ansys/fluent/core/launcher/launcher.py +2 -6
- ansys/fluent/core/launcher/pim_launcher.py +76 -3
- ansys/fluent/core/launcher/process_launch_string.py +1 -2
- ansys/fluent/core/launcher/slurm_launcher.py +4 -3
- ansys/fluent/core/launcher/standalone_launcher.py +3 -2
- ansys/fluent/core/module_config.py +5 -10
- ansys/fluent/core/report.py +1 -1
- ansys/fluent/core/services/__init__.py +2 -0
- ansys/fluent/core/services/datamodel_se.py +4 -1
- ansys/fluent/core/services/field_data.py +24 -0
- ansys/fluent/core/services/reduction.py +2 -0
- ansys/fluent/core/services/settings.py +1 -1
- ansys/fluent/core/services/solution_variables.py +92 -0
- ansys/fluent/core/session.py +1 -2
- ansys/fluent/core/session_base_meshing.py +8 -0
- ansys/fluent/core/session_meshing.py +5 -0
- ansys/fluent/core/session_pure_meshing.py +6 -0
- ansys/fluent/core/session_pure_meshing.pyi +5 -0
- ansys/fluent/core/session_utilities.py +8 -5
- ansys/fluent/core/solver/flobject.py +19 -0
- ansys/fluent/core/solver/function/reduction.py +2 -0
- ansys/fluent/core/ui/__init__.py +64 -0
- ansys/fluent/core/ui/jupyter_ui.py +203 -0
- ansys/fluent/core/ui/standalone_web_ui.py +296 -0
- ansys/fluent/core/ui/utils.py +173 -0
- ansys/fluent/core/utils/deprecate.py +1 -0
- {ansys_fluent_core-0.35.dev1.dist-info → ansys_fluent_core-0.36.dev0.dist-info}/METADATA +25 -19
- {ansys_fluent_core-0.35.dev1.dist-info → ansys_fluent_core-0.36.dev0.dist-info}/RECORD +67 -62
- {ansys_fluent_core-0.35.dev1.dist-info → ansys_fluent_core-0.36.dev0.dist-info}/WHEEL +0 -0
- {ansys_fluent_core-0.35.dev1.dist-info → ansys_fluent_core-0.36.dev0.dist-info}/licenses/LICENSE +0 -0
|
@@ -118,8 +118,9 @@ class DockerLauncher:
|
|
|
118
118
|
----------
|
|
119
119
|
mode : FluentMode
|
|
120
120
|
Specifies the launch mode of Fluent to target a specific session type.
|
|
121
|
-
ui_mode : UIMode
|
|
122
|
-
Defines the user interface mode for Fluent.
|
|
121
|
+
ui_mode : UIMode or str, optional
|
|
122
|
+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
|
|
123
|
+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
|
|
123
124
|
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
|
|
124
125
|
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
|
|
125
126
|
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).
|
|
@@ -231,7 +232,15 @@ class DockerLauncher:
|
|
|
231
232
|
compose_config=self._compose_config,
|
|
232
233
|
)
|
|
233
234
|
|
|
234
|
-
|
|
235
|
+
try:
|
|
236
|
+
_, _, password = _get_server_info_from_container(
|
|
237
|
+
config_dict=config_dict
|
|
238
|
+
)
|
|
239
|
+
except PermissionError:
|
|
240
|
+
container.chown_server_info_file()
|
|
241
|
+
_, _, password = _get_server_info_from_container(
|
|
242
|
+
config_dict=config_dict
|
|
243
|
+
)
|
|
235
244
|
else:
|
|
236
245
|
port, password, container = start_fluent_container(
|
|
237
246
|
self._args,
|
|
@@ -172,7 +172,7 @@ def configure_container_dict(
|
|
|
172
172
|
file_transfer_service: Any | None = None,
|
|
173
173
|
compose_config: ComposeConfig | None = None,
|
|
174
174
|
**container_dict,
|
|
175
|
-
) -> (dict, int, int, Path, bool):
|
|
175
|
+
) -> (dict, int, int, Path, str, bool):
|
|
176
176
|
"""Parses the parameters listed below, and sets up the container configuration file.
|
|
177
177
|
|
|
178
178
|
Parameters
|
|
@@ -218,6 +218,7 @@ def configure_container_dict(
|
|
|
218
218
|
timeout : int
|
|
219
219
|
port : int
|
|
220
220
|
host_server_info_file : Path
|
|
221
|
+
container_server_info_file: str
|
|
221
222
|
remove_server_info_file: bool
|
|
222
223
|
|
|
223
224
|
Raises
|
|
@@ -353,8 +354,6 @@ def configure_container_dict(
|
|
|
353
354
|
"FLUENT_ALLOW_REMOTE_GRPC_CONNECTION": "1",
|
|
354
355
|
}
|
|
355
356
|
)
|
|
356
|
-
if compose_config.is_compose:
|
|
357
|
-
container_dict["environment"]["FLUENT_SERVER_INFO_PERMISSION_SYSTEM"] = "1"
|
|
358
357
|
|
|
359
358
|
if "labels" not in container_dict:
|
|
360
359
|
test_name = pyfluent.config.test_name
|
|
@@ -468,6 +467,7 @@ def configure_container_dict(
|
|
|
468
467
|
timeout,
|
|
469
468
|
container_grpc_port,
|
|
470
469
|
host_server_info_file,
|
|
470
|
+
container_server_info_file,
|
|
471
471
|
remove_server_info_file,
|
|
472
472
|
)
|
|
473
473
|
|
|
@@ -528,6 +528,7 @@ def start_fluent_container(
|
|
|
528
528
|
timeout,
|
|
529
529
|
port,
|
|
530
530
|
host_server_info_file,
|
|
531
|
+
container_server_info_file,
|
|
531
532
|
remove_server_info_file,
|
|
532
533
|
) = container_vars
|
|
533
534
|
launch_string = " ".join(config_dict["command"])
|
|
@@ -546,6 +547,7 @@ def start_fluent_container(
|
|
|
546
547
|
compose_container = ComposeBasedLauncher(
|
|
547
548
|
compose_config=compose_config,
|
|
548
549
|
container_dict=config_dict,
|
|
550
|
+
container_server_info_file=container_server_info_file,
|
|
549
551
|
)
|
|
550
552
|
|
|
551
553
|
if not compose_container.check_image_exists():
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"""Provides a module for enums used in the PyFluent."""
|
|
24
24
|
|
|
25
25
|
from enum import Enum
|
|
26
|
+
import os
|
|
26
27
|
import warnings
|
|
27
28
|
|
|
28
29
|
from ansys.fluent.core.exceptions import DisallowedValuesError
|
|
@@ -344,7 +345,6 @@ def _get_standalone_launch_fluent_version(argvals) -> FluentVersion | None:
|
|
|
344
345
|
FluentVersion, optional
|
|
345
346
|
Fluent version or ``None``
|
|
346
347
|
"""
|
|
347
|
-
from ansys.fluent.core import config
|
|
348
348
|
|
|
349
349
|
# Look for Fluent version in the following order:
|
|
350
350
|
# 1. product_version parameter passed with launch_fluent
|
|
@@ -358,7 +358,7 @@ def _get_standalone_launch_fluent_version(argvals) -> FluentVersion | None:
|
|
|
358
358
|
|
|
359
359
|
# (DEV) if "PYFLUENT_FLUENT_ROOT" environment variable is defined, we cannot
|
|
360
360
|
# determine the Fluent version, so returning None.
|
|
361
|
-
if
|
|
361
|
+
if "PYFLUENT_FLUENT_ROOT" in os.environ:
|
|
362
362
|
return None
|
|
363
363
|
|
|
364
364
|
# 2. the latest ANSYS version from AWP_ROOT environment variables
|
|
@@ -240,12 +240,8 @@ def launch_fluent(
|
|
|
240
240
|
Fluent transcript subsequently via the method calls, ``transcript.start()``
|
|
241
241
|
and ``transcript.stop()`` on the session object.
|
|
242
242
|
ui_mode : UIMode or str, optional
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
``"no_graphics"`` or ``"gui"``. The default is ``UIMode.HIDDEN_GUI`` in
|
|
246
|
-
Windows and ``UIMode.NO_GUI`` in Linux. ``"no_gui_or_graphics"`` and
|
|
247
|
-
``"no_gui"`` user interface modes are supported in Windows starting from Fluent
|
|
248
|
-
version 2024 R1.
|
|
243
|
+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
|
|
244
|
+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
|
|
249
245
|
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver or str, optional
|
|
250
246
|
Graphics driver of Fluent. In Windows, options are either the values of the
|
|
251
247
|
``FluentWindowsGraphicsDriver`` enum or any of ``"null"``, ``"msw"``,
|
|
@@ -38,6 +38,8 @@ Examples
|
|
|
38
38
|
import inspect
|
|
39
39
|
import logging
|
|
40
40
|
import os
|
|
41
|
+
import tempfile
|
|
42
|
+
import time
|
|
41
43
|
from typing import Any, Dict
|
|
42
44
|
|
|
43
45
|
from ansys.fluent.core.fluent_connection import FluentConnection, _get_max_c_int_limit
|
|
@@ -50,6 +52,7 @@ from ansys.fluent.core.launcher.launch_options import (
|
|
|
50
52
|
UIMode,
|
|
51
53
|
_get_argvals_and_session,
|
|
52
54
|
)
|
|
55
|
+
from ansys.fluent.core.session import _parse_server_info_file
|
|
53
56
|
from ansys.fluent.core.session_meshing import Meshing
|
|
54
57
|
from ansys.fluent.core.session_pure_meshing import PureMeshing
|
|
55
58
|
from ansys.fluent.core.session_solver import Solver
|
|
@@ -93,8 +96,9 @@ class PIMLauncher:
|
|
|
93
96
|
----------
|
|
94
97
|
mode : FluentMode
|
|
95
98
|
Specifies the launch mode of Fluent for targeting a specific session type.
|
|
96
|
-
ui_mode : UIMode
|
|
97
|
-
Defines the user interface mode for Fluent.
|
|
99
|
+
ui_mode : UIMode or str, optional
|
|
100
|
+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
|
|
101
|
+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
|
|
98
102
|
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
|
|
99
103
|
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
|
|
100
104
|
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).
|
|
@@ -193,6 +197,54 @@ class PIMLauncher:
|
|
|
193
197
|
)
|
|
194
198
|
|
|
195
199
|
|
|
200
|
+
def get_ip_port_password(
|
|
201
|
+
file_service,
|
|
202
|
+
filename="sifile.txt",
|
|
203
|
+
max_retries=20,
|
|
204
|
+
wait_time_between_retries=1, # seconds
|
|
205
|
+
):
|
|
206
|
+
"""
|
|
207
|
+
Downloads the file with retries and parses server info.
|
|
208
|
+
|
|
209
|
+
Parameters
|
|
210
|
+
----------
|
|
211
|
+
file_service: PimFileTransferService
|
|
212
|
+
Service object with method download_file(filename, target_dir).
|
|
213
|
+
filename: str
|
|
214
|
+
Name of the file to download.
|
|
215
|
+
max_retries: int
|
|
216
|
+
Maximum number of attempts.
|
|
217
|
+
wait_time_between_retries: float
|
|
218
|
+
Seconds to wait between retries (can be fractional, e.g., 0.5 for half a second).
|
|
219
|
+
|
|
220
|
+
Returns
|
|
221
|
+
-------
|
|
222
|
+
Tuple (ip, port, password) parsed from the downloaded file.
|
|
223
|
+
|
|
224
|
+
Raises
|
|
225
|
+
------
|
|
226
|
+
TimeoutError
|
|
227
|
+
If unable to download the server info file after multiple retries.
|
|
228
|
+
"""
|
|
229
|
+
with tempfile.TemporaryDirectory(prefix="fluent_sifile_") as tmpdir:
|
|
230
|
+
for attempt in range(1, max_retries + 1):
|
|
231
|
+
try:
|
|
232
|
+
file_service.download_file(filename, tmpdir)
|
|
233
|
+
break
|
|
234
|
+
except Exception as ex:
|
|
235
|
+
logger.warning(
|
|
236
|
+
f"Attempt {attempt} of {max_retries} failed to download {filename}: {ex}"
|
|
237
|
+
)
|
|
238
|
+
if attempt == max_retries:
|
|
239
|
+
raise TimeoutError(
|
|
240
|
+
f"Failed to download file '{filename}' after {max_retries} attempts "
|
|
241
|
+
f"with {wait_time_between_retries}s between retries."
|
|
242
|
+
) from ex
|
|
243
|
+
time.sleep(wait_time_between_retries)
|
|
244
|
+
|
|
245
|
+
return _parse_server_info_file(os.path.join(tmpdir, filename))
|
|
246
|
+
|
|
247
|
+
|
|
196
248
|
def launch_remote_fluent(
|
|
197
249
|
session_cls,
|
|
198
250
|
start_transcript: bool,
|
|
@@ -232,6 +284,11 @@ def launch_remote_fluent(
|
|
|
232
284
|
-------
|
|
233
285
|
Meshing | PureMeshing | Solver | SolverIcing
|
|
234
286
|
Session object.
|
|
287
|
+
|
|
288
|
+
Raises
|
|
289
|
+
------
|
|
290
|
+
TimeoutError
|
|
291
|
+
If unable to download the server info file after multiple retries.
|
|
235
292
|
"""
|
|
236
293
|
|
|
237
294
|
pim = pypim.connect()
|
|
@@ -245,6 +302,10 @@ def launch_remote_fluent(
|
|
|
245
302
|
|
|
246
303
|
instance.wait_for_ready()
|
|
247
304
|
|
|
305
|
+
ip, port, password = get_ip_port_password(
|
|
306
|
+
file_service=PimFileTransferService(pim_instance=instance)
|
|
307
|
+
)
|
|
308
|
+
|
|
248
309
|
channel = instance.build_grpc_channel(
|
|
249
310
|
options=[
|
|
250
311
|
("grpc.max_send_message_length", _get_max_c_int_limit()),
|
|
@@ -253,6 +314,9 @@ def launch_remote_fluent(
|
|
|
253
314
|
)
|
|
254
315
|
|
|
255
316
|
fluent_connection = create_fluent_connection(
|
|
317
|
+
ip=ip,
|
|
318
|
+
port=port,
|
|
319
|
+
password=password,
|
|
256
320
|
channel=channel,
|
|
257
321
|
cleanup_on_exit=cleanup_on_exit,
|
|
258
322
|
instance=instance,
|
|
@@ -288,11 +352,20 @@ def create_fluent_instance(
|
|
|
288
352
|
|
|
289
353
|
|
|
290
354
|
def create_fluent_connection(
|
|
291
|
-
|
|
355
|
+
ip: str,
|
|
356
|
+
port: int,
|
|
357
|
+
password: str,
|
|
358
|
+
channel,
|
|
359
|
+
cleanup_on_exit: bool,
|
|
360
|
+
instance,
|
|
361
|
+
launcher_args: Dict[str, Any] | None,
|
|
292
362
|
):
|
|
293
363
|
"""Create a Fluent connection."""
|
|
294
364
|
|
|
295
365
|
return FluentConnection(
|
|
366
|
+
ip=ip,
|
|
367
|
+
port=port,
|
|
368
|
+
password=password,
|
|
296
369
|
channel=channel,
|
|
297
370
|
cleanup_on_exit=cleanup_on_exit,
|
|
298
371
|
remote_instance=instance,
|
|
@@ -149,7 +149,6 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
|
|
|
149
149
|
Path
|
|
150
150
|
Fluent executable path
|
|
151
151
|
"""
|
|
152
|
-
from ansys.fluent.core import config
|
|
153
152
|
|
|
154
153
|
def get_exe_path(fluent_root: Path) -> Path:
|
|
155
154
|
if launcher_utils.is_windows():
|
|
@@ -171,7 +170,7 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
|
|
|
171
170
|
return FluentVersion(product_version).get_fluent_exe_path()
|
|
172
171
|
|
|
173
172
|
# (DEV) "PYFLUENT_FLUENT_ROOT" environment variable
|
|
174
|
-
fluent_root =
|
|
173
|
+
fluent_root = os.getenv("PYFLUENT_FLUENT_ROOT")
|
|
175
174
|
if fluent_root:
|
|
176
175
|
return get_exe_path(Path(fluent_root))
|
|
177
176
|
|
|
@@ -316,8 +316,9 @@ class SlurmLauncher:
|
|
|
316
316
|
----------
|
|
317
317
|
mode : FluentMode
|
|
318
318
|
Launch mode of Fluent to point to a specific session type.
|
|
319
|
-
ui_mode : UIMode
|
|
320
|
-
|
|
319
|
+
ui_mode : UIMode or str, optional
|
|
320
|
+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
|
|
321
|
+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
|
|
321
322
|
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
|
|
322
323
|
Graphics driver of Fluent. Options are the values of the
|
|
323
324
|
``FluentWindowsGraphicsDriver`` enum in Windows or the values of the
|
|
@@ -460,7 +461,7 @@ class SlurmLauncher:
|
|
|
460
461
|
launch_cmd += _build_journal_argument(
|
|
461
462
|
self._argvals["topy"], self._argvals["journal_file_names"]
|
|
462
463
|
)
|
|
463
|
-
launch_cmd += '
|
|
464
|
+
launch_cmd += ' -setenv="FLUENT_ALLOW_REMOTE_GRPC_CONNECTION=1"'
|
|
464
465
|
|
|
465
466
|
logger.debug(f"Launching Fluent with command: {launch_cmd}")
|
|
466
467
|
proc = subprocess.Popen(launch_cmd, **kwargs)
|
|
@@ -113,8 +113,9 @@ class StandaloneLauncher:
|
|
|
113
113
|
----------
|
|
114
114
|
mode : FluentMode
|
|
115
115
|
Specifies the launch mode of Fluent to target a specific session type.
|
|
116
|
-
ui_mode : UIMode
|
|
117
|
-
Defines the user interface mode for Fluent.
|
|
116
|
+
ui_mode : UIMode or str, optional
|
|
117
|
+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
|
|
118
|
+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
|
|
118
119
|
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
|
|
119
120
|
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
|
|
120
121
|
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).
|
|
@@ -141,10 +141,10 @@ class Config:
|
|
|
141
141
|
lambda instance: False, "FLUENT_SHOW_MESH_AFTER_CASE_READ"
|
|
142
142
|
)
|
|
143
143
|
|
|
144
|
-
#: Whether to write the automatic transcript in Fluent, defaults to
|
|
144
|
+
#: Whether to write the automatic transcript in Fluent, defaults to True if ``PYFLUENT_SKIP_FLUENT_AUTOMATIC_TRANSCRIPT`` environment variable is not set to "1".
|
|
145
145
|
fluent_automatic_transcript = _ConfigDescriptor["Config"](
|
|
146
|
-
lambda instance: instance._env.get("
|
|
147
|
-
|
|
146
|
+
lambda instance: instance._env.get("PYFLUENT_SKIP_FLUENT_AUTOMATIC_TRANSCRIPT")
|
|
147
|
+
!= "1",
|
|
148
148
|
"FLUENT_AUTOMATIC_TRANSCRIPT",
|
|
149
149
|
)
|
|
150
150
|
|
|
@@ -216,9 +216,9 @@ class Config:
|
|
|
216
216
|
lambda instance: False, "LAUNCH_FLUENT_SKIP_PASSWORD_CHECK"
|
|
217
217
|
)
|
|
218
218
|
|
|
219
|
-
#: The timeout in seconds to wait for Fluent to exit, defaults to the value of ``
|
|
219
|
+
#: The timeout in seconds to wait for Fluent to exit, defaults to the value of ``PYFLUENT_TIMEOUT_FORCE_EXIT`` environment variable.
|
|
220
220
|
force_exit_timeout = _ConfigDescriptor["Config"](
|
|
221
|
-
lambda instance: instance._env.get("
|
|
221
|
+
lambda instance: instance._env.get("PYFLUENT_TIMEOUT_FORCE_EXIT")
|
|
222
222
|
)
|
|
223
223
|
|
|
224
224
|
#: Whether to skip code generation of built-in settings, defaults to the value of ``PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS`` environment variable.
|
|
@@ -300,11 +300,6 @@ class Config:
|
|
|
300
300
|
lambda instance: instance._env.get("PYFLUENT_HIDE_LOG_SECRETS") == "1"
|
|
301
301
|
)
|
|
302
302
|
|
|
303
|
-
#: The Fluent root directory to be used for PyFluent, defaults to the value of ``PYFLUENT_FLUENT_ROOT`` environment variable.
|
|
304
|
-
fluent_root = _ConfigDescriptor["Config"](
|
|
305
|
-
lambda instance: instance._env.get("PYFLUENT_FLUENT_ROOT")
|
|
306
|
-
)
|
|
307
|
-
|
|
308
303
|
#: The remoting server address to be used in Fluent, defaults to the value of ``REMOTING_SERVER_ADDRESS`` environment variable.
|
|
309
304
|
remoting_server_address = _ConfigDescriptor["Config"](
|
|
310
305
|
lambda instance: instance._env.get("REMOTING_SERVER_ADDRESS")
|
ansys/fluent/core/report.py
CHANGED
|
@@ -45,7 +45,7 @@ ANSYS_ENV_VARS = [
|
|
|
45
45
|
"PYFLUENT_FLUENT_PORT",
|
|
46
46
|
"PYFLUENT_FLUENT_ROOT",
|
|
47
47
|
"PYFLUENT_FLUENT_LAUNCH_TIMEOUT",
|
|
48
|
-
"
|
|
48
|
+
"PYFLUENT_SKIP_FLUENT_AUTOMATIC_TRANSCRIPT",
|
|
49
49
|
"PYFLUENT_GRPC_LOG_BYTES_LIMIT",
|
|
50
50
|
"PYFLUENT_LAUNCH_CONTAINER",
|
|
51
51
|
"PYFLUENT_LOGGING",
|
|
@@ -43,6 +43,7 @@ from ansys.fluent.core.services.solution_variables import (
|
|
|
43
43
|
SolutionVariableService,
|
|
44
44
|
)
|
|
45
45
|
from ansys.fluent.core.services.transcript import TranscriptService
|
|
46
|
+
from ansys.fluent.core.streaming_services.field_data_streaming import FieldDataStreaming
|
|
46
47
|
|
|
47
48
|
_service_cls_by_name = {
|
|
48
49
|
"app_utilities": AppUtilities,
|
|
@@ -61,6 +62,7 @@ _service_cls_by_name = {
|
|
|
61
62
|
"svar_data": SolutionVariableData,
|
|
62
63
|
"transcript": TranscriptService,
|
|
63
64
|
"batch_ops": BatchOpsService,
|
|
65
|
+
"field_data_streaming": FieldDataStreaming,
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
|
|
@@ -1098,7 +1098,10 @@ class PyStateContainer(PyCallableStateObject):
|
|
|
1098
1098
|
Any
|
|
1099
1099
|
Value of the attribute.
|
|
1100
1100
|
"""
|
|
1101
|
-
if
|
|
1101
|
+
if (
|
|
1102
|
+
pyfluent.config.datamodel_use_attr_cache
|
|
1103
|
+
and self.rules != "meshing_workflow"
|
|
1104
|
+
):
|
|
1102
1105
|
return self._get_cached_attr(attrib)
|
|
1103
1106
|
return self._get_remote_attr(attrib)
|
|
1104
1107
|
|
|
@@ -623,6 +623,18 @@ class BatchFieldData(BaseFieldData, BaseFieldDataSource):
|
|
|
623
623
|
return self.data
|
|
624
624
|
|
|
625
625
|
|
|
626
|
+
class TransactionFieldData(BatchFieldData):
|
|
627
|
+
"""TransactionFieldData class - deprecated."""
|
|
628
|
+
|
|
629
|
+
def __init__(self, *args, **kwargs):
|
|
630
|
+
warnings.warn(
|
|
631
|
+
"'TransactionFieldData' is deprecated, use 'BatchFieldData' instead.",
|
|
632
|
+
PyFluentDeprecationWarning,
|
|
633
|
+
stacklevel=2,
|
|
634
|
+
)
|
|
635
|
+
super().__init__(*args, **kwargs)
|
|
636
|
+
|
|
637
|
+
|
|
626
638
|
class Batch(FieldBatch):
|
|
627
639
|
"""Populates Fluent field data on surfaces."""
|
|
628
640
|
|
|
@@ -1011,6 +1023,18 @@ class Batch(FieldBatch):
|
|
|
1011
1023
|
self.get_response()
|
|
1012
1024
|
|
|
1013
1025
|
|
|
1026
|
+
class Transaction(Batch):
|
|
1027
|
+
"""Transaction class - deprecated."""
|
|
1028
|
+
|
|
1029
|
+
def __init__(self, *args, **kwargs):
|
|
1030
|
+
warnings.warn(
|
|
1031
|
+
"'Transaction' is deprecated, use 'Batch' instead.",
|
|
1032
|
+
PyFluentDeprecationWarning,
|
|
1033
|
+
stacklevel=2,
|
|
1034
|
+
)
|
|
1035
|
+
super().__init__(*args, **kwargs)
|
|
1036
|
+
|
|
1037
|
+
|
|
1014
1038
|
class _FieldDataConstants:
|
|
1015
1039
|
"""Defines constants for Fluent field data."""
|
|
1016
1040
|
|
|
@@ -314,6 +314,8 @@ class Reduction:
|
|
|
314
314
|
) -> Any:
|
|
315
315
|
request = getattr(ReductionProtoModule, requestName)()
|
|
316
316
|
if expression is not None:
|
|
317
|
+
if hasattr(expression, "definition"):
|
|
318
|
+
expression = expression.definition()
|
|
317
319
|
request.expression = self._to_str(expression)
|
|
318
320
|
if weight is not None:
|
|
319
321
|
request.weight = Weight(weight).value
|
|
@@ -335,7 +335,7 @@ class SettingsService:
|
|
|
335
335
|
"""
|
|
336
336
|
request = SettingsModule.GetStaticInfoRequest()
|
|
337
337
|
request.root = "fluent"
|
|
338
|
-
request.optional_attrs.
|
|
338
|
+
request.optional_attrs.extend(["allowed-values", "has-migration-adapter?"])
|
|
339
339
|
response = self._service_impl.get_static_info(request)
|
|
340
340
|
# The RPC calls no longer raise an exception. Force an exception if
|
|
341
341
|
# type is empty
|
|
@@ -42,6 +42,7 @@ from ansys.fluent.core.services.interceptors import (
|
|
|
42
42
|
TracingInterceptor,
|
|
43
43
|
)
|
|
44
44
|
from ansys.fluent.core.solver.error_message import allowed_name_error_message
|
|
45
|
+
from ansys.fluent.core.utils.deprecate import all_deprecators
|
|
45
46
|
from ansys.fluent.core.variable_strategies import (
|
|
46
47
|
FluentSVarNamingStrategy as naming_strategy,
|
|
47
48
|
)
|
|
@@ -343,6 +344,19 @@ class _AllowedSvarNames:
|
|
|
343
344
|
zone_names=zone_names, domain_name=domain_name
|
|
344
345
|
).solution_variables
|
|
345
346
|
|
|
347
|
+
# pylint: disable=unused-argument
|
|
348
|
+
@all_deprecators(
|
|
349
|
+
deprecate_arg_mappings=[
|
|
350
|
+
{
|
|
351
|
+
"old_arg": "solution_variable_name",
|
|
352
|
+
"new_arg": "variable_name",
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
data_type_converter=None,
|
|
356
|
+
deprecated_version="v0.35.1",
|
|
357
|
+
deprecated_reason="'solution_variable_name' is deprecated. Use 'variable_name' instead.",
|
|
358
|
+
warn_message="",
|
|
359
|
+
)
|
|
346
360
|
def is_valid(
|
|
347
361
|
self,
|
|
348
362
|
variable_name,
|
|
@@ -352,6 +366,19 @@ class _AllowedSvarNames:
|
|
|
352
366
|
"""Check whether solution variable name is valid or not."""
|
|
353
367
|
return variable_name in self(zone_names=zone_names, domain_name=domain_name)
|
|
354
368
|
|
|
369
|
+
# pylint: disable=unused-argument
|
|
370
|
+
@all_deprecators(
|
|
371
|
+
deprecate_arg_mappings=[
|
|
372
|
+
{
|
|
373
|
+
"old_arg": "solution_variable_name",
|
|
374
|
+
"new_arg": "variable_name",
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
data_type_converter=None,
|
|
378
|
+
deprecated_version="v0.35.1",
|
|
379
|
+
deprecated_reason="'solution_variable_name' is deprecated. Use 'variable_name' instead.",
|
|
380
|
+
warn_message="",
|
|
381
|
+
)
|
|
355
382
|
def valid_name(
|
|
356
383
|
self,
|
|
357
384
|
variable_name,
|
|
@@ -581,6 +608,19 @@ class SolutionVariableData:
|
|
|
581
608
|
self._solution_variable_info
|
|
582
609
|
)
|
|
583
610
|
|
|
611
|
+
# pylint: disable=unused-argument
|
|
612
|
+
@all_deprecators(
|
|
613
|
+
deprecate_arg_mappings=[
|
|
614
|
+
{
|
|
615
|
+
"old_arg": "solution_variable_name",
|
|
616
|
+
"new_arg": "variable_name",
|
|
617
|
+
},
|
|
618
|
+
],
|
|
619
|
+
data_type_converter=None,
|
|
620
|
+
deprecated_version="v0.35.1",
|
|
621
|
+
deprecated_reason="'solution_variable_name' is deprecated. Use 'variable_name' instead.",
|
|
622
|
+
warn_message="",
|
|
623
|
+
)
|
|
584
624
|
def create_empty_array(
|
|
585
625
|
self,
|
|
586
626
|
variable_name: str,
|
|
@@ -605,6 +645,19 @@ class SolutionVariableData:
|
|
|
605
645
|
dtype=solution_variables_info[variable_name].field_type,
|
|
606
646
|
)
|
|
607
647
|
|
|
648
|
+
# pylint: disable=unused-argument
|
|
649
|
+
@all_deprecators(
|
|
650
|
+
deprecate_arg_mappings=[
|
|
651
|
+
{
|
|
652
|
+
"old_arg": "solution_variable_name",
|
|
653
|
+
"new_arg": "variable_name",
|
|
654
|
+
},
|
|
655
|
+
],
|
|
656
|
+
data_type_converter=None,
|
|
657
|
+
deprecated_version="v0.35.1",
|
|
658
|
+
deprecated_reason="'solution_variable_name' is deprecated. Use 'variable_name' instead.",
|
|
659
|
+
warn_message="",
|
|
660
|
+
)
|
|
608
661
|
def get_data(
|
|
609
662
|
self,
|
|
610
663
|
variable_name: str,
|
|
@@ -650,6 +703,19 @@ class SolutionVariableData:
|
|
|
650
703
|
extract_svars(self._service.get_data(svars_request)),
|
|
651
704
|
)
|
|
652
705
|
|
|
706
|
+
# pylint: disable=unused-argument
|
|
707
|
+
@all_deprecators(
|
|
708
|
+
deprecate_arg_mappings=[
|
|
709
|
+
{
|
|
710
|
+
"old_arg": "solution_variable_name",
|
|
711
|
+
"new_arg": "variable_name",
|
|
712
|
+
},
|
|
713
|
+
],
|
|
714
|
+
data_type_converter=None,
|
|
715
|
+
deprecated_version="v0.35.1",
|
|
716
|
+
deprecated_reason="'solution_variable_name' is deprecated. Use 'variable_name' instead.",
|
|
717
|
+
warn_message="",
|
|
718
|
+
)
|
|
653
719
|
def get_svar_data(
|
|
654
720
|
self,
|
|
655
721
|
variable_name: str,
|
|
@@ -667,6 +733,19 @@ class SolutionVariableData:
|
|
|
667
733
|
domain_name=domain_name,
|
|
668
734
|
)
|
|
669
735
|
|
|
736
|
+
# pylint: disable=unused-argument
|
|
737
|
+
@all_deprecators(
|
|
738
|
+
deprecate_arg_mappings=[
|
|
739
|
+
{
|
|
740
|
+
"old_arg": "solution_variable_name",
|
|
741
|
+
"new_arg": "variable_name",
|
|
742
|
+
},
|
|
743
|
+
],
|
|
744
|
+
data_type_converter=None,
|
|
745
|
+
deprecated_version="v0.35.1",
|
|
746
|
+
deprecated_reason="'solution_variable_name' is deprecated. Use 'variable_name' instead.",
|
|
747
|
+
warn_message="",
|
|
748
|
+
)
|
|
670
749
|
def set_data(
|
|
671
750
|
self,
|
|
672
751
|
variable_name: str,
|
|
@@ -767,6 +846,19 @@ class SolutionVariableData:
|
|
|
767
846
|
|
|
768
847
|
self._service.set_data(generate_set_data_requests())
|
|
769
848
|
|
|
849
|
+
# pylint: disable=unused-argument
|
|
850
|
+
@all_deprecators(
|
|
851
|
+
deprecate_arg_mappings=[
|
|
852
|
+
{
|
|
853
|
+
"old_arg": "solution_variable_name",
|
|
854
|
+
"new_arg": "variable_name",
|
|
855
|
+
},
|
|
856
|
+
],
|
|
857
|
+
data_type_converter=None,
|
|
858
|
+
deprecated_version="v0.35.1",
|
|
859
|
+
deprecated_reason="'solution_variable_name' is deprecated. Use 'variable_name' instead.",
|
|
860
|
+
warn_message="",
|
|
861
|
+
)
|
|
770
862
|
def set_svar_data(
|
|
771
863
|
self,
|
|
772
864
|
variable_name: str,
|
ansys/fluent/core/session.py
CHANGED
|
@@ -45,7 +45,6 @@ from ansys.fluent.core.streaming_services.datamodel_event_streaming import (
|
|
|
45
45
|
DatamodelEvents,
|
|
46
46
|
)
|
|
47
47
|
from ansys.fluent.core.streaming_services.events_streaming import EventsManager
|
|
48
|
-
from ansys.fluent.core.streaming_services.field_data_streaming import FieldDataStreaming
|
|
49
48
|
from ansys.fluent.core.streaming_services.transcript_streaming import Transcript
|
|
50
49
|
from ansys.fluent.core.utils.fluent_version import FluentVersion
|
|
51
50
|
|
|
@@ -516,7 +515,7 @@ class Fields:
|
|
|
516
515
|
_session.scheme,
|
|
517
516
|
get_zones_info,
|
|
518
517
|
)
|
|
519
|
-
self.field_data_streaming =
|
|
518
|
+
self.field_data_streaming = service_creator("field_data_streaming").create(
|
|
520
519
|
_session._fluent_connection._id, _session._field_data_service
|
|
521
520
|
)
|
|
522
521
|
self.field_data_old = service_creator("field_data_old").create(
|
|
@@ -72,6 +72,7 @@ class BaseMeshing:
|
|
|
72
72
|
self._fluent_version = fluent_version
|
|
73
73
|
self._meshing_utilities = None
|
|
74
74
|
self._old_workflow = None
|
|
75
|
+
self._meshing_workflow = None
|
|
75
76
|
self._part_management = None
|
|
76
77
|
self._pm_file_management = None
|
|
77
78
|
self._preferences = None
|
|
@@ -127,6 +128,13 @@ class BaseMeshing:
|
|
|
127
128
|
self._old_workflow = _make_datamodel_module(self, "workflow")
|
|
128
129
|
return self._old_workflow
|
|
129
130
|
|
|
131
|
+
@property
|
|
132
|
+
def meshing_workflow(self):
|
|
133
|
+
"""Full API to meshing and meshing_workflow."""
|
|
134
|
+
if self._meshing_workflow is None:
|
|
135
|
+
self._meshing_workflow = _make_datamodel_module(self, "meshing_workflow")
|
|
136
|
+
return self._meshing_workflow
|
|
137
|
+
|
|
130
138
|
def watertight_workflow(self, initialize: bool = True):
|
|
131
139
|
"""Datamodel root of workflow."""
|
|
132
140
|
self._current_workflow = WorkflowMode.WATERTIGHT_MESHING_MODE.value(
|
|
@@ -127,6 +127,11 @@ class Meshing(PureMeshing):
|
|
|
127
127
|
"""Workflow datamodel root."""
|
|
128
128
|
return super(Meshing, self).workflow
|
|
129
129
|
|
|
130
|
+
@property
|
|
131
|
+
def meshing_workflow(self):
|
|
132
|
+
"""Full API to meshing and meshing_workflow."""
|
|
133
|
+
return super(Meshing, self).meshing_workflow
|
|
134
|
+
|
|
130
135
|
@property
|
|
131
136
|
def PartManagement(self):
|
|
132
137
|
"""Part management datamodel root."""
|
|
@@ -50,6 +50,7 @@ class PureMeshing(BaseSession):
|
|
|
50
50
|
|
|
51
51
|
_rules = [
|
|
52
52
|
"workflow",
|
|
53
|
+
"meshing_workflow",
|
|
53
54
|
"meshing",
|
|
54
55
|
"MeshingUtilities",
|
|
55
56
|
"PartManagement",
|
|
@@ -146,6 +147,11 @@ class PureMeshing(BaseSession):
|
|
|
146
147
|
"""Datamodel root of workflow."""
|
|
147
148
|
return self._base_meshing.workflow
|
|
148
149
|
|
|
150
|
+
@property
|
|
151
|
+
def meshing_workflow(self):
|
|
152
|
+
"""Full API to meshing and meshing_workflow."""
|
|
153
|
+
return self._base_meshing.meshing_workflow
|
|
154
|
+
|
|
149
155
|
def watertight(self):
|
|
150
156
|
"""Get a new watertight workflow."""
|
|
151
157
|
return self._base_meshing.watertight_workflow()
|