ansys-fluent-core 0.28.1__py3-none-any.whl → 0.29.0__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 (223) hide show
  1. ansys/fluent/core/__init__.py +26 -1
  2. ansys/fluent/core/_stand_alone_datamodel_client/_datamodel_client.py +22 -0
  3. ansys/fluent/core/_version.py +24 -2
  4. ansys/fluent/core/codegen/__init__.py +22 -0
  5. ansys/fluent/core/codegen/allapigen.py +38 -5
  6. ansys/fluent/core/codegen/builtin_settingsgen.py +22 -0
  7. ansys/fluent/core/codegen/data/__init__.py +21 -0
  8. ansys/fluent/core/codegen/data/fluent_gui_help_patch.py +22 -0
  9. ansys/fluent/core/codegen/data/meshing_utilities_examples.py +22 -0
  10. ansys/fluent/core/codegen/datamodelgen.py +40 -4
  11. ansys/fluent/core/codegen/print_fluent_version.py +22 -0
  12. ansys/fluent/core/codegen/settingsgen.py +67 -4
  13. ansys/fluent/core/codegen/tuigen.py +44 -6
  14. ansys/fluent/core/codegen/walk_api.py +67 -18
  15. ansys/fluent/core/codegen/write_settings_yaml.py +22 -0
  16. ansys/fluent/core/data_model_cache.py +22 -0
  17. ansys/fluent/core/examples/__init__.py +22 -0
  18. ansys/fluent/core/examples/downloads.py +22 -0
  19. ansys/fluent/core/exceptions.py +22 -0
  20. ansys/fluent/core/file_session.py +22 -0
  21. ansys/fluent/core/filereader/__init__.py +21 -0
  22. ansys/fluent/core/filereader/case_file.py +22 -0
  23. ansys/fluent/core/filereader/casereader.py +22 -0
  24. ansys/fluent/core/filereader/data_file.py +22 -0
  25. ansys/fluent/core/filereader/lispy.py +22 -0
  26. ansys/fluent/core/fluent_connection.py +23 -1
  27. ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
  28. ansys/fluent/core/generated/datamodel_252/meshing.py +32 -0
  29. ansys/fluent/core/generated/datamodel_252/preferences.py +7 -0
  30. ansys/fluent/core/generated/fluent_version_252.py +3 -3
  31. ansys/fluent/core/generated/meshing/tui_252.py +395 -390
  32. ansys/fluent/core/generated/solver/settings_222.py +0 -72
  33. ansys/fluent/core/generated/solver/settings_222.pyi +0 -307
  34. ansys/fluent/core/generated/solver/settings_231.py +0 -574
  35. ansys/fluent/core/generated/solver/settings_231.pyi +0 -561
  36. ansys/fluent/core/generated/solver/settings_232.py +0 -527
  37. ansys/fluent/core/generated/solver/settings_232.pyi +0 -2803
  38. ansys/fluent/core/generated/solver/settings_241.py +0 -478
  39. ansys/fluent/core/generated/solver/settings_241.pyi +0 -522
  40. ansys/fluent/core/generated/solver/settings_242.py +0 -361
  41. ansys/fluent/core/generated/solver/settings_242.pyi +0 -591
  42. ansys/fluent/core/generated/solver/settings_251.py +0 -399
  43. ansys/fluent/core/generated/solver/settings_251.pyi +0 -629
  44. ansys/fluent/core/generated/solver/settings_252.py +8118 -4206
  45. ansys/fluent/core/generated/solver/settings_252.pyi +7229 -3259
  46. ansys/fluent/core/generated/solver/tui_252.py +4508 -3877
  47. ansys/fluent/core/get_build_details.py +22 -0
  48. ansys/fluent/core/journaling.py +38 -0
  49. ansys/fluent/core/launcher/__init__.py +22 -0
  50. ansys/fluent/core/launcher/container_launcher.py +65 -56
  51. ansys/fluent/core/launcher/error_handler.py +30 -0
  52. ansys/fluent/core/launcher/fluent_container.py +45 -20
  53. ansys/fluent/core/launcher/launcher.py +53 -5
  54. ansys/fluent/core/launcher/launcher_utils.py +22 -0
  55. ansys/fluent/core/launcher/pim_launcher.py +120 -86
  56. ansys/fluent/core/launcher/process_launch_string.py +22 -0
  57. ansys/fluent/core/launcher/pyfluent_enums.py +22 -0
  58. ansys/fluent/core/launcher/server_info.py +45 -3
  59. ansys/fluent/core/launcher/slurm_launcher.py +25 -3
  60. ansys/fluent/core/launcher/standalone_launcher.py +68 -63
  61. ansys/fluent/core/launcher/watchdog.py +22 -0
  62. ansys/fluent/core/logging.py +24 -0
  63. ansys/fluent/core/logging_config.yaml +3 -0
  64. ansys/fluent/core/meshing/meshing_workflow.py +22 -0
  65. ansys/fluent/core/parametric.py +22 -0
  66. ansys/fluent/core/post_objects/__init__.py +21 -0
  67. ansys/fluent/core/post_objects/check_in_notebook.py +22 -0
  68. ansys/fluent/core/post_objects/meta.py +22 -0
  69. ansys/fluent/core/post_objects/post_helper.py +22 -0
  70. ansys/fluent/core/post_objects/post_object_definitions.py +22 -0
  71. ansys/fluent/core/post_objects/post_objects_container.py +22 -0
  72. ansys/fluent/core/post_objects/singleton_meta.py +22 -0
  73. ansys/fluent/core/post_objects/timing_decorator.py +22 -0
  74. ansys/fluent/core/report.py +77 -0
  75. ansys/fluent/core/rpvars.py +22 -0
  76. ansys/fluent/core/scheduler/__init__.py +22 -0
  77. ansys/fluent/core/scheduler/load_machines.py +22 -0
  78. ansys/fluent/core/scheduler/machine_list.py +22 -0
  79. ansys/fluent/core/search.py +22 -0
  80. ansys/fluent/core/services/__init__.py +22 -0
  81. ansys/fluent/core/services/api_upgrade.py +22 -0
  82. ansys/fluent/core/services/app_utilities.py +38 -0
  83. ansys/fluent/core/services/batch_ops.py +22 -0
  84. ansys/fluent/core/services/datamodel_se.py +163 -61
  85. ansys/fluent/core/services/datamodel_tui.py +22 -0
  86. ansys/fluent/core/services/deprecated_field_data.py +23 -1
  87. ansys/fluent/core/services/events.py +22 -0
  88. ansys/fluent/core/services/field_data.py +285 -2
  89. ansys/fluent/core/services/health_check.py +22 -0
  90. ansys/fluent/core/services/interceptors.py +50 -2
  91. ansys/fluent/core/services/monitor.py +22 -0
  92. ansys/fluent/core/services/reduction.py +22 -0
  93. ansys/fluent/core/services/scheme_eval.py +22 -0
  94. ansys/fluent/core/services/settings.py +22 -0
  95. ansys/fluent/core/services/solution_variables.py +22 -0
  96. ansys/fluent/core/services/streaming.py +22 -0
  97. ansys/fluent/core/services/transcript.py +22 -0
  98. ansys/fluent/core/session.py +39 -2
  99. ansys/fluent/core/session_base_meshing.py +22 -0
  100. ansys/fluent/core/session_meshing.py +22 -0
  101. ansys/fluent/core/session_meshing.pyi +22 -0
  102. ansys/fluent/core/session_pure_meshing.py +22 -0
  103. ansys/fluent/core/session_pure_meshing.pyi +22 -0
  104. ansys/fluent/core/session_shared.py +22 -0
  105. ansys/fluent/core/session_solver.py +43 -0
  106. ansys/fluent/core/session_solver.pyi +22 -0
  107. ansys/fluent/core/session_solver_aero.py +22 -0
  108. ansys/fluent/core/session_solver_icing.py +22 -0
  109. ansys/fluent/core/session_solver_lite.py +22 -0
  110. ansys/fluent/core/solver/__init__.py +22 -0
  111. ansys/fluent/core/solver/error_message.py +22 -0
  112. ansys/fluent/core/solver/flobject.py +22 -0
  113. ansys/fluent/core/solver/flunits.py +22 -0
  114. ansys/fluent/core/solver/function/__init__.py +22 -0
  115. ansys/fluent/core/solver/function/reduction.py +22 -0
  116. ansys/fluent/core/solver/settings_builtin_bases.py +22 -0
  117. ansys/fluent/core/solver/settings_builtin_data.py +22 -0
  118. ansys/fluent/core/solver/settings_external.py +22 -0
  119. ansys/fluent/core/streaming_services/__init__.py +21 -0
  120. ansys/fluent/core/streaming_services/datamodel_event_streaming.py +34 -12
  121. ansys/fluent/core/streaming_services/datamodel_streaming.py +22 -0
  122. ansys/fluent/core/streaming_services/events_streaming.py +22 -0
  123. ansys/fluent/core/streaming_services/field_data_streaming.py +22 -0
  124. ansys/fluent/core/streaming_services/monitor_streaming.py +23 -1
  125. ansys/fluent/core/streaming_services/streaming.py +22 -0
  126. ansys/fluent/core/streaming_services/transcript_streaming.py +22 -0
  127. ansys/fluent/core/systemcoupling.py +22 -0
  128. ansys/fluent/core/utils/__init__.py +22 -0
  129. ansys/fluent/core/utils/data_transfer.py +22 -0
  130. ansys/fluent/core/utils/deprecate.py +24 -1
  131. ansys/fluent/core/utils/dictionary_operations.py +22 -0
  132. ansys/fluent/core/utils/dump_session_data.py +22 -0
  133. ansys/fluent/core/utils/event_loop.py +22 -0
  134. ansys/fluent/core/utils/execution.py +22 -0
  135. ansys/fluent/core/utils/file_transfer_service.py +22 -0
  136. ansys/fluent/core/utils/fix_doc.py +22 -0
  137. ansys/fluent/core/utils/fldoc.py +22 -0
  138. ansys/fluent/core/utils/fluent_version.py +22 -0
  139. ansys/fluent/core/utils/networking.py +22 -0
  140. ansys/fluent/core/utils/setup_for_fluent.py +22 -0
  141. ansys/fluent/core/warnings.py +22 -0
  142. ansys/fluent/core/workflow.py +22 -0
  143. {ansys_fluent_core-0.28.1.dist-info → ansys_fluent_core-0.29.0.dist-info}/LICENSE +8 -8
  144. {ansys_fluent_core-0.28.1.dist-info → ansys_fluent_core-0.29.0.dist-info}/METADATA +56 -33
  145. ansys_fluent_core-0.29.0.dist-info/RECORD +219 -0
  146. {ansys_fluent_core-0.28.1.dist-info → ansys_fluent_core-0.29.0.dist-info}/WHEEL +1 -1
  147. ansys/fluent/core/docs/README.rst +0 -155
  148. ansys/fluent/tests/conftest.py +0 -415
  149. ansys/fluent/tests/fluent_fixtures.py +0 -195
  150. ansys/fluent/tests/integration/test_optislang/test_optislang_integration.py +0 -263
  151. ansys/fluent/tests/parametric/test_local_parametric_run.py +0 -36
  152. ansys/fluent/tests/parametric/test_local_parametric_setup.py +0 -34
  153. ansys/fluent/tests/parametric/test_parametric_workflow.py +0 -279
  154. ansys/fluent/tests/test_aero_session.py +0 -88
  155. ansys/fluent/tests/test_batch_ops.py +0 -39
  156. ansys/fluent/tests/test_builtin_settings.py +0 -761
  157. ansys/fluent/tests/test_cad_to_post_ftm.py +0 -525
  158. ansys/fluent/tests/test_cad_to_post_wtm.py +0 -250
  159. ansys/fluent/tests/test_casereader.py +0 -324
  160. ansys/fluent/tests/test_codegen.py +0 -783
  161. ansys/fluent/tests/test_creatable.py +0 -31
  162. ansys/fluent/tests/test_data_model_cache.py +0 -434
  163. ansys/fluent/tests/test_datamodel_api.py +0 -449
  164. ansys/fluent/tests/test_datamodel_service.py +0 -814
  165. ansys/fluent/tests/test_datareader.py +0 -103
  166. ansys/fluent/tests/test_error_handling.py +0 -24
  167. ansys/fluent/tests/test_events_manager.py +0 -214
  168. ansys/fluent/tests/test_field_data.py +0 -466
  169. ansys/fluent/tests/test_file_session.py +0 -355
  170. ansys/fluent/tests/test_file_transfer_service.py +0 -165
  171. ansys/fluent/tests/test_fix_doc.py +0 -29
  172. ansys/fluent/tests/test_flobject.py +0 -1235
  173. ansys/fluent/tests/test_fluent_fixes.py +0 -106
  174. ansys/fluent/tests/test_fluent_session.py +0 -270
  175. ansys/fluent/tests/test_fluent_version.py +0 -66
  176. ansys/fluent/tests/test_fluent_version_marker.py +0 -65
  177. ansys/fluent/tests/test_icing_session.py +0 -9
  178. ansys/fluent/tests/test_launcher.py +0 -529
  179. ansys/fluent/tests/test_launcher_remote.py +0 -272
  180. ansys/fluent/tests/test_lispy.py +0 -40
  181. ansys/fluent/tests/test_logging.py +0 -16
  182. ansys/fluent/tests/test_mapped_api.py +0 -774
  183. ansys/fluent/tests/test_meshing_utilities.py +0 -2436
  184. ansys/fluent/tests/test_meshing_workflow.py +0 -421
  185. ansys/fluent/tests/test_meshingmode/test_meshing_launch.py +0 -168
  186. ansys/fluent/tests/test_new_meshing_workflow.py +0 -1801
  187. ansys/fluent/tests/test_preferences.py +0 -89
  188. ansys/fluent/tests/test_pure_mesh_vs_mesh_workflow.py +0 -101
  189. ansys/fluent/tests/test_reduction.py +0 -484
  190. ansys/fluent/tests/test_rp_vars.py +0 -77
  191. ansys/fluent/tests/test_scheduler.py +0 -471
  192. ansys/fluent/tests/test_scheme_eval_222.py +0 -338
  193. ansys/fluent/tests/test_scheme_eval_231.py +0 -243
  194. ansys/fluent/tests/test_search.py +0 -344
  195. ansys/fluent/tests/test_session.py +0 -594
  196. ansys/fluent/tests/test_settings_api.py +0 -606
  197. ansys/fluent/tests/test_settings_reader.py +0 -85
  198. ansys/fluent/tests/test_slurm_future.py +0 -67
  199. ansys/fluent/tests/test_solution_variables.py +0 -241
  200. ansys/fluent/tests/test_solver_monitors.py +0 -83
  201. ansys/fluent/tests/test_solvermode/boundaries_periodic_expDict +0 -1712
  202. ansys/fluent/tests/test_solvermode/test_boundaries.py +0 -127
  203. ansys/fluent/tests/test_solvermode/test_calculationactivities.py +0 -20
  204. ansys/fluent/tests/test_solvermode/test_controls.py +0 -131
  205. ansys/fluent/tests/test_solvermode/test_general.py +0 -109
  206. ansys/fluent/tests/test_solvermode/test_initialization.py +0 -83
  207. ansys/fluent/tests/test_solvermode/test_materials.py +0 -40
  208. ansys/fluent/tests/test_solvermode/test_methods.py +0 -65
  209. ansys/fluent/tests/test_solvermode/test_models.py +0 -99
  210. ansys/fluent/tests/test_solvermode/test_named_expressions.py +0 -35
  211. ansys/fluent/tests/test_solvermode/test_post_vector.py +0 -22
  212. ansys/fluent/tests/test_solvermode/test_species_model.py +0 -67
  213. ansys/fluent/tests/test_streaming_services.py +0 -52
  214. ansys/fluent/tests/test_systemcoupling.py +0 -44
  215. ansys/fluent/tests/test_topy.py +0 -179
  216. ansys/fluent/tests/test_tui_api.py +0 -70
  217. ansys/fluent/tests/test_type_stub.py +0 -37
  218. ansys/fluent/tests/test_utils.py +0 -82
  219. ansys/fluent/tests/util/__init__.py +0 -36
  220. ansys/fluent/tests/util/meshing_workflow.py +0 -33
  221. ansys/fluent/tests/util/solver.py +0 -72
  222. ansys_fluent_core-0.28.1.dist-info/AUTHORS +0 -12
  223. ansys_fluent_core-0.28.1.dist-info/RECORD +0 -294
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Provides a module for launching Fluent in pim mode.
2
24
 
