ansys-fluent-core 0.31.dev1__py3-none-any.whl → 0.32.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.

Files changed (57) hide show
  1. ansys/fluent/core/__init__.py +11 -3
  2. ansys/fluent/core/codegen/settingsgen.py +6 -0
  3. ansys/fluent/core/codegen/tuigen.py +1 -2
  4. ansys/fluent/core/docker/docker_compose.py +243 -0
  5. ansys/fluent/core/field_data_interfaces.py +6 -0
  6. ansys/fluent/core/file_session.py +158 -128
  7. ansys/fluent/core/filereader/data_file.py +11 -0
  8. ansys/fluent/core/filereader/pre_processor.py +22 -0
  9. ansys/fluent/core/fluent_connection.py +48 -20
  10. ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
  11. ansys/fluent/core/generated/datamodel_231/flicing.py +20 -20
  12. ansys/fluent/core/generated/datamodel_231/meshing.py +228 -228
  13. ansys/fluent/core/generated/datamodel_232/flicing.py +40 -40
  14. ansys/fluent/core/generated/datamodel_232/meshing.py +203 -203
  15. ansys/fluent/core/generated/datamodel_241/flicing.py +20 -20
  16. ansys/fluent/core/generated/datamodel_241/meshing.py +303 -303
  17. ansys/fluent/core/generated/datamodel_242/flicing.py +35 -35
  18. ansys/fluent/core/generated/datamodel_242/meshing.py +334 -334
  19. ansys/fluent/core/generated/datamodel_242/part_management.py +6 -6
  20. ansys/fluent/core/generated/datamodel_251/flicing.py +40 -40
  21. ansys/fluent/core/generated/datamodel_251/meshing.py +366 -366
  22. ansys/fluent/core/generated/datamodel_251/part_management.py +6 -6
  23. ansys/fluent/core/generated/datamodel_252/flicing.py +30 -30
  24. ansys/fluent/core/generated/datamodel_252/meshing.py +816 -454
  25. ansys/fluent/core/generated/datamodel_252/part_management.py +10 -10
  26. ansys/fluent/core/generated/datamodel_252/preferences.py +1 -1
  27. ansys/fluent/core/generated/fluent_version_252.py +4 -4
  28. ansys/fluent/core/generated/solver/settings_252.py +2241 -1649
  29. ansys/fluent/core/generated/solver/settings_252.pyi +1785 -1430
  30. ansys/fluent/core/generated/solver/settings_builtin.pyi +104 -0
  31. ansys/fluent/core/generated/solver/tui_252.py +126 -2
  32. ansys/fluent/core/launcher/container_launcher.py +39 -8
  33. ansys/fluent/core/launcher/fluent_container.py +60 -22
  34. ansys/fluent/core/launcher/launcher.py +24 -13
  35. ansys/fluent/core/launcher/launcher_utils.py +8 -0
  36. ansys/fluent/core/launcher/process_launch_string.py +2 -6
  37. ansys/fluent/core/report.py +2 -0
  38. ansys/fluent/core/services/deprecated_field_data.py +74 -46
  39. ansys/fluent/core/services/field_data.py +104 -69
  40. ansys/fluent/core/services/reduction.py +55 -66
  41. ansys/fluent/core/services/solution_variables.py +9 -1
  42. ansys/fluent/core/session.py +15 -12
  43. ansys/fluent/core/session_meshing.py +3 -0
  44. ansys/fluent/core/session_solver.py +20 -43
  45. ansys/fluent/core/session_utilities.py +429 -0
  46. ansys/fluent/core/solver/flobject.py +28 -0
  47. ansys/fluent/core/utils/deprecate.py +46 -0
  48. ansys/fluent/core/utils/file_transfer_service.py +19 -3
  49. ansys/fluent/core/utils/fluent_version.py +42 -11
  50. ansys/fluent/core/variable_strategies/__init__.py +29 -0
  51. ansys/fluent/core/variable_strategies/expr.py +186 -0
  52. ansys/fluent/core/variable_strategies/field.py +186 -0
  53. ansys/fluent/core/variable_strategies/svar.py +61 -0
  54. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/METADATA +7 -5
  55. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/RECORD +57 -51
  56. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/LICENSE +0 -0
  57. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/WHEEL +0 -0
@@ -2436,12 +2436,14 @@ class main_menu(TUIMenu):
2436
2436
  self.average_each_step = self.__class__.average_each_step(service, version, mode, path + ["average_each_step"])
