ansys-fluent-core 0.27.dev1__py3-none-any.whl → 0.28.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 +22 -9
- ansys/fluent/core/_version.py +5 -2
- ansys/fluent/core/codegen/__init__.py +0 -3
- ansys/fluent/core/codegen/allapigen.py +1 -5
- ansys/fluent/core/codegen/builtin_settingsgen.py +44 -10
- ansys/fluent/core/codegen/datamodelgen.py +53 -12
- ansys/fluent/core/codegen/settingsgen.py +21 -12
- ansys/fluent/core/codegen/settingsgen_old.py +2 -2
- ansys/fluent/core/codegen/tuigen.py +1 -1
- ansys/fluent/core/codegen/write_settings_yaml.py +3 -4
- ansys/fluent/core/data_model_cache.py +132 -70
- ansys/fluent/core/docs/README.rst +2 -2
- ansys/fluent/core/examples/downloads.py +3 -5
- ansys/fluent/core/exceptions.py +1 -0
- ansys/fluent/core/file_session.py +59 -131
- ansys/fluent/core/filereader/case_file.py +17 -17
- ansys/fluent/core/filereader/casereader.py +2 -1
- ansys/fluent/core/filereader/data_file.py +7 -7
- ansys/fluent/core/filereader/lispy.py +6 -1
- ansys/fluent/core/fluent_connection.py +35 -7
- ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
- ansys/fluent/core/generated/datamodel_222/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_222/PartManagement.py +28 -28
- ansys/fluent/core/generated/datamodel_222/meshing.py +301 -301
- ansys/fluent/core/generated/datamodel_222/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_231/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_231/PartManagement.py +55 -55
- ansys/fluent/core/generated/datamodel_231/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_231/meshing.py +317 -317
- ansys/fluent/core/generated/datamodel_231/solverworkflow.py +51 -51
- ansys/fluent/core/generated/datamodel_231/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_232/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_232/PartManagement.py +55 -55
- ansys/fluent/core/generated/datamodel_232/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_232/meshing.py +335 -335
- ansys/fluent/core/generated/datamodel_232/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_232/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_241/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_241/PartManagement.py +57 -57
- ansys/fluent/core/generated/datamodel_241/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_241/meshing.py +361 -361
- ansys/fluent/core/generated/datamodel_241/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_241/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_242/MeshingUtilities.py +240 -240
- ansys/fluent/core/generated/datamodel_242/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_242/PartManagement.py +60 -60
- ansys/fluent/core/generated/datamodel_242/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_242/meshing.py +371 -371
- ansys/fluent/core/generated/datamodel_242/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_242/workflow.py +9 -9
- ansys/fluent/core/generated/datamodel_251/MeshingUtilities.py +244 -244
- ansys/fluent/core/generated/datamodel_251/PMFileManagement.py +2 -2
- ansys/fluent/core/generated/datamodel_251/PartManagement.py +60 -60
- ansys/fluent/core/generated/datamodel_251/flicing.py +51 -51
- ansys/fluent/core/generated/datamodel_251/meshing.py +384 -382
- ansys/fluent/core/generated/datamodel_251/preferences.py +7 -0
- ansys/fluent/core/generated/datamodel_251/solverworkflow.py +58 -58
- ansys/fluent/core/generated/datamodel_251/workflow.py +10 -10
- ansys/fluent/core/generated/datamodel_252/MeshingUtilities.py +3664 -0
- ansys/fluent/core/generated/datamodel_252/PMFileManagement.py +288 -0
- ansys/fluent/core/generated/datamodel_252/PartManagement.py +2588 -0
- ansys/fluent/core/generated/datamodel_252/flicing.py +7972 -0
- ansys/fluent/core/generated/datamodel_252/meshing.py +2644 -0
- ansys/fluent/core/generated/datamodel_252/preferences.py +2760 -0
- ansys/fluent/core/generated/datamodel_252/solverworkflow.py +479 -0
- ansys/fluent/core/generated/datamodel_252/workflow.py +466 -0
- ansys/fluent/core/generated/fluent_version_251.py +4 -4
- ansys/fluent/core/generated/fluent_version_252.py +5 -0
- ansys/fluent/core/generated/meshing/tui_251.py +1139 -1179
- ansys/fluent/core/generated/meshing/tui_252.py +10181 -0
- ansys/fluent/core/generated/solver/settings_222.py +3 -3
- ansys/fluent/core/generated/solver/settings_231.py +4 -4
- ansys/fluent/core/generated/solver/settings_232.py +5 -5
- ansys/fluent/core/generated/solver/settings_241.py +5 -5
- ansys/fluent/core/generated/solver/settings_242.py +1185 -1185
- ansys/fluent/core/generated/solver/settings_251.py +1847 -1652
- ansys/fluent/core/generated/solver/settings_251.pyi +237 -211
- ansys/fluent/core/generated/solver/settings_252.py +90369 -0
- ansys/fluent/core/generated/solver/settings_252.pyi +63778 -0
- ansys/fluent/core/generated/solver/settings_builtin.py +612 -1
- ansys/fluent/core/generated/solver/settings_builtin.pyi +235 -0
- ansys/fluent/core/generated/solver/tui_251.py +2283 -2103
- ansys/fluent/core/generated/solver/tui_252.py +37720 -0
- ansys/fluent/core/journaling.py +1 -1
- ansys/fluent/core/launcher/error_handler.py +3 -0
- ansys/fluent/core/launcher/fluent_container.py +5 -0
- ansys/fluent/core/launcher/launcher.py +1 -2
- ansys/fluent/core/launcher/launcher_utils.py +17 -6
- ansys/fluent/core/launcher/process_launch_string.py +3 -3
- ansys/fluent/core/launcher/pyfluent_enums.py +1 -1
- ansys/fluent/core/launcher/slurm_launcher.py +2 -1
- ansys/fluent/core/launcher/standalone_launcher.py +11 -5
- ansys/fluent/core/launcher/watchdog.py +1 -1
- ansys/fluent/core/launcher/watchdog_exec +6 -3
- ansys/fluent/core/logging.py +1 -5
- ansys/fluent/core/parametric.py +6 -3
- ansys/fluent/core/post_objects/meta.py +1 -39
- ansys/fluent/core/post_objects/post_helper.py +4 -3
- ansys/fluent/core/post_objects/post_object_definitions.py +12 -7
- ansys/fluent/core/post_objects/post_objects_container.py +39 -2
- ansys/fluent/core/rpvars.py +2 -1
- ansys/fluent/core/scheduler/machine_list.py +3 -1
- ansys/fluent/core/search.py +109 -262
- ansys/fluent/core/services/__init__.py +3 -0
- ansys/fluent/core/services/api_upgrade.py +1 -0
- ansys/fluent/core/services/batch_ops.py +3 -1
- ansys/fluent/core/services/datamodel_se.py +37 -30
- ansys/fluent/core/services/datamodel_tui.py +8 -3
- ansys/fluent/core/services/deprecated_field_data.py +691 -0
- ansys/fluent/core/services/field_data.py +67 -357
- ansys/fluent/core/services/interceptors.py +6 -4
- ansys/fluent/core/services/reduction.py +1 -2
- ansys/fluent/core/services/scheme_eval.py +2 -3
- ansys/fluent/core/services/solution_variables.py +46 -48
- ansys/fluent/core/session.py +6 -4
- ansys/fluent/core/session_meshing.pyi +5 -0
- ansys/fluent/core/session_pure_meshing.pyi +4 -1
- ansys/fluent/core/session_solver_lite.py +2 -1
- ansys/fluent/core/solver/flobject.py +179 -207
- ansys/fluent/core/solver/flunits.py +65 -56
- ansys/fluent/core/solver/function/reduction.py +9 -29
- ansys/fluent/core/solver/settings_builtin_bases.py +28 -22
- ansys/fluent/core/solver/settings_builtin_data.py +105 -1
- ansys/fluent/core/solver/settings_external.py +0 -28
- ansys/fluent/core/streaming_services/field_data_streaming.py +1 -0
- ansys/fluent/core/streaming_services/monitor_streaming.py +0 -1
- ansys/fluent/core/systemcoupling.py +145 -14
- ansys/fluent/core/utils/__init__.py +18 -2
- ansys/fluent/core/utils/dump_session_data.py +7 -4
- ansys/fluent/core/utils/execution.py +2 -2
- ansys/fluent/core/utils/file_transfer_service.py +37 -42
- ansys/fluent/core/utils/fluent_version.py +20 -2
- ansys/fluent/core/utils/networking.py +39 -1
- ansys/fluent/core/workflow.py +3 -15
- ansys/fluent/tests/conftest.py +89 -7
- ansys/fluent/tests/fluent/test_version/test.py +2 -0
- ansys/fluent/tests/fluent_fixtures.py +195 -0
- ansys/fluent/tests/integration/test_optislang/test_optislang_integration.py +7 -7
- ansys/fluent/tests/parametric/test_parametric_workflow.py +14 -4
- ansys/fluent/tests/test_builtin_settings.py +28 -0
- ansys/fluent/tests/test_cad_to_post_ftm.py +1 -3
- ansys/fluent/tests/test_cad_to_post_wtm.py +1 -1
- ansys/fluent/tests/test_casereader.py +1 -1
- ansys/fluent/tests/test_codegen.py +116 -6
- ansys/fluent/tests/test_data_model_cache.py +1 -1
- ansys/fluent/tests/test_datamodel_service.py +14 -19
- ansys/fluent/tests/test_field_data.py +93 -45
- ansys/fluent/tests/test_file_session.py +32 -29
- ansys/fluent/tests/test_flobject.py +16 -58
- ansys/fluent/tests/test_fluent_fixes.py +5 -5
- ansys/fluent/tests/test_fluent_session.py +11 -8
- ansys/fluent/tests/test_fluent_version.py +1 -1
- ansys/fluent/tests/test_launcher.py +22 -5
- ansys/fluent/tests/test_launcher_remote.py +80 -4
- ansys/fluent/tests/test_meshing_utilities.py +93 -44
- ansys/fluent/tests/test_meshing_workflow.py +6 -6
- ansys/fluent/tests/test_meshingmode/test_meshing_launch.py +1 -1
- ansys/fluent/tests/test_new_meshing_workflow.py +42 -3
- ansys/fluent/tests/test_preferences.py +6 -6
- ansys/fluent/tests/test_reduction.py +61 -30
- ansys/fluent/tests/test_rp_vars.py +1 -1
- ansys/fluent/tests/test_search.py +53 -200
- ansys/fluent/tests/test_session.py +18 -13
- ansys/fluent/tests/test_settings_api.py +93 -29
- ansys/fluent/tests/test_settings_reader.py +1 -1
- ansys/fluent/tests/test_solver_monitors.py +1 -1
- ansys/fluent/tests/test_solvermode/test_calculationactivities.py +4 -4
- ansys/fluent/tests/test_solvermode/test_controls.py +3 -3
- ansys/fluent/tests/test_solvermode/test_methods.py +1 -1
- ansys/fluent/tests/test_solvermode/test_models.py +3 -3
- ansys/fluent/tests/test_systemcoupling.py +33 -5
- ansys/fluent/tests/test_topy.py +2 -2
- ansys/fluent/tests/test_tui_api.py +5 -5
- ansys/fluent/tests/test_utils.py +1 -1
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/METADATA +6 -17
- ansys_fluent_core-0.28.dev0.dist-info/RECORD +291 -0
- ansys/fluent/core/generated/api_tree_222.pickle +0 -0
- ansys/fluent/core/generated/api_tree_231.pickle +0 -0
- ansys/fluent/core/generated/api_tree_232.pickle +0 -0
- ansys/fluent/core/generated/api_tree_241.pickle +0 -0
- ansys/fluent/core/generated/api_tree_242.pickle +0 -0
- ansys/fluent/core/generated/api_tree_251.pickle +0 -0
- ansys/fluent/tests/test_tests_util.py +0 -47
- ansys/fluent/tests/util/__init__.py +0 -38
- ansys_fluent_core-0.27.dev1.dist-info/RECORD +0 -283
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/AUTHORS +0 -0
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/LICENSE +0 -0
- {ansys_fluent_core-0.27.dev1.dist-info → ansys_fluent_core-0.28.dev0.dist-info}/WHEEL +0 -0
|
@@ -12,7 +12,9 @@ from ansys.fluent.core.solver.flobject import (
|
|
|
12
12
|
_OutputFile,
|
|
13
13
|
to_python_name,
|
|
14
14
|
)
|
|
15
|
+
from ansys.fluent.core.utils.execution import timeout_loop
|
|
15
16
|
from ansys.fluent.core.utils.fluent_version import FluentVersion
|
|
17
|
+
from ansys.fluent.core.warnings import PyFluentUserWarning
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
@pytest.mark.nightly
|
|
@@ -23,8 +25,6 @@ def test_setup_models_viscous_model_settings(new_solver_session) -> None:
|
|
|
23
25
|
solver_session.file.read(
|
|
24
26
|
file_name=case_path, file_type="case", lightweight_setup=True
|
|
25
27
|
)
|
|
26
|
-
# NOTE: Not sure why initialization is necessary here
|
|
27
|
-
# solver_session.solution.initialization.hybrid_initialize()
|
|
28
28
|
|
|
29
29
|
viscous_model = solver_session.setup.models.viscous
|
|
30
30
|
|
|
@@ -213,24 +213,26 @@ def test_api_upgrade(new_solver_session, capsys):
|
|
|
213
213
|
solver = new_solver_session
|
|
214
214
|
case_path = download_file("Static_Mixer_main.cas.h5", "pyfluent/static_mixer")
|
|
215
215
|
solver.tui.file.read_case(case_path)
|
|
216
|
-
|
|
216
|
+
timeout_loop(
|
|
217
|
+
lambda: "<solver_session>.settings.file.read_case" in capsys.readouterr().out,
|
|
218
|
+
timeout=5,
|
|
219
|
+
)
|
|
217
220
|
|
|
218
221
|
|
|
219
|
-
|
|
222
|
+
# Custom aliases are not tested with 25.1 or later due to conflicts with the actual aliases
|
|
223
|
+
# defined in the settings API
|
|
224
|
+
@pytest.mark.fluent_version("==24.2")
|
|
220
225
|
def test_deprecated_settings_with_custom_aliases(new_solver_session):
|
|
221
226
|
solver = new_solver_session
|
|
222
|
-
if solver.get_fluent_version() >= FluentVersion.v251:
|
|
223
|
-
# https://github.com/ansys/pyfluent/issues/3134
|
|
224
|
-
return
|
|
225
227
|
case_path = download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow")
|
|
226
228
|
download_file("mixing_elbow.dat.h5", "pyfluent/mixing_elbow")
|
|
227
|
-
solver.file._setattr("_child_aliases", {"rcd": "read_case_data"})
|
|
229
|
+
solver.file._setattr("_child_aliases", {"rcd": ("read_case_data", "rcd")})
|
|
228
230
|
with pytest.warns(DeprecatedSettingWarning):
|
|
229
231
|
solver.file.rcd(file_name=case_path)
|
|
230
232
|
|
|
231
233
|
solver.setup.boundary_conditions.velocity_inlet.child_object_type._child_aliases[
|
|
232
234
|
"mom"
|
|
233
|
-
] = "momentum"
|
|
235
|
+
] = ("momentum", "mom")
|
|
234
236
|
with pytest.warns(DeprecatedSettingWarning):
|
|
235
237
|
solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].mom.velocity = 20
|
|
236
238
|
assert (
|
|
@@ -259,12 +261,9 @@ def test_deprecated_settings_with_custom_aliases(new_solver_session):
|
|
|
259
261
|
)
|
|
260
262
|
> 0
|
|
261
263
|
)
|
|
262
|
-
assert
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
].thermal.temperature._child_aliases["constant"]
|
|
266
|
-
== "value"
|
|
267
|
-
)
|
|
264
|
+
assert solver.setup.boundary_conditions.wall[
|
|
265
|
+
"wall-inlet"
|
|
266
|
+
].thermal.temperature._child_aliases["constant"] == ("value", "constant")
|
|
268
267
|
with pytest.warns(DeprecatedSettingWarning):
|
|
269
268
|
solver.setup.boundary_conditions.wall[
|
|
270
269
|
"wall-inlet"
|
|
@@ -296,7 +295,7 @@ def test_deprecated_settings_with_custom_aliases(new_solver_session):
|
|
|
296
295
|
== 410
|
|
297
296
|
)
|
|
298
297
|
|
|
299
|
-
solver.setup.boundary_conditions._setattr("_child_aliases", {"w": "wall"})
|
|
298
|
+
solver.setup.boundary_conditions._setattr("_child_aliases", {"w": ("wall", "w")})
|
|
300
299
|
with pytest.warns(DeprecatedSettingWarning):
|
|
301
300
|
solver.setup.boundary_conditions.w["wall-inlet"].thermal.temperature.value = 420
|
|
302
301
|
|
|
@@ -305,7 +304,7 @@ def test_deprecated_settings_with_custom_aliases(new_solver_session):
|
|
|
305
304
|
== 420
|
|
306
305
|
)
|
|
307
306
|
|
|
308
|
-
solver.setup._setattr("_child_aliases", {"bc": "boundary_conditions"})
|
|
307
|
+
solver.setup._setattr("_child_aliases", {"bc": ("boundary_conditions", "bc")})
|
|
309
308
|
with pytest.warns(DeprecatedSettingWarning):
|
|
310
309
|
solver.setup.bc.wall["wall-inlet"].thermal.temperature.value = 430
|
|
311
310
|
|
|
@@ -324,7 +323,7 @@ def test_deprecated_settings_with_custom_aliases(new_solver_session):
|
|
|
324
323
|
== 400
|
|
325
324
|
)
|
|
326
325
|
|
|
327
|
-
solver.results._setattr("_child_aliases", {"gr": "graphics"})
|
|
326
|
+
solver.results._setattr("_child_aliases", {"gr": ("graphics", "gr")})
|
|
328
327
|
with pytest.warns(DeprecatedSettingWarning):
|
|
329
328
|
solver.results.gr.contour.create("c1")
|
|
330
329
|
|
|
@@ -340,7 +339,10 @@ def test_deprecated_settings_with_custom_aliases(new_solver_session):
|
|
|
340
339
|
|
|
341
340
|
solver.setup.boundary_conditions.velocity_inlet[
|
|
342
341
|
"hot-inlet"
|
|
343
|
-
].momentum.velocity._child_aliases["hd"] =
|
|
342
|
+
].momentum.velocity._child_aliases["hd"] = (
|
|
343
|
+
"../../turbulence/hydraulic_diameter",
|
|
344
|
+
"hd",
|
|
345
|
+
)
|
|
344
346
|
with pytest.warns(DeprecatedSettingWarning):
|
|
345
347
|
solver.setup.boundary_conditions.velocity_inlet[
|
|
346
348
|
"hot-inlet"
|
|
@@ -360,11 +362,8 @@ def test_deprecated_settings_with_custom_aliases(new_solver_session):
|
|
|
360
362
|
|
|
361
363
|
|
|
362
364
|
@pytest.mark.fluent_version(">=25.1")
|
|
363
|
-
def test_deprecated_settings_with_settings_api_aliases(
|
|
364
|
-
solver =
|
|
365
|
-
case_path = download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow")
|
|
366
|
-
download_file("mixing_elbow.dat.h5", "pyfluent/mixing_elbow")
|
|
367
|
-
solver.settings.file.read_case_data(file_name=case_path)
|
|
365
|
+
def test_deprecated_settings_with_settings_api_aliases(mixing_elbow_case_data_session):
|
|
366
|
+
solver = mixing_elbow_case_data_session
|
|
368
367
|
solver.settings.results.surfaces.iso_clip["clip-1"] = {}
|
|
369
368
|
assert solver.settings.results.surfaces.iso_clip["clip-1"].range() == {
|
|
370
369
|
"minimum": 0,
|
|
@@ -378,6 +377,44 @@ def test_deprecated_settings_with_settings_api_aliases(new_solver_session):
|
|
|
378
377
|
"minimum": -0.0001,
|
|
379
378
|
"maximum": 0.0001,
|
|
380
379
|
}
|
|
380
|
+
solver.settings.results.graphics.contour["temperature"] = {}
|
|
381
|
+
solver.settings.results.graphics.contour["temperature"] = {
|
|
382
|
+
"field": "temperature",
|
|
383
|
+
"surfaces_list": "wall*",
|
|
384
|
+
"color_map": {
|
|
385
|
+
"visible": True,
|
|
386
|
+
"size": 100,
|
|
387
|
+
"color": "field-velocity",
|
|
388
|
+
"log_scale": False,
|
|
389
|
+
"format": "%0.1f",
|
|
390
|
+
"user_skip": 9,
|
|
391
|
+
"show_all": True,
|
|
392
|
+
"position": 1,
|
|
393
|
+
"font_name": "Helvetica",
|
|
394
|
+
"font_automatic": True,
|
|
395
|
+
"font_size": 0.032,
|
|
396
|
+
"length": 0.54,
|
|
397
|
+
"width": 6,
|
|
398
|
+
"bground_transparent": True,
|
|
399
|
+
"bground_color": "#CCD3E2",
|
|
400
|
+
"title_elements": "Variable and Object Name",
|
|
401
|
+
},
|
|
402
|
+
"range_option": {
|
|
403
|
+
"option": "auto-range-off",
|
|
404
|
+
"auto_range_off": {
|
|
405
|
+
"maximum": 400.0,
|
|
406
|
+
"minimum": 300,
|
|
407
|
+
"clip_to_range": False,
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
}
|
|
411
|
+
assert solver.settings.results.graphics.contour["temperature"].range_options() == {
|
|
412
|
+
"global_range": True,
|
|
413
|
+
"auto_range": False,
|
|
414
|
+
"clip_to_range": False,
|
|
415
|
+
"minimum": 300,
|
|
416
|
+
"maximum": 400.0,
|
|
417
|
+
}
|
|
381
418
|
|
|
382
419
|
|
|
383
420
|
@pytest.mark.fluent_version(">=23.1")
|
|
@@ -482,7 +519,10 @@ def test_child_alias_with_parent_path(mixing_elbow_settings_session):
|
|
|
482
519
|
solver.settings.solution.initialization.hybrid_initialize()
|
|
483
520
|
assert (
|
|
484
521
|
solver.settings.setup.models.discrete_phase.numerics.node_based_averaging.kernel._child_aliases
|
|
485
|
-
== {
|
|
522
|
+
== {
|
|
523
|
+
"gaussian_factor": ("../gaussian_factor", "gaussian-factor"),
|
|
524
|
+
"option": ("../kernel_type", "option"),
|
|
525
|
+
}
|
|
486
526
|
)
|
|
487
527
|
solver.settings.setup.models.discrete_phase.numerics.node_based_averaging.enabled = (
|
|
488
528
|
True
|
|
@@ -512,10 +552,34 @@ def test_child_alias_with_parent_path(mixing_elbow_settings_session):
|
|
|
512
552
|
|
|
513
553
|
|
|
514
554
|
@pytest.mark.fluent_version(">=25.1")
|
|
515
|
-
def
|
|
555
|
+
def test_commands_not_in_settings(new_solver_session):
|
|
516
556
|
solver = new_solver_session
|
|
517
557
|
|
|
518
|
-
|
|
558
|
+
for command in ["exit", "switch_to_meshing_mode"]:
|
|
559
|
+
assert command not in dir(solver.settings)
|
|
560
|
+
with pytest.raises(AttributeError):
|
|
561
|
+
getattr(solver.settings, command)
|
|
519
562
|
|
|
520
|
-
|
|
521
|
-
|
|
563
|
+
|
|
564
|
+
@pytest.mark.fluent_version(">=25.1")
|
|
565
|
+
def test_deprecated_command_arguments(mixing_elbow_case_data_session):
|
|
566
|
+
solver = mixing_elbow_case_data_session
|
|
567
|
+
with pytest.warns() as record:
|
|
568
|
+
# all_boundary_zones is an unknown/unsupported keyword
|
|
569
|
+
solver.settings.results.report.fluxes.mass_flow(
|
|
570
|
+
all_boundary_zones=False, zones=["cold-inlet", "hot-inlet", "outlet"]
|
|
571
|
+
)
|
|
572
|
+
assert len(record) == 1
|
|
573
|
+
assert record[0].category == PyFluentUserWarning
|
|
574
|
+
assert "all_boundary_zones" in str(record[0].message)
|
|
575
|
+
|
|
576
|
+
solver.settings.results.graphics.mesh.create("m1")
|
|
577
|
+
solver.settings.results.graphics.mesh.make_a_copy(from_="m1", to="m2")
|
|
578
|
+
solver.settings.results.graphics.mesh.copy(
|
|
579
|
+
from_name="m1", new_name="m3"
|
|
580
|
+
) # deprecated
|
|
581
|
+
assert set(solver.settings.results.graphics.mesh.get_object_names()) == {
|
|
582
|
+
"m1",
|
|
583
|
+
"m2",
|
|
584
|
+
"m3",
|
|
585
|
+
}
|
|
@@ -57,7 +57,7 @@ def test_settings_reader_static_mixer_h5():
|
|
|
57
57
|
|
|
58
58
|
def test_meshing_unavailable():
|
|
59
59
|
reader = SettingsReader(settings_file_name=static_mixer_settings_file())
|
|
60
|
-
with pytest.raises(AttributeError)
|
|
60
|
+
with pytest.raises(AttributeError):
|
|
61
61
|
reader.get_mesh()
|
|
62
62
|
|
|
63
63
|
|
|
@@ -74,7 +74,7 @@ def test_solver_monitors(new_solver_session):
|
|
|
74
74
|
# n.b. there is no checking of the callback signature at registration. Instead
|
|
75
75
|
# we would get a TypeError at callback time if the signature is wrong. The correct
|
|
76
76
|
# signature is undocumented.
|
|
77
|
-
|
|
77
|
+
solver.monitors.register_callback(monitor_callback)
|
|
78
78
|
|
|
79
79
|
# trigger callback by running the solver
|
|
80
80
|
assert not monitor_callback.called
|
|
@@ -7,14 +7,14 @@ from ansys.fluent.core.utils.fluent_version import FluentVersion
|
|
|
7
7
|
def test_solver_calculation(static_mixer_case_session):
|
|
8
8
|
solver_session = static_mixer_case_session
|
|
9
9
|
scheme_eval = solver_session.scheme_eval.scheme_eval
|
|
10
|
-
assert scheme_eval("(client-get-var 'residuals/plot?)")
|
|
10
|
+
assert scheme_eval("(client-get-var 'residuals/plot?)") is True
|
|
11
11
|
# TODO: Remove the if condition after a stable version of 23.1 is available and update the commands as required.
|
|
12
12
|
if solver_session.get_fluent_version() < FluentVersion.v231:
|
|
13
13
|
solver_session.tui.solve.monitors.residual.plot("no")
|
|
14
|
-
assert scheme_eval("(client-get-var 'residuals/plot?)")
|
|
15
|
-
assert scheme_eval("(data-valid?)")
|
|
14
|
+
assert scheme_eval("(client-get-var 'residuals/plot?)") is False
|
|
15
|
+
assert scheme_eval("(data-valid?)") is False
|
|
16
16
|
solver_session.solution.initialization.hybrid_initialize()
|
|
17
|
-
assert scheme_eval("(data-valid?)")
|
|
17
|
+
assert scheme_eval("(data-valid?)") is True
|
|
18
18
|
# solver_session.solution.run_calculation.iterate.get_attr("arguments")
|
|
19
19
|
# solver_session.solution.run_calculation.number_of_iterations = 5
|
|
20
20
|
# assert solver_session.solution.run_calculation.number_of_iterations == 5
|
|
@@ -43,8 +43,8 @@ def test_controls(mixing_elbow_settings_session):
|
|
|
43
43
|
)
|
|
44
44
|
assert param_coarsening.max_coarse_levels() == 48
|
|
45
45
|
assert param_coarsening.coarsen_by_interval() == 9
|
|
46
|
-
assert param_coarsening.conservative_coarsening()
|
|
47
|
-
assert param_coarsening.aggressive_coarsening()
|
|
46
|
+
assert param_coarsening.conservative_coarsening() is True
|
|
47
|
+
assert param_coarsening.aggressive_coarsening() is True
|
|
48
48
|
|
|
49
49
|
param_fixed_cycle = (
|
|
50
50
|
solver.solution.controls.advanced.multi_grid.amg_controls.scalar_parameters.fixed_cycle_parameters
|
|
@@ -66,7 +66,7 @@ def test_controls(mixing_elbow_settings_session):
|
|
|
66
66
|
solver.solution.methods.p_v_coupling.flow_scheme = "Coupled"
|
|
67
67
|
assert solver.solution.methods.p_v_coupling.flow_scheme() == "Coupled"
|
|
68
68
|
solver.solution.methods.p_v_coupling.coupled_form = True
|
|
69
|
-
assert solver.solution.methods.p_v_coupling.coupled_form()
|
|
69
|
+
assert solver.solution.methods.p_v_coupling.coupled_form() is True
|
|
70
70
|
solver.solution.controls.advanced.multi_grid.amg_controls.scalar_parameters.smoother_type = (
|
|
71
71
|
"Gauss-Seidel"
|
|
72
72
|
)
|
|
@@ -57,7 +57,7 @@ def test_methods(mixing_elbow_settings_session):
|
|
|
57
57
|
"first_to_second_order_blending": 1.0,
|
|
58
58
|
}
|
|
59
59
|
solver.solution.methods.expert.numerics_pbns.presto_pressure_scheme = True
|
|
60
|
-
assert solver.solution.methods.expert.numerics_pbns.presto_pressure_scheme()
|
|
60
|
+
assert solver.solution.methods.expert.numerics_pbns.presto_pressure_scheme() is True
|
|
61
61
|
solver.solution.methods.gradient_scheme = "green-gauss-node-based"
|
|
62
62
|
assert solver.solution.methods.gradient_scheme() == "green-gauss-node-based"
|
|
63
63
|
solver.solution.methods.warped_face_gradient_correction(
|
|
@@ -82,16 +82,16 @@ def test_disk_2d_models(disk_settings_session):
|
|
|
82
82
|
]
|
|
83
83
|
k_omega_options = models.viscous.k_omega_options
|
|
84
84
|
k_omega_options.kw_low_re_correction = True
|
|
85
|
-
assert k_omega_options.kw_low_re_correction()
|
|
85
|
+
assert k_omega_options.kw_low_re_correction() is True
|
|
86
86
|
|
|
87
87
|
turb_options = models.viscous.options
|
|
88
88
|
turb_options.production_kato_launder_enabled = True
|
|
89
|
-
assert turb_options.production_kato_launder_enabled()
|
|
89
|
+
assert turb_options.production_kato_launder_enabled() is True
|
|
90
90
|
turb_options.production_limiter.clip_factor = 9
|
|
91
91
|
assert turb_options.production_limiter.clip_factor() == 9
|
|
92
92
|
turb_expert = models.viscous.turbulence_expert
|
|
93
93
|
turb_expert.turb_non_newtonian = True
|
|
94
|
-
assert turb_expert.turb_non_newtonian()
|
|
94
|
+
assert turb_expert.turb_non_newtonian() is True
|
|
95
95
|
|
|
96
96
|
models.viscous.model = "laminar"
|
|
97
97
|
assert models.viscous.model() == "laminar"
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
@pytest.mark.fluent_version(">=
|
|
5
|
-
def
|
|
6
|
-
"""
|
|
4
|
+
@pytest.mark.fluent_version(">=25.1")
|
|
5
|
+
def test_systemcoupling_mixing_elbow_settings_apis(mixing_elbow_case_data_session):
|
|
6
|
+
"""Test System Coupling related settings APIs"""
|
|
7
|
+
solver = mixing_elbow_case_data_session
|
|
8
|
+
# enable the feature flag to be able to make the queries
|
|
9
|
+
solver.scheme_eval.scheme_eval("(enable-feature 'sc/participant-info)")
|
|
10
|
+
elbow_fluid = "elbow-fluid"
|
|
11
|
+
region_names = solver.settings.setup.models.system_coupling.get_all_regions()
|
|
12
|
+
assert elbow_fluid in region_names
|
|
13
|
+
# elbow fluid must be a volume
|
|
14
|
+
assert (
|
|
15
|
+
solver.settings.setup.models.system_coupling.get_topology(
|
|
16
|
+
region_name=elbow_fluid
|
|
17
|
+
)
|
|
18
|
+
== "Volume"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _test_systemcoupling_mixing_elbow_settings_common(mixing_elbow_case_data_session):
|
|
7
23
|
solver = mixing_elbow_case_data_session
|
|
8
24
|
# check participant type, analysis type, regions, and variables
|
|
9
25
|
assert solver.system_coupling.participant_type == "FLUENT"
|
|
@@ -12,5 +28,17 @@ def test_systemcoupling_mixing_elbow_settings(mixing_elbow_case_data_session):
|
|
|
12
28
|
variables = solver.system_coupling.get_variables()
|
|
13
29
|
# [wall-inlet, wall-elbow, elbow-fluid, hot-inlet, cold-inlet, outlet]
|
|
14
30
|
assert len(regions) >= 6
|
|
15
|
-
# [force,
|
|
16
|
-
assert len(variables) >=
|
|
31
|
+
# [force, temp, htc, hflow, nwt, hrate, e-cond, lorentz-force]
|
|
32
|
+
assert len(variables) >= 8
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@pytest.mark.fluent_version(">=25.1")
|
|
36
|
+
def test_systemcoupling_mixing_elbow_settings(mixing_elbow_case_data_session):
|
|
37
|
+
"""Very superficial test of System Coupling related settings."""
|
|
38
|
+
_test_systemcoupling_mixing_elbow_settings_common(mixing_elbow_case_data_session)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@pytest.mark.fluent_version(">=24.1,<25.1")
|
|
42
|
+
def test_systemcoupling_mixing_elbow_settings_legacy(mixing_elbow_case_data_session):
|
|
43
|
+
"""Test legacy implementation of getting System Coupling related settings."""
|
|
44
|
+
_test_systemcoupling_mixing_elbow_settings_common(mixing_elbow_case_data_session)
|
ansys/fluent/tests/test_topy.py
CHANGED
|
@@ -110,7 +110,7 @@ def test_2_jou():
|
|
|
110
110
|
+ "_"
|
|
111
111
|
+ Path(file_name_2).stem.split(".")[0]
|
|
112
112
|
+ ".py"
|
|
113
|
-
)
|
|
113
|
+
)
|
|
114
114
|
gen_file_name = os.path.join(os.getcwd(), gen_file_name)
|
|
115
115
|
|
|
116
116
|
with open(gen_file_name) as file:
|
|
@@ -162,7 +162,7 @@ def test_2_scm():
|
|
|
162
162
|
+ "_"
|
|
163
163
|
+ Path(file_name_2).stem.split(".")[0]
|
|
164
164
|
+ ".py"
|
|
165
|
-
)
|
|
165
|
+
)
|
|
166
166
|
gen_file_name = os.path.join(os.getcwd(), gen_file_name)
|
|
167
167
|
|
|
168
168
|
with open(gen_file_name) as file:
|
|
@@ -61,10 +61,10 @@ def test_exit_not_in_meshing_tui(new_meshing_session):
|
|
|
61
61
|
meshing.tui.exit()
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
def
|
|
64
|
+
def test_commands_not_in_solver_tui(new_solver_session):
|
|
65
65
|
solver = new_solver_session
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
for command in ["exit", "switch_to_meshing_mode"]:
|
|
68
|
+
assert command not in dir(solver.tui)
|
|
69
|
+
with pytest.raises(AttributeError):
|
|
70
|
+
getattr(solver.tui, command)
|
ansys/fluent/tests/test_utils.py
CHANGED
|
@@ -54,7 +54,7 @@ def test_timeout_loop():
|
|
|
54
54
|
ret = timeout_loop(waiter, timeout=0.2, expected="truthy", idle_period=0.1)
|
|
55
55
|
assert ret is False
|
|
56
56
|
|
|
57
|
-
with pytest.raises(InvalidArgument)
|
|
57
|
+
with pytest.raises(InvalidArgument):
|
|
58
58
|
timeout_loop(waiter, timeout=0.2, expected=True, idle_period=0.1)
|
|
59
59
|
|
|
60
60
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ansys-fluent-core
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.28.dev0
|
|
4
4
|
Summary: PyFluent provides Pythonic access to Ansys Fluent
|
|
5
5
|
Home-page: https://github.com/ansys/pyfluent
|
|
6
6
|
License: MIT
|
|
@@ -16,32 +16,21 @@ Classifier: Programming Language :: Python :: 3
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Provides-Extra: examples
|
|
20
19
|
Provides-Extra: reader
|
|
21
20
|
Provides-Extra: tests
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist: ansys-api-fluent (>=0.3.27,<0.4.0)
|
|
21
|
+
Requires-Dist: ansys-api-fluent (>=0.3.28,<0.4.0)
|
|
24
22
|
Requires-Dist: ansys-platform-instancemanagement (>=1.0,<2.0)
|
|
25
23
|
Requires-Dist: ansys-tools-filetransfer (>=0.1,<0.3)
|
|
26
|
-
Requires-Dist: ansys-units (>=0.3.
|
|
27
|
-
Requires-Dist: beartype (>=0.17)
|
|
24
|
+
Requires-Dist: ansys-units (>=0.3.3,<0.4.0)
|
|
28
25
|
Requires-Dist: docker (>=7.1.0)
|
|
29
26
|
Requires-Dist: grpcio (>=1.30.0,<2.0.0)
|
|
30
27
|
Requires-Dist: grpcio-health-checking (>=1.30.0,<2.0.0)
|
|
31
28
|
Requires-Dist: h5py (==3.12.1) ; extra == "reader"
|
|
32
29
|
Requires-Dist: lxml (>=4.9.2)
|
|
33
30
|
Requires-Dist: nltk (>=3.9.1)
|
|
34
|
-
Requires-Dist: numpy (>=1.14.0,<
|
|
35
|
-
Requires-Dist: openpyxl (>=3.1.5) ; extra == "examples"
|
|
31
|
+
Requires-Dist: numpy (>=1.14.0,<3.0.0)
|
|
36
32
|
Requires-Dist: pandas (>=1.1.0,<2.3)
|
|
37
|
-
Requires-Dist: platformdirs (>=3.6.0)
|
|
38
|
-
Requires-Dist: plotly (>=5.22.0) ; extra == "examples"
|
|
39
|
-
Requires-Dist: psutil (>=5.9.5)
|
|
40
|
-
Requires-Dist: python-pptx (>=0.6.23) ; extra == "examples"
|
|
41
33
|
Requires-Dist: pyyaml (>=6.0)
|
|
42
|
-
Requires-Dist: requests (>=2.32.3)
|
|
43
|
-
Requires-Dist: seaborn (>=0.13.2) ; extra == "examples"
|
|
44
|
-
Requires-Dist: tensorflow (>=2.17.0) ; extra == "examples"
|
|
45
34
|
Project-URL: Documentation, https://fluent.docs.pyansys.com/
|
|
46
35
|
Project-URL: Repository, https://github.com/ansys/pyfluent
|
|
47
36
|
Project-URL: Source, https://github.com/ansys/pyfluent
|
|
@@ -117,7 +106,7 @@ To reach the project support team, email `pyansys.core@ansys.com <pyansys.core@a
|
|
|
117
106
|
Installation
|
|
118
107
|
------------
|
|
119
108
|
The ``ansys-fluent-core`` package supports Python 3.9 through Python
|
|
120
|
-
3.
|
|
109
|
+
3.13 on Windows and Linux.
|
|
121
110
|
|
|
122
111
|
Install the latest release from `PyPI
|
|
123
112
|
<https://pypi.org/project/ansys-fluent-core/>`_ with:
|
|
@@ -149,7 +138,7 @@ example, the installer automatically sets the ``AWP_ROOT232`` environment variab
|
|
|
149
138
|
to ``C:\Program Files\ANSYS Inc\v232``.
|
|
150
139
|
|
|
151
140
|
On Linux, the required environment variable is not set automatically, and can be set for the
|
|
152
|
-
current user in the current shell session, using Fluent 2023
|
|
141
|
+
current user in the current shell session, using Fluent 2023 R2 in the default installation
|
|
153
142
|
directory as an example, before running PyFluent, with:
|
|
154
143
|
|
|
155
144
|
.. code:: console
|