3
25
  Examples
@@ -24,7 +46,6 @@ from ansys.fluent.core.launcher.pyfluent_enums import (
24
46
  FluentMode,
25
47
  FluentWindowsGraphicsDriver,
26
48
  Precision,
27
- UIMode,
28
49
  _get_argvals_and_session,
29
50
  )
30
51
  from ansys.fluent.core.session_meshing import Meshing
@@ -46,7 +67,6 @@ class PIMLauncher:
46
67
  def __init__(
47
68
  self,
48
69
  mode: FluentMode | str | None = None,
49
- ui_mode: UIMode | str | None = None,
50
70
  graphics_driver: (
51
71
  FluentWindowsGraphicsDriver | FluentLinuxGraphicsDriver | str | None
52
72
  ) = None,
@@ -55,76 +75,60 @@ class PIMLauncher:
55
75
  precision: Precision | str | None = None,
56
76
  processor_count: int | None = None,
57
77
  start_timeout: int = 60,
58
- additional_arguments: str | None = "",
78
+ additional_arguments: str = "",
59
79
  cleanup_on_exit: bool = True,
60
80
  start_transcript: bool = True,
61
- py: bool | None = None,
62
81
  gpu: bool | None = None,
63
82
  start_watchdog: bool | None = None,
64
83
  file_transfer_service: Any | None = None,
65
84
  ):