2437
2437
  self.average_kernel = self.__class__.average_kernel(service, version, mode, path + ["average_kernel"])
2438
2438
  self.average_source_terms = self.__class__.average_source_terms(service, version, mode, path + ["average_source_terms"])
2439
+ self.consider_pressure_drho_dt = self.__class__.consider_pressure_drho_dt(service, version, mode, path + ["consider_pressure_drho_dt"])
2439
2440
  self.coupled_heat_mass_update = self.__class__.coupled_heat_mass_update(service, version, mode, path + ["coupled_heat_mass_update"])
2440
2441
  self.drag_law = self.__class__.drag_law(service, version, mode, path + ["drag_law"])
2441
2442
  self.dynamic_interaction = self.__class__.dynamic_interaction(service, version, mode, path + ["dynamic_interaction"])
2442
2443
  self.enable_node_based_averaging = self.__class__.enable_node_based_averaging(service, version, mode, path + ["enable_node_based_averaging"])
2443
2444
  self.enhanced_packing_limit_numerics = self.__class__.enhanced_packing_limit_numerics(service, version, mode, path + ["enhanced_packing_limit_numerics"])
2444
2445
  self.error_control = self.__class__.error_control(service, version, mode, path + ["error_control"])
2446
+ self.fluid_formulation_momentum = self.__class__.fluid_formulation_momentum(service, version, mode, path + ["fluid_formulation_momentum"])
2445
2447
  self.gaussian_factor = self.__class__.gaussian_factor(service, version, mode, path + ["gaussian_factor"])
2446
2448
  self.granular_stress_tensor = self.__class__.granular_stress_tensor(service, version, mode, path + ["granular_stress_tensor"])
2447
2449
  self.limit_granular_forces = self.__class__.limit_granular_forces(service, version, mode, path + ["limit_granular_forces"])
@@ -2452,6 +2454,7 @@ class main_menu(TUIMenu):
2452
2454
  self.predictor_corrector = self.__class__.predictor_corrector(service, version, mode, path + ["predictor_corrector"])
2453
2455
  self.re_randomize_every_iteration = self.__class__.re_randomize_every_iteration(service, version, mode, path + ["re_randomize_every_iteration"])
2454
2456
  self.re_randomize_every_timestep = self.__class__.re_randomize_every_timestep(service, version, mode, path + ["re_randomize_every_timestep"])
2457
+ self.set_overpacking_force_model = self.__class__.set_overpacking_force_model(service, version, mode, path + ["set_overpacking_force_model"])
2455
2458
  self.source_terms_cell_cloud_limit = self.__class__.source_terms_cell_cloud_limit(service, version, mode, path + ["source_terms_cell_cloud_limit"])
2456
2459
  self.tracking_parameters = self.__class__.tracking_parameters(service, version, mode, path + ["tracking_parameters"])
2457
2460
  self.tracking_scheme = self.__class__.tracking_scheme(service, version, mode, path + ["tracking_scheme"])
@@ -2459,6 +2462,7 @@ class main_menu(TUIMenu):
2459
2462
  self.underrelax_film_height = self.__class__.underrelax_film_height(service, version, mode, path + ["underrelax_film_height"])
2460
2463
  self.use_advanced_settings_for_epln = self.__class__.use_advanced_settings_for_epln(service, version, mode, path + ["use_advanced_settings_for_epln"])
2461
2464
  self.use_cell_based_vof_for_epln = self.__class__.use_cell_based_vof_for_epln(service, version, mode, path + ["use_cell_based_vof_for_epln"])
2465
+ self.use_improved_limiters = self.__class__.use_improved_limiters(service, version, mode, path + ["use_improved_limiters"])
2462
2466
  self.vaporization_limiting_factors = self.__class__.vaporization_limiting_factors(service, version, mode, path + ["vaporization_limiting_factors"])
2463
2467
  self.verbosity = self.__class__.verbosity(service, version, mode, path + ["verbosity"])
2464
2468
  super().__init__(service, version, mode, path)
@@ -2482,6 +2486,10 @@ class main_menu(TUIMenu):
2482
2486
  """
2483
2487
  No help available.
2484
2488
  """
2489
+ class consider_pressure_drho_dt(TUIMethod):
2490
+ """
2491
+ Consider drho/dt term in pressure correction equation.
2492
+ """
2485
2493
  class coupled_heat_mass_update(TUIMethod):
