field_data#
Wrappers over FieldData gRPC service of Fluent.
Classes:
|
Class for parsing field data stream received from Fluent. |
|
Provides access to Fluent field data on surfaces. |
|
FieldData service of Fluent. |
|
Provides access to Fluent field information. |
|
Populates Fluent field data on surfaces. |
|
Provides surface data types. |
Exceptions:
Raised when field is unavailable. |
Functions:
Populates a new field request. |
|
|
Override function help text. |
- class ansys.fluent.core.services.field_data.ChunkParser(callbacks_provider=None)#
Bases:
object
Class for parsing field data stream received from Fluent.
- Parameters:
- callbacks_provider
object
- The object which can register and unregister callbacks.
- It provides callbacks, which are triggered with following arguments:
zone_id : int
field_name : str
field : numpy array
- callbacks_provider
Methods:
__init__
([callbacks_provider])__init__ method of ChunkParser class.
extract_fields
(chunk_iterator)Extracts field data received from Fluent.
- __init__(callbacks_provider=None)#
__init__ method of ChunkParser class.
- extract_fields(chunk_iterator)#
Extracts field data received from Fluent.
if callbacks_provider is set then callbacks are triggered with extracted data.
- class ansys.fluent.core.services.field_data.FieldData(service, field_info, is_data_valid, scheme_eval=None)#
Bases:
object
Provides access to Fluent field data on surfaces.
Methods:
__init__
(service, field_info, is_data_valid)__init__ method of FieldData class.
get_pathlines_field_data
(field_name, surfaces)Get the pathlines field data on a surface.
get_scalar_field_data
(field_name, surfaces)Get scalar field data on a surface.
get_surface_data
(data_types, surfaces[, ...])Get surface data (vertices, faces connectivity, centroids, and normals).
get_vector_field_data
(field_name, surfaces)Get vector field data on a surface.
Create a new field transaction.
- __init__(service, field_info, is_data_valid, scheme_eval=None)#
__init__ method of FieldData class.
- get_pathlines_field_data(field_name, surfaces, additional_field_name='', provide_particle_time_field=False, node_value=True, steps=500, step_size=500, skip=0, reverse=False, accuracy_control_on=False, tolerance=0.001, coarsen=1, velocity_domain='all-phases', zones=None)#
Get the pathlines field data on a surface.
- Parameters:
- field_name
str
Name of the scalar field to color pathlines.
- surfaces
List
[int
|str
] List of surface IDS or surface names for the surface data.
- additional_field_name
str
,optional
Additional field if required.
- provide_particle_time_field: bool, optional
Whether to provide the particle time. The default is
False
.- node_valuebool,
optional
Whether to provide the nodal values. The default is
True
. IfFalse
, element values are provided.- steps: int, optional
Pathlines steps. The default is
500
- step_size: float, optional
Pathlines step size. The default is
0.01
.- skip: int, optional
Pathlines to skip. The default is
0
.- reverse: bool, optional
Whether to draw pathlines in reverse direction. The default is
False
.- accuracy_control_on: bool, optional
Whether to control accuracy. The default is
False
.- tolerance: float, optional
Pathlines tolerance. The default is
0.001
.- coarsen: int, optional
Pathlines coarsen. The default is
1
.- velocity_domain: str, optional
Domain for pathlines. The default is
"all-phases"
.- zones: list, optional
Zones for pathlines. The default is
[]
.
- field_name
- Returns:
Dict
Dictionary containing a map of surface IDs to the pathline data. For example, pathlines connectivity, vertices, and field.
- get_scalar_field_data(field_name, surfaces, node_value=True, boundary_value=True)#
Get scalar field data on a surface.
- Parameters:
- field_name
str
Name of the scalar field.
- surfaces
List
[int
|str
] List of surface IDS or surface names for the surface data.
- node_valuebool,
optional
Whether to provide data for the nodal location. The default is
True
. WhenFalse
, data is provided for the element location.- boundary_valuebool,
optional
Whether to provide slip velocity at the wall boundaries. The default is
True
. WhenTrue
, no slip velocity is provided.
- field_name
- Returns:
- get_surface_data(data_types, surfaces, overset_mesh=False)#
Get surface data (vertices, faces connectivity, centroids, and normals).
- Parameters:
- data_types
List
[SurfaceDataType
], SurfaceDataType Enum members.
- surfaces
List
[int
|str
] List of surface IDS or surface names for the surface data.
- overset_meshbool,
optional
Whether to provide the overset method. The default is
False
.
- data_types
- Returns:
Dict
[int
|str
,Dict
[SurfaceDataType
,np.array
|List
[np.array
]]]Returns a map of surface IDs (or names) to face vertices, connectivity data, and normal or centroid data.
- get_vector_field_data(field_name, surfaces)#
Get vector field data on a surface.
- new_transaction()#
Create a new field transaction.
- class ansys.fluent.core.services.field_data.FieldDataService(channel, metadata, fluent_error_state)#
Bases:
StreamingService
FieldData service of Fluent.
Methods:
__init__
(channel, metadata, fluent_error_state)__init__ method of FieldDataService class.
get_fields
(request)GetFields RPC of FieldData service.
get_scalar_field_range
(request)GetRange RPC of FieldData service.
get_scalar_fields_info
(request)GetFieldsInfo RPC of FieldData service.
get_surfaces_info
(request)GetSurfacesInfo RPC of FieldData service.
get_vector_fields_info
(request)GetVectorFieldsInfo RPC of FieldData service.
- __init__(channel, metadata, fluent_error_state)#
__init__ method of FieldDataService class.
- get_fields(request)#
GetFields RPC of FieldData service.
- Raises:
RuntimeError
If an empty chunk encountered during field extraction.
- get_scalar_field_range(request)#
GetRange RPC of FieldData service.
- get_scalar_fields_info(request)#
GetFieldsInfo RPC of FieldData service.
- get_surfaces_info(request)#
GetSurfacesInfo RPC of FieldData service.
- get_vector_fields_info(request)#
GetVectorFieldsInfo RPC of FieldData service.
- class ansys.fluent.core.services.field_data.FieldInfo(service, is_data_valid)#
Bases:
object
Provides access to Fluent field information.
Methods
get_scalar_field_range(field: str, node_value: bool, surface_ids: List[int])
-> List[float]
Get the range (minimum and maximum values) of the field.
get_scalar_fields_info(self) -> dict
Get fields information (field name, domain, and section).
get_vector_fields_info(self) -> dict
Get vector fields information.
get_surfaces_info(self) -> dict
Get surfaces information (surface name, ID, and type).
Methods:
__init__
(service, is_data_valid)__init__ method of FieldInfo class.
get_scalar_field_range
(field[, node_value, ...])Get the range (minimum and maximum values) of the field.
Get fields information (field name, domain, and section).
Get surfaces information (surface name, ID, and type).
Get vector fields information (vector components).
validate_scalar_fields
(field_name)Validate scalar fields.
validate_surfaces
(surfaces)Validate surfaces.
validate_vector_fields
(field_name)Validate vector fields.
- __init__(service, is_data_valid)#
__init__ method of FieldInfo class.
- get_scalar_field_range(field, node_value=False, surface_ids=None)#
Get the range (minimum and maximum values) of the field.
- get_scalar_fields_info()#
Get fields information (field name, domain, and section).
- Returns:
Dict
- get_surfaces_info()#
Get surfaces information (surface name, ID, and type).
- Returns:
Dict
- get_vector_fields_info()#
Get vector fields information (vector components).
- Returns:
Dict
- validate_scalar_fields(field_name)#
Validate scalar fields.
- validate_surfaces(surfaces)#
Validate surfaces.
- validate_vector_fields(field_name)#
Validate vector fields.
- class ansys.fluent.core.services.field_data.FieldTransaction(service, field_info, allowed_surface_ids, allowed_surface_names, allowed_scalar_field_names, allowed_vector_field_names)#
Bases:
object
Populates Fluent field data on surfaces.
Methods:
__init__
(service, field_info, ...)__init__ method of FieldTransaction class.
add_pathlines_fields_request
(field_name, ...)Add request to get pathlines field on surfaces.
add_scalar_fields_request
(field_name, surfaces)Add request to get scalar field data on surfaces.
add_surfaces_request
(data_types, surfaces[, ...])Add request to get surface data (vertices, face connectivity, centroids, and normals).
add_vector_fields_request
(field_name, surfaces)Add request to get vector field data on surfaces.
Get data for previously added requests and then clear all requests.
- __init__(service, field_info, allowed_surface_ids, allowed_surface_names, allowed_scalar_field_names, allowed_vector_field_names)#
__init__ method of FieldTransaction class.
- add_pathlines_fields_request(field_name, surfaces, additional_field_name='', provide_particle_time_field=False, node_value=True, steps=500, step_size=500, skip=0, reverse=False, accuracy_control_on=False, tolerance=0.001, coarsen=1, velocity_domain='all-phases', zones=None)#
Add request to get pathlines field on surfaces.
- Parameters:
- field_name
str
Name of the scalar field to color pathlines.
- surfaces
List
[int
|str
] List of surface IDS or surface names for the surface data.
- additional_field_name
str
,optional
Additional field if required.
- provide_particle_time_field: bool, optional
Whether to provide the particle time. The default is
False
.- node_valuebool,
optional
Whether to provide the nodal values. The default is
True
. IfFalse
, element values are provided.- steps: int, optional
Pathlines steps. The default is
500
- step_size: float, optional
Pathlines step size. The default is
0.01
.- skip: int, optional
Pathlines to skip. The default is
0
.- reverse: bool, optional
Whether to draw pathlines in a reverse direction. The default is
False
.- accuracy_control_on: bool, optional
Whether to control accuracy. The default is
False
.- tolerance: float, optional
Pathlines tolerance. The default is
0.001
.- coarsen: int, optional
Pathlines coarsen. The default is
1
.- velocity_domain: str, optional
Domain for pathlines. The default is
"all-phases"
.- zones: list, optional
Zones for pathlines. The default is
[]
.- Returns
- ——-
- None
- field_name
- add_scalar_fields_request(field_name, surfaces, node_value=True, boundary_value=True)#
Add request to get scalar field data on surfaces.
- Parameters:
- field_name
str
Name of the scalar field.
- surfaces
List
[int
|str
] List of surface IDS or surface names for the surface data.
- node_valuebool,
optional
Whether to provide the nodal location. The default is
True
. IfFalse
, the element location is provided.- boundary_valuebool,
optional
Whether to provide the slip velocity at the wall boundaries. The default is
True
. WhenTrue
, no slip velocity is provided.
- field_name
- Returns:
- add_surfaces_request(data_types, surfaces, overset_mesh=False)#
Add request to get surface data (vertices, face connectivity, centroids, and normals).
- add_vector_fields_request(field_name, surfaces)#
Add request to get vector field data on surfaces.
- get_fields()#
Get data for previously added requests and then clear all requests.
Bases:
RuntimeError
Raised when field is unavailable.
- class ansys.fluent.core.services.field_data.SurfaceDataType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
Bases:
Enum
Provides surface data types.
Attributes:
- FacesCentroid = 'centroid'#
- FacesConnectivity = 'faces'#
- FacesNormal = 'face-normal'#
- Vertices = 'vertices'#
- ansys.fluent.core.services.field_data.get_fields_request()#
Populates a new field request.
- ansys.fluent.core.services.field_data.override_help_text(func, func_to_be_wrapped)#
Override function help text.