66
- """Launch Fluent session in `PIM <https://pypim.docs.pyansys.com/version/stable/>`_ mode.
85
+ """
86
+ Launch a Fluent session in `PIM <https://pypim.docs.pyansys.com/version/stable/>`_ mode.
67
87
 
68
88
  Parameters
69
89
  ----------
70
90
  mode : FluentMode
71
- Launch mode of Fluent to point to a specific session type.
72
- ui_mode : UIMode
73
- Fluent user interface mode. Options are the values of the ``UIMode`` enum.
91
+ Specifies the launch mode of Fluent for targeting a specific session type.
74
92
  graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
75
- Graphics driver of Fluent. Options are the values of the
76
- ``FluentWindowsGraphicsDriver`` enum in Windows or the values of the
77
- ``FluentLinuxGraphicsDriver`` enum in Linux.
93
+ Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
94
+ (for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).
78
95
  product_version : FluentVersion or str or float or int, optional
79
- Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass
80
- ``FluentVersion.v242``, ``"24.2.0"``, ``"24.2"``, ``24.2``, or ``242``.
81
- The default is ``None``, in which case the newest installed version is used.
96
+ Indicates the version of Ansys Fluent to launch. For example, to use version 2025 R1, pass
97
+ any of ``FluentVersion.v251``, ``"25.1.0"``, ``"25.1"``, ``25.1``, or ``251``. Defaults to ``None``,
98
+ which uses the newest installed version.
82
99
  dimension : Dimension or int, optional
