diff --git a/.ci/fluent_test_runner.py b/.ci/fluent_test_runner.py index 5e6d5ff37ef9..bf2450adb3e7 100644 --- a/.ci/fluent_test_runner.py +++ b/.ci/fluent_test_runner.py @@ -45,12 +45,12 @@ def _run_single_test( """ logging.debug(f"journal_file: {journal_file}") src_pyfluent_dir = str(Path(pyfluent.__file__).parent) - verion_for_file_name = FluentVersion.current_dev().number - dst_pyfluent_dir = f"/ansys_inc/v{verion_for_file_name}/commonfiles/CPython/3_10/linx64/Release/Ansys/PyFluentCore/ansys/fluent/core" + version_for_file_name = FluentVersion.current_dev().number + dst_pyfluent_dir = f"/ansys_inc/v{version_for_file_name}/commonfiles/CPython/3_10/linx64/Release/Ansys/PyFluentCore/ansys/fluent/core" src_gen_dir = ( Path(pyfluent.__file__).parent / "ansys" / "fluent" / "core" / "generated" ) - dst_gen_dir = f"/ansys_inc/v{verion_for_file_name}/fluent/fluent{FluentVersion.current_dev()!r}/cortex/pylib/flapi/generated" + dst_gen_dir = f"/ansys_inc/v{version_for_file_name}/fluent/fluent{FluentVersion.current_dev()!r}/cortex/pylib/flapi/generated" dst_test_dir = "/testing" working_dir = Path(dst_test_dir) parent = journal_file.parent diff --git a/doc/changelog.d/4480.maintenance.md b/doc/changelog.d/4480.maintenance.md new file mode 100644 index 000000000000..ba5ec62b41d6 --- /dev/null +++ b/doc/changelog.d/4480.maintenance.md @@ -0,0 +1 @@ +Update 26R1 meshing tests. diff --git a/doc/settings_rstgen.py b/doc/settings_rstgen.py index 0e4af8842836..0d1141307dda 100644 --- a/doc/settings_rstgen.py +++ b/doc/settings_rstgen.py @@ -9,7 +9,7 @@ -- Populate a parents dictionary with current class file name (not class name) as key and list of parents file names (not class names) as value. - Recursively Generate the rst files for classes starting with settings.root. -- Add target reference as the file name for the given class. This is used by other classes to generate hyperlinks - -- Add properties like members, undoc-memebers, show-inheritence to the autoclass directive. + -- Add properties like members, undoc-members, show-inheritance to the autoclass directive. -- Generate the tables of children, commands, arguments, and parents. --- Get access to the respective properties and members on the class with get_attr. --- Use the file name of the child class to generate the hyperlink to that class. diff --git a/examples/00-fluent/lunar_lander_thermal.py b/examples/00-fluent/lunar_lander_thermal.py index 4291c73c8d33..57e1c82e9812 100644 --- a/examples/00-fluent/lunar_lander_thermal.py +++ b/examples/00-fluent/lunar_lander_thermal.py @@ -665,13 +665,13 @@ def get_surf_mean_temp( ) # Simulate closing louvers below 273 K by changing emissivity - rad_emiss = solver_session.setup.boundary_conditions.wall[ + rad_emission = solver_session.setup.boundary_conditions.wall[ "sc-radiator" ].radiation.internal_emissivity_band["thermal-ir"] if rad_mean_temp < 273: - rad_emiss.value = 0.09 + rad_emission.value = 0.09 else: - rad_emiss.value = 0.70 + rad_emission.value = 0.70 # Run simulation for 1 timestep solver_session.solution.run_calculation.calculate() diff --git a/pyproject.toml b/pyproject.toml index 432c1222bb4a..e0d5d96a78b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "grpcio-health-checking>=1.30.0", "grpcio-status>=1.26.0", "nltk>=3.9.1", - "numpy>=1.14.0,<3.0.0", + "numpy>=1.14.0,<2.0.0", "pandas>=1.1.0,<3.0.0", "pyansys-tools-report>=0.8.1", "pyyaml>=6.0", diff --git a/src/ansys/fluent/core/fluent_connection.py b/src/ansys/fluent/core/fluent_connection.py index ca0061b04065..90e84d4f21e4 100644 --- a/src/ansys/fluent/core/fluent_connection.py +++ b/src/ansys/fluent/core/fluent_connection.py @@ -104,7 +104,7 @@ class MonitorThread(threading.Thread): """A class used for monitoring a Fluent session. Daemon thread which will ensure cleanup of session objects, shutdown of - non-deamon threads etc. + non-daemon threads etc. Attributes ---------- diff --git a/tests/test_datamodel_service.py b/tests/test_datamodel_service.py index a20084668c0d..e063cec76ce6 100644 --- a/tests/test_datamodel_service.py +++ b/tests/test_datamodel_service.py @@ -387,11 +387,11 @@ def test_get_and_set_state_for_command_arg_instance(new_meshing_session): assert x.LengthUnit.get_state() == "ft" - assert x.CadImportOptions.ExtractFeatures() + assert not x.ImportCadPreferences.ShowImportCadPreferences() - x.CadImportOptions.ExtractFeatures.set_state(False) + x.ImportCadPreferences.ShowImportCadPreferences.set_state(True) - assert not x.CadImportOptions.ExtractFeatures() + assert x.ImportCadPreferences.ShowImportCadPreferences() x.set_state({"FileName": "dummy_file_name.dummy_extn"}) @@ -813,15 +813,17 @@ def test_set_command_args_and_sub_args(new_meshing_session): meshing = new_meshing_session ig = meshing.meshing.ImportGeometry.create_instance() + ig.FileFormat = "Mesh" + # Command Arguments assert ig.MeshUnit() == "m" ig.MeshUnit = "mm" assert ig.MeshUnit() == "mm" # Command Arguments SubItem - assert ig.CadImportOptions.OneZonePer() == "body" - ig.CadImportOptions.OneZonePer = "face" - assert ig.CadImportOptions.OneZonePer() == "face" + assert ig.ImportCadPreferences.ShowImportCadPreferences() is False + ig.ImportCadPreferences.ShowImportCadPreferences = True + assert ig.ImportCadPreferences.ShowImportCadPreferences() is True @pytest.mark.fluent_version(">=24.1") diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index fb5f7911297e..68c255fffc4b 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -455,39 +455,6 @@ def test_new_2d_meshing_workflow(new_meshing_session_wo_exit): assert solver.is_active() is False -@pytest.mark.codegen_required -@pytest.mark.fluent_version(">=23.2") -def test_updating_state_in_new_meshing_workflow(new_meshing_session): - # Import geometry - import_file_name = examples.download_file( - "mixing_elbow.pmdb", "pyfluent/mixing_elbow" - ) - watertight = new_meshing_session.watertight() - assert watertight.import_geometry.length_unit() == "mm" - assert watertight.import_geometry.cad_import_options.feature_angle() == 40.0 - assert ( - watertight.import_geometry.cad_import_options.one_zone_per.allowed_values() - == ["body", "face", "object"] - ) - assert watertight.import_geometry.cad_import_options.one_zone_per() == "body" - watertight.import_geometry.arguments = { - "file_name": import_file_name, - "length_unit": "in", - "cad_import_options": {"feature_angle": 35, "one_zone_per": "object"}, - } - assert watertight.import_geometry.cad_import_options.feature_angle() == 35.0 - assert ( - watertight.import_geometry.cad_import_options.one_zone_per.get_state() - == "object" - ) - assert watertight.import_geometry.length_unit.get_state() == "in" - watertight.import_geometry.cad_import_options.feature_angle = 25.0 - assert watertight.import_geometry.cad_import_options.feature_angle() == 25.0 - watertight.import_geometry.cad_import_options.one_zone_per = "face" - assert watertight.import_geometry.cad_import_options.one_zone_per() == "face" - watertight.import_geometry() - - def _assert_snake_case_attrs(attrs: Iterable): for attr in attrs: assert str(attr).islower() @@ -617,10 +584,19 @@ def test_watertight_workflow_dynamic_interface( watertight = new_meshing_session.watertight() watertight.import_geometry.file_name = mixing_elbow_geometry_filename watertight.import_geometry() - create_volume_mesh = watertight.create_volume_mesh + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + create_volume_mesh = watertight.create_volume_mesh + else: + create_volume_mesh = watertight.create_volume_mesh_wtm assert create_volume_mesh is not None - watertight.delete_tasks(list_of_tasks=["create_volume_mesh"]) - assert "create_volume_mesh" not in watertight.task_names() + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.delete_tasks(list_of_tasks=["create_volume_mesh"]) + vol_mesh_task_name = "" + assert "create_volume_mesh" not in watertight.task_names() + else: + watertight.delete_tasks(list_of_tasks=["create_volume_mesh_wtm"]) + vol_mesh_task_name = "" + assert "create_volume_mesh_wtm" not in watertight.task_names() assert sorted( [repr(x) for x in watertight.add_boundary_layer.insertable_tasks()] @@ -631,15 +607,20 @@ def test_watertight_workflow_dynamic_interface( "", "", "", - "", + vol_mesh_task_name, "", "", "", ] ) - watertight.add_boundary_layer.insertable_tasks.create_volume_mesh.insert() - assert "create_volume_mesh" in watertight.task_names() - create_volume_mesh = watertight.create_volume_mesh + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.add_boundary_layer.insertable_tasks.create_volume_mesh.insert() + assert "create_volume_mesh" in watertight.task_names() + create_volume_mesh = watertight.create_volume_mesh + else: + watertight.add_boundary_layer.insertable_tasks.create_volume_mesh_wtm.insert() + assert "create_volume_mesh_wtm" in watertight.task_names() + create_volume_mesh = watertight.create_volume_mesh_wtm assert create_volume_mesh is not None assert ( @@ -653,8 +634,12 @@ def test_watertight_workflow_dynamic_interface( assert watertight.describe_geometry.enclose_fluid_regions watertight.describe_geometry.enclose_fluid_regions.delete() assert "enclose_fluid_regions" not in watertight.task_names() - watertight.create_volume_mesh.delete() - assert "create_volume_mesh" not in watertight.task_names() + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.create_volume_mesh.delete() + assert "create_volume_mesh" not in watertight.task_names() + else: + watertight.create_volume_mesh_wtm.delete() + assert "create_volume_mesh_wtm" not in watertight.task_names() @pytest.mark.fluent_version("==23.2") @@ -687,7 +672,7 @@ def test_extended_wrapper(new_meshing_session, mixing_elbow_geometry_filename): import_geometry = watertight.import_geometry assert import_geometry.Arguments() == {} import_geometry.Arguments = dict(FileName=mixing_elbow_geometry_filename) - assert 8 < len(import_geometry.arguments.get_state()) < 15 + assert 7 <= len(import_geometry.arguments.get_state()) < 15 assert len(import_geometry.arguments.get_state(explicit_only=True)) == 1 import_geometry.arguments.set_state(dict(file_name=None)) time.sleep(5) @@ -1095,7 +1080,10 @@ def test_new_meshing_workflow_without_dm_caching( watertight.add_local_sizing.add_child_to_task() watertight.add_local_sizing() - watertight.create_volume_mesh() + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.create_volume_mesh() + else: + watertight.create_volume_mesh_wtm() watertight.import_geometry.rename(new_name="import_geom_wtm") time.sleep(2) @@ -1236,6 +1224,10 @@ def test_duplicate_tasks_in_workflow(new_meshing_session): watertight.import_geometry.insertable_tasks.import_boi_geometry.insert() watertight.import_geometry.insertable_tasks.import_boi_geometry.insert() watertight.import_geometry.insertable_tasks.import_boi_geometry.insert() + if meshing.get_fluent_version() < FluentVersion.v261: + _entry = "create_volume_mesh" + else: + _entry = "create_volume_mesh_wtm" assert set(watertight.task_names()) == { "import_geometry", "create_surface_mesh", @@ -1246,7 +1238,7 @@ def test_duplicate_tasks_in_workflow(new_meshing_session): "create_regions", "update_regions", "add_boundary_layer", - "create_volume_mesh", + _entry, "add_local_sizing", "import_boi_geometry", "import_boi_geometry_1", @@ -1517,7 +1509,9 @@ def test_accessors_for_argument_sub_items(new_meshing_session): meshing.workflow.TaskObject["Import Geometry"].Arguments = dict(LengthUnit="in") assert import_geom.arguments.length_unit() == "in" + import_geom.arguments.file_format = "Mesh" assert not import_geom.arguments.mesh_unit.is_read_only() + import_geom.arguments.file_format = "CAD" assert import_geom.arguments.length_unit.is_active() assert not import_geom.arguments.file_name.is_read_only() assert not import_geom.arguments.file_name() @@ -1529,8 +1523,10 @@ def test_accessors_for_argument_sub_items(new_meshing_session): with pytest.raises(AttributeError): import_geom.arguments.CadImportOptions.OneZonePer = "face" - assert import_geom.arguments.cad_import_options() - assert import_geom.arguments.cad_import_options.one_zone_per() + assert import_geom.arguments.import_cad_preferences() + assert ( + not import_geom.arguments.import_cad_preferences.show_import_cad_preferences() + ) assert import_geom.arguments.file_format.get_attrib_value("allowedValues") == [ "CAD", @@ -1538,14 +1534,10 @@ def test_accessors_for_argument_sub_items(new_meshing_session): ] assert import_geom.arguments.file_format.allowed_values() == ["CAD", "Mesh"] - assert not import_geom.arguments.cad_import_options.one_zone_per.is_read_only() - assert import_geom.arguments.cad_import_options.one_zone_per() == "body" - import_geom.arguments.cad_import_options.one_zone_per.set_state("face") - assert import_geom.arguments.cad_import_options.one_zone_per() == "face" - import_geom.arguments.cad_import_options.one_zone_per = "object" - assert import_geom.arguments.cad_import_options.one_zone_per() == "object" - - volume_mesh_gen = watertight.create_volume_mesh + if meshing.get_fluent_version() < FluentVersion.v261: + volume_mesh_gen = watertight.create_volume_mesh + else: + volume_mesh_gen = watertight.create_volume_mesh_wtm assert ( volume_mesh_gen.arguments.volume_fill_controls.cell_sizing.default_value() == "Geometric" @@ -1559,28 +1551,14 @@ def test_accessors_for_argument_sub_items(new_meshing_session): "Geometric", ] ) - feat_angle = import_geom.arguments.cad_import_options.feature_angle - assert feat_angle.default_value() == 40.0 - - # Test particular to numerical type (min() only available in numerical types) - assert feat_angle.min() == 0.0 - - # Test intended to fail in numerical type (allowed_values() only available in string types) - with pytest.raises(AttributeError) as msg: - assert feat_angle.allowed_values() - assert ( - msg.value.args[0] == "'_FeatureAngle' object has no attribute 'allowed_values'" - ) # Test intended to fail in numerical type (allowed_values() only available in string types) with pytest.raises(AttributeError) as msg: assert import_geom.arguments.num_parts.allowed_values() - assert msg.value.args[0] == "'_NumParts' object has no attribute 'allowed_values'" # Test intended to fail in string type (min() only available in numerical types) with pytest.raises(AttributeError) as msg: assert import_geom.arguments.length_unit.min() - assert msg.value.args[0] == "'_LengthUnit' object has no attribute 'min'" @pytest.mark.codegen_required @@ -1594,7 +1572,10 @@ def test_scenario_with_common_python_names_from_fdl(new_meshing_session): assert len(fault_tolerant.task_names()) == len(set(fault_tolerant.task_names())) # APIName from fdl file - assert "create_volume_mesh" in fault_tolerant.task_names() + if meshing.get_fluent_version() < FluentVersion.v261: + assert "create_volume_mesh" in fault_tolerant.task_names() + else: + assert "create_volume_mesh_ftm" in fault_tolerant.task_names() assert "generate_volume_mesh" in fault_tolerant.task_names() assert "generate_surface_mesh" in fault_tolerant.task_names() diff --git a/tests/test_preferences.py b/tests/test_preferences.py index 8632e99f6876..3fedafd46704 100644 --- a/tests/test_preferences.py +++ b/tests/test_preferences.py @@ -52,9 +52,9 @@ def test_solver_preferences(new_solver_session): ansys_logo.Visible = True assert ansys_logo.Visible() is True - perfered_graphics = solver.preferences.Graphics - perfered_graphics.AnimationOption = "wireframe" - assert perfered_graphics.AnimationOption() == "wireframe" + preferred_graphics = solver.preferences.Graphics + preferred_graphics.AnimationOption = "wireframe" + assert preferred_graphics.AnimationOption() == "wireframe" solver.exit() diff --git a/tests/test_reduction.py b/tests/test_reduction.py index de4d4cc9f8b9..b9baaf9bcd4a 100644 --- a/tests/test_reduction.py +++ b/tests/test_reduction.py @@ -463,7 +463,7 @@ def test_reductions( def test_reduction_does_not_modify_case(static_mixer_case_session: Any): solver = static_mixer_case_session solver.solution.initialization.hybrid_initialize() - # After reading the static-mixer case in Fluent, case-modifed? flag is somehow True + # After reading the static-mixer case in Fluent, case-modified? flag is somehow True solver.scheme.eval("(%save-case-id)") assert not solver.scheme.eval("(case-modified?)") solver.reduction.area_average(