From 02471a13174c16ef0c6828f55b43d640de458d49 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Mon, 21 Oct 2024 16:45:17 -0400 Subject: [PATCH 1/2] feat: Changes to support Fluent 25.2 dev --- .github/workflows/ci.yml | 32 +++++++ Makefile | 20 ++++ devel/update_pyfluent_in_fluent.md | 5 - doc/settings_rstgen.py | 9 +- src/ansys/fluent/core/_version.py | 2 +- .../core/solver/settings_builtin_data.py | 95 +++++++++++++++++++ src/ansys/fluent/core/utils/fluent_version.py | 6 ++ 7 files changed, 161 insertions(+), 8 deletions(-) delete mode 100644 devel/update_pyfluent_in_fluent.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7f005d079b..bc7d317329d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -417,6 +417,36 @@ jobs: cat src/ansys/fluent/core/generated/fluent_version_251.py python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" + - name: Cache 25.2 API Code + uses: actions/cache@v4 + id: cache-252-api-code + with: + path: + src/ansys/fluent/core/generated + doc/source/api/core/meshing/tui + doc/source/api/core/meshing/datamodel + doc/source/api/core/solver/tui + doc/source/api/core/solver/datamodel + key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} + restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0 + + - name: Pull 25.2 Fluent docker image + if: steps.cache-252-api-code.outputs.cache-hit != 'true' + run: make docker-pull + env: + FLUENT_IMAGE_TAG: v25.2.0 + + - name: Run 25.2 API codegen + if: steps.cache-252-api-code.outputs.cache-hit != 'true' + run: make api-codegen + env: + FLUENT_IMAGE_TAG: v25.2.0 + + - name: Print 25.2 Fluent version info + run: | + cat src/ansys/fluent/core/generated/fluent_version_252.py + python -c "from ansys.fluent.core.generated.solver.settings_252 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" + - name: Install again after codegen run: | rm -rf dist @@ -457,6 +487,8 @@ jobs: version: 242 - image-tag: v25.1.0 version: 251 + - image-tag: v25.2.0 + version: 252 timeout-minutes: 120 env: FLUENT_IMAGE_TAG: ${{ matrix.version == 251 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }} diff --git a/Makefile b/Makefile index f34f895c665..eb664942acb 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,11 @@ unittest-dev-251: @sudo rm -rf /home/ansys/Documents/ansys_fluent_core_examples/* @poetry run python -m pytest --fluent-version=25.1 $(PYTESTEXTRA) || poetry run python -m pytest --fluent-version=25.1 $(PYTESTRERUN) +unittest-dev-252: + @echo "Running unittests" + @sudo rm -rf /home/ansys/Documents/ansys_fluent_core_examples/* + @poetry run python -m pytest --fluent-version=25.2 $(PYTESTEXTRA) || poetry run python -m pytest --fluent-version=25.2 $(PYTESTRERUN) + unittest-all-222: @echo "Running all unittests" @sudo rm -rf /home/ansys/Documents/ansys_fluent_core_examples/* @@ -123,6 +128,21 @@ unittest-all-251-no-codegen: @sudo rm -rf /home/ansys/Documents/ansys_fluent_core_examples/* @poetry run python -m pytest --nightly --fluent-version=25.1 -m "not codegen_required" $(PYTESTEXTRA) || poetry run python -m pytest --nightly --fluent-version=25.1 -m "not codegen_required" $(PYTESTRERUN) +unittest-all-252: + @echo "Running all unittests" + @sudo rm -rf /home/ansys/Documents/ansys_fluent_core_examples/* + @poetry run python -m pytest --nightly --fluent-version=25.2 $(PYTESTEXTRA) || poetry run python -m pytest --nightly --fluent-version=25.2 $(PYTESTRERUN) + +unittest-solvermode-252: + @echo "Running all unittests" + @sudo rm -rf /home/ansys/Documents/ansys_fluent_core_examples/* + @poetry run python -m pytest --fluent-version=25.2 --solvermode $(PYTESTEXTRA) || poetry run python -m pytest --fluent-version=25.2 --solvermode $(PYTESTRERUN) + +unittest-all-252-no-codegen: + @echo "Running all unittests" + @sudo rm -rf /home/ansys/Documents/ansys_fluent_core_examples/* + @poetry run python -m pytest --nightly --fluent-version=25.2 -m "not codegen_required" $(PYTESTEXTRA) || poetry run python -m pytest --nightly --fluent-version=25.2 -m "not codegen_required" $(PYTESTRERUN) + api-codegen: @echo "Running API codegen" @python -m venv env diff --git a/devel/update_pyfluent_in_fluent.md b/devel/update_pyfluent_in_fluent.md deleted file mode 100644 index 48d5d325fd1..00000000000 --- a/devel/update_pyfluent_in_fluent.md +++ /dev/null @@ -1,5 +0,0 @@ -#### Steps to update PyFluent version packaged within Fluent: - -1. Update the `pyfluent_version` variable in flmake.py to the new version. - -2. Merge the changes through a PR. Run the custom regression `flcore_pyconsole.py` before merging. diff --git a/doc/settings_rstgen.py b/doc/settings_rstgen.py index 5e8cad8eab2..e89815deb9a 100644 --- a/doc/settings_rstgen.py +++ b/doc/settings_rstgen.py @@ -23,7 +23,10 @@ import importlib import os -from ansys.fluent.core.utils.fluent_version import get_version_for_file_name +from ansys.fluent.core.utils.fluent_version import ( + FluentVersion, + get_version_for_file_name, +) parents_dict = {} rst_list = [] @@ -216,7 +219,9 @@ def _populate_rst_from_settings(rst_dir, cls, version): if not os.path.exists(rst_dir): os.makedirs(rst_dir) - image_tag = os.getenv("FLUENT_IMAGE_TAG", "v24.2.0") + image_tag = os.getenv( + "FLUENT_IMAGE_TAG", FluentVersion.current_release().docker_image_tag + ) version = get_version_for_file_name(image_tag.lstrip("v")) settings = importlib.import_module( f"ansys.fluent.core.generated.solver.settings_{version}" diff --git a/src/ansys/fluent/core/_version.py b/src/ansys/fluent/core/_version.py index 8e69b9e1649..22ef25607cb 100644 --- a/src/ansys/fluent/core/_version.py +++ b/src/ansys/fluent/core/_version.py @@ -12,4 +12,4 @@ __version__ = ".".join(map(str, version_info)) # Current Fluent version -fluent_release_version = "24.1.0" +fluent_release_version = "24.2.0" diff --git a/src/ansys/fluent/core/solver/settings_builtin_data.py b/src/ansys/fluent/core/solver/settings_builtin_data.py index 9b1503590f2..59f8dc66666 100644 --- a/src/ansys/fluent/core/solver/settings_builtin_data.py +++ b/src/ansys/fluent/core/solver/settings_builtin_data.py @@ -13,6 +13,7 @@ "Radiation": ( "Singleton", { + FluentVersion.v252: "setup.models.radiation", FluentVersion.v251: "setup.models.radiation", FluentVersion.v242: "setup.models.radiation", FluentVersion.v241: "setup.models.radiation", @@ -22,6 +23,7 @@ "Species": ( "Singleton", { + FluentVersion.v252: "setup.models.species", FluentVersion.v251: "setup.models.species", FluentVersion.v242: "setup.models.species", FluentVersion.v241: "setup.models.species", @@ -31,6 +33,7 @@ "DiscretePhase": ( "Singleton", { + FluentVersion.v252: "setup.models.discrete_phase", FluentVersion.v251: "setup.models.discrete_phase", FluentVersion.v242: "setup.models.discrete_phase", FluentVersion.v241: "setup.models.discrete_phase", @@ -41,6 +44,7 @@ "Injections": ( "Singleton", { + FluentVersion.v252: "setup.models.discrete_phase.injections", FluentVersion.v251: "setup.models.discrete_phase.injections", FluentVersion.v242: "setup.models.discrete_phase.injections", FluentVersion.v241: "setup.models.discrete_phase.injections", @@ -51,6 +55,7 @@ "Injection": ( "NamedObject", { + FluentVersion.v252: "setup.models.discrete_phase.injections", FluentVersion.v251: "setup.models.discrete_phase.injections", FluentVersion.v242: "setup.models.discrete_phase.injections", FluentVersion.v241: "setup.models.discrete_phase.injections", @@ -61,6 +66,7 @@ "VirtualBladeModel": ( "Singleton", { + FluentVersion.v252: "setup.models.virtual_blade_model", FluentVersion.v251: "setup.models.virtual_blade_model", FluentVersion.v242: "setup.models.virtual_blade_model", FluentVersion.v241: "setup.models.virtual_blade_model", @@ -71,6 +77,7 @@ "Optics": ( "Singleton", { + FluentVersion.v252: "setup.models.optics", FluentVersion.v251: "setup.models.optics", FluentVersion.v242: "setup.models.optics", FluentVersion.v241: "setup.models.optics", @@ -81,6 +88,7 @@ "Structure": ( "Singleton", { + FluentVersion.v252: "setup.models.structure", FluentVersion.v251: "setup.models.structure", FluentVersion.v242: "setup.models.structure", FluentVersion.v241: "setup.models.structure", @@ -90,6 +98,7 @@ "Ablation": ( "Singleton", { + FluentVersion.v252: "setup.models.ablation", FluentVersion.v251: "setup.models.ablation", FluentVersion.v242: "setup.models.ablation", FluentVersion.v241: "setup.models.ablation", @@ -99,6 +108,7 @@ "EChemistry": ( "Singleton", { + FluentVersion.v252: "setup.models.echemistry", FluentVersion.v251: "setup.models.echemistry", FluentVersion.v242: "setup.models.echemistry", FluentVersion.v241: "setup.models.echemistry", @@ -107,6 +117,7 @@ "Battery": ( "Singleton", { + FluentVersion.v252: "setup.models.battery", FluentVersion.v251: "setup.models.battery", FluentVersion.v242: "setup.models.battery", FluentVersion.v241: "setup.models.battery", @@ -115,6 +126,7 @@ "SystemCoupling": ( "Singleton", { + FluentVersion.v252: "setup.models.system_coupling", FluentVersion.v251: "setup.models.system_coupling", FluentVersion.v242: "setup.models.system_coupling", FluentVersion.v241: "setup.models.system_coupling", @@ -123,6 +135,7 @@ "Sofc": ( "Singleton", { + FluentVersion.v252: "setup.models.sofc", FluentVersion.v251: "setup.models.sofc", FluentVersion.v242: "setup.models.sofc", FluentVersion.v241: "setup.models.sofc", @@ -131,6 +144,7 @@ "Pemfc": ( "Singleton", { + FluentVersion.v252: "setup.models.pemfc", FluentVersion.v251: "setup.models.pemfc", FluentVersion.v242: "setup.models.pemfc", }, @@ -148,6 +162,7 @@ "CellZoneCondition": ( "NamedObject", { + FluentVersion.v252: "setup.cell_zone_conditions", FluentVersion.v251: "setup.cell_zone_conditions", FluentVersion.v242: "setup.cell_zone_conditions", FluentVersion.v241: "setup.cell_zone_conditions", @@ -163,6 +178,7 @@ "BoundaryCondition": ( "NamedObject", { + FluentVersion.v252: "setup.boundary_conditions", FluentVersion.v251: "setup.boundary_conditions", FluentVersion.v242: "setup.boundary_conditions", FluentVersion.v241: "setup.boundary_conditions", @@ -255,6 +271,7 @@ "NonReflectingBoundaries": ( "Singleton", { + FluentVersion.v252: "setup.boundary_conditions.non_reflecting_bc", FluentVersion.v251: "setup.boundary_conditions.non_reflecting_bc", FluentVersion.v242: "setup.boundary_conditions.non_reflecting_bc", FluentVersion.v241: "setup.boundary_conditions.non_reflecting_bc", @@ -263,6 +280,7 @@ "NonReflectingBoundary": ( "NamedObject", { + FluentVersion.v252: "setup.boundary_conditions.non_reflecting_bc", FluentVersion.v251: "setup.boundary_conditions.non_reflecting_bc", FluentVersion.v242: "setup.boundary_conditions.non_reflecting_bc", FluentVersion.v241: "setup.boundary_conditions.non_reflecting_bc", @@ -271,6 +289,7 @@ "PerforatedWallBoundaries": ( "Singleton", { + FluentVersion.v252: "setup.boundary_conditions.perforated_wall", FluentVersion.v251: "setup.boundary_conditions.perforated_wall", FluentVersion.v242: "setup.boundary_conditions.perforated_wall", FluentVersion.v241: "setup.boundary_conditions.perforated_wall", @@ -279,6 +298,7 @@ "PerforatedWallBoundary": ( "NamedObject", { + FluentVersion.v252: "setup.boundary_conditions.perforated_wall", FluentVersion.v251: "setup.boundary_conditions.perforated_wall", FluentVersion.v242: "setup.boundary_conditions.perforated_wall", FluentVersion.v241: "setup.boundary_conditions.perforated_wall", @@ -287,17 +307,20 @@ "MeshInterfaces": ( "Singleton", { + FluentVersion.v252: "setup.mesh_interfaces", FluentVersion.v251: "setup.mesh_interfaces", FluentVersion.v242: "setup.mesh_interfaces", FluentVersion.v241: "setup.mesh_interfaces", FluentVersion.v232: "setup.mesh_interfaces", }, ), + "DynamicMesh": ("Singleton", {FluentVersion.v252: "setup.dynamic_mesh"}), "DynamicMesh": ("Singleton", {FluentVersion.v251: "setup.dynamic_mesh"}), "ReferenceValues": ("Singleton", "setup.reference_values"), "ReferenceFrames": ( "Singleton", { + FluentVersion.v252: "setup.reference_frames", FluentVersion.v251: "setup.reference_frames", FluentVersion.v242: "setup.reference_frames", FluentVersion.v241: "setup.reference_frames", @@ -307,6 +330,7 @@ "ReferenceFrame": ( "NamedObject", { + FluentVersion.v252: "setup.reference_frames", FluentVersion.v251: "setup.reference_frames", FluentVersion.v242: "setup.reference_frames", FluentVersion.v241: "setup.reference_frames", @@ -316,6 +340,7 @@ "NamedExpressions": ( "Singleton", { + FluentVersion.v252: "setup.named_expressions", FluentVersion.v251: "setup.named_expressions", FluentVersion.v242: "setup.named_expressions", FluentVersion.v241: "setup.named_expressions", @@ -325,6 +350,7 @@ "NamedExpression": ( "NamedObject", { + FluentVersion.v252: "setup.named_expressions", FluentVersion.v251: "setup.named_expressions", FluentVersion.v242: "setup.named_expressions", FluentVersion.v241: "setup.named_expressions", @@ -338,6 +364,7 @@ "Monitor": ( "Singleton", { + FluentVersion.v252: "solution.monitor", FluentVersion.v251: "solution.monitor", FluentVersion.v242: "solution.monitor", FluentVersion.v241: "solution.monitor", @@ -348,6 +375,7 @@ "Residual": ( "Singleton", { + FluentVersion.v252: "solution.monitor.residual", FluentVersion.v251: "solution.monitor.residual", FluentVersion.v242: "solution.monitor.residual", FluentVersion.v241: "solution.monitor.residual", @@ -356,6 +384,7 @@ "ReportFiles": ( "Singleton", { + FluentVersion.v252: "solution.monitor.report_files", FluentVersion.v251: "solution.monitor.report_files", FluentVersion.v242: "solution.monitor.report_files", FluentVersion.v241: "solution.monitor.report_files", @@ -366,6 +395,7 @@ "ReportFile": ( "NamedObject", { + FluentVersion.v252: "solution.monitor.report_files", FluentVersion.v251: "solution.monitor.report_files", FluentVersion.v242: "solution.monitor.report_files", FluentVersion.v241: "solution.monitor.report_files", @@ -376,6 +406,7 @@ "ReportPlots": ( "Singleton", { + FluentVersion.v252: "solution.monitor.report_plots", FluentVersion.v251: "solution.monitor.report_plots", FluentVersion.v242: "solution.monitor.report_plots", FluentVersion.v241: "solution.monitor.report_plots", @@ -386,6 +417,7 @@ "ReportPlot": ( "NamedObject", { + FluentVersion.v252: "solution.monitor.report_plots", FluentVersion.v251: "solution.monitor.report_plots", FluentVersion.v242: "solution.monitor.report_plots", FluentVersion.v241: "solution.monitor.report_plots", @@ -396,6 +428,7 @@ "ConvergenceConditions": ( "Singleton", { + FluentVersion.v252: "solution.monitor.convergence_conditions", FluentVersion.v251: "solution.monitor.convergence_conditions", FluentVersion.v242: "solution.monitor.convergence_conditions", FluentVersion.v241: "solution.monitor.convergence_conditions", @@ -406,6 +439,7 @@ "CellRegisters": ( "Singleton", { + FluentVersion.v252: "solution.cell_registers", FluentVersion.v251: "solution.cell_registers", FluentVersion.v242: "solution.cell_registers", FluentVersion.v241: "solution.cell_registers", @@ -416,6 +450,7 @@ "CellRegister": ( "NamedObject", { + FluentVersion.v252: "solution.cell_registers", FluentVersion.v251: "solution.cell_registers", FluentVersion.v242: "solution.cell_registers", FluentVersion.v241: "solution.cell_registers", @@ -427,6 +462,7 @@ "CalculationActivity": ( "Singleton", { + FluentVersion.v252: "solution.calculation_activity", FluentVersion.v251: "solution.calculation_activity", FluentVersion.v242: "solution.calculation_activity", FluentVersion.v241: "solution.calculation_activity", @@ -437,6 +473,7 @@ "ExecuteCommands": ( "Singleton", { + FluentVersion.v252: "solution.calculation_activity.execute_commands", FluentVersion.v251: "solution.calculation_activity.execute_commands", FluentVersion.v242: "solution.calculation_activity.execute_commands", FluentVersion.v241: "solution.calculation_activity.execute_commands", @@ -447,6 +484,7 @@ "CaseModification": ( "Singleton", { + FluentVersion.v252: "solution.calculation_activity.case_modification", FluentVersion.v251: "solution.calculation_activity.case_modification", FluentVersion.v242: "solution.calculation_activity.case_modification", FluentVersion.v241: "solution.calculation_activity.case_modification", @@ -458,6 +496,7 @@ "PointSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.point_surface", FluentVersion.v251: "results.surfaces.point_surface", FluentVersion.v242: "results.surfaces.point_surface", FluentVersion.v241: "results.surfaces.point_surface", @@ -467,6 +506,7 @@ "PointSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.point_surface", FluentVersion.v251: "results.surfaces.point_surface", FluentVersion.v242: "results.surfaces.point_surface", FluentVersion.v241: "results.surfaces.point_surface", @@ -476,6 +516,7 @@ "LineSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.line_surface", FluentVersion.v251: "results.surfaces.line_surface", FluentVersion.v242: "results.surfaces.line_surface", FluentVersion.v241: "results.surfaces.line_surface", @@ -485,6 +526,7 @@ "LineSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.line_surface", FluentVersion.v251: "results.surfaces.line_surface", FluentVersion.v242: "results.surfaces.line_surface", FluentVersion.v241: "results.surfaces.line_surface", @@ -494,6 +536,7 @@ "RakeSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.rake_surface", FluentVersion.v251: "results.surfaces.rake_surface", FluentVersion.v242: "results.surfaces.rake_surface", FluentVersion.v241: "results.surfaces.rake_surface", @@ -503,6 +546,7 @@ "RakeSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.rake_surface", FluentVersion.v251: "results.surfaces.rake_surface", FluentVersion.v242: "results.surfaces.rake_surface", FluentVersion.v241: "results.surfaces.rake_surface", @@ -514,6 +558,7 @@ "IsoSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.iso_surface", FluentVersion.v251: "results.surfaces.iso_surface", FluentVersion.v242: "results.surfaces.iso_surface", FluentVersion.v241: "results.surfaces.iso_surface", @@ -523,6 +568,7 @@ "IsoSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.iso_surface", FluentVersion.v251: "results.surfaces.iso_surface", FluentVersion.v242: "results.surfaces.iso_surface", FluentVersion.v241: "results.surfaces.iso_surface", @@ -532,6 +578,7 @@ "IsoClips": ( "Singleton", { + FluentVersion.v252: "results.surfaces.iso_clip", FluentVersion.v251: "results.surfaces.iso_clip", FluentVersion.v242: "results.surfaces.iso_clip", FluentVersion.v241: "results.surfaces.iso_clip", @@ -540,6 +587,7 @@ "IsoClip": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.iso_clip", FluentVersion.v251: "results.surfaces.iso_clip", FluentVersion.v242: "results.surfaces.iso_clip", FluentVersion.v241: "results.surfaces.iso_clip", @@ -548,6 +596,7 @@ "ZoneSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.zone_surface", FluentVersion.v251: "results.surfaces.zone_surface", FluentVersion.v242: "results.surfaces.zone_surface", FluentVersion.v241: "results.surfaces.zone_surface", @@ -556,6 +605,7 @@ "ZoneSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.zone_surface", FluentVersion.v251: "results.surfaces.zone_surface", FluentVersion.v242: "results.surfaces.zone_surface", FluentVersion.v241: "results.surfaces.zone_surface", @@ -564,6 +614,7 @@ "PartitionSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.partition_surface", FluentVersion.v251: "results.surfaces.partition_surface", FluentVersion.v242: "results.surfaces.partition_surface", FluentVersion.v241: "results.surfaces.partition_surface", @@ -572,6 +623,7 @@ "PartitionSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.partition_surface", FluentVersion.v251: "results.surfaces.partition_surface", FluentVersion.v242: "results.surfaces.partition_surface", FluentVersion.v241: "results.surfaces.partition_surface", @@ -580,6 +632,7 @@ "TransformSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.transform_surface", FluentVersion.v251: "results.surfaces.transform_surface", FluentVersion.v242: "results.surfaces.transform_surface", FluentVersion.v241: "results.surfaces.transform_surface", @@ -588,6 +641,7 @@ "TransformSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.transform_surface", FluentVersion.v251: "results.surfaces.transform_surface", FluentVersion.v242: "results.surfaces.transform_surface", FluentVersion.v241: "results.surfaces.transform_surface", @@ -596,6 +650,7 @@ "ImprintSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.imprint_surface", FluentVersion.v251: "results.surfaces.imprint_surface", FluentVersion.v242: "results.surfaces.imprint_surface", FluentVersion.v241: "results.surfaces.imprint_surface", @@ -604,6 +659,7 @@ "ImprintSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.imprint_surface", FluentVersion.v251: "results.surfaces.imprint_surface", FluentVersion.v242: "results.surfaces.imprint_surface", FluentVersion.v241: "results.surfaces.imprint_surface", @@ -612,6 +668,7 @@ "PlaneSlices": ( "Singleton", { + FluentVersion.v252: "results.surfaces.plane_slice", FluentVersion.v251: "results.surfaces.plane_slice", FluentVersion.v242: "results.surfaces.plane_slice", FluentVersion.v241: "results.surfaces.plane_slice", @@ -620,6 +677,7 @@ "PlaneSlice": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.plane_slice", FluentVersion.v251: "results.surfaces.plane_slice", FluentVersion.v242: "results.surfaces.plane_slice", FluentVersion.v241: "results.surfaces.plane_slice", @@ -628,6 +686,7 @@ "SphereSlices": ( "Singleton", { + FluentVersion.v252: "results.surfaces.sphere_slice", FluentVersion.v251: "results.surfaces.sphere_slice", FluentVersion.v242: "results.surfaces.sphere_slice", FluentVersion.v241: "results.surfaces.sphere_slice", @@ -636,6 +695,7 @@ "SphereSlice": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.sphere_slice", FluentVersion.v251: "results.surfaces.sphere_slice", FluentVersion.v242: "results.surfaces.sphere_slice", FluentVersion.v241: "results.surfaces.sphere_slice", @@ -644,6 +704,7 @@ "QuadricSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.quadric_surface", FluentVersion.v251: "results.surfaces.quadric_surface", FluentVersion.v242: "results.surfaces.quadric_surface", FluentVersion.v241: "results.surfaces.quadric_surface", @@ -652,6 +713,7 @@ "QuadricSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.quadric_surface", FluentVersion.v251: "results.surfaces.quadric_surface", FluentVersion.v242: "results.surfaces.quadric_surface", FluentVersion.v241: "results.surfaces.quadric_surface", @@ -660,6 +722,7 @@ "SurfaceCells": ( "Singleton", { + FluentVersion.v252: "results.surfaces.surface_cells", FluentVersion.v251: "results.surfaces.surface_cells", FluentVersion.v242: "results.surfaces.surface_cells", FluentVersion.v241: "results.surfaces.surface_cells", @@ -668,6 +731,7 @@ "SurfaceCell": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.surface_cells", FluentVersion.v251: "results.surfaces.surface_cells", FluentVersion.v242: "results.surfaces.surface_cells", FluentVersion.v241: "results.surfaces.surface_cells", @@ -676,24 +740,28 @@ "ExpressionVolumes": ( "Singleton", { + FluentVersion.v252: "results.surfaces.expression_volume", FluentVersion.v251: "results.surfaces.expression_volume", }, ), "ExpressionVolume": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.expression_volume", FluentVersion.v251: "results.surfaces.expression_volume", }, ), "GroupSurfaces": ( "Singleton", { + FluentVersion.v252: "results.surfaces.group_surface", FluentVersion.v251: "results.surfaces.group_surface", }, ), "GroupSurface": ( "NamedObject", { + FluentVersion.v252: "results.surfaces.group_surface", FluentVersion.v251: "results.surfaces.group_surface", }, ), @@ -707,6 +775,7 @@ "Pathlines": ( "Singleton", { + FluentVersion.v252: "results.graphics.pathline", FluentVersion.v251: "results.graphics.pathline", FluentVersion.v242: "results.graphics.pathline", FluentVersion.v241: "results.graphics.pathline", @@ -717,6 +786,7 @@ "Pathline": ( "NamedObject", { + FluentVersion.v252: "results.graphics.pathline", FluentVersion.v251: "results.graphics.pathline", FluentVersion.v242: "results.graphics.pathline", FluentVersion.v241: "results.graphics.pathline", @@ -727,6 +797,7 @@ "ParticleTracks": ( "Singleton", { + FluentVersion.v252: "results.graphics.particle_track", FluentVersion.v251: "results.graphics.particle_track", FluentVersion.v242: "results.graphics.particle_track", FluentVersion.v241: "results.graphics.particle_track", @@ -737,6 +808,7 @@ "ParticleTrack": ( "NamedObject", { + FluentVersion.v252: "results.graphics.particle_track", FluentVersion.v251: "results.graphics.particle_track", FluentVersion.v242: "results.graphics.particle_track", FluentVersion.v241: "results.graphics.particle_track", @@ -749,6 +821,7 @@ "Plots": ( "Singleton", { + FluentVersion.v252: "results.plot", FluentVersion.v251: "results.plot", FluentVersion.v242: "results.plot", FluentVersion.v241: "results.plot", @@ -759,6 +832,7 @@ "XYPlots": ( "Singleton", { + FluentVersion.v252: "results.plot.xy_plot", FluentVersion.v251: "results.plot.xy_plot", FluentVersion.v242: "results.plot.xy_plot", FluentVersion.v241: "results.plot.xy_plot", @@ -769,6 +843,7 @@ "XYPlot": ( "NamedObject", { + FluentVersion.v252: "results.plot.xy_plot", FluentVersion.v251: "results.plot.xy_plot", FluentVersion.v242: "results.plot.xy_plot", FluentVersion.v241: "results.plot.xy_plot", @@ -779,6 +854,7 @@ "Histogram": ( "Singleton", { + FluentVersion.v252: "results.plot.histogram", FluentVersion.v251: "results.plot.histogram", FluentVersion.v242: "results.plot.histogram", FluentVersion.v241: "results.plot.histogram", @@ -787,6 +863,7 @@ "CumulativePlots": ( "Singleton", { + FluentVersion.v252: "results.plot.cumulative_plot", FluentVersion.v251: "results.plot.cumulative_plot", FluentVersion.v242: "results.plot.cumulative_plot", FluentVersion.v241: "results.plot.cumulative_plot", @@ -795,6 +872,7 @@ "CumulativePlot": ( "NamedObject", { + FluentVersion.v252: "results.plot.cumulative_plot", FluentVersion.v251: "results.plot.cumulative_plot", FluentVersion.v242: "results.plot.cumulative_plot", FluentVersion.v241: "results.plot.cumulative_plot", @@ -803,6 +881,7 @@ "ProfileData": ( "Singleton", { + FluentVersion.v252: "results.plot.profile_data", FluentVersion.v251: "results.plot.profile_data", FluentVersion.v242: "results.plot.profile_data", }, @@ -810,6 +889,7 @@ "InterpolatedData": ( "Singleton", { + FluentVersion.v252: "results.plot.interpolated_data", FluentVersion.v251: "results.plot.interpolated_data", FluentVersion.v242: "results.plot.interpolated_data", }, @@ -817,6 +897,7 @@ "Scenes": ( "Singleton", { + FluentVersion.v252: "results.scene", FluentVersion.v251: "results.scene", FluentVersion.v242: "results.scene", FluentVersion.v241: "results.scene", @@ -827,6 +908,7 @@ "Scene": ( "NamedObject", { + FluentVersion.v252: "results.scene", FluentVersion.v251: "results.scene", FluentVersion.v242: "results.scene", FluentVersion.v241: "results.scene", @@ -837,6 +919,7 @@ "SceneAnimation": ( "Singleton", { + FluentVersion.v252: "results.animations.scene_animation", FluentVersion.v251: "results.animations.scene_animation", FluentVersion.v242: "results.animations.scene_animation", FluentVersion.v241: "results.animations.scene_animation", @@ -845,6 +928,7 @@ "Report": ( "Singleton", { + FluentVersion.v252: "results.report", FluentVersion.v251: "results.report", FluentVersion.v242: "results.report", FluentVersion.v241: "results.report", @@ -855,6 +939,7 @@ "DiscretePhaseHistogram": ( "Singleton", { + FluentVersion.v252: "results.report.discrete_phase.histogram", FluentVersion.v251: "results.report.discrete_phase.histogram", FluentVersion.v242: "results.report.discrete_phase.histogram", FluentVersion.v241: "results.report.discrete_phase.histogram", @@ -865,6 +950,7 @@ "Fluxes": ( "Singleton", { + FluentVersion.v252: "results.report.fluxes", FluentVersion.v251: "results.report.fluxes", FluentVersion.v242: "results.report.fluxes", FluentVersion.v241: "results.report.fluxes", @@ -875,6 +961,7 @@ "SurfaceIntegrals": ( "Singleton", { + FluentVersion.v252: "results.report.surface_integrals", FluentVersion.v251: "results.report.surface_integrals", FluentVersion.v242: "results.report.surface_integrals", FluentVersion.v241: "results.report.surface_integrals", @@ -885,6 +972,7 @@ "VolumeIntegrals": ( "Singleton", { + FluentVersion.v252: "results.report.volume_integrals", FluentVersion.v251: "results.report.volume_integrals", FluentVersion.v242: "results.report.volume_integrals", FluentVersion.v241: "results.report.volume_integrals", @@ -895,6 +983,7 @@ "InputParameters": ( "Singleton", { + FluentVersion.v252: "parameters.input_parameters", FluentVersion.v251: "parameters.input_parameters", FluentVersion.v242: "parameters.input_parameters", FluentVersion.v241: "parameters.input_parameters", @@ -903,6 +992,7 @@ "OutputParameters": ( "Singleton", { + FluentVersion.v252: "parameters.output_parameters", FluentVersion.v251: "parameters.output_parameters", FluentVersion.v242: "parameters.output_parameters", FluentVersion.v241: "parameters.output_parameters", @@ -911,18 +1001,21 @@ "CustomFieldFunctions": ( "Singleton", { + FluentVersion.v252: "results.custom_field_functions", FluentVersion.v251: "results.custom_field_functions", }, ), "CustomFieldFunction": ( "NamedObject", { + FluentVersion.v252: "results.custom_field_functions", FluentVersion.v251: "results.custom_field_functions", }, ), "CustomVectors": ( "Singleton", { + FluentVersion.v252: "results.custom_vectors", FluentVersion.v251: "results.custom_vectors", FluentVersion.v242: "results.custom_vectors", FluentVersion.v241: "results.custom_vectors", @@ -931,6 +1024,7 @@ "CustomVector": ( "NamedObject", { + FluentVersion.v252: "results.custom_vectors", FluentVersion.v251: "results.custom_vectors", FluentVersion.v242: "results.custom_vectors", FluentVersion.v241: "results.custom_vectors", @@ -939,6 +1033,7 @@ "SimulationReports": ( "Singleton", { + FluentVersion.v252: "results.report.simulation_reports", FluentVersion.v251: "results.report.simulation_reports", FluentVersion.v242: "results.report.simulation_reports", FluentVersion.v241: "results.report.simulation_reports", diff --git a/src/ansys/fluent/core/utils/fluent_version.py b/src/ansys/fluent/core/utils/fluent_version.py index f81d7dae968..6a8c1d9bfef 100644 --- a/src/ansys/fluent/core/utils/fluent_version.py +++ b/src/ansys/fluent/core/utils/fluent_version.py @@ -52,6 +52,7 @@ class FluentVersion(Enum): FluentVersion.v232.awp_var == 'AWP_ROOT232' """ + v252 = "25.2.0" v251 = "25.1.0" v242 = "24.2.0" v241 = "24.1.0" @@ -119,6 +120,11 @@ def number(self): """Get the Fluent version as a plain integer.""" return int(self.value.replace(".", "")[:-1]) + @property + def docker_image_tag(self): + """Get the Fluent version as a Docker image tag.""" + return f"v{self.value}" + def __lt__(self, other): if isinstance(other, FluentVersion): return self.value < other.value From b58b68e8907d7c87b234beddeec7f44248356ef2 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Mon, 21 Oct 2024 16:55:05 -0400 Subject: [PATCH 2/2] feat: Changes to support Fluent 25.2 dev --- devel/update_settings_builtin_data.py | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 devel/update_settings_builtin_data.py diff --git a/devel/update_settings_builtin_data.py b/devel/update_settings_builtin_data.py new file mode 100644 index 00000000000..ad7fad5df7c --- /dev/null +++ b/devel/update_settings_builtin_data.py @@ -0,0 +1,37 @@ +""" +Script to update the settings_builtin_data.py file with the new Fluent version. +Usage: python devel/update_settings_builtin_data.py --version 252 +""" + +import argparse +from pathlib import Path + +from ansys.fluent.core.utils.fluent_version import FluentVersion + +parser = argparse.ArgumentParser() +parser.add_argument("--version", type=str, required=True) +args = parser.parse_args() +new_version = FluentVersion(args.version).name +index = FluentVersion._member_names_.index(new_version) +previous_version = FluentVersion._member_names_[index + 1] + +file_path = ( + Path(__file__).parent.parent + / "src" + / "ansys" + / "fluent" + / "core" + / "solver" + / "settings_builtin_data.py" +).resolve() +lines = [] + +with open(file_path, "r") as file: + for line in file: + if previous_version in line: + new_line = line.replace(previous_version, new_version) + lines.append(new_line) + lines.append(line) + +with open(file_path, "w") as file: + file.writelines(lines)