83
- Geometric dimensionality of the Fluent simulation. The default is ``None``,
84
- in which case ``Dimension.THREE`` is used. Options are either the values of the
85
- ``Dimension`` enum (``Dimension.TWO`` or ``Dimension.THREE``) or any of ``2`` and ``3``.
100
+ Specifies the geometric dimensionality of the Fluent simulation. Defaults to ``None``,
101
+ which corresponds to ``Dimension.THREE``. Acceptable values include ``Dimension.TWO``,
102
+ ``Dimension.THREE``, or integers ``2`` and ``3``.
86
103
  precision : Precision or str, optional
87
- Floating point precision. The default is ``None``, in which case ``Precision.DOUBLE``
88
- is used. Options are either the values of the ``Precision`` enum (``Precision.SINGLE``
89
- or ``Precision.DOUBLE``) or any of ``"double"`` and ``"single"``.
104
+ Defines the floating point precision. Defaults to ``None``, which corresponds to
105
+ ``Precision.DOUBLE``. Acceptable values include ``Precision.SINGLE``,
106
+ ``Precision.DOUBLE``, or strings ``"single"`` and ``"double"``.
90
107
  processor_count : int, optional
91
- Number of processors. The default is ``None``, in which case ``1``
92
- processor is used. In job scheduler environments the total number of
93
- allocated cores is clamped to value of ``processor_count``.
108
+ Specifies the number of processors to use. Defaults to ``None``, which uses 1 processor.
109
+ In job scheduler environments, this value limits the total number of allocated cores.
94
110
  start_timeout : int, optional
