ansys-fluent-core 0.31.dev1__py3-none-any.whl → 0.32.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.

Files changed (57) hide show
  1. ansys/fluent/core/__init__.py +11 -3
  2. ansys/fluent/core/codegen/settingsgen.py +6 -0
  3. ansys/fluent/core/codegen/tuigen.py +1 -2
  4. ansys/fluent/core/docker/docker_compose.py +243 -0
  5. ansys/fluent/core/field_data_interfaces.py +6 -0
  6. ansys/fluent/core/file_session.py +158 -128
  7. ansys/fluent/core/filereader/data_file.py +11 -0
  8. ansys/fluent/core/filereader/pre_processor.py +22 -0
  9. ansys/fluent/core/fluent_connection.py +48 -20
  10. ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
  11. ansys/fluent/core/generated/datamodel_231/flicing.py +20 -20
  12. ansys/fluent/core/generated/datamodel_231/meshing.py +228 -228
  13. ansys/fluent/core/generated/datamodel_232/flicing.py +40 -40
  14. ansys/fluent/core/generated/datamodel_232/meshing.py +203 -203
  15. ansys/fluent/core/generated/datamodel_241/flicing.py +20 -20
  16. ansys/fluent/core/generated/datamodel_241/meshing.py +303 -303
  17. ansys/fluent/core/generated/datamodel_242/flicing.py +35 -35
  18. ansys/fluent/core/generated/datamodel_242/meshing.py +334 -334
  19. ansys/fluent/core/generated/datamodel_242/part_management.py +6 -6
  20. ansys/fluent/core/generated/datamodel_251/flicing.py +40 -40
  21. ansys/fluent/core/generated/datamodel_251/meshing.py +366 -366
  22. ansys/fluent/core/generated/datamodel_251/part_management.py +6 -6
  23. ansys/fluent/core/generated/datamodel_252/flicing.py +30 -30
  24. ansys/fluent/core/generated/datamodel_252/meshing.py +816 -454
  25. ansys/fluent/core/generated/datamodel_252/part_management.py +10 -10
  26. ansys/fluent/core/generated/datamodel_252/preferences.py +1 -1
  27. ansys/fluent/core/generated/fluent_version_252.py +4 -4
  28. ansys/fluent/core/generated/solver/settings_252.py +2241 -1649
  29. ansys/fluent/core/generated/solver/settings_252.pyi +1785 -1430
  30. ansys/fluent/core/generated/solver/settings_builtin.pyi +104 -0
  31. ansys/fluent/core/generated/solver/tui_252.py +126 -2
  32. ansys/fluent/core/launcher/container_launcher.py +39 -8
  33. ansys/fluent/core/launcher/fluent_container.py +60 -22
  34. ansys/fluent/core/launcher/launcher.py +24 -13
  35. ansys/fluent/core/launcher/launcher_utils.py +8 -0
  36. ansys/fluent/core/launcher/process_launch_string.py +2 -6
  37. ansys/fluent/core/report.py +2 -0
  38. ansys/fluent/core/services/deprecated_field_data.py +74 -46
  39. ansys/fluent/core/services/field_data.py +104 -69
  40. ansys/fluent/core/services/reduction.py +55 -66
  41. ansys/fluent/core/services/solution_variables.py +9 -1
  42. ansys/fluent/core/session.py +15 -12
  43. ansys/fluent/core/session_meshing.py +3 -0
  44. ansys/fluent/core/session_solver.py +20 -43
  45. ansys/fluent/core/session_utilities.py +429 -0
  46. ansys/fluent/core/solver/flobject.py +28 -0
  47. ansys/fluent/core/utils/deprecate.py +46 -0
  48. ansys/fluent/core/utils/file_transfer_service.py +19 -3
  49. ansys/fluent/core/utils/fluent_version.py +42 -11
  50. ansys/fluent/core/variable_strategies/__init__.py +29 -0
  51. ansys/fluent/core/variable_strategies/expr.py +186 -0
  52. ansys/fluent/core/variable_strategies/field.py +186 -0
  53. ansys/fluent/core/variable_strategies/svar.py +61 -0
  54. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/METADATA +7 -5
  55. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/RECORD +57 -51
  56. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/LICENSE +0 -0
  57. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.32.dev0.dist-info}/WHEEL +0 -0
@@ -25,6 +25,9 @@
25
25
  from enum import Enum
26
26
  from functools import total_ordering
27
27
  import os
28
+ from pathlib import Path
29
+ import platform
30
+ from typing import Any
28
31
 
29
32
  import ansys.fluent.core as pyfluent
30
33
 
@@ -32,7 +35,19 @@ import ansys.fluent.core as pyfluent
32
35
  class AnsysVersionNotFound(RuntimeError):
33
36
  """Raised when Ansys version is not found."""