2486
2494
  """
2487
2495
  Enable/disable coupled heat and mass update.
@@ -2506,6 +2514,10 @@ class main_menu(TUIMenu):
2506
2514
  """
2507
2515
  Set the adapt integration step length based on a maximum error.
2508
2516
  """
2517
+ class fluid_formulation_momentum(TUIMethod):
2518
+ """
2519
+ Compute momemtum sources based on fluid force formulation instead of change of momentum between entry and exit of cell.
2520
+ """
2509
2521
  class gaussian_factor(TUIMethod):
2510
2522
  """
2511
2523
  No help available.
@@ -2546,6 +2558,10 @@ class main_menu(TUIMenu):
2546
2558
  """
2547
2559
  Decide whether pseudo-random number sequences shall vary from timestep to timestep or not.
2548
2560
  """
2561
+ class set_overpacking_force_model(TUIMethod):
2562
+ """
2563
+ Set overpacking force model (0 = off, 1 = enabled.
2564
+ """
2549
2565
  class source_terms_cell_cloud_limit(TUIMethod):
2550
2566
  """
2551
2567
  Limiting particle source terms based on minimum of particle cloud volume and cell volume.
@@ -2574,6 +2590,10 @@ class main_menu(TUIMenu):
2574
2590
  """
2575
2591
  Use cell based VOF for enhanced packing limit numerics.
2576
2592
  """
2593
+ class use_improved_limiters(TUIMethod):
2594
+ """
2595
+ Use improved limiters in combination with granular force limiting.
2596
+ """
2577
2597
  class vaporization_limiting_factors(TUIMethod):
2578
2598
  """
2579
2599
  Set Vaporization Fractional Change Limits.
@@ -14012,7 +14032,7 @@ class main_menu(TUIMenu):
14012
14032
  self.read_case = self.__class__.read_case(service, version, mode, path + ["read_case"])
14013
14033
  self.read_case_data = self.__class__.read_case_data(service, version, mode, path + ["read_case_data"])
14014
14034
  self.read_case_info = self.__class__.read_case_info(service, version, mode, path + ["read_case_info"])
14015
- self.read_case_settings = self.__class__.read_case_settings(service, version, mode, path + ["read_case_settings"])
14035
+ self.read_case_lightweight = self.__class__.read_case_lightweight(service, version, mode, path + ["read_case_lightweight"])
14016
14036
  self.read_data = self.__class__.read_data(service, version, mode, path + ["read_data"])
14017
14037
  self.read_field_functions = self.__class__.read_field_functions(service, version, mode, path + ["read_field_functions"])
14018
14038
  self.read_injections = self.__class__.read_injections(service, version, mode, path + ["read_injections"])
@@ -14122,7 +14142,7 @@ class main_menu(TUIMenu):
14122
14142
  """
14123
14143
  Read basic case info.
14124
14144
  """
14125
- class read_case_settings(TUIMethod):
14145
+ class read_case_lightweight(TUIMethod):
14126
14146
  """
14127
14147
  Read a case file while skipping mesh elements.
14128
14148
  """
@@ -31432,6 +31452,7 @@ class main_menu(TUIMenu):
31432
31452
  self.overset = self.__class__.overset(service, version, mode, path + ["overset"])
31433
31453
  self.p_v_coupling = self.__class__.p_v_coupling(service, version, mode, path + ["p_v_coupling"])
31434
31454
  self.phase_based_vof_discretization = self.__class__.phase_based_vof_discretization(service, version, mode, path + ["phase_based_vof_discretization"])
31455
+ self.poor_mesh_robustness = self.__class__.poor_mesh_robustness(service, version, mode, path + ["poor_mesh_robustness"])
31435
31456
  self.pseudo_time_method = self.__class__.pseudo_time_method(service, version, mode, path + ["pseudo_time_method"])
31436
31457
  self.reduced_rank_extrapolation_options = self.__class__.reduced_rank_extrapolation_options(service, version, mode, path + ["reduced_rank_extrapolation_options"])
31437
31458
  self.spatial_discretization = self.__class__.spatial_discretization(service, version, mode, path + ["spatial_discretization"])
@@ -32687,6 +32708,89 @@ class main_menu(TUIMenu):
32687
32708
  No help available.