95
- Maximum allowable time in seconds for connecting to the Fluent
96
- server. The default is ``60``.
111
+ Maximum allowable time in seconds for connecting to the Fluent server. Defaults to 60 seconds.
97
112
  additional_arguments : str, optional
98
- Additional arguments to send to Fluent as a string in the same
99
- format they are normally passed to Fluent on the command line.
100
- cleanup_on_exit : bool, optional
101
- Whether to shut down the connected Fluent session when PyFluent is
102
- exited, or the ``exit()`` method is called on the session instance,
103
- or if the session instance becomes unreferenced. The default is ``True``.
104
- start_transcript : bool, optional
105
- Whether to start streaming the Fluent transcript in the client. The
106
- default is ``True``. You can stop and start the streaming of the
107
- Fluent transcript subsequently via the method calls, ``transcript.start()``
108
- and ``transcript.stop()`` on the session object.
109
- py : bool, optional
110
- If True, Fluent will run in Python mode. Default is None.
113
+ Additional command-line arguments for Fluent, formatted as they would be on the command line.
114
+ cleanup_on_exit : bool
115
+ Determines whether to shut down the connected Fluent session upon exit or when calling
116
+ the session's `exit()` method. Defaults to True.
117
+ start_transcript : bool
118
+ Indicates whether to start streaming the Fluent transcript in the client. Defaults to True;
119
+ streaming can be controlled via `transcript.start()` and `transcript.stop()` methods on the session object.
111
120
  gpu : bool, optional