34
37
 
35
- pass
38
+ def __init__(self, version: Any):
39
+ """Initialize VersionNotFound.
40
+
41
+ Parameters
42
+ ----------
43
+ version : str
44
+ Version that was not found.
45
+ """
46
+ super().__init__(
47
+ f"The specified version '{version}' is not supported."
48
+ + " Supported versions are: "
49
+ + ", ".join([member.value for member in FluentVersion][::-1])
50
+ )
36
51
 
37
52
 
38
53
  class ComparisonError(RuntimeError):
@@ -74,6 +89,7 @@ class FluentVersion(Enum):
74
89
  FluentVersion.v232.awp_var == 'AWP_ROOT232'
75
90
  """
76
91
 
92
+ v261 = "26.1.0"
77
93
  v252 = "25.2.0"
78
94
  v251 = "25.1.0"
79
95
  v242 = "24.2.0"
@@ -83,7 +99,7 @@ class FluentVersion(Enum):
83
99
  v222 = "22.2.0"
84
100
 
85
101
  @classmethod
86
- def _missing_(cls, version):
102
+ def _missing_(cls, version: Any):
87
103
  if isinstance(version, (int, float, str)):
88
104
  version = str(version)
89
105
  if len(version) == 3:
@@ -92,11 +108,8 @@ class FluentVersion(Enum):
92
108
  for member in cls:
93
109
  if version == member.value:
94
110
  return member
95
- raise AnsysVersionNotFound(
96
- f"The specified version '{version[:-2]}' is not supported."
97
- + " Supported versions are: "
98
- + ", ".join([member.value for member in cls][::-1])
99
- )
111
+
112
+ raise AnsysVersionNotFound(version[:-2])
100
113
 
101
114
  @classmethod
102
115
  def get_latest_installed(cls):
@@ -110,15 +123,33 @@ class FluentVersion(Enum):
110
123
 
111
124
  Raises
112
125
  ------
113
- AnsysVersionNotFound
126
+ FileNotFoundError
114
127
  If an Ansys version cannot be found.
115
128
  """
116
129
  for member in cls:
117
- if member.awp_var in os.environ:
130
+ if member.awp_var in os.environ and member.get_fluent_exe_path().exists():
118
131
  return member
119
132
 
