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
|
@@ -124,7 +124,7 @@ def test_add_on_deleted(new_meshing_session):
|
|
|
124
124
|
meshing = new_meshing_session
|
|
125
125
|
meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")
|
|
126
126
|
data = []
|
|
127
|
-
|
|
127
|
+
_ = meshing.workflow.TaskObject["Import Geometry"].add_on_deleted(
|
|
128
128
|
lambda obj: data.append(convert_path_to_se_path(obj.path))
|
|
129
129
|
)
|
|
130
130
|
assert data == []
|
|
@@ -166,7 +166,7 @@ def test_add_on_affected(new_meshing_session):
|
|
|
166
166
|
wt = meshing.watertight()
|
|
167
167
|
sleep(5)
|
|
168
168
|
assert len(data) > 0
|
|
169
|
-
assert data[0]
|
|
169
|
+
assert data[0]
|
|
170
170
|
|
|
171
171
|
calls = []
|
|
172
172
|
subscription2 = meshing.workflow.add_on_affected(lambda obj: calls.append(True))
|
|
@@ -220,7 +220,7 @@ def test_add_on_affected_at_type_path(new_meshing_session):
|
|
|
220
220
|
meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")
|
|
221
221
|
sleep(5)
|
|
222
222
|
assert len(data) > 0
|
|
223
|
-
assert data[0]
|
|
223
|
+
assert data[0]
|
|
224
224
|
data.clear()
|
|
225
225
|
subscription.unsubscribe()
|
|
226
226
|
meshing.workflow.InitializeWorkflow(WorkflowType="Fault-tolerant Meshing")
|
|
@@ -244,7 +244,7 @@ def test_add_on_command_executed(new_meshing_session):
|
|
|
244
244
|
meshing.meshing.ImportGeometry(FileName=import_file_name)
|
|
245
245
|
sleep(5)
|
|
246
246
|
assert len(data) > 0
|
|
247
|
-
assert data[0]
|
|
247
|
+
assert data[0]
|
|
248
248
|
data.clear()
|
|
249
249
|
subscription.unsubscribe()
|
|
250
250
|
meshing.meshing.ImportGeometry(FileName=import_file_name)
|
|
@@ -252,11 +252,6 @@ def test_add_on_command_executed(new_meshing_session):
|
|
|
252
252
|
assert data == []
|
|
253
253
|
|
|
254
254
|
|
|
255
|
-
@pytest.fixture
|
|
256
|
-
def disable_datamodel_cache(monkeypatch: pytest.MonkeyPatch):
|
|
257
|
-
monkeypatch.setattr(pyfluent, "DATAMODEL_USE_STATE_CACHE", False)
|
|
258
|
-
|
|
259
|
-
|
|
260
255
|
@pytest.mark.skip("https://github.com/ansys/pyfluent/issues/2999")
|
|
261
256
|
@pytest.mark.fluent_version(">=23.2")
|
|
262
257
|
@pytest.mark.codegen_required
|
|
@@ -591,7 +586,7 @@ def test_on_child_created_lifetime(new_solver_session):
|
|
|
591
586
|
root = _create_datamodel_root(solver, test_rules)
|
|
592
587
|
root.A["A1"] = {}
|
|
593
588
|
data = []
|
|
594
|
-
|
|
589
|
+
_ = root.A["A1"].add_on_child_created("B", lambda _: data.append(1))
|
|
595
590
|
root.A["A1"].add_on_child_created("B", lambda _: data.append(2))
|
|
596
591
|
gc.collect()
|
|
597
592
|
assert "/test/created/A:A1/B" in solver._se_service.subscriptions
|
|
@@ -609,7 +604,7 @@ def test_on_deleted_lifetime(new_solver_session):
|
|
|
609
604
|
root = _create_datamodel_root(solver, test_rules)
|
|
610
605
|
root.A["A1"] = {}
|
|
611
606
|
data = []
|
|
612
|
-
|
|
607
|
+
_ = root.A["A1"].add_on_deleted(lambda _: data.append(1))
|
|
613
608
|
root.A["A1"].add_on_deleted(lambda _: data.append(2))
|
|
614
609
|
gc.collect()
|
|
615
610
|
assert "/test/deleted/A:A1" in solver._se_service.subscriptions
|
|
@@ -630,7 +625,7 @@ def test_on_changed_lifetime(new_solver_session):
|
|
|
630
625
|
root = _create_datamodel_root(solver, test_rules)
|
|
631
626
|
root.A["A1"] = {}
|
|
632
627
|
data = []
|
|
633
|
-
|
|
628
|
+
_ = root.A["A1"].X.add_on_changed(lambda _: data.append(1))
|
|
634
629
|
root.A["A1"].X.add_on_changed(lambda _: data.append(2))
|
|
635
630
|
gc.collect()
|
|
636
631
|
assert "/test/modified/A:A1/X" in solver._se_service.subscriptions
|
|
@@ -648,7 +643,7 @@ def test_on_affected_lifetime(new_solver_session):
|
|
|
648
643
|
root = _create_datamodel_root(solver, test_rules)
|
|
649
644
|
root.A["A1"] = {}
|
|
650
645
|
data = []
|
|
651
|
-
|
|
646
|
+
_ = root.A["A1"].add_on_affected(lambda _: data.append(1))
|
|
652
647
|
root.A["A1"].add_on_affected(lambda _: data.append(2))
|
|
653
648
|
gc.collect()
|
|
654
649
|
assert "/test/affected/A:A1" in solver._se_service.subscriptions
|
|
@@ -666,7 +661,7 @@ def test_on_affected_at_type_path_lifetime(new_solver_session):
|
|
|
666
661
|
root = _create_datamodel_root(solver, test_rules)
|
|
667
662
|
root.A["A1"] = {}
|
|
668
663
|
data = []
|
|
669
|
-
|
|
664
|
+
_ = root.A["A1"].add_on_affected_at_type_path("B", lambda _: data.append(1))
|
|
670
665
|
root.A["A1"].add_on_affected_at_type_path("B", lambda _: data.append(2))
|
|
671
666
|
gc.collect()
|
|
672
667
|
assert "/test/affected/A:A1/B" in solver._se_service.subscriptions
|
|
@@ -684,7 +679,7 @@ def test_on_command_executed_lifetime(new_solver_session):
|
|
|
684
679
|
root = _create_datamodel_root(solver, test_rules)
|
|
685
680
|
root.A["A1"] = {}
|
|
686
681
|
data = []
|
|
687
|
-
|
|
682
|
+
_ = root.A["A1"].add_on_command_executed("C", lambda *args: data.append(1))
|
|
688
683
|
root.A["A1"].add_on_command_executed("C", lambda *args: data.append(2))
|
|
689
684
|
gc.collect()
|
|
690
685
|
assert "/test/command_executed/A:A1/C" in solver._se_service.subscriptions
|
|
@@ -702,7 +697,7 @@ def test_on_attribute_changed_lifetime(new_solver_session):
|
|
|
702
697
|
root = _create_datamodel_root(solver, test_rules)
|
|
703
698
|
root.A["A1"] = {}
|
|
704
699
|
data = []
|
|
705
|
-
|
|
700
|
+
_ = root.A["A1"].add_on_attribute_changed("isABC", lambda _: data.append(1))
|
|
706
701
|
root.A["A1"].add_on_attribute_changed("isABC", lambda _: data.append(2))
|
|
707
702
|
gc.collect()
|
|
708
703
|
assert "/test/attribute_changed/A:A1/isABC" in solver._se_service.subscriptions
|
|
@@ -722,7 +717,7 @@ def test_on_command_attribute_changed_lifetime(new_solver_session):
|
|
|
722
717
|
root = _create_datamodel_root(solver, test_rules)
|
|
723
718
|
root.A["A1"] = {}
|
|
724
719
|
data = []
|
|
725
|
-
|
|
720
|
+
_ = root.A["A1"].add_on_command_attribute_changed(
|
|
726
721
|
"C", "isABC", lambda _: data.append(1)
|
|
727
722
|
)
|
|
728
723
|
root.A["A1"].add_on_command_attribute_changed(
|
|
@@ -757,7 +752,7 @@ def test_on_affected_lifetime_with_delete_child_objects(new_solver_session):
|
|
|
757
752
|
pyfluent.logging.enable()
|
|
758
753
|
root.A["A1"] = {}
|
|
759
754
|
data = []
|
|
760
|
-
|
|
755
|
+
_ = root.A["A1"].add_on_affected(lambda _: data.append(1))
|
|
761
756
|
root.A["A1"].add_on_affected(lambda _: data.append(2))
|
|
762
757
|
gc.collect()
|
|
763
758
|
assert "/test/affected/A:A1" in solver._se_service.subscriptions
|
|
@@ -776,7 +771,7 @@ def test_on_affected_lifetime_with_delete_all_child_objects(new_solver_session):
|
|
|
776
771
|
pyfluent.logging.enable()
|
|
777
772
|
root.A["A1"] = {}
|
|
778
773
|
data = []
|
|
779
|
-
|
|
774
|
+
_ = root.A["A1"].add_on_affected(lambda _: data.append(1))
|
|
780
775
|
root.A["A1"].add_on_affected(lambda _: data.append(2))
|
|
781
776
|
gc.collect()
|
|
782
777
|
assert "/test/affected/A:A1" in solver._se_service.subscriptions
|
|
@@ -191,48 +191,89 @@ def test_field_data_objects_3d(new_solver_session) -> None:
|
|
|
191
191
|
field_name="absolute-pressure", surfaces=["cold-inlet"]
|
|
192
192
|
)
|
|
193
193
|
|
|
194
|
-
assert abs_press_data.
|
|
195
|
-
assert abs_press_data[120]
|
|
194
|
+
assert abs_press_data["cold-inlet"].shape == (241,)
|
|
195
|
+
assert abs_press_data["cold-inlet"][120] == 101325.0
|
|
196
196
|
|
|
197
197
|
vertices_data = field_data.get_surface_data(
|
|
198
198
|
data_types=[SurfaceDataType.Vertices], surfaces=["cold-inlet"]
|
|
199
199
|
)
|
|
200
|
-
assert
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
assert vertices_data["cold-inlet"][SurfaceDataType.Vertices].shape == (241, 3)
|
|
201
|
+
assert (
|
|
202
|
+
round(float(vertices_data["cold-inlet"][SurfaceDataType.Vertices][5][0]), 2)
|
|
203
|
+
== -0.2
|
|
204
204
|
)
|
|
205
|
-
assert round(float(faces_centroid_data[5].y), 2) == -0.18
|
|
206
205
|
|
|
207
|
-
|
|
208
|
-
data_types=[SurfaceDataType.
|
|
206
|
+
vertices_and_faces_centroid_data = field_data.get_surface_data(
|
|
207
|
+
data_types=[SurfaceDataType.Vertices, SurfaceDataType.FacesCentroid],
|
|
208
|
+
surfaces=["hot-inlet", "cold-inlet"],
|
|
209
|
+
)
|
|
210
|
+
assert list(vertices_and_faces_centroid_data["cold-inlet"].keys()) == [
|
|
211
|
+
SurfaceDataType.Vertices,
|
|
212
|
+
SurfaceDataType.FacesCentroid,
|
|
213
|
+
]
|
|
214
|
+
assert vertices_and_faces_centroid_data["hot-inlet"][
|
|
215
|
+
SurfaceDataType.Vertices
|
|
216
|
+
].shape == (79, 3)
|
|
217
|
+
assert list(vertices_and_faces_centroid_data.keys()) == [
|
|
218
|
+
"hot-inlet",
|
|
219
|
+
"cold-inlet",
|
|
220
|
+
]
|
|
221
|
+
assert (
|
|
222
|
+
round(
|
|
223
|
+
float(
|
|
224
|
+
vertices_and_faces_centroid_data["cold-inlet"][
|
|
225
|
+
SurfaceDataType.FacesCentroid
|
|
226
|
+
][5][1]
|
|
227
|
+
),
|
|
228
|
+
2,
|
|
229
|
+
)
|
|
230
|
+
== -0.18
|
|
231
|
+
)
|
|
232
|
+
assert (
|
|
233
|
+
round(
|
|
234
|
+
float(
|
|
235
|
+
vertices_and_faces_centroid_data["hot-inlet"][
|
|
236
|
+
SurfaceDataType.FacesCentroid
|
|
237
|
+
][5][1]
|
|
238
|
+
),
|
|
239
|
+
2,
|
|
240
|
+
)
|
|
241
|
+
== -0.23
|
|
209
242
|
)
|
|
210
|
-
assert faces_connectivity_data[5].node_count == 4
|
|
211
|
-
assert (faces_connectivity_data[5].node_indices == [12, 13, 17, 16]).all()
|
|
212
243
|
|
|
213
244
|
faces_normal_data = field_data.get_surface_data(
|
|
214
|
-
data_types=[SurfaceDataType.FacesNormal], surfaces=[
|
|
245
|
+
data_types=[SurfaceDataType.FacesNormal], surfaces=[3, 5]
|
|
246
|
+
)
|
|
247
|
+
assert faces_normal_data[3][SurfaceDataType.FacesNormal].shape == (152, 3)
|
|
248
|
+
assert faces_normal_data[5][SurfaceDataType.FacesNormal].shape == (2001, 3)
|
|
249
|
+
|
|
250
|
+
faces_connectivity_data = field_data.get_surface_data(
|
|
251
|
+
data_types=[SurfaceDataType.FacesConnectivity], surfaces=["cold-inlet"]
|
|
215
252
|
)
|
|
216
|
-
assert
|
|
217
|
-
|
|
253
|
+
assert (
|
|
254
|
+
faces_connectivity_data["cold-inlet"][SurfaceDataType.FacesConnectivity][5]
|
|
255
|
+
== [12, 13, 17, 16]
|
|
256
|
+
).all()
|
|
218
257
|
|
|
219
258
|
velocity_vector_data = field_data.get_vector_field_data(
|
|
220
259
|
field_name="velocity", surfaces=["cold-inlet"]
|
|
221
260
|
)
|
|
222
261
|
|
|
223
|
-
assert velocity_vector_data.
|
|
224
|
-
assert velocity_vector_data.scale == 1.0
|
|
262
|
+
assert velocity_vector_data["cold-inlet"].shape == (152, 3)
|
|
225
263
|
|
|
226
264
|
path_lines_data = field_data.get_pathlines_field_data(
|
|
227
|
-
field_name="velocity", surfaces=["cold-inlet"]
|
|
265
|
+
field_name="velocity", surfaces=["cold-inlet", "hot-inlet"]
|
|
228
266
|
)
|
|
229
267
|
|
|
230
|
-
assert path_lines_data["vertices"].
|
|
231
|
-
assert path_lines_data["lines"]
|
|
232
|
-
assert path_lines_data["velocity"].
|
|
268
|
+
assert path_lines_data["cold-inlet"]["vertices"].shape == (76152, 3)
|
|
269
|
+
assert len(path_lines_data["cold-inlet"]["lines"]) == 76000
|
|
270
|
+
assert path_lines_data["cold-inlet"]["velocity"].shape == (76152,)
|
|
271
|
+
|
|
272
|
+
assert path_lines_data["hot-inlet"]["vertices"].shape == (27555, 3)
|
|
273
|
+
assert len(path_lines_data["hot-inlet"]["lines"]) == 27500
|
|
274
|
+
assert path_lines_data["hot-inlet"]["velocity"].shape == (27555,)
|
|
233
275
|
|
|
234
|
-
assert path_lines_data["lines"][100]
|
|
235
|
-
assert all(path_lines_data["lines"][100].node_indices == [100, 101])
|
|
276
|
+
assert all(path_lines_data["cold-inlet"]["lines"][100] == [100, 101])
|
|
236
277
|
|
|
237
278
|
|
|
238
279
|
@pytest.mark.fluent_version(">=23.2")
|
|
@@ -255,42 +296,49 @@ def test_field_data_objects_2d(disk_case_session) -> None:
|
|
|
255
296
|
field_name="absolute-pressure", surfaces=["velocity-inlet-2"]
|
|
256
297
|
)
|
|
257
298
|
|
|
258
|
-
assert abs_press_data.
|
|
259
|
-
assert abs_press_data[5]
|
|
299
|
+
assert abs_press_data["velocity-inlet-2"].shape == (11,)
|
|
300
|
+
assert abs_press_data["velocity-inlet-2"][5] == 101325.0
|
|
260
301
|
|
|
261
302
|
vertices_data = field_data.get_surface_data(
|
|
262
303
|
data_types=[SurfaceDataType.Vertices], surfaces=["interior-4"]
|
|
263
304
|
)
|
|
264
|
-
assert round(
|
|
305
|
+
assert round(vertices_data["interior-4"][SurfaceDataType.Vertices][5][0], 2) == 0.0
|
|
265
306
|
|
|
266
307
|
faces_centroid_data = field_data.get_surface_data(
|
|
267
308
|
data_types=[SurfaceDataType.FacesCentroid], surfaces=["velocity-inlet-2"]
|
|
268
309
|
)
|
|
269
|
-
assert
|
|
310
|
+
assert (
|
|
311
|
+
round(
|
|
312
|
+
float(
|
|
313
|
+
faces_centroid_data["velocity-inlet-2"][SurfaceDataType.FacesCentroid][
|
|
314
|
+
5
|
|
315
|
+
][1]
|
|
316
|
+
),
|
|
317
|
+
2,
|
|
318
|
+
)
|
|
319
|
+
== 0.02
|
|
320
|
+
)
|
|
270
321
|
|
|
271
322
|
faces_connectivity_data = field_data.get_surface_data(
|
|
272
323
|
data_types=[SurfaceDataType.FacesConnectivity], surfaces=["velocity-inlet-2"]
|
|
273
|
-
)[5]
|
|
274
|
-
assert faces_connectivity_data
|
|
275
|
-
assert (faces_connectivity_data.node_indices == [5, 6]).all()
|
|
324
|
+
)["velocity-inlet-2"][SurfaceDataType.FacesConnectivity][5]
|
|
325
|
+
assert (faces_connectivity_data == [5, 6]).all()
|
|
276
326
|
|
|
277
327
|
velocity_vector_data = field_data.get_vector_field_data(
|
|
278
328
|
field_name="velocity", surfaces=["velocity-inlet-2"]
|
|
279
329
|
)
|
|
280
330
|
|
|
281
|
-
assert velocity_vector_data.
|
|
282
|
-
assert velocity_vector_data.scale == 1.0
|
|
331
|
+
assert velocity_vector_data["velocity-inlet-2"].shape == (10, 3)
|
|
283
332
|
|
|
284
333
|
path_lines_data = field_data.get_pathlines_field_data(
|
|
285
334
|
field_name="velocity", surfaces=["velocity-inlet-2"]
|
|
286
335
|
)
|
|
287
336
|
|
|
288
|
-
assert path_lines_data["vertices"].
|
|
289
|
-
assert path_lines_data["lines"]
|
|
290
|
-
assert path_lines_data["velocity"].
|
|
337
|
+
assert path_lines_data["velocity-inlet-2"]["vertices"].shape == (5010, 3)
|
|
338
|
+
assert len(path_lines_data["velocity-inlet-2"]["lines"]) == 5000
|
|
339
|
+
assert path_lines_data["velocity-inlet-2"]["velocity"].shape == (5010,)
|
|
291
340
|
|
|
292
|
-
assert path_lines_data["lines"][100]
|
|
293
|
-
assert all(path_lines_data["lines"][100].node_indices == [100, 101])
|
|
341
|
+
assert all(path_lines_data["velocity-inlet-2"]["lines"][100] == [100, 101])
|
|
294
342
|
|
|
295
343
|
|
|
296
344
|
def test_field_data_errors(new_solver_session) -> None:
|
|
@@ -299,19 +347,19 @@ def test_field_data_errors(new_solver_session) -> None:
|
|
|
299
347
|
"mixing_elbow.msh.h5", "pyfluent/mixing_elbow"
|
|
300
348
|
)
|
|
301
349
|
|
|
302
|
-
with pytest.raises(DisallowedValuesError)
|
|
350
|
+
with pytest.raises(DisallowedValuesError):
|
|
303
351
|
solver.fields.field_data.get_scalar_field_data(
|
|
304
352
|
field_name="y-face-area", surfaces=[0]
|
|
305
353
|
)
|
|
306
354
|
|
|
307
|
-
with pytest.raises(DisallowedValuesError)
|
|
355
|
+
with pytest.raises(DisallowedValuesError):
|
|
308
356
|
solver.fields.field_data.get_scalar_field_data(
|
|
309
357
|
field_name="partition-neighbors", surfaces=[0]
|
|
310
358
|
)
|
|
311
359
|
|
|
312
360
|
solver.file.read(file_type="case", file_name=import_file_name)
|
|
313
361
|
|
|
314
|
-
with pytest.raises(FieldUnavailable)
|
|
362
|
+
with pytest.raises(FieldUnavailable):
|
|
315
363
|
solver.fields.field_data.get_scalar_field_data(
|
|
316
364
|
field_name="density", surfaces=[0]
|
|
317
365
|
)
|
|
@@ -330,14 +378,14 @@ def test_field_data_errors(new_solver_session) -> None:
|
|
|
330
378
|
solver.solution.initialization.hybrid_initialize()
|
|
331
379
|
|
|
332
380
|
# Get field data object
|
|
333
|
-
|
|
381
|
+
assert solver.fields.field_data
|
|
334
382
|
|
|
335
|
-
with pytest.raises(DisallowedValuesError)
|
|
383
|
+
with pytest.raises(DisallowedValuesError):
|
|
336
384
|
solver.fields.field_data.get_scalar_field_data(
|
|
337
385
|
field_name="density", surfaces=["bob"]
|
|
338
386
|
)
|
|
339
387
|
|
|
340
|
-
with pytest.raises(DisallowedValuesError)
|
|
388
|
+
with pytest.raises(DisallowedValuesError):
|
|
341
389
|
solver.fields.field_data.get_scalar_field_data(
|
|
342
390
|
field_name="xdensity", surfaces=[0]
|
|
343
391
|
)
|
|
@@ -355,19 +403,19 @@ def test_field_info_validators(new_solver_session) -> None:
|
|
|
355
403
|
vector_field_1 = solver.fields.field_info.validate_vector_fields("velocity")
|
|
356
404
|
assert vector_field_1 is None
|
|
357
405
|
|
|
358
|
-
with pytest.raises(DisallowedValuesError)
|
|
406
|
+
with pytest.raises(DisallowedValuesError):
|
|
359
407
|
solver.fields.field_info.validate_vector_fields("relative-vel")
|
|
360
408
|
|
|
361
409
|
scalar_field_1 = solver.fields.field_info.validate_scalar_fields("z-velocity")
|
|
362
410
|
assert scalar_field_1 is None
|
|
363
411
|
|
|
364
|
-
with pytest.raises(DisallowedValuesError)
|
|
412
|
+
with pytest.raises(DisallowedValuesError):
|
|
365
413
|
solver.fields.field_info.validate_scalar_fields("z-vel")
|
|
366
414
|
|
|
367
415
|
surface = solver.fields.field_info.validate_surfaces(["cold-inlet"])
|
|
368
416
|
assert surface is None
|
|
369
417
|
|
|
370
|
-
with pytest.raises(DisallowedValuesError)
|
|
418
|
+
with pytest.raises(DisallowedValuesError):
|
|
371
419
|
solver.fields.field_info.validate_surfaces(["out"])
|
|
372
420
|
|
|
373
421
|
|
|
@@ -42,20 +42,26 @@ def test_field_info_data_multi_phase():
|
|
|
42
42
|
sv_density = file_session.fields.field_data.get_scalar_field_data(
|
|
43
43
|
field_name="phase-2:SV_DENSITY", surfaces=[33]
|
|
44
44
|
)
|
|
45
|
-
assert sv_density[33].
|
|
46
|
-
assert sv_density[33][130]
|
|
45
|
+
assert sv_density[33].shape == (268,)
|
|
46
|
+
assert sv_density[33][130] == 1.225
|
|
47
47
|
assert (
|
|
48
48
|
round(
|
|
49
49
|
file_session.fields.field_data.get_scalar_field_data(
|
|
50
50
|
field_name="phase-2:SV_WALL_YPLUS", surfaces=[33]
|
|
51
|
-
)[33][130]
|
|
51
|
+
)[33][130],
|
|
52
52
|
5,
|
|
53
53
|
)
|
|
54
54
|
== 0.00103
|
|
55
55
|
)
|
|
56
56
|
vector_data = file_session.fields.field_data.get_vector_field_data
|
|
57
|
-
assert vector_data(field_name="phase-2:velocity", surfaces=[33])[33].
|
|
58
|
-
|
|
57
|
+
assert vector_data(field_name="phase-2:velocity", surfaces=[33])[33].shape == (
|
|
58
|
+
268,
|
|
59
|
+
3,
|
|
60
|
+
)
|
|
61
|
+
assert vector_data(field_name="phase-1:velocity", surfaces=[34])[34].shape == (
|
|
62
|
+
2168,
|
|
63
|
+
3,
|
|
64
|
+
)
|
|
59
65
|
|
|
60
66
|
|
|
61
67
|
def test_field_info_data_single_phase():
|
|
@@ -88,32 +94,31 @@ def test_field_info_data_single_phase():
|
|
|
88
94
|
sv_t_wall = file_session.fields.field_data.get_scalar_field_data(
|
|
89
95
|
"SV_T", surfaces=["wall"]
|
|
90
96
|
)
|
|
91
|
-
assert sv_t_wall.
|
|
92
|
-
assert round(sv_t_wall[1800]
|
|
97
|
+
assert sv_t_wall["wall"].shape == (3630,)
|
|
98
|
+
assert round(sv_t_wall["wall"][1800], 4) == 313.15
|
|
93
99
|
|
|
94
100
|
surface_data = file_session.fields.field_data.get_surface_data
|
|
95
101
|
surface_data_wall = surface_data(
|
|
96
|
-
data_types=[SurfaceDataType.Vertices], surfaces=[
|
|
102
|
+
data_types=[SurfaceDataType.Vertices], surfaces=[3]
|
|
97
103
|
)
|
|
98
|
-
assert surface_data_wall.
|
|
99
|
-
assert round(surface_data_wall[1500]
|
|
100
|
-
assert round(surface_data_wall[1500]
|
|
101
|
-
assert round(surface_data_wall[1500]
|
|
104
|
+
assert surface_data_wall[3].shape == (3810, 3)
|
|
105
|
+
assert round(surface_data_wall[3][1500][0], 5) == 0.12406
|
|
106
|
+
assert round(surface_data_wall[3][1500][1], 5) == 0.09525
|
|
107
|
+
assert round(surface_data_wall[3][1500][2], 5) == 0.04216
|
|
102
108
|
|
|
103
109
|
surface_data_symmetry = surface_data(
|
|
104
110
|
data_types=[SurfaceDataType.FacesConnectivity], surfaces=["symmetry"]
|
|
105
111
|
)
|
|
106
|
-
assert surface_data_symmetry
|
|
107
|
-
assert surface_data_symmetry[1000]
|
|
108
|
-
assert list(surface_data_symmetry[1000].node_indices) == [1259, 1260, 1227, 1226]
|
|
112
|
+
assert len(surface_data_symmetry["symmetry"]) == 2018
|
|
113
|
+
assert list(surface_data_symmetry["symmetry"][1000]) == [1259, 1260, 1227, 1226]
|
|
109
114
|
|
|
110
115
|
vector_data = file_session.fields.field_data.get_vector_field_data
|
|
111
|
-
assert vector_data("velocity", surfaces=["wall"]).
|
|
116
|
+
assert vector_data("velocity", surfaces=["wall"])["wall"].shape == (3630, 3)
|
|
112
117
|
|
|
113
|
-
vector_data_symmetry = vector_data("velocity", surfaces=["symmetry"])
|
|
114
|
-
assert vector_data_symmetry.
|
|
115
|
-
assert round(vector_data_symmetry[1009]
|
|
116
|
-
assert round(vector_data_symmetry[1009]
|
|
118
|
+
vector_data_symmetry = vector_data("velocity", surfaces=["symmetry"])["symmetry"]
|
|
119
|
+
assert vector_data_symmetry.shape == (2018, 3)
|
|
120
|
+
assert round(vector_data_symmetry[1009][0], 5) == 0.0023
|
|
121
|
+
assert round(vector_data_symmetry[1009][1], 5) == 1.22311
|
|
117
122
|
|
|
118
123
|
|
|
119
124
|
def test_data_reader_single_phase():
|
|
@@ -315,10 +320,10 @@ def test_error_handling_single_phase():
|
|
|
315
320
|
|
|
316
321
|
transaction_1 = field_data.new_transaction()
|
|
317
322
|
|
|
318
|
-
with pytest.raises(NotImplementedError)
|
|
323
|
+
with pytest.raises(NotImplementedError):
|
|
319
324
|
transaction_1.add_pathlines_fields_request("SV_T", surfaces=[3, 5])
|
|
320
325
|
|
|
321
|
-
with pytest.raises(NotImplementedError)
|
|
326
|
+
with pytest.raises(NotImplementedError):
|
|
322
327
|
field_data.get_pathlines_field_data("SV_T", surfaces=[3, 5])
|
|
323
328
|
|
|
324
329
|
|
|
@@ -340,13 +345,11 @@ def test_error_handling_multi_phase():
|
|
|
340
345
|
field_data = file_session.fields.field_data
|
|
341
346
|
|
|
342
347
|
transaction_1 = field_data.new_transaction()
|
|
343
|
-
with pytest.raises(InvalidMultiPhaseFieldName)
|
|
348
|
+
with pytest.raises(InvalidMultiPhaseFieldName):
|
|
344
349
|
transaction_1.add_scalar_fields_request("SV_WALL_YPLUS", surfaces=[29, 30])
|
|
345
350
|
|
|
346
|
-
with pytest.raises(InvalidMultiPhaseFieldName)
|
|
347
|
-
|
|
351
|
+
with pytest.raises(InvalidMultiPhaseFieldName):
|
|
352
|
+
field_data.get_vector_field_data("velocity", surfaces=[34])[34].size
|
|
348
353
|
|
|
349
|
-
with pytest.raises(InvalidFieldName)
|
|
350
|
-
|
|
351
|
-
34
|
|
352
|
-
].size
|
|
354
|
+
with pytest.raises(InvalidFieldName):
|
|
355
|
+
field_data.get_vector_field_data("phase-1:temperature", surfaces=[34])[34].size
|
|
@@ -11,7 +11,6 @@ from ansys.fluent.core.examples import download_file
|
|
|
11
11
|
from ansys.fluent.core.solver import flobject
|
|
12
12
|
from ansys.fluent.core.solver.flobject import (
|
|
13
13
|
InactiveObjectError,
|
|
14
|
-
_combine_set_states,
|
|
15
14
|
_gethash,
|
|
16
15
|
find_children,
|
|
17
16
|
)
|
|
@@ -230,13 +229,12 @@ class ListObject(Setting):
|
|
|
230
229
|
def size(self):
|
|
231
230
|
return len(self._objs)
|
|
232
231
|
|
|
233
|
-
def resize(self,
|
|
234
|
-
if
|
|
235
|
-
|
|
236
|
-
for i in range(len(self._objs), l):
|
|
232
|
+
def resize(self, new_size):
|
|
233
|
+
if new_size > len(self._objs):
|
|
234
|
+
for _ in range(len(self._objs), new_size):
|
|
237
235
|
self._objs.append(self.child_object_type(self))
|
|
238
|
-
elif
|
|
239
|
-
self._objs = self._objs[:
|
|
236
|
+
elif new_size < len(self._objs):
|
|
237
|
+
self._objs = self._objs[:new_size]
|
|
240
238
|
|
|
241
239
|
def get_child(self, c):
|
|
242
240
|
return self._objs[int(c)]
|
|
@@ -271,6 +269,11 @@ class Command(Setting):
|
|
|
271
269
|
# arguments = None
|
|
272
270
|
# cb = None
|
|
273
271
|
|
|
272
|
+
def __init__(self, parent):
|
|
273
|
+
self.attrs = super().attrs.copy()
|
|
274
|
+
self.attrs["arguments-aliases"] = lambda self: {}
|
|
275
|
+
super().__init__(parent)
|
|
276
|
+
|
|
274
277
|
def __call__(self, **kwds):
|
|
275
278
|
args = []
|
|
276
279
|
for k, v in self.arguments.items():
|
|
@@ -357,10 +360,6 @@ class Root(Group):
|
|
|
357
360
|
}
|
|
358
361
|
|
|
359
362
|
|
|
360
|
-
class _SchemeEval:
|
|
361
|
-
version = "25.1.0"
|
|
362
|
-
|
|
363
|
-
|
|
364
363
|
class Proxy:
|
|
365
364
|
"""Proxy class."""
|
|
366
365
|
|
|
@@ -368,7 +367,6 @@ class Proxy:
|
|
|
368
367
|
|
|
369
368
|
def __init__(self):
|
|
370
369
|
self.r = self.root(None)
|
|
371
|
-
self._scheme_eval = _SchemeEval()
|
|
372
370
|
|
|
373
371
|
def get_obj(self, path):
|
|
374
372
|
if not path:
|
|
@@ -515,13 +513,14 @@ def test_command():
|
|
|
515
513
|
|
|
516
514
|
|
|
517
515
|
def test_attrs():
|
|
518
|
-
r = flobject.get_root(Proxy()
|
|
516
|
+
r = flobject.get_root(Proxy())
|
|
517
|
+
r._setattr("version", "251")
|
|
519
518
|
assert r.g_1.s_4.get_attr("active?")
|
|
520
519
|
assert r.g_1.s_4.get_attr("allowed-values") == ["foo", "bar"]
|
|
521
520
|
r.g_1.b_3 = True
|
|
522
521
|
assert not r.g_1.s_4.get_attr("active?")
|
|
523
|
-
with pytest.raises(InactiveObjectError)
|
|
524
|
-
r.g_1.s_4.get_attr("allowed-values")
|
|
522
|
+
with pytest.raises(InactiveObjectError):
|
|
523
|
+
r.g_1.s_4.get_attr("allowed-values")
|
|
525
524
|
|
|
526
525
|
|
|
527
526
|
# The following test is commented out as codegen module is not packaged in the
|
|
@@ -916,7 +915,6 @@ def test_accessor_methods_on_settings_objects(new_solver_session):
|
|
|
916
915
|
"Real",
|
|
917
916
|
"Integer",
|
|
918
917
|
"RealList",
|
|
919
|
-
"IntegerList",
|
|
920
918
|
"ListObject",
|
|
921
919
|
]
|
|
922
920
|
type_list = expected_type_list.copy()
|
|
@@ -989,7 +987,7 @@ def test_strings_with_allowed_values(static_mixer_settings_session):
|
|
|
989
987
|
solver = static_mixer_settings_session
|
|
990
988
|
|
|
991
989
|
with pytest.raises(AttributeError) as e:
|
|
992
|
-
|
|
990
|
+
solver.file.auto_save.root_name.allowed_values()
|
|
993
991
|
assert e.value.args[0] == "'root_name' object has no attribute 'allowed_values'"
|
|
994
992
|
|
|
995
993
|
string_with_allowed_values = solver.setup.general.solver.type.allowed_values()
|
|
@@ -1029,7 +1027,7 @@ def test_ansys_units_integration(mixing_elbow_settings_session):
|
|
|
1029
1027
|
hydraulic_diameter = turbulence.hydraulic_diameter
|
|
1030
1028
|
hydraulic_diameter.set_state("1 [in]")
|
|
1031
1029
|
assert hydraulic_diameter() == "1 [in]"
|
|
1032
|
-
assert hydraulic_diameter.as_quantity()
|
|
1030
|
+
assert hydraulic_diameter.as_quantity() is None
|
|
1033
1031
|
assert hydraulic_diameter.state_with_units() == ("1 [in]", "m")
|
|
1034
1032
|
assert hydraulic_diameter.units() == "m"
|
|
1035
1033
|
turbulent_intensity = turbulence.turbulent_intensity
|
|
@@ -1077,9 +1075,6 @@ def test_ansys_units_integration(mixing_elbow_settings_session):
|
|
|
1077
1075
|
_check_vector_units(
|
|
1078
1076
|
solver.setup.general.operating_conditions.reference_pressure_location, "m"
|
|
1079
1077
|
)
|
|
1080
|
-
if solver.get_fluent_version() >= FluentVersion.v251:
|
|
1081
|
-
# https://github.com/ansys/pyfluent/issues/3134
|
|
1082
|
-
return
|
|
1083
1078
|
_check_vector_units(
|
|
1084
1079
|
solver.setup.reference_frames[
|
|
1085
1080
|
"global"
|
|
@@ -1218,7 +1213,6 @@ def test_default_argument_names_for_commands(static_mixer_settings_session):
|
|
|
1218
1213
|
"list_properties",
|
|
1219
1214
|
"make_a_copy",
|
|
1220
1215
|
"display",
|
|
1221
|
-
"copy",
|
|
1222
1216
|
"add_to_graphics",
|
|
1223
1217
|
"clear_history",
|
|
1224
1218
|
}
|
|
@@ -1239,39 +1233,3 @@ def test_default_argument_names_for_commands(static_mixer_settings_session):
|
|
|
1239
1233
|
assert solver.results.graphics.contour.delete.argument_names == ["name_list"]
|
|
1240
1234
|
# The following is the default behavior when no arguments are associated with the command.
|
|
1241
1235
|
assert solver.results.graphics.contour.list.argument_names == []
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
def test_combine_set_states():
|
|
1245
|
-
assert _combine_set_states(
|
|
1246
|
-
[
|
|
1247
|
-
("A/B/C", 1),
|
|
1248
|
-
]
|
|
1249
|
-
) == ("A/B/C", 1)
|
|
1250
|
-
|
|
1251
|
-
assert _combine_set_states(
|
|
1252
|
-
[
|
|
1253
|
-
("A/B/C", 1),
|
|
1254
|
-
("A/B/C", 2),
|
|
1255
|
-
]
|
|
1256
|
-
) == ("A/B/C", 2)
|
|
1257
|
-
|
|
1258
|
-
assert _combine_set_states(
|
|
1259
|
-
[
|
|
1260
|
-
("A/B/C", 1),
|
|
1261
|
-
("A/B/C", {"X": 2}),
|
|
1262
|
-
]
|
|
1263
|
-
) == ("A/B/C", {"X": 2})
|
|
1264
|
-
|
|
1265
|
-
assert _combine_set_states(
|
|
1266
|
-
[
|
|
1267
|
-
("A/B/C", 1),
|
|
1268
|
-
("A/B/D", 2),
|
|
1269
|
-
]
|
|
1270
|
-
) == ("A/B", {"C": 1, "D": 2})
|
|
1271
|
-
|
|
1272
|
-
assert _combine_set_states(
|
|
1273
|
-
[
|
|
1274
|
-
("A/B/C", {"X": 1}),
|
|
1275
|
-
("A/B/D/E", 2),
|
|
1276
|
-
]
|
|
1277
|
-
) == ("A/B", {"C": {"X": 1}, "D": {"E": 2}})
|
|
@@ -31,7 +31,7 @@ def test_allowed_values_on_report_definitions_1364(new_solver_session):
|
|
|
31
31
|
|
|
32
32
|
assert report_def.zone_names.allowed_values() == ["fluid"]
|
|
33
33
|
|
|
34
|
-
assert report_def.expr_list.allowed_values()
|
|
34
|
+
assert report_def.expr_list.allowed_values() is None
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
@pytest.mark.fluent_version(">=23.2")
|
|
@@ -42,7 +42,7 @@ def test_monitors_list_set_data_637_974_1744_2188(new_solver_session):
|
|
|
42
42
|
file_name="exhaust_system.cas.h5", directory="pyfluent/exhaust_system"
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
examples.download_file(
|
|
46
46
|
file_name="exhaust_system.dat.h5", directory="pyfluent/exhaust_system"
|
|
47
47
|
)
|
|
48
48
|
|
|
@@ -99,8 +99,8 @@ def test_empty_vector_field_data_2339(new_solver_session):
|
|
|
99
99
|
solver.file.read_data(file_name=import_data)
|
|
100
100
|
|
|
101
101
|
assert [
|
|
102
|
-
a
|
|
102
|
+
a[0]
|
|
103
103
|
for a in solver.fields.field_data.get_vector_field_data(
|
|
104
|
-
field_name="velocity",
|
|
105
|
-
)[1]
|
|
104
|
+
field_name="velocity", surfaces=[1]
|
|
105
|
+
)[1]
|
|
106
106
|
][:5]
|