112
- If True, Fluent will start with GPU Solver.
121
+ If True, starts Fluent with GPU Solver enabled.
113
122
  start_watchdog : bool, optional
114
- When ``cleanup_on_exit`` is True, ``start_watchdog`` defaults to True,
115
- which means an independent watchdog process is run to ensure
116
- that any local GUI-less Fluent sessions started by PyFluent are properly closed (or killed if frozen)
117
- when the current Python process ends.
118
- file_transfer_service : optional
119
- File transfer service. Uploads/downloads files to/from the server.
123
+ If True and `cleanup_on_exit` is True, an independent watchdog process is run to ensure that any local
124
+ GUI-less Fluent sessions started by PyFluent are properly closed when the current Python process ends.
125
+ file_transfer_service : Any, optional
126
+ Service for uploading/downloading files to/from the server.
120
127
 
121
128
  Returns
122
129
  -------
123
- :obj:`~typing.Union` [:class:`Meshing<ansys.fluent.core.session_meshing.Meshing>`, \
124
- :class:`~ansys.fluent.core.session_pure_meshing.PureMeshing`, \
125
- :class:`~ansys.fluent.core.session_solver.Solver`, \
126
- :class:`~ansys.fluent.core.session_solver_icing.SolverIcing`, dict]
127
- Session object or configuration dictionary if ``dry_run = True``.
130
+ Union[Meshing, PureMeshing, Solver, SolverIcing, dict]
131
+ Session object or configuration dictionary if ``dry_run`` is True.
128
132
 
129
133
  Raises
130
134
  ------
@@ -133,10 +137,10 @@ class PIMLauncher:
133
137
 
134
138
  Notes
135
139
  -----
136
- Job scheduler environments such as SLURM, LSF, PBS, etc. allocates resources / compute nodes.
137
- The allocated machines and core counts are queried from the scheduler environment and
138
- passed to Fluent.
140
+ In job scheduler environments (e.g., SLURM, LSF, PBS), resources and compute nodes are allocated,
141
+ and core counts are queried from these environments before being passed to Fluent.
139
142
  """
143
+
140
144
  if additional_arguments:
141
145
  logger.warning(
142
146
  "'additional_arguments' option for 'launch_fluent()' method is not supported "
@@ -186,9 +190,8 @@ def launch_remote_fluent(
186
190
  ) -> Meshing | PureMeshing | Solver | SolverIcing:
187
191
  """Launch Fluent remotely using `PyPIM <https://pypim.docs.pyansys.com>`.
188
192
 
189
- When calling this method, you must ensure that you are in an
190
- environment where PyPIM is configured. You can use the :func:
191
- `pypim.is_configured <ansys.platform.instancemanagement.is_configured>`
193
+ Ensure that you are in an environment where PyPIM is configured.
194
+ Use the :func:`pypim.is_configured <ansys.platform.instancemanagement.is_configured>`
192
195
  method to verify that PyPIM is configured.
193
196
 
194
197
  Parameters