32688
32709
  """
32689
32710
 
32711
+ class poor_mesh_robustness(TUIMenu):
32712
+ """
32713
+ No help available.
32714
+ """
32715
+ def __init__(self, service, version, mode, path):
32716
+ self.poor_mesh_numerics = self.__class__.poor_mesh_numerics(service, version, mode, path + ["poor_mesh_numerics"])
32717
+ self.poor_mesh_removal = self.__class__.poor_mesh_removal(service, version, mode, path + ["poor_mesh_removal"])
32718
+ super().__init__(service, version, mode, path)
32719
+
32720
+ class poor_mesh_numerics(TUIMenu):
32721
+ """
32722
+ No help available.
32723
+ """
32724
+ def __init__(self, service, version, mode, path):
32725
+ self.enable = self.__class__.enable(service, version, mode, path + ["enable"])
32726
+ self.orthogonal_quality_threshold = self.__class__.orthogonal_quality_threshold(service, version, mode, path + ["orthogonal_quality_threshold"])
32727
+ self.orthogonal_quality_threshold_enabled = self.__class__.orthogonal_quality_threshold_enabled(service, version, mode, path + ["orthogonal_quality_threshold_enabled"])
32728
+ self.tangent_skewness_threshold = self.__class__.tangent_skewness_threshold(service, version, mode, path + ["tangent_skewness_threshold"])
32729
+ self.tangent_skewness_threshold_enabled = self.__class__.tangent_skewness_threshold_enabled(service, version, mode, path + ["tangent_skewness_threshold_enabled"])
32730
+ super().__init__(service, version, mode, path)
32731
+ class enable(TUIMethod):
32732
+ """
32733
+ No help available.
32734
+ """
32735
+ class orthogonal_quality_threshold(TUIMethod):
32736
+ """
32737
+ No help available.
32738
+ """
32739
+ class orthogonal_quality_threshold_enabled(TUIMethod):
32740
+ """
32741
+ No help available.
32742
+ """
32743
+ class tangent_skewness_threshold(TUIMethod):
32744
+ """
32745
+ No help available.
32746
+ """
32747
+ class tangent_skewness_threshold_enabled(TUIMethod):
32748
+ """
32749
+ No help available.
32750
+ """
32751
+
32752
+ class poor_mesh_removal(TUIMenu):
32753
+ """
32754
+ No help available.
32755
+ """
32756
+ def __init__(self, service, version, mode, path):
32757
+ self.enable = self.__class__.enable(service, version, mode, path + ["enable"])
32758
+ self.orthogonal_quality_threshold = self.__class__.orthogonal_quality_threshold(service, version, mode, path + ["orthogonal_quality_threshold"])
32759
+ self.orthogonal_quality_threshold_enabled = self.__class__.orthogonal_quality_threshold_enabled(service, version, mode, path + ["orthogonal_quality_threshold_enabled"])
32760
+ self.tangent_skewness_threshold = self.__class__.tangent_skewness_threshold(service, version, mode, path + ["tangent_skewness_threshold"])
32761
+ self.tangent_skewness_threshold_enabled = self.__class__.tangent_skewness_threshold_enabled(service, version, mode, path + ["tangent_skewness_threshold_enabled"])
32762
+ self.warpage_threshold = self.__class__.warpage_threshold(service, version, mode, path + ["warpage_threshold"])
32763
+ self.warpage_threshold_enabled = self.__class__.warpage_threshold_enabled(service, version, mode, path + ["warpage_threshold_enabled"])
32764
+ super().__init__(service, version, mode, path)
32765
+ class enable(TUIMethod):
32766
+ """
32767
+ No help available.
32768
+ """
32769
+ class orthogonal_quality_threshold(TUIMethod):
32770
+ """
32771
+ No help available.
32772
+ """
32773
+ class orthogonal_quality_threshold_enabled(TUIMethod):
32774
+ """
32775
+ No help available.
32776
+ """
32777
+ class tangent_skewness_threshold(TUIMethod):
32778
+ """
32779
+ No help available.
32780
+ """
32781
+ class tangent_skewness_threshold_enabled(TUIMethod):
32782
+ """
32783
+ No help available.
32784
+ """
32785
+ class warpage_threshold(TUIMethod):
32786
+ """
32787
+ No help available.
32788
+ """
32789
+ class warpage_threshold_enabled(TUIMethod):
32790
+ """
32791
+ No help available.
32792
+ """
32793
+
32690
32794
  class pseudo_time_method(TUIMenu):
32691
32795
  """