120
- raise AnsysVersionNotFound(
121
- "Verify the value of the 'AWP_ROOT' environment variable."
133
+ raise FileNotFoundError(
134
+ "Unable to locate a compatible Ansys Fluent installation. "
135
+ "Ensure that an environment variable like 'AWP_ROOT242' or 'AWP_ROOT251' "
136
+ "points to a supported Ansys version, and that Fluent is included in the installation."
137
+ )
138
+
139
+ def get_fluent_exe_path(self) -> Path:
140
+ """Get the path for the Fluent executable file.
141
+
142
+ Returns
143
+ -------
144
+ Path
145
+ Fluent executable path.
146
+ """
147
+ awp_root = os.environ[self.awp_var]
148
+ fluent_root = Path(awp_root) / "fluent"
149
+ return (
150
+ fluent_root / "ntbin" / "win64" / "fluent.exe"
151
+ if platform.system() == "Windows"
152
+ else fluent_root / "bin" / "fluent"
122
153
  )
123
154
 
124
155
  @classmethod
@@ -0,0 +1,29 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """
24
+ Provides ConversionStrategy classes for mapping VariableDescriptor to variable names used in Fluent.
25
+ """
26
+
27
+ from .expr import FluentExprNamingStrategy # noqa: F401
28
+ from .field import FluentFieldDataNamingStrategy # noqa: F401
29
+ from .svar import FluentSVarNamingStrategy # noqa: F401
@@ -0,0 +1,186 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """
24
+ Provides a ConversionStrategy for mapping VariableDescriptor to variable names used in Fluent expressions.
25
+ """
26
+
27
+ try:
28
+ from ansys.units.variable_descriptor import (
29
+ MappingConversionStrategy,
30
+ VariableCatalog,
31
+ )
32
+ except ModuleNotFoundError:
33
+ MappingConversionStrategy = None
34
+
35
+
36
+ if MappingConversionStrategy:
37
+
38
+ class FluentExprNamingStrategy(MappingConversionStrategy):
39
+ """This strategy handles conversion of selected VariableCatalog into Fluent's
40
+ server-side expression variable naming conventions.
41
+ """
42
+
43
+ _c = VariableCatalog
44
+
45
+ _mapping = {
46
+ # pressure
47
+ _c.PRESSURE: "StaticPressure",
48
+ _c.STATIC_PRESSURE: "StaticPressure",
49
+ _c.ABSOLUTE_PRESSURE: "AbsolutePressure",
50
+ _c.DYNAMIC_PRESSURE: "DynamicPressure",
51
+ _c.TOTAL_PRESSURE: "TotalPressure",
52
+ _c.PRESSURE_COEFFICIENT: "PressureCoefficient",
53
+ # velocity
54
+ _c.AXIAL_VELOCITY: "AxialVelocity",
55
+ _c.CONVECTIVE_COURANT_NUMBER: "ElementConvectionCourantNumber",
56
+ _c.CELL_REYNOLDS_NUMBER: "ElementReynoldsNumber",
57
+ _c.fluent.HELICITY: "Helicity",
58
+ _c.fluent.LAMBDA_2_CRITERION: "Lambda2Criterion",
59
+ _c.MESH_VELOCITY: "MeshVelocity",
60
+ _c.MESH_VELOCITY_X: "MeshVelocity.x",
61
+ _c.MESH_VELOCITY_Y: "MeshVelocity.y",
62
+ _c.MESH_VELOCITY_Z: "MeshVelocity.z",
63
+ _c.MESH_VELOCITY_MAGNITUDE: "MeshVelocityMagnitude",
64
+ _c.NORMALIZED_Q_CRITERION: "QCriterionNormalized",
65
+ _c.Q_CRITERION: "QCriterionRaw",
66
+ _c.RADIAL_VELOCITY: "RadialVelocity",
67
+ _c.TANGENTIAL_VELOCITY: "TangentialVelocity",
68
+ _c.VELOCITY: "Velocity",
69
+ _c.VELOCITY_X: "Velocity.x",
70
+ _c.VELOCITY_Y: "Velocity.y",
71
+ _c.VELOCITY_Z: "Velocity.z",
72
+ _c.VELOCITY_MAGNITUDE: "VelocityMagnitude",
73
+ _c.fluent.VELOCITY_ANGLE: "VelocityAngle",
74
+ _c.VORTICITY: "Vorticity",
75
+ _c.VORTICITY_X: "Vorticity.x",
76
+ _c.VORTICITY_Y: "Vorticity.y",
77
+ _c.VORTICITY_Z: "Vorticity.z",
78
+ _c.VORTICITY_MAGNITUDE: "VorticityMagnitude",
79
+ # density
80
+ _c.DENSITY: "Density",
81
+ _c.fluent.DENSITY_ALL: "DensityAll",
82
+ # "properties"
83
+ _c.DYNAMIC_VISCOSITY: "DynamicViscosity",
84
+ _c.PRANDTL_NUMBER: "PrandtlNumber",
85
+ _c.SPECIFIC_HEAT_CAPACITY: "SpecificHeatCapacity",
86
+ _c.THERMAL_CONDUCTIVITY: "ThermalConductivity",
87
+ # turbulence
88
+ _c.EFFECTIVE_PRANDTL_NUMBER: "EffectivePrandtlNumber",
89
+ _c.EFFECTIVE_THERMAL_CONDUCTIVITY: "EffectiveThermalConductivity",
90
+ _c.EFFECTIVE_VISCOSITY: "EffectiveViscosity",
91
+ _c.PRODUCTION_OF_TURBULENT_KINETIC_ENERGY: "Productionofk",
92
+ _c.SPECIFIC_DISSIPATION_RATE: "SpecificDissipationRateOmega",
93
+ _c.TURBULENT_DISSIPATION_RATE: "TurbulenceDissipationRate",
94
+ _c.TURBULENT_INTENSITY: "TurbulenceIntensity",
95
+ _c.TURBULENT_VISCOSITY: "TurbulenceViscosity",
96
+ _c.TURBULENT_VISCOSITY_RATIO: "TurbulenceViscosityRatio",
97
+ _c.TURBULENT_KINETIC_ENERGY: "TurbulentKineticEnergyk",
98
+ _c.TURBULENT_REYNOLDS_NUMBER: "TurbulentReynoldsNumberRe_y",
99
+ _c.WALL_Y_PLUS: "WallYplus",
100
+ _c.WALL_Y_STAR: "WallYstar",
101
+ # wall fluxes
102
+ _c.SURFACE_HEAT_TRANSFER_COEFFICIENT: "HeatTransferCoefficient",
103
+ _c.SKIN_FRICTION_COEFFICIENT: "SkinFrictionCoefficient",
104
+ _c.SURFACE_HEAT_FLUX: "SurfaceHeatFlux",
105
+ _c.SURFACE_HEAT_TRANSFER_COEFFICIENT: "SurfaceHeatTransferCoefficient",
106
+ _c.SURFACE_NUSSELT_NUMBER: "SurfaceNusseltNumber",
107
+ _c.SURFACE_STANTON_NUMBER: "SurfaceStantonNumber",
108
+ _c.WALL_ADJACENT_HEAT_TRANSFER_COEFFICIENT: "WallAdjacentHeatTransferCoef",
109
+ _c.WALL_SHEAR_STRESS: "WallShearStressVector",
110
+ _c.WALL_SHEAR_STRESS_X: "WallShearStressVector.x",
111
+ _c.WALL_SHEAR_STRESS_Y: "WallShearStressVector.y",
112
+ _c.WALL_SHEAR_STRESS_Z: "WallShearStressVector.z",
113
+ _c.WALL_SHEAR_STRESS_MAGNITUDE: "WallShearStressVector.mag",
114
+ _c.fluent.Y_PLUS_BASED_HEAT_TRANSFER_COEFFICIENT: "YplusBasedHeatTranCoef",
115
+ # residuals
116
+ _c.fluent.MASS_IMBALANCE: "MassImbalance",
117
+ # derivatives
118
+ _c.fluent.PRESSURE_HESSIAN_INDICATOR: "PressureHessianIndicator",
119
+ _c.STRAIN_RATE: "StrainRate",
120
+ _c.fluent.DVELOCITY_DX: "dVelocitydx",
121
+ _c.fluent.DVELOCITY_DX_X: "dVelocitydx.x",
122
+ _c.fluent.DVELOCITY_DX_Y: "dVelocitydx.y",
123
+ _c.fluent.DVELOCITY_DX_Z: "dVelocitydx.z",
124
+ _c.fluent.DVELOCITY_DX_MAGNITUDE: "dVelocitydx.mag",
125
+ _c.fluent.DVELOCITY_DY: "dVelocitydy",
126
+ _c.fluent.DVELOCITY_DY_X: "dVelocitydy.x",
127
+ _c.fluent.DVELOCITY_DY_Y: "dVelocitydy.y",
128
+ _c.fluent.DVELOCITY_DY_Z: "dVelocitydy.z",
129
+ _c.fluent.DVELOCITY_DY_MAGNITUDE: "dVelocitydy.mag",
130
+ _c.fluent.DVELOCITY_DZ: "dVelocitydz",
131
+ _c.fluent.DVELOCITY_DZ_X: "dVelocitydz.x",
132
+ _c.fluent.DVELOCITY_DZ_Y: "dVelocitydz.y",
133
+ _c.fluent.DVELOCITY_DZ_Z: "dVelocitydz.z",
134
+ _c.fluent.DVELOCITY_DZ_MAGNITUDE: "dVelocitydz.mag",
135
+ # temperature
136
+ _c.SPECIFIC_ENTHALPY: "SpecificEnthalpy",
137
+ _c.SPECIFIC_ENTROPY: "SpecificEntropy",
138
+ _c.SPECIFIC_INTERNAL_ENERGY: "SpecificInternalEnergy",
139
+ _c.SPECIFIC_TOTAL_ENERGY: "SpecificTotalEnergy",
140
+ _c.TEMPERATURE: "StaticTemperature",
141
+ _c.SPECIFIC_TOTAL_ENTHALPY: "SpecificTotalEnthalpy",
142
+ _c.fluent.TOTAL_ENTHALPY_DEVIATION: "TotalEnthalpyDeviation",
143
+ _c.TOTAL_TEMPERATURE: "TotalTemperature",
144
+ _c.WALL_ADJACENT_TEMPERATURE: "WallAdjacentTemperature",
145
+ _c.WALL_TEMPERATURE: "WallTemperature",
146
+ _c.WALL_TEMPERATURE_THIN: "WallTemperatureThin",
147
+ _c.fluent.Y_PLUS_BASED_HEAT_TRANSFER_COEFFICIENT: "YplusBasedHeatTranRefTemperature",
148
+ # mesh
149
+ _c.mesh.ANISOTROPIC_ADAPTION_CELLS: "AnisotropicAdaptionCells",
150
+ _c.mesh.BOUNDARY_CELL_DISTANCE: "BoundaryCellDistance",
151
+ _c.mesh.BOUNDARY_LAYER_CELLS: "BoundaryLayerCells",
152
+ _c.mesh.BOUNDARY_NORMAL_DISTANCE: "BoundaryNormalDistance",
153
+ _c.mesh.BOUNDARY_VOLUME_DISTANCE: "BoundaryVolumeDistance",
154
+ _c.mesh.CELL_EQUIANGLE_SKEW: "CellEquiangleSkew",
155
+ _c.mesh.CELL_EQUIVOLUME_SKEW: "CellEquivolumeSkew",
156
+ _c.mesh.CELL_PARENT_INDEX: "CellParentIndex",
157
+ _c.mesh.CELL_REFINE_LEVEL: "CellRefineLevel",
158
+ _c.mesh.CELL_VOLUME: "CellVolume",
159
+ _c.mesh.CELL_VOLUME_CHANGE: "CellVolumeChange",
160
+ _c.mesh.ELEMENT_ASPECT_RATIO: "ElementAspectRatio",
161
+ _c.mesh.ELEMENT_WALL_DISTANCE: "ElementWallDistance",
162
+ _c.mesh.FACE_AREA_MAGNITUDE: "FaceAreaMagnitude",
163
+ _c.mesh.FACE_HANDEDNESS: "FaceHandedness",
164
+ _c.mesh.INTERFACE_OVERLAP_FRACTION: "InterfaceOverlapFraction",
165
+ _c.mesh.MARK_POOR_ELEMENTS: "MarkPoorElements",
166
+ _c.POSITION: "Position",
167
+ _c.POSITION_X: "Position.x",
168
+ _c.POSITION_Y: "Position.y",
169
+ _c.POSITION_Z: "Position.z",
170
+ _c.POSITION_MAGNITUDE: "Position.mag",
171
+ _c.mesh.SMOOTHED_CELL_REFINE_LEVEL: "SmoothedCellRefineLevel",
172
+ _c.mesh.X_FACE_AREA: "XFaceArea",
173
+ _c.mesh.Y_FACE_AREA: "YFaceArea",
174
+ _c.mesh.Z_FACE_AREA: "ZFaceArea",
175
+ _c.mesh.ACTIVE_CELL_PARTITION: "ActiveElementPartition",
176
+ _c.mesh.CELL_ELEMENT_TYPE: "CellElementType",
177
+ _c.mesh.CELL_ID: "CellId",
178
+ _c.mesh.CELL_WEIGHT: "CellWeight",
179
+ _c.mesh.CELL_ZONE_INDEX: "CellZoneIndex",
180
+ _c.mesh.CELL_ZONE_TYPE: "CellZoneType",
181
+ _c.mesh.PARTITION_NEIGHBOURS: "PartitionNeighbors",
182
+ _c.mesh.STORED_CELL_PARTITIION: "StoredElementPartition",
183
+ }
184
+
185
+ else:
186
+ FluentExprNamingStrategy = None
@@ -0,0 +1,186 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """
24
+ Provides a ConversionStrategy for mapping VariableDescriptor to names used in Fluent's field data API.
25
+ """
26
+
27
+ try:
28
+ from ansys.units.variable_descriptor import (
29
+ MappingConversionStrategy,
30
+ VariableCatalog,
31
+ )
32
+ except ModuleNotFoundError:
33
+ MappingConversionStrategy = None
34
+
35
+
36
+ if MappingConversionStrategy:
37
+
38
+ class FluentFieldDataNamingStrategy(MappingConversionStrategy):
39
+ """This strategy handles conversion of selected
40
+ VariableCatalog into Fluent's server-side field variable naming conventions.
41
+ """
42
+
43
+ _c = VariableCatalog
44
+
45
+ _mapping = {
46
+ # pressure
47
+ _c.PRESSURE: "pressure",
48
+ _c.STATIC_PRESSURE: "pressure",
49
+ _c.ABSOLUTE_PRESSURE: "absolute-pressure",
50
+ _c.DYNAMIC_PRESSURE: "dynamic-pressure",
51
+ _c.TOTAL_PRESSURE: "total-pressure",
52
+ _c.PRESSURE_COEFFICIENT: "pressure-coefficient",
53
+ # velocity
54
+ _c.AXIAL_VELOCITY: "axial-velocity",
55
+ _c.CONVECTIVE_COURANT_NUMBER: "cell-convective-courant-number",
56
+ _c.CELL_REYNOLDS_NUMBER: "cell-reynolds-number",
57
+ _c.fluent.HELICITY: "helicity",
58
+ _c.fluent.LAMBDA_2_CRITERION: "raw-q-criterion", # ???
59
+ _c.MESH_VELOCITY: "mesh-velocity", # ?
60
+ _c.MESH_VELOCITY_X: "mesh-x-velocity", # TODO
61
+ _c.MESH_VELOCITY_Y: "mesh-y-velocity", # TODO
62
+ _c.MESH_VELOCITY_Z: "mesh-z-velocity", # TODO
63
+ _c.MESH_VELOCITY_MAGNITUDE: "MeshVelocityMagnitude", # TODO
64
+ _c.NORMALIZED_Q_CRITERION: "q-criterion",
65
+ _c.Q_CRITERION: "raw-q-criterion",
66
+ _c.RADIAL_VELOCITY: "radial-velocity",
67
+ _c.TANGENTIAL_VELOCITY: "tangential-velocity",
68
+ _c.VELOCITY: "velocity",
69
+ _c.VELOCITY_X: "x-velocity",
70
+ _c.VELOCITY_Y: "y-velocity",
71
+ _c.VELOCITY_Z: "z-velocity",
72
+ _c.VELOCITY_MAGNITUDE: "velocity-magnitude",
73
+ _c.fluent.VELOCITY_ANGLE: "xxx", # eliminate altogether
74
+ _c.VORTICITY: "vorticity",
75
+ _c.VORTICITY_X: "x-vorticity",
76
+ _c.VORTICITY_Y: "y-vorticity",
77
+ _c.VORTICITY_Z: "z-vorticity",
78
+ _c.VORTICITY_MAGNITUDE: "vorticity-mag",
79
+ # density
80
+ _c.DENSITY: "density",
81
+ _c.fluent.DENSITY_ALL: "density-all",
82
+ # "properties"
83
+ _c.DYNAMIC_VISCOSITY: "viscosity-lam",
84
+ _c.PRANDTL_NUMBER: "prandtl-number-lam",
85
+ _c.SPECIFIC_HEAT_CAPACITY: "specific-heat-cp",
86
+ _c.THERMAL_CONDUCTIVITY: "thermal-conductivity",
87
+ # turbulence
88
+ _c.EFFECTIVE_PRANDTL_NUMBER: "prandtl-number-eff",
89
+ _c.EFFECTIVE_THERMAL_CONDUCTIVITY: "thermal-conductivity-eff",
90
+ _c.EFFECTIVE_VISCOSITY: "viscosity-eff",
91
+ _c.PRODUCTION_OF_TURBULENT_KINETIC_ENERGY: "production-of-k",
92
+ _c.SPECIFIC_DISSIPATION_RATE: "specific-diss-rate",
93
+ _c.TURBULENT_DISSIPATION_RATE: "turb-diss-rate",
94
+ _c.TURBULENT_INTENSITY: "turb-intensity",
95
+ _c.TURBULENT_VISCOSITY: "viscosity-turb",
96
+ _c.TURBULENT_VISCOSITY_RATIO: "viscosity-ratio",
97
+ _c.TURBULENT_KINETIC_ENERGY: "turb-kinetic-energy",
98
+ _c.TURBULENT_REYNOLDS_NUMBER: "turb-reynolds-number-rey",
99
+ _c.WALL_Y_PLUS: "y-plus",
100
+ _c.WALL_Y_STAR: "y-star",
101
+ # wall fluxes
102
+ _c.SURFACE_HEAT_TRANSFER_COEFFICIENT: "heat-transfer-coef",
103
+ _c.SKIN_FRICTION_COEFFICIENT: "skin-friction-coef",
104
+ _c.SURFACE_HEAT_FLUX: "heat-flux",
105
+ _c.SURFACE_HEAT_TRANSFER_COEFFICIENT: "heat-transfer-coef-wall",
106
+ _c.SURFACE_NUSSELT_NUMBER: "nusselt-number",
107
+ _c.SURFACE_STANTON_NUMBER: "stanton-number",
108
+ _c.WALL_ADJACENT_HEAT_TRANSFER_COEFFICIENT: "heat-transfer-coef-wall-adj",
109
+ _c.WALL_SHEAR_STRESS: "wall-shear",
110
+ _c.WALL_SHEAR_STRESS_X: "x-wall-shear",
111
+ _c.WALL_SHEAR_STRESS_Y: "y-wall-shear",
112
+ _c.WALL_SHEAR_STRESS_Z: "z-wall-shear",
113
+ # _c.WALL_SHEAR_STRESS_MAGNITUDE: "WallShearStressVector.mag",
114
+ _c.fluent.Y_PLUS_BASED_HEAT_TRANSFER_COEFFICIENT: "heat-transfer-coef-yplus",
115
+ # residuals
116
+ _c.fluent.MASS_IMBALANCE: "mass-imbalance",
117
+ # derivatives
118
+ _c.fluent.PRESSURE_HESSIAN_INDICATOR: "pressure-hessian-indicator",
119
+ _c.STRAIN_RATE: "strain-rate-mag",
120
+ # _c.fluent.DVELOCITY_DX: "dVelocitydx",
121
+ _c.fluent.DVELOCITY_DX_X: "dx-velocity-dx",
122
+ _c.fluent.DVELOCITY_DX_Y: "dy-velocity-dx",
123
+ _c.fluent.DVELOCITY_DX_Z: "dz-velocity-dx",
124
+ # _c.fluent.DVELOCITY_DX_MAGNITUDE: "dVelocitydx.mag",
125
+ # _c.fluent.DVELOCITY_DY: "dVelocitydy",
126
+ _c.fluent.DVELOCITY_DY_X: "dx-velocity-dy",
127
+ _c.fluent.DVELOCITY_DY_Y: "dy-velocity-dy",
128
+ _c.fluent.DVELOCITY_DY_Z: "dz-velocity-dy",
129
+ # _c.fluent.DVELOCITY_DY_MAGNITUDE: "dVelocitydy.mag",
130
+ # _c.fluent.DVELOCITY_DZ: "dVelocitydz",
131
+ _c.fluent.DVELOCITY_DZ_X: "dx-velocity-dz",
132
+ _c.fluent.DVELOCITY_DZ_Y: "dy-velocity-dz",
133
+ _c.fluent.DVELOCITY_DZ_Z: "dz-velocity-dz",
134
+ # _c.fluent.DVELOCITY_DZ_MAGNITUDE: "dVelocitydz.mag",
135
+ # temperature
136
+ _c.SPECIFIC_ENTHALPY: "enthalpy",
137
+ _c.SPECIFIC_ENTROPY: "entropy",
138
+ _c.SPECIFIC_INTERNAL_ENERGY: "internal-energy",
139
+ _c.SPECIFIC_TOTAL_ENERGY: "total-energy",
140
+ _c.TEMPERATURE: "temperature",
141
+ _c.SPECIFIC_TOTAL_ENTHALPY: "total-enthalpy",
142
+ _c.fluent.TOTAL_ENTHALPY_DEVIATION: "total-enthalpy-deviation",
143
+ _c.TOTAL_TEMPERATURE: "total-temperature",
144
+ _c.WALL_ADJACENT_TEMPERATURE: "wall-adjacent-temperature",
145
+ _c.WALL_TEMPERATURE: "wall-temperature",
146
+ _c.WALL_TEMPERATURE_THIN: "wall-temp-thin",
147
+ _c.fluent.Y_PLUS_BASED_HEAT_TRANSFER_COEFFICIENT: "reference-temperature-at-y+",
148
+ # mesh
149
+ _c.mesh.ANISOTROPIC_ADAPTION_CELLS: "anisotropic-adaption-cells",
150
+ _c.mesh.BOUNDARY_CELL_DISTANCE: "boundary-cell-dist",
151
+ _c.mesh.BOUNDARY_LAYER_CELLS: "boundary-layer-cells",
152
+ _c.mesh.BOUNDARY_NORMAL_DISTANCE: "boundary-normal-dist",
153
+ _c.mesh.BOUNDARY_VOLUME_DISTANCE: "boundary-volume-dist",
154
+ _c.mesh.CELL_EQUIANGLE_SKEW: "cell-equiangle-skew",
155
+ _c.mesh.CELL_EQUIVOLUME_SKEW: "cell-equivolume-skew",
156
+ _c.mesh.CELL_PARENT_INDEX: "cell-parent-index",
157
+ _c.mesh.CELL_REFINE_LEVEL: "cell-refine-level",
158
+ _c.mesh.CELL_VOLUME: "cell-volume",
159
+ _c.mesh.CELL_VOLUME_CHANGE: "cell-volume-change",
160
+ _c.mesh.ELEMENT_ASPECT_RATIO: "aspect-ratio",
161
+ _c.mesh.ELEMENT_WALL_DISTANCE: "cell-wall-distance",
162
+ _c.mesh.FACE_AREA_MAGNITUDE: "face-area-magnitude",
163
+ _c.mesh.FACE_HANDEDNESS: "face-handedness",
164
+ _c.mesh.INTERFACE_OVERLAP_FRACTION: "interface-overlap-fraction",
165
+ _c.mesh.MARK_POOR_ELEMENTS: "mark-poor-elements",
166
+ # _c.POSITION: "Position", ???
167
+ _c.POSITION_X: "x-coordinate",
168
+ _c.POSITION_Y: "y-coordinate",
169
+ _c.POSITION_Z: "z-coordinate",
170
+ # _c.POSITION_MAGNITUDE: "Position.mag", ???
171
+ _c.mesh.SMOOTHED_CELL_REFINE_LEVEL: "smoothed-cell-refine-level",
172
+ _c.mesh.X_FACE_AREA: "x-face-area",
173
+ _c.mesh.Y_FACE_AREA: "y-face-area",
174
+ _c.mesh.Z_FACE_AREA: "z-face-area",
175
+ _c.mesh.ACTIVE_CELL_PARTITION: "cell-partition-active",
176
+ _c.mesh.CELL_ELEMENT_TYPE: "cell-element-type",
177
+ _c.mesh.CELL_ID: "cell-id",
178
+ _c.mesh.CELL_WEIGHT: "cell-weight",
179
+ _c.mesh.CELL_ZONE_INDEX: "cell-zone",
180
+ _c.mesh.CELL_ZONE_TYPE: "cell-type",
181
+ _c.mesh.PARTITION_NEIGHBOURS: "partition-neighbors",
182
+ _c.mesh.STORED_CELL_PARTITIION: "cell-partition-stored",
183
+ }
184
+
185
+ else:
186
+ FluentFieldDataNamingStrategy = None
@@ -0,0 +1,61 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """
24
+ Provides a ConversionStrategy for mapping VariableDescriptor to Fluent's SVAR names.
25
+ """
26
+
27
+ try:
28
+ from ansys.units.variable_descriptor import (
29
+ MappingConversionStrategy,
30
+ VariableCatalog,
31
+ )
32
+ except ModuleNotFoundError:
33
+ MappingConversionStrategy = None
34
+
35
+
36
+ if MappingConversionStrategy:
37
+
38
+ class FluentSVarNamingStrategy(MappingConversionStrategy):
39
+ """This strategy handles conversion of selected VariableCatalog into Fluent's
40
+ server-side field variable naming conventions (e.g., "SV_P" for pressure).
41
+ """
42
+
43
+ _c = VariableCatalog
44
+
45
+ _mapping = {
46
+ # pressure
47
+ _c.PRESSURE: "SV_P",
48
+ _c.STATIC_PRESSURE: "SV_P",
49
+ # velocity
50
+ _c.VELOCITY_X: "SV_U",
51
+ _c.VELOCITY_Y: "SV_V",
52
+ _c.VELOCITY_Z: "SV_W",
53
+ # density
54
+ _c.DENSITY: "SV_DENSITY",
55
+ # temperature
56
+ _c.SPECIFIC_ENTHALPY: "SV_H",
57
+ _c.TEMPERATURE: "SV_T",
58
+ }
59
+
60
+ else:
61
+ FluentSVarNamingStrategy = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ansys-fluent-core
3
- Version: 0.31.dev1
3
+ Version: 0.32.dev0
4
4
  Summary: PyFluent provides Pythonic access to Ansys Fluent.
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
@@ -13,8 +13,9 @@ Classifier: Operating System :: OS Independent
13
13
  Requires-Dist: ansys-api-fluent>=0.3.35
14
14
  Requires-Dist: ansys-platform-instancemanagement~=1.1
15
15
  Requires-Dist: ansys-tools-filetransfer>=0.1,<0.3
16
- Requires-Dist: ansys-units>=0.4.0,<1.0
16
+ Requires-Dist: ansys-units>=0.6.dev1,<1.0
17
17
  Requires-Dist: defusedxml>=0.7.1
18
+ Requires-Dist: deprecated>=1.2.18
18
19
  Requires-Dist: docker>=7.1.0
19
20
  Requires-Dist: grpcio>=1.30.0
20
21
  Requires-Dist: grpcio-health-checking>=1.30.0
@@ -40,19 +41,20 @@ Requires-Dist: sphinxcontrib-websupport==2.0.0 ; extra == "docs"
40
41
  Requires-Dist: sphinxemoji==0.3.1 ; extra == "docs"
41
42
  Requires-Dist: sphinx-toggleprompt==0.6.0 ; extra == "docs"
42
43
  Requires-Dist: autodocsumm==0.2.14 ; extra == "docs"
43
- Requires-Dist: beautifulsoup4==4.13.3 ; extra == "docs"
44
+ Requires-Dist: beautifulsoup4==4.13.4 ; extra == "docs"
44
45
  Requires-Dist: openpyxl>=3.1.5 ; extra == "docs"
45
46
  Requires-Dist: plotly>=5.22.0 ; extra == "docs"
46
47
  Requires-Dist: python-pptx>=0.6.23 ; extra == "docs"
47
- Requires-Dist: quarto-cli==1.6.42 ; extra == "docs"
48
+ Requires-Dist: quarto-cli==1.7.29 ; extra == "docs"
48
49
  Requires-Dist: pdf2image==1.17.0 ; extra == "docs"
49
50
  Requires-Dist: seaborn>=0.13.2 ; extra == "docs"
50
51
  Requires-Dist: tensorflow>=2.17.0 ; extra == "docs"
51
52
  Requires-Dist: h5py==3.13.0 ; extra == "reader"
52
53
  Requires-Dist: pytest==8.3.5 ; extra == "tests"
53
- Requires-Dist: pytest-cov==6.1.0 ; extra == "tests"
54
+ Requires-Dist: pytest-cov==6.1.1 ; extra == "tests"
54
55
  Requires-Dist: pytest-mock==3.14.0 ; extra == "tests"
55
56
  Requires-Dist: pytest-xdist==3.6.1 ; extra == "tests"
57
+ Requires-Dist: pyfakefs==5.8.0 ; extra == "tests"
56
58
  Project-URL: Documentation, https://fluent.docs.pyansys.com/
57
59
  Project-URL: Source, https://github.com/ansys/pyfluent
58
60
  Project-URL: Tracker, https://github.com/ansys/pyfluent/issues