ansys-fluent-core 0.33.0__py3-none-any.whl → 0.34.0__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 +3 -3
- ansys/fluent/core/codegen/builtin_settingsgen.py +25 -19
- ansys/fluent/core/codegen/settingsgen.py +17 -5
- ansys/fluent/core/codegen/tuigen.py +2 -1
- ansys/fluent/core/docker/docker_compose.py +4 -1
- ansys/fluent/core/docker/utils.py +35 -0
- ansys/fluent/core/exceptions.py +13 -1
- ansys/fluent/core/field_data_interfaces.py +239 -38
- ansys/fluent/core/file_session.py +139 -59
- ansys/fluent/core/fluent_connection.py +23 -16
- ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
- ansys/fluent/core/generated/datamodel_231/flicing.py +30 -30
- ansys/fluent/core/generated/datamodel_231/meshing.py +171 -171
- ansys/fluent/core/generated/datamodel_232/flicing.py +35 -35
- ansys/fluent/core/generated/datamodel_232/meshing.py +223 -223
- ansys/fluent/core/generated/datamodel_241/flicing.py +35 -35
- ansys/fluent/core/generated/datamodel_241/meshing.py +264 -264
- ansys/fluent/core/generated/datamodel_242/flicing.py +30 -30
- ansys/fluent/core/generated/datamodel_242/meshing.py +369 -369
- ansys/fluent/core/generated/datamodel_251/flicing.py +35 -35
- ansys/fluent/core/generated/datamodel_251/meshing.py +331 -331
- ansys/fluent/core/generated/datamodel_251/part_management.py +3 -3
- ansys/fluent/core/generated/datamodel_252/flicing.py +50 -50
- ansys/fluent/core/generated/datamodel_252/meshing.py +398 -398
- ansys/fluent/core/generated/datamodel_252/part_management.py +5 -5
- ansys/fluent/core/generated/datamodel_261/flicing.py +40 -40
- ansys/fluent/core/generated/datamodel_261/meshing.py +416 -397
- ansys/fluent/core/generated/datamodel_261/part_management.py +10 -10
- ansys/fluent/core/generated/datamodel_261/preferences.py +7 -0
- ansys/fluent/core/generated/fluent_version_261.py +3 -3
- ansys/fluent/core/generated/meshing/tui_261.py +1186 -1180
- ansys/fluent/core/generated/solver/settings_231.py +1 -0
- ansys/fluent/core/generated/solver/settings_231.pyi +3025 -1
- ansys/fluent/core/generated/solver/settings_232.py +1 -0
- ansys/fluent/core/generated/solver/settings_232.pyi +3425 -1
- ansys/fluent/core/generated/solver/settings_241.py +1 -0
- ansys/fluent/core/generated/solver/settings_241.pyi +4423 -1
- ansys/fluent/core/generated/solver/settings_242.py +1 -0
- ansys/fluent/core/generated/solver/settings_242.pyi +5474 -1
- ansys/fluent/core/generated/solver/settings_251.py +11 -0
- ansys/fluent/core/generated/solver/settings_251.pyi +6006 -1
- ansys/fluent/core/generated/solver/settings_252.py +11 -1
- ansys/fluent/core/generated/solver/settings_252.pyi +6782 -2
- ansys/fluent/core/generated/solver/settings_261.py +5592 -2740
- ansys/fluent/core/generated/solver/settings_261.pyi +10335 -1994
- ansys/fluent/core/generated/solver/settings_builtin.py +56 -22
- ansys/fluent/core/generated/solver/settings_builtin.pyi +22 -0
- ansys/fluent/core/generated/solver/tui_261.py +2445 -2281
- ansys/fluent/core/launcher/container_launcher.py +6 -2
- ansys/fluent/core/launcher/error_handler.py +1 -1
- ansys/fluent/core/launcher/fluent_container.py +53 -10
- ansys/fluent/core/launcher/launcher.py +3 -0
- ansys/fluent/core/launcher/watchdog.py +6 -6
- ansys/fluent/core/launcher/watchdog_exec +1 -1
- ansys/fluent/core/pyfluent_warnings.py +7 -1
- ansys/fluent/core/report.py +2 -0
- ansys/fluent/core/search.py +11 -3
- ansys/fluent/core/services/__init__.py +2 -2
- ansys/fluent/core/services/app_utilities.py +39 -0
- ansys/fluent/core/services/deprecated_field_data.py +4 -4
- ansys/fluent/core/services/field_data.py +158 -41
- ansys/fluent/core/services/reduction.py +16 -5
- ansys/fluent/core/services/settings.py +1 -0
- ansys/fluent/core/session.py +16 -1
- ansys/fluent/core/session_pure_meshing.py +5 -5
- ansys/fluent/core/session_pure_meshing.pyi +1 -0
- ansys/fluent/core/session_solver.py +33 -8
- ansys/fluent/core/session_solver.pyi +1 -0
- ansys/fluent/core/solver/error_message.py +2 -2
- ansys/fluent/core/solver/flobject.py +187 -120
- ansys/fluent/core/solver/function/reduction.py +37 -9
- ansys/fluent/core/solver/settings_builtin_data.py +5 -3
- ansys/fluent/core/utils/fluent_version.py +1 -3
- ansys/fluent/core/utils/networking.py +18 -8
- {ansys_fluent_core-0.33.0.dist-info → ansys_fluent_core-0.34.0.dist-info}/METADATA +10 -11
- {ansys_fluent_core-0.33.0.dist-info → ansys_fluent_core-0.34.0.dist-info}/RECORD +78 -77
- {ansys_fluent_core-0.33.0.dist-info → ansys_fluent_core-0.34.0.dist-info}/WHEEL +1 -1
- {ansys_fluent_core-0.33.0.dist-info/licenses → ansys_fluent_core-0.34.0.dist-info}/LICENSE +0 -0
|
@@ -25,14 +25,15 @@
|
|
|
25
25
|
from typing import Dict, List
|
|
26
26
|
import warnings
|
|
27
27
|
|
|
28
|
+
from deprecated.sphinx import deprecated
|
|
28
29
|
import numpy as np
|
|
29
30
|
|
|
30
31
|
from ansys.api.fluent.v0.field_data_pb2 import DataLocation
|
|
31
32
|
from ansys.fluent.core import PyFluentDeprecationWarning
|
|
32
33
|
from ansys.fluent.core.field_data_interfaces import (
|
|
33
34
|
BaseFieldInfo,
|
|
35
|
+
FieldBatch,
|
|
34
36
|
FieldDataSource,
|
|
35
|
-
FieldTransaction,
|
|
36
37
|
PathlinesFieldDataRequest,
|
|
37
38
|
ScalarFieldDataRequest,
|
|
38
39
|
SurfaceDataType,
|
|
@@ -41,6 +42,11 @@ from ansys.fluent.core.field_data_interfaces import (
|
|
|
41
42
|
_AllowedScalarFieldNames,
|
|
42
43
|
_AllowedSurfaceNames,
|
|
43
44
|
_ReturnFieldData,
|
|
45
|
+
_ScalarFields,
|
|
46
|
+
_SurfaceIds,
|
|
47
|
+
_SurfaceNames,
|
|
48
|
+
_transform_faces_connectivity_data,
|
|
49
|
+
_VectorFields,
|
|
44
50
|
)
|
|
45
51
|
from ansys.fluent.core.filereader.case_file import CaseFile
|
|
46
52
|
from ansys.fluent.core.filereader.data_file import (
|
|
@@ -81,8 +87,8 @@ def _data_type_convertor(args_dict):
|
|
|
81
87
|
return args_dict
|
|
82
88
|
|
|
83
89
|
|
|
84
|
-
class
|
|
85
|
-
"""Provides access to Fluent field data on surfaces collected via
|
|
90
|
+
class BatchFieldData:
|
|
91
|
+
"""Provides access to Fluent field data on surfaces collected via batches."""
|
|
86
92
|
|
|
87
93
|
def __init__(
|
|
88
94
|
self,
|
|
@@ -91,7 +97,7 @@ class TransactionFieldData:
|
|
|
91
97
|
allowed_surface_names,
|
|
92
98
|
allowed_scalar_field_names,
|
|
93
99
|
):
|
|
94
|
-
"""__init__ method of
|
|
100
|
+
"""__init__ method of BatchFieldData class."""
|
|
95
101
|
self.data = data
|
|
96
102
|
self._field_info = field_info
|
|
97
103
|
self._allowed_surface_names = allowed_surface_names
|
|
@@ -133,6 +139,7 @@ class TransactionFieldData:
|
|
|
133
139
|
kwargs.get("surfaces"),
|
|
134
140
|
self.get_surface_ids(kwargs.get("surfaces")),
|
|
135
141
|
surface_data,
|
|
142
|
+
flatten_connectivity=kwargs.get("flatten_connectivity"),
|
|
136
143
|
)
|
|
137
144
|
|
|
138
145
|
def _get_vector_field_data(
|
|
@@ -196,7 +203,7 @@ class TransactionFieldData:
|
|
|
196
203
|
return self.data
|
|
197
204
|
|
|
198
205
|
|
|
199
|
-
class
|
|
206
|
+
class Batch(FieldBatch):
|
|
200
207
|
"""Populates field data on surfaces."""
|
|
201
208
|
|
|
202
209
|
class _SurfaceTransaction:
|
|
@@ -218,10 +225,10 @@ class Transaction(FieldTransaction):
|
|
|
218
225
|
self.surface_ids = surface_ids
|
|
219
226
|
|
|
220
227
|
def __init__(self, file_session, field_info):
|
|
221
|
-
"""__init__ method of
|
|
222
|
-
self.
|
|
223
|
-
self.
|
|
224
|
-
self.
|
|
228
|
+
"""__init__ method of Batch class."""
|
|
229
|
+
self._surface_batches = []
|
|
230
|
+
self._scalar_field_batches = []
|
|
231
|
+
self._vector_field_batches = []
|
|
225
232
|
self._file_session = file_session
|
|
226
233
|
self._field_info = field_info
|
|
227
234
|
self._cache_requests = []
|
|
@@ -287,10 +294,8 @@ class Transaction(FieldTransaction):
|
|
|
287
294
|
provide_vertices = SurfaceDataType.Vertices in data_types
|
|
288
295
|
provide_faces = SurfaceDataType.FacesConnectivity in data_types
|
|
289
296
|
for surface_id in self.get_surface_ids(surfaces):
|
|
290
|
-
self.
|
|
291
|
-
|
|
292
|
-
surface_id, provide_vertices, provide_faces
|
|
293
|
-
)
|
|
297
|
+
self._surface_batches.append(
|
|
298
|
+
Batch._SurfaceTransaction(surface_id, provide_vertices, provide_faces)
|
|
294
299
|
)
|
|
295
300
|
|
|
296
301
|
@all_deprecators(
|
|
@@ -360,14 +365,14 @@ class Transaction(FieldTransaction):
|
|
|
360
365
|
if len(self._file_session._data_file.get_phases()) > 1:
|
|
361
366
|
if not field_name.startswith("phase-"):
|
|
362
367
|
raise InvalidMultiPhaseFieldName()
|
|
363
|
-
self.
|
|
364
|
-
|
|
368
|
+
self._scalar_field_batches.append(
|
|
369
|
+
Batch._ScalarFieldTransaction(
|
|
365
370
|
field_name, surface_ids, field_name.split(":")[0]
|
|
366
371
|
)
|
|
367
372
|
)
|
|
368
373
|
else:
|
|
369
|
-
self.
|
|
370
|
-
|
|
374
|
+
self._scalar_field_batches.append(
|
|
375
|
+
Batch._ScalarFieldTransaction(field_name, surface_ids)
|
|
371
376
|
)
|
|
372
377
|
|
|
373
378
|
@all_deprecators(
|
|
@@ -422,14 +427,14 @@ class Transaction(FieldTransaction):
|
|
|
422
427
|
if len(self._file_session._data_file.get_phases()) > 1:
|
|
423
428
|
if not field_name.startswith("phase-"):
|
|
424
429
|
raise InvalidMultiPhaseFieldName()
|
|
425
|
-
self.
|
|
426
|
-
|
|
430
|
+
self._vector_field_batches.append(
|
|
431
|
+
Batch._VectorFieldTransaction(
|
|
427
432
|
field_name, surface_ids, field_name.split(":")[0]
|
|
428
433
|
)
|
|
429
434
|
)
|
|
430
435
|
else:
|
|
431
|
-
self.
|
|
432
|
-
|
|
436
|
+
self._vector_field_batches.append(
|
|
437
|
+
Batch._VectorFieldTransaction(field_name, surface_ids)
|
|
433
438
|
)
|
|
434
439
|
|
|
435
440
|
@all_deprecators(
|
|
@@ -503,14 +508,14 @@ class Transaction(FieldTransaction):
|
|
|
503
508
|
)
|
|
504
509
|
elif isinstance(req, ScalarFieldDataRequest):
|
|
505
510
|
self._add_scalar_fields_request(
|
|
506
|
-
field_name=req.field_name,
|
|
511
|
+
field_name=_to_scalar_field_name(req.field_name),
|
|
507
512
|
surfaces=req.surfaces,
|
|
508
513
|
node_value=req.node_value,
|
|
509
514
|
boundary_value=req.boundary_value,
|
|
510
515
|
)
|
|
511
516
|
elif isinstance(req, VectorFieldDataRequest):
|
|
512
517
|
self._add_vector_fields_request(
|
|
513
|
-
field_name=req.field_name,
|
|
518
|
+
field_name=_to_vector_field_name(req.field_name),
|
|
514
519
|
surfaces=req.surfaces,
|
|
515
520
|
)
|
|
516
521
|
elif isinstance(req, PathlinesFieldDataRequest):
|
|
@@ -555,47 +560,47 @@ class Transaction(FieldTransaction):
|
|
|
555
560
|
("boundaryValues", False),
|
|
556
561
|
)
|
|
557
562
|
|
|
558
|
-
for
|
|
563
|
+
for batch in self._scalar_field_batches:
|
|
559
564
|
if scalar_field_tag not in field_data:
|
|
560
565
|
field_data[scalar_field_tag] = {}
|
|
561
566
|
field_data_surface = field_data[scalar_field_tag]
|
|
562
|
-
for surface_id in
|
|
567
|
+
for surface_id in batch.surface_ids:
|
|
563
568
|
field_data_surface[surface_id] = {}
|
|
564
|
-
field_data_surface[surface_id][
|
|
569
|
+
field_data_surface[surface_id][batch.field_name] = (
|
|
565
570
|
self._file_session._data_file.get_face_scalar_field_data(
|
|
566
|
-
|
|
571
|
+
batch.phase_name, batch.field_name, surface_id
|
|
567
572
|
)
|
|
568
573
|
)
|
|
569
574
|
|
|
570
575
|
vector_field_tag = (("type", "vector-field"),)
|
|
571
576
|
|
|
572
|
-
for
|
|
573
|
-
if "velocity" not in
|
|
577
|
+
for batch in self._vector_field_batches:
|
|
578
|
+
if "velocity" not in batch.field_name:
|
|
574
579
|
raise InvalidFieldName()
|
|
575
580
|
if vector_field_tag not in field_data:
|
|
576
581
|
field_data[vector_field_tag] = {}
|
|
577
582
|
field_data_surface = field_data[vector_field_tag]
|
|
578
|
-
for surface_id in
|
|
583
|
+
for surface_id in batch.surface_ids:
|
|
579
584
|
field_data_surface[surface_id] = {}
|
|
580
|
-
field_data_surface[surface_id][
|
|
585
|
+
field_data_surface[surface_id][batch.field_name] = (
|
|
581
586
|
self._file_session._data_file.get_face_vector_field_data(
|
|
582
|
-
|
|
587
|
+
batch.phase_name, surface_id
|
|
583
588
|
)
|
|
584
589
|
)
|
|
585
590
|
field_data_surface[surface_id]["vector-scale"] = np.array([0.1])
|
|
586
591
|
|
|
587
|
-
for
|
|
592
|
+
for batch in self._surface_batches:
|
|
588
593
|
if (("type", "surface-data"),) not in field_data:
|
|
589
594
|
field_data[(("type", "surface-data"),)] = {}
|
|
590
595
|
field_data_surface = field_data[(("type", "surface-data"),)]
|
|
591
|
-
field_data_surface[
|
|
592
|
-
field_data_surface[
|
|
593
|
-
|
|
596
|
+
field_data_surface[batch.surface_id] = {}
|
|
597
|
+
field_data_surface[batch.surface_id]["faces"] = mesh.get_connectivity(
|
|
598
|
+
batch.surface_id
|
|
594
599
|
)
|
|
595
|
-
field_data_surface[
|
|
596
|
-
|
|
600
|
+
field_data_surface[batch.surface_id]["vertices"] = mesh.get_vertices(
|
|
601
|
+
batch.surface_id
|
|
597
602
|
)
|
|
598
|
-
return
|
|
603
|
+
return BatchFieldData(
|
|
599
604
|
field_data,
|
|
600
605
|
self._field_info,
|
|
601
606
|
_AllowedSurfaceNames(self._field_info),
|
|
@@ -610,10 +615,29 @@ class FileFieldData(FieldDataSource):
|
|
|
610
615
|
"""Initialize FileFieldData."""
|
|
611
616
|
self._file_session = file_session
|
|
612
617
|
self._field_info = field_info
|
|
618
|
+
self.scalar_fields = _ScalarFields(
|
|
619
|
+
self._field_info._get_scalar_fields_info, self._field_info
|
|
620
|
+
)
|
|
621
|
+
self.vector_fields = _VectorFields(self._field_info._get_vector_fields_info)
|
|
622
|
+
self.surfaces = _SurfaceNames(self._field_info._get_surfaces_info)
|
|
613
623
|
|
|
624
|
+
@property
|
|
625
|
+
def surface_ids(self):
|
|
626
|
+
"""Get the surface ids."""
|
|
627
|
+
return _SurfaceIds(
|
|
628
|
+
_get_surface_ids(
|
|
629
|
+
self._field_info, list(self._field_info._get_surfaces_info())
|
|
630
|
+
)
|
|
631
|
+
)
|
|
632
|
+
|
|
633
|
+
def new_batch(self):
|
|
634
|
+
"""Create a new field batch."""
|
|
635
|
+
return Batch(self._file_session, self._field_info)
|
|
636
|
+
|
|
637
|
+
@deprecated(version="0.34", reason="Use `new_batch` instead.")
|
|
614
638
|
def new_transaction(self):
|
|
615
639
|
"""Create a new field transaction."""
|
|
616
|
-
return
|
|
640
|
+
return self.new_batch()
|
|
617
641
|
|
|
618
642
|
def get_surface_ids(self, surfaces: List[str | int]) -> List[int]:
|
|
619
643
|
"""Get a list of surface ids based on surfaces provided as inputs."""
|
|
@@ -650,6 +674,7 @@ class FileFieldData(FieldDataSource):
|
|
|
650
674
|
data_types: List[SurfaceDataType] | List[str],
|
|
651
675
|
surfaces: List[int | str],
|
|
652
676
|
overset_mesh: bool | None = False,
|
|
677
|
+
flatten_connectivity: bool = False,
|
|
653
678
|
):
|
|
654
679
|
"""Get surface data (vertices and faces connectivity).
|
|
655
680
|
|
|
@@ -661,6 +686,8 @@ class FileFieldData(FieldDataSource):
|
|
|
661
686
|
List of surface IDS or surface names for the surface data.
|
|
662
687
|
overset_mesh : bool, optional
|
|
663
688
|
Whether to provide the overset method. The default is ``False``.
|
|
689
|
+
flatten_connectivity: bool, optional
|
|
690
|
+
Whether to provide faces connectivity data in flattened format.
|
|
664
691
|
|
|
665
692
|
Returns
|
|
666
693
|
-------
|
|
@@ -673,6 +700,7 @@ class FileFieldData(FieldDataSource):
|
|
|
673
700
|
data_types=data_types,
|
|
674
701
|
surfaces=surfaces,
|
|
675
702
|
overset_mesh=overset_mesh,
|
|
703
|
+
flatten_connectivity=flatten_connectivity,
|
|
676
704
|
)
|
|
677
705
|
|
|
678
706
|
def _get_surface_data(
|
|
@@ -680,6 +708,7 @@ class FileFieldData(FieldDataSource):
|
|
|
680
708
|
data_types: List[SurfaceDataType] | List[str],
|
|
681
709
|
surfaces: List[int | str],
|
|
682
710
|
overset_mesh: bool | None = False,
|
|
711
|
+
flatten_connectivity: bool = False,
|
|
683
712
|
):
|
|
684
713
|
for d_type in data_types:
|
|
685
714
|
if isinstance(d_type, str):
|
|
@@ -697,24 +726,28 @@ class FileFieldData(FieldDataSource):
|
|
|
697
726
|
}
|
|
698
727
|
|
|
699
728
|
if SurfaceDataType.FacesConnectivity in data_types:
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
self._file_session._case_file.get_mesh().get_connectivity(
|
|
729
|
+
if flatten_connectivity:
|
|
730
|
+
return {
|
|
731
|
+
surface: self._file_session._case_file.get_mesh().get_connectivity(
|
|
703
732
|
surface_ids[count]
|
|
704
733
|
)
|
|
734
|
+
for count, surface in enumerate(surfaces)
|
|
735
|
+
}
|
|
736
|
+
else:
|
|
737
|
+
warnings.warn(
|
|
738
|
+
"Structured face connectivity output is deprecated and will be replaced by the flat format "
|
|
739
|
+
"in a future release. In the current release, pass 'flatten_connectivity=True' argument while creating the "
|
|
740
|
+
"'SurfaceFieldDataRequest' to request data in the flat format.",
|
|
741
|
+
PyFluentDeprecationWarning,
|
|
705
742
|
)
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
end = i + 1 + data[i]
|
|
715
|
-
faces_data.append(data[i + 1 : end])
|
|
716
|
-
i = end
|
|
717
|
-
return faces_data
|
|
743
|
+
return {
|
|
744
|
+
surface: _transform_faces_connectivity_data(
|
|
745
|
+
self._file_session._case_file.get_mesh().get_connectivity(
|
|
746
|
+
surface_ids[count]
|
|
747
|
+
)
|
|
748
|
+
)
|
|
749
|
+
for count, surface in enumerate(surfaces)
|
|
750
|
+
}
|
|
718
751
|
|
|
719
752
|
@all_deprecators(
|
|
720
753
|
deprecate_arg_mappings=[
|
|
@@ -951,11 +984,11 @@ class FileFieldData(FieldDataSource):
|
|
|
951
984
|
return self._get_pathlines_field_data(**obj._asdict())
|
|
952
985
|
|
|
953
986
|
|
|
954
|
-
class
|
|
987
|
+
class _FileFieldInfo(BaseFieldInfo):
|
|
955
988
|
"""File field info."""
|
|
956
989
|
|
|
957
990
|
def __init__(self, file_session):
|
|
958
|
-
"""Initialize
|
|
991
|
+
"""Initialize _FileFieldInfo."""
|
|
959
992
|
self._file_session = file_session
|
|
960
993
|
|
|
961
994
|
def get_scalar_field_range(
|
|
@@ -975,6 +1008,16 @@ class FileFieldInfo((BaseFieldInfo)):
|
|
|
975
1008
|
-------
|
|
976
1009
|
List[float]
|
|
977
1010
|
"""
|
|
1011
|
+
warnings.warn(
|
|
1012
|
+
"This usage is deprecated and will be removed in a future release. "
|
|
1013
|
+
f"Please use 'field_data.scalar_fields.range({field}, {node_value}, {surface_ids})' instead",
|
|
1014
|
+
PyFluentDeprecationWarning,
|
|
1015
|
+
)
|
|
1016
|
+
return self._get_scalar_field_range(field, node_value, surface_ids)
|
|
1017
|
+
|
|
1018
|
+
def _get_scalar_field_range(
|
|
1019
|
+
self, field: str, node_value: bool = False, surface_ids: List[int] = None
|
|
1020
|
+
) -> List[float]:
|
|
978
1021
|
minimum = None
|
|
979
1022
|
maximum = None
|
|
980
1023
|
if not surface_ids:
|
|
@@ -997,6 +1040,14 @@ class FileFieldInfo((BaseFieldInfo)):
|
|
|
997
1040
|
-------
|
|
998
1041
|
Dict
|
|
999
1042
|
"""
|
|
1043
|
+
warnings.warn(
|
|
1044
|
+
"This usage is deprecated and will be removed in a future release. "
|
|
1045
|
+
"Please use 'field_data.scalar_fields()' instead",
|
|
1046
|
+
PyFluentDeprecationWarning,
|
|
1047
|
+
)
|
|
1048
|
+
return self._get_scalar_fields_info()
|
|
1049
|
+
|
|
1050
|
+
def _get_scalar_fields_info(self):
|
|
1000
1051
|
phases = self._file_session._data_file.get_phases()
|
|
1001
1052
|
|
|
1002
1053
|
scalar_field_info = {}
|
|
@@ -1032,6 +1083,14 @@ class FileFieldInfo((BaseFieldInfo)):
|
|
|
1032
1083
|
-------
|
|
1033
1084
|
Dict
|
|
1034
1085
|
"""
|
|
1086
|
+
warnings.warn(
|
|
1087
|
+
"This usage is deprecated and will be removed in a future release. "
|
|
1088
|
+
"Please use 'field_data.vector_fields()' instead",
|
|
1089
|
+
PyFluentDeprecationWarning,
|
|
1090
|
+
)
|
|
1091
|
+
return self._get_vector_fields_info()
|
|
1092
|
+
|
|
1093
|
+
def _get_vector_fields_info(self):
|
|
1035
1094
|
phases = self._file_session._data_file.get_phases()
|
|
1036
1095
|
|
|
1037
1096
|
if len(phases) > 1:
|
|
@@ -1061,6 +1120,14 @@ class FileFieldInfo((BaseFieldInfo)):
|
|
|
1061
1120
|
-------
|
|
1062
1121
|
Dict
|
|
1063
1122
|
"""
|
|
1123
|
+
warnings.warn(
|
|
1124
|
+
"This usage is deprecated and will be removed in a future release. "
|
|
1125
|
+
"Please use 'field_data.surfaces()' instead",
|
|
1126
|
+
PyFluentDeprecationWarning,
|
|
1127
|
+
)
|
|
1128
|
+
return self._get_surfaces_info()
|
|
1129
|
+
|
|
1130
|
+
def _get_surfaces_info(self):
|
|
1064
1131
|
mesh = self._file_session._case_file.get_mesh()
|
|
1065
1132
|
surface_names = mesh.get_surface_names()
|
|
1066
1133
|
surface_ids = mesh.get_surface_ids()
|
|
@@ -1076,6 +1143,19 @@ class FileFieldInfo((BaseFieldInfo)):
|
|
|
1076
1143
|
return info
|
|
1077
1144
|
|
|
1078
1145
|
|
|
1146
|
+
class FileFieldInfo(_FileFieldInfo):
|
|
1147
|
+
"""File field info."""
|
|
1148
|
+
|
|
1149
|
+
def __init__(self, file_session):
|
|
1150
|
+
"""Initialize FileFieldInfo"""
|
|
1151
|
+
warnings.warn(
|
|
1152
|
+
"'FieldInfo' is deprecated and will be removed in a future release. "
|
|
1153
|
+
"Please use relevant methods from 'FieldData' instead",
|
|
1154
|
+
PyFluentDeprecationWarning,
|
|
1155
|
+
)
|
|
1156
|
+
super().__init__(file_session)
|
|
1157
|
+
|
|
1158
|
+
|
|
1079
1159
|
class FileSession:
|
|
1080
1160
|
"""File session to read case and data file."""
|
|
1081
1161
|
|
|
@@ -1141,7 +1221,7 @@ def _get_surface_ids(
|
|
|
1141
1221
|
surface_ids = []
|
|
1142
1222
|
for surf in surfaces:
|
|
1143
1223
|
if isinstance(surf, str):
|
|
1144
|
-
surface_ids.extend(field_info.
|
|
1224
|
+
surface_ids.extend(field_info._get_surfaces_info()[surf]["surface_id"])
|
|
1145
1225
|
else:
|
|
1146
1226
|
surface_ids.append(surf)
|
|
1147
1227
|
return surface_ids
|
|
@@ -1152,5 +1232,5 @@ class Fields:
|
|
|
1152
1232
|
|
|
1153
1233
|
def __init__(self, _session: FileSession):
|
|
1154
1234
|
"""Initialize Fields."""
|
|
1155
|
-
self.field_info =
|
|
1235
|
+
self.field_info = _FileFieldInfo(_session)
|
|
1156
1236
|
self.field_data = FileFieldData(_session, self.field_info)
|
|
@@ -47,6 +47,7 @@ from ansys.fluent.core.services import service_creator
|
|
|
47
47
|
from ansys.fluent.core.services.app_utilities import (
|
|
48
48
|
AppUtilitiesOld,
|
|
49
49
|
AppUtilitiesService,
|
|
50
|
+
AppUtilitiesV252,
|
|
50
51
|
)
|
|
51
52
|
from ansys.fluent.core.services.scheme_eval import SchemeEvalService
|
|
52
53
|
from ansys.fluent.core.utils.execution import timeout_exec, timeout_loop
|
|
@@ -277,18 +278,22 @@ class _ConnectionInterface:
|
|
|
277
278
|
self.scheme_eval = service_creator("scheme_eval").create(
|
|
278
279
|
self._scheme_eval_service
|
|
279
280
|
)
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
):
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
281
|
+
self._app_utilities_service = create_grpc_service(
|
|
282
|
+
AppUtilitiesService, error_state
|
|
283
|
+
)
|
|
284
|
+
match pyfluent.FluentVersion(self.scheme_eval.version):
|
|
285
|
+
case v if v < pyfluent.FluentVersion.v252:
|
|
286
|
+
self._app_utilities = AppUtilitiesOld(self.scheme_eval)
|
|
287
|
+
|
|
288
|
+
case pyfluent.FluentVersion.v252:
|
|
289
|
+
self._app_utilities = AppUtilitiesV252(
|
|
290
|
+
self._app_utilities_service, self.scheme_eval
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
case _:
|
|
294
|
+
self._app_utilities = service_creator("app_utilities").create(
|
|
295
|
+
self._app_utilities_service
|
|
296
|
+
)
|
|
292
297
|
|
|
293
298
|
@property
|
|
294
299
|
def product_build_info(self) -> str:
|
|
@@ -744,15 +749,17 @@ class FluentConnection:
|
|
|
744
749
|
|
|
745
750
|
if timeout is None:
|
|
746
751
|
env_timeout = os.getenv("PYFLUENT_TIMEOUT_FORCE_EXIT")
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
752
|
+
if env_timeout is not None:
|
|
753
|
+
logger.debug(
|
|
754
|
+
f"Found PYFLUENT_TIMEOUT_FORCE_EXIT env var: '{env_timeout}'"
|
|
755
|
+
)
|
|
750
756
|
try:
|
|
751
757
|
timeout = float(env_timeout)
|
|
752
758
|
logger.debug(f"Setting TIMEOUT_FORCE_EXIT to {timeout}")
|
|
753
759
|
except ValueError:
|
|
754
760
|
logger.debug(
|
|
755
|
-
"
|
|
761
|
+
"Invalid PYFLUENT_TIMEOUT_FORCE_EXIT. Must be a float or int. "
|
|
762
|
+
"Timeout forced exit is disabled."
|
|
756
763
|
)
|
|
757
764
|
|
|
758
765
|
if timeout is None:
|