@@ -196,58 +199,48 @@ def launch_remote_fluent(
196
199
  session_cls: type(Meshing) | type(PureMeshing) | type(Solver) | type(SolverIcing)
197
200
  Session type.
198
201
  start_transcript: bool
199
- Whether to start streaming the Fluent transcript in the client. The
200
- default is ``True``. You can stop and start the streaming of the
201
- Fluent transcript subsequently via method calls on the session object.
202
+ Whether to start streaming the Fluent transcript in the client.
202
203
  product_version : str, optional
203
- Version of Ansys Fluent to launch. Use ``"242"`` for 2024 R2.
204
- The default is ``None``, in which case the newest installed version is used.
204
+ Version of Ansys Fluent to launch. Default is ``None`` for the newest version.
205
205
  cleanup_on_exit : bool, optional
206
- Whether to clean up and exit Fluent when Python exits or when garbage
207
- is collected for the Fluent Python instance. The default is ``True``.
206
+ Whether to clean up and exit Fluent when Python exits. Default is ``True``.
208
207
  mode : FluentMode, optional
209
- Whether to launch Fluent remotely in meshing mode. The default is
210
- ``FluentMode.SOLVER``.
208
+ Launch Fluent in meshing mode. Default is ``FluentMode.SOLVER``.
211
209
  dimensionality : str, optional
212
- Geometric dimensionality of the Fluent simulation. The default is ``None``,
213
- in which case ``"3d"`` is used. Options are ``"3d"`` and ``"2d"``.
210
+ Geometric dimensionality of the Fluent simulation. Default is ``None`` (3D).
214
211
  file_transfer_service : optional
215
- File transfer service for uploading or downloading files to or from the server.
212
+ Service for uploading/downloading files to/from the server.
216
213
  launcher_args : Any
217
214
  Launcher arguments.
218
215
 
219
216
  Returns
220
217
  -------
221
- :obj:`~typing.Union` [:class:`Meshing<ansys.fluent.core.session_meshing.Meshing>`, \
222
- :class:`~ansys.fluent.core.session_pure_meshing.PureMeshing`, \
223
- :class:`~ansys.fluent.core.session_solver.Solver`, \
224
- :class:`~ansys.fluent.core.session_solver_icing.SolverIcing`]
218
+ Meshing | PureMeshing | Solver | SolverIcing
225
219
  Session object.
226
220
  """
221
+
227
222
  pim = pypim.connect()
228
- instance = pim.create_instance(
229
- product_name=(
230
- "fluent-meshing"
231
- if FluentMode.is_meshing(mode)
232
- else "fluent-2ddp" if dimensionality == "2d" else "fluent-3ddp"
233
- ),
223
+
224
+ instance = create_fluent_instance(
225
+ pim=pim,
226
+ mode=mode,
227
+ dimensionality=dimensionality,
234
228
  product_version=product_version,
235
229
  )
230
+
236
231
  instance.wait_for_ready()
237
- # nb pymapdl sets max msg len here:
232
+
238
233
  channel = instance.build_grpc_channel()
239
234
 
240
- fluent_connection = FluentConnection(
235
+ fluent_connection = create_fluent_connection(
241
236
  channel=channel,
242
237
  cleanup_on_exit=cleanup_on_exit,
243
- remote_instance=instance,
244
- slurm_job_id=launcher_args and launcher_args.get("slurm_job_id"),
238
+ instance=instance,
239
+ launcher_args=launcher_args,
245
240
  )
246
241
 
247
- file_transfer_service = (
248
- file_transfer_service
249
- if file_transfer_service
250
- else PimFileTransferService(pim_instance=fluent_connection._remote_instance)
242
+ file_transfer_service = get_file_transfer_service(
243
+ file_transfer_service, fluent_connection
251
244
  )
252
245
 
253
246
  return session_cls(
@@ -256,3 +249,44 @@ def launch_remote_fluent(
256
249
  file_transfer_service=file_transfer_service,
257
250
  start_transcript=start_transcript,
258
251
  )
252
+
253
+
254
+ def create_fluent_instance(
255
+ pim, mode: FluentMode, dimensionality: str | None, product_version: str | None
256
+ ):
257
+ """Create a Fluent instance based on mode and dimensionality."""
258
+
259
+ product_name = (
260
+ "fluent-meshing"
261
+ if FluentMode.is_meshing(mode)
262
+ else "fluent-2ddp" if dimensionality == Dimension.TWO else "fluent-3ddp"
263
+ )
264
+
265
+ return pim.create_instance(
266
+ product_name=product_name, product_version=product_version
267
+ )
268
+
269
+
270
+ def create_fluent_connection(
271
+ channel, cleanup_on_exit: bool, instance, launcher_args: Dict[str, Any] | None
272
+ ):
273
+ """Create a Fluent connection."""
274
+
275
+ return FluentConnection(
276
+ channel=channel,
277
+ cleanup_on_exit=cleanup_on_exit,
278
+ remote_instance=instance,
279
+ slurm_job_id=launcher_args.get("slurm_job_id") if launcher_args else None,
280
+ )
281
+
282
+
283
+ def get_file_transfer_service(
284
+ file_transfer_service: Any | None, fluent_connection
285
+ ) -> Any:
286
+ """Get the file transfer service."""
287
+
288
+ return (
289
+ file_transfer_service
290
+ if file_transfer_service
291
+ else PimFileTransferService(pim_instance=fluent_connection._remote_instance)
292
+ )
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Provides a module to process launch string."""
2
24
 
3
25
  import json
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Provides a module for enums used in the PyFluent."""
2
24
 
3
25
  from enum import Enum
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Provides a module for server information."""
2
24
 
3
25
  import os
@@ -6,7 +28,7 @@ import tempfile
6
28
 
7
29
  from ansys.fluent.core.fluent_connection import PortNotProvided
8
30
  from ansys.fluent.core.launcher import launcher_utils
9
- from ansys.fluent.core.launcher.error_handler import IpPortNotProvided
31
+ from ansys.fluent.core.launcher.error_handler import InvalidIpPort, IpPortNotProvided
10
32
  from ansys.fluent.core.session import _parse_server_info_file
11
33
 
12
34
 
@@ -45,6 +67,27 @@ def _get_server_info_file_names(use_tmpdir=True) -> tuple[str, str]:
45
67
  return file_name, file_name
46
68
 
47
69
 
70
+ def _check_ip_port(ip: str, port: int):
71
+ """Check if a port is open on a given IP address."""
72
+
73
+ if not (ip and port):
74
+ raise IpPortNotProvided()
75
+
76
+ if not port:
77
+ raise PortNotProvided()
78
+
79
+ import socket
80
+
81
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
82
+ sock.settimeout(2)
83
+ try:
84
+ result = sock.connect_ex((ip, port))
85
+ if result != 0:
86
+ raise InvalidIpPort()
87
+ finally:
88
+ sock.close()
89
+
90
+
48
91
  def _get_server_info(
49
92
  server_info_file_name: str,
50
93
  ip: str | None = None,
@@ -65,7 +108,6 @@ def _get_server_info(
65
108
  ip = ip or os.getenv("PYFLUENT_FLUENT_IP", "127.0.0.1")
66
109
  port = port or os.getenv("PYFLUENT_FLUENT_PORT")
67
110
 
68
- if not port:
69
- raise PortNotProvided()
111
+ _check_ip_port(ip=ip, port=port)
70
112
 
71
113
  return ip, port, password
@@ -1,3 +1,25 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
1
23
  """Provides a module for launching Fluent within a Slurm environment.
2
24
 
3
25
  Examples
@@ -272,7 +294,7 @@ class SlurmLauncher:
272
294
  processor_count: int | None = None,
273
295
  journal_file_names: None | str | list[str] = None,
274
296
  start_timeout: int = -1,
275
- additional_arguments: str | None = "",
297
+ additional_arguments: str = "",
276
298
  env: Dict[str, Any] | None = None,
277
299
  cleanup_on_exit: bool = True,
278
300
  start_transcript: bool = True,
@@ -301,8 +323,8 @@ class SlurmLauncher:
301
323
  ``FluentWindowsGraphicsDriver`` enum in Windows or the values of the
302
324
  ``FluentLinuxGraphicsDriver`` enum in Linux.
303
325
  product_version : FluentVersion or str or float or int, optional
304
- Version of Ansys Fluent to launch. To use Fluent version 2024 R2, pass
305
- ``FluentVersion.v242``, ``"24.2.0"``, ``"24.2"``, ``24.2``, or ``242``.
326
+ Version of Ansys Fluent to launch. To use Fluent version 2025 R1, pass
327
+ ``FluentVersion.v251``, ``"25.1.0"``, ``"25.1"``, ``25.1``, or ``251``.
306
328
  The default is ``None``, in which case the newest installed version is used.
307
329
  dimension : Dimension or int, optional
308
330
  Geometric dimensionality of the Fluent simulation. The default is ``None``,