32692
32796
  No help available.
@@ -39199,6 +39303,10 @@ class main_menu(TUIMenu):
39199
39303
  self.global_exterma_tracker = self.__class__.global_exterma_tracker(service, version, mode, path + ["global_exterma_tracker"])
39200
39304
  self.inspector = self.__class__.inspector(service, version, mode, path + ["inspector"])
39201
39305
  self.local_divergence_tracker = self.__class__.local_divergence_tracker(service, version, mode, path + ["local_divergence_tracker"])
39306
+ self.mark_cell_neighbors_by_id = self.__class__.mark_cell_neighbors_by_id(service, version, mode, path + ["mark_cell_neighbors_by_id"])
39307
+ self.mark_cell_neighbors_by_register = self.__class__.mark_cell_neighbors_by_register(service, version, mode, path + ["mark_cell_neighbors_by_register"])
39308
+ self.report_cell_info_by_id = self.__class__.report_cell_info_by_id(service, version, mode, path + ["report_cell_info_by_id"])
39309
+ self.report_cell_info_by_register = self.__class__.report_cell_info_by_register(service, version, mode, path + ["report_cell_info_by_register"])
39202
39310
  super().__init__(service, version, mode, path)
39203
39311
  class clear_divergence_tracker_files(TUIMethod):
39204
39312
  """
@@ -39220,6 +39328,22 @@ class main_menu(TUIMenu):
39220
39328
  """
39221
39329
  Stop simulation after divergence incident detected.
39222
39330
  """
39331
+ class mark_cell_neighbors_by_id(TUIMethod):
39332
+ """
39333
+ Mark cells' neighbors based on cell ids.
39334
+ """
39335
+ class mark_cell_neighbors_by_register(TUIMethod):
39336
+ """
39337
+ Mark cells' neighbors based on the provided id or name of a register.
39338
+ """
39339
+ class report_cell_info_by_id(TUIMethod):
39340
+ """
39341
+ Report cells information based on cell ids.
39342
+ """
39343
+ class report_cell_info_by_register(TUIMethod):
39344
+ """
39345
+ Report cells information based on the provided id or name of a register.
39346
+ """
39223
39347
 
39224
39348
  class transient_controls(TUIMenu):
39225
39349
  """
@@ -38,6 +38,7 @@ Examples
38
38
  import inspect
39
39
  import logging
40
40
  import os
41
+ import time
41
42
  from typing import Any
42
43
 
43
44
  from ansys.fluent.core.fluent_connection import FluentConnection
@@ -45,6 +46,7 @@ from ansys.fluent.core.launcher.fluent_container import (
45
46
  configure_container_dict,
46
47
  start_fluent_container,
47
48
  )
49
+ from ansys.fluent.core.launcher.launcher_utils import is_compose
48
50
  from ansys.fluent.core.launcher.process_launch_string import (
49
51
  _build_fluent_launch_args_string,
50
52
  )
@@ -58,6 +60,7 @@ from ansys.fluent.core.launcher.pyfluent_enums import (
58
60
  _get_argvals_and_session,
59
61
  )
60
62
  import ansys.fluent.core.launcher.watchdog as watchdog
63
+ from ansys.fluent.core.session import _parse_server_info_file
61
64
  from ansys.fluent.core.utils.fluent_version import FluentVersion
62
65
 
63
66
  _THIS_DIR = os.path.dirname(__file__)
@@ -65,6 +68,21 @@ _OPTIONS_FILE = os.path.join(_THIS_DIR, "fluent_launcher_options.json")
65
68
  logger = logging.getLogger("pyfluent.launcher")
66
69
 
67
70
 
71
+ def _get_server_info_from_container(config_dict):
72
+ """Retrieve the server info from a specified file in a container."""
73
+
74
+ host_server_info_file = config_dict["host_server_info_file"]
75
+
76
+ time_limit = 0
77
+ while not host_server_info_file.exists():
78
+ time.sleep(2)
79
+ time_limit += 2
80
+ if time_limit > 60:
81
+ raise FileNotFoundError(f"{host_server_info_file} not found.")
82
+
83
+ return _parse_server_info_file(str(host_server_info_file))
84
+
85
+
68
86
  class DockerLauncher:
69
87
  """Instantiates Fluent session in container mode."""
70
88
 
@@ -198,9 +216,16 @@ class DockerLauncher:
198
216
  del config_dict_h
199
217
  return config_dict
200
218
 
201
- port, password, container = start_fluent_container(
202
- self._args, self.argvals["container_dict"]
203
- )
219
+ if is_compose():
220
+ port, config_dict, container = start_fluent_container(
221
+ self._args, self.argvals["container_dict"]
222
+ )
223
+
224
+ _, _, password = _get_server_info_from_container(config_dict=config_dict)
225
+ else:
226
+ port, password, container = start_fluent_container(
227
+ self._args, self.argvals["container_dict"]
228
+ )
204
229
 
205
230
  fluent_connection = FluentConnection(
206
231
  port=port,
@@ -209,6 +234,7 @@ class DockerLauncher:
209
234
  cleanup_on_exit=self.argvals["cleanup_on_exit"],
210
235
  slurm_job_id=self.argvals and self.argvals.get("slurm_job_id"),
211
236
  inside_container=True,
237
+ container=container,
212
238
  )
213
239
 
214
240
  session = self.new_session(
@@ -217,12 +243,17 @@ class DockerLauncher:
217
243
  file_transfer_service=self.file_transfer_service,
218
244
  start_transcript=self.argvals["start_transcript"],
219
245
  )
246
+
220
247
  session._container = container
221
248
 
222
- if self.argvals["start_watchdog"] is None and self.argvals["cleanup_on_exit"]:
223
- self.argvals["start_watchdog"] = True
224
- if self.argvals["start_watchdog"]:
225
- logger.debug("Launching Watchdog for Fluent container...")
226
- watchdog.launch(os.getpid(), port, password)
249
+ if not is_compose():
250
+ if (
251
+ self.argvals["start_watchdog"] is None
252
+ and self.argvals["cleanup_on_exit"]
253
+ ):
254
+ self.argvals["start_watchdog"] = True
255
+ if self.argvals["start_watchdog"]:
256
+ logger.debug("Launching Watchdog for Fluent container...")
257
+ watchdog.launch(os.getpid(), port, password)
227
258
 
228
259
  return session
@@ -78,8 +78,10 @@ import tempfile
78
78
  from typing import Any, List
79
79
 
80
80
  import ansys.fluent.core as pyfluent
81
+ from ansys.fluent.core.docker.docker_compose import ComposeBasedLauncher
82
+ from ansys.fluent.core.launcher.launcher_utils import is_compose
81
83
  from ansys.fluent.core.session import _parse_server_info_file
82
- from ansys.fluent.core.utils.deprecate import deprecate_argument
84
+ from ansys.fluent.core.utils.deprecate import all_deprecators
83
85
  from ansys.fluent.core.utils.execution import timeout_loop
84
86
  from ansys.fluent.core.utils.networking import get_free_port
85
87
 
@@ -116,8 +118,24 @@ class LicenseServerNotSpecified(KeyError):
116
118
  )
117
119
 
118
120
 
119
- @deprecate_argument("container_mount_path", "mount_target")
120
- @deprecate_argument("host_mount_path", "mount_source")
121
+ @all_deprecators(
122
+ deprecate_arg_mappings=[
123
+ {
124
+ "old_arg": "container_mount_path",
125
+ "new_arg": "mount_target",
126
+ "converter": lambda old_arg_val: old_arg_val,
127
+ },
128
+ {
129
+ "old_arg": "host_mount_path",
130
+ "new_arg": "mount_source",
131
+ "converter": lambda old_arg_val: old_arg_val,
132
+ },
133
+ ],
134
+ data_type_converter=None,
135
+ deprecated_version="v0.23.dev1",
136
+ deprecated_reason="'container_mount_path' and 'host_mount_path' are deprecated. Use 'mount_target' and 'mount_source' instead.",
137
+ warn_message="",
138
+ )
121
139
  def configure_container_dict(
122
140
  args: List[str],
123
141
  mount_source: str | Path | None = None,
@@ -381,6 +399,11 @@ def configure_container_dict(
381
399
 
382
400
  host_server_info_file = Path(mount_source) / container_server_info_file.name
383
401
 
402
+ if is_compose():
403
+ container_dict["host_server_info_file"] = host_server_info_file
404
+ container_dict["mount_source"] = mount_source
405
+ container_dict["mount_target"] = mount_target
406
+
384
407
  return (
385
408
  container_dict,
386
409
  timeout,
@@ -451,34 +474,49 @@ def start_fluent_container(
451
474
  del container_vars_tmp
452
475
 
453
476
  try:
454
- if not host_server_info_file.exists():
455
- host_server_info_file.parents[0].mkdir(exist_ok=True)
477
+ if is_compose():
478
+ config_dict["fluent_port"] = port
456
479
 
457
- host_server_info_file.touch(exist_ok=True)
458
- last_mtime = host_server_info_file.stat().st_mtime
480
+ compose_container = ComposeBasedLauncher(container_dict=config_dict)
459
481
 
460
- import docker
482
+ if not compose_container.check_image_exists():
483
+ logger.debug(
484
+ f"Fluent image {config_dict['fluent_image']} not found. Pulling image..."
485
+ )
486
+ compose_container.pull_image()
461
487
 
462
- docker_client = docker.from_env()
488
+ compose_container.start()
463
489
 
464
- logger.debug("Starting Fluent docker container...")
490
+ return port, config_dict, compose_container
491
+ else:
492
+ if not host_server_info_file.exists():
493
+ host_server_info_file.parents[0].mkdir(exist_ok=True)
465
494
 
466
- container = docker_client.containers.run(
467
- config_dict.pop("fluent_image"), **config_dict
468
- )
495
+ host_server_info_file.touch(exist_ok=True)
496
+ last_mtime = host_server_info_file.stat().st_mtime
469
497
 
470
- success = timeout_loop(
471
- lambda: host_server_info_file.stat().st_mtime > last_mtime, timeout
472
- )
498
+ import docker
499
+
500
+ docker_client = docker.from_env()
473
501
 
474
- if not success:
475
- raise TimeoutError(
476
- "Fluent container launch has timed out, stop container manually."
502
+ logger.debug("Starting Fluent docker container...")
503
+
504
+ container = docker_client.containers.run(
505
+ config_dict.pop("fluent_image"), **config_dict
477
506
  )
478
- else:
479
- _, _, password = _parse_server_info_file(str(host_server_info_file))
480
507
 
481
- return port, password, container
508
+ success = timeout_loop(
509
+ lambda: host_server_info_file.stat().st_mtime > last_mtime, timeout
510
+ )
511
+
512
+ if not success:
513
+ raise TimeoutError(
514
+ "Fluent container launch has timed out, stop container manually."
515
+ )
516
+ else:
517
+ _, _, password = _parse_server_info_file(str(host_server_info_file))
518
+
519
+ return port, password, container
482
520
  finally:
483
521
  if remove_server_info_file and host_server_info_file.exists():
484
522
  host_server_info_file.unlink()
@@ -54,12 +54,11 @@ from ansys.fluent.core.launcher.server_info import _get_server_info
54
54
  from ansys.fluent.core.launcher.slurm_launcher import SlurmFuture, SlurmLauncher
55
55
  from ansys.fluent.core.launcher.standalone_launcher import StandaloneLauncher
56
56
  import ansys.fluent.core.launcher.watchdog as watchdog
57
- from ansys.fluent.core.pyfluent_warnings import PyFluentDeprecationWarning
58
57
  from ansys.fluent.core.session_meshing import Meshing
59
58
  from ansys.fluent.core.session_pure_meshing import PureMeshing
60
59
  from ansys.fluent.core.session_solver import Solver
61
60
  from ansys.fluent.core.session_solver_icing import SolverIcing
62
- from ansys.fluent.core.utils.deprecate import deprecate_argument
61
+ from ansys.fluent.core.utils.deprecate import all_deprecators
63
62
  from ansys.fluent.core.utils.fluent_version import FluentVersion
64
63
 
65
64
  _THIS_DIR = os.path.dirname(__file__)
@@ -127,17 +126,23 @@ def _version_to_dimension(old_arg_val):
127
126
 
128
127
 
129
128
  # pylint: disable=unused-argument
130
- @deprecate_argument(
131
- old_arg="show_gui",
132
- new_arg="ui_mode",
133
- converter=_show_gui_to_ui_mode,
134
- warning_cls=PyFluentDeprecationWarning,
135
- )
136
- @deprecate_argument(
137
- old_arg="version",
138
- new_arg="dimension",
139
- converter=_version_to_dimension,
140
- warning_cls=PyFluentDeprecationWarning,
129
+ @all_deprecators(
130
+ deprecate_arg_mappings=[
131
+ {
132
+ "old_arg": "show_gui",
133
+ "new_arg": "ui_mode",
134
+ "converter": _show_gui_to_ui_mode,
135
+ },
136
+ {
137
+ "old_arg": "version",
138
+ "new_arg": "dimension",
139
+ "converter": _version_to_dimension,
140
+ },
141
+ ],
142
+ data_type_converter=None,
143
+ deprecated_version="v0.22.dev0",
144
+ deprecated_reason="'show_gui' and 'version' are deprecated. Use 'ui_mode' and 'dimension' instead.",
145
+ warn_message="",
141
146
  )
142
147
  def launch_fluent(
143
148
  product_version: FluentVersion | str | float | int | None = None,
@@ -179,6 +184,12 @@ def launch_fluent(
179
184
  Version of Ansys Fluent to launch. To use Fluent version 2025 R1, pass
180
185
  any of ``FluentVersion.v251``, ``"25.1.0"``, ``"25.1"``, ``25.1``or ``251``.
181
186
  The default is ``None``, in which case the newest installed version is used.
187
+ PyFluent uses the ``AWP_ROOT<ver>`` environment variable to locate the Fluent
188
+ installation, where ``<ver>`` is the Ansys release number such as ``251``.
189
+ The ``AWP_ROOT<ver>`` environment variable is automatically configured on Windows
190
+ system when Fluent is installed. On Linux systems, ``AWP_ROOT<ver>`` must be
191
+ configured to point to the absolute path of an Ansys installation such as
192
+ ``/apps/ansys_inc/v251``.
182
193
  dimension : Dimension or int, optional
183
194
  Geometric dimensionality of the Fluent simulation. The default is ``None``,
184
195
  in which case ``Dimension.THREE`` is used. Options are either the values of the
@@ -37,6 +37,14 @@ from ansys.fluent.core.utils.networking import find_remoting_ip
37
37
  logger = logging.getLogger("pyfluent.launcher")
38
38
 
39
39
 
40
+ def is_compose() -> bool:
41
+ """Check if the Fluent launch is through compose."""
42
+ return (
43
+ os.getenv("PYFLUENT_USE_DOCKER_COMPOSE") == "1"
44
+ or os.getenv("PYFLUENT_USE_PODMAN_COMPOSE") == "1"
45
+ )
46
+
47
+
40
48
  def is_windows():
41
49
  """Check if the current operating system is Windows."""
42
50
  return platform.system() == "Windows"
@@ -150,10 +150,6 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
150
150
  Fluent executable path
151
151
  """
152
152
 
153
- def get_fluent_root(version: FluentVersion) -> Path:
154
- awp_root = os.environ[version.awp_var]
155
- return Path(awp_root) / "fluent"
156
-
157
153
  def get_exe_path(fluent_root: Path) -> Path:
158
154
  if launcher_utils.is_windows():
159
155
  return fluent_root / "ntbin" / "win64" / "fluent.exe"
@@ -171,7 +167,7 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
171
167
  # 2. product_version parameter passed with launch_fluent
172
168
  product_version = launch_argvals.get("product_version")
173
169
  if product_version:
174
- return get_exe_path(get_fluent_root(FluentVersion(product_version)))
170
+ return FluentVersion(product_version).get_fluent_exe_path()
175
171
 
176
172
  # (DEV) "PYFLUENT_FLUENT_ROOT" environment variable
177
173
  fluent_root = os.getenv("PYFLUENT_FLUENT_ROOT")
@@ -179,4 +175,4 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
179
175
  return get_exe_path(Path(fluent_root))
180
176
 
181
177
  # 3. the latest ANSYS version from AWP_ROOT environment variables
182
- return get_exe_path(get_fluent_root(FluentVersion.get_latest_installed()))
178
+ return FluentVersion.get_latest_installed().get_fluent_exe_path()
@@ -56,6 +56,8 @@ ANSYS_ENV_VARS = [
56
56
  "REMOTING_PORTS",
57
57
  "REMOTING_SERVER_ADDRESS",
58
58
  "SERVER_INFO_DIR",
59
+ "PYFLUENT_USE_DOCKER_COMPOSE",
60
+ "PYFLUENT_USE_PODMAN_COMPOSE",
59
61
  ]
60
62
 
61
63