field_data#
Wrappers over FieldData gRPC service of Fluent.
Classes:
|
Contains common properties required by all field data types. |
|
Class for parsing field data stream received from Fluent. |
|
Provides the container for the face centroid data. |
|
Provides the container for the face connectivity data. |
|
Provides the container for the face normal data. |
|
Provides access to Fluent field data on surfaces. |
|
FieldData service of Fluent. |
|
Provides access to Fluent field information. |
|
Populates Fluent field data on surfaces. |
|
Contains scalar field data. |
|
Provides surface data types. |
|
Stores the data as a vector |
|
Provides a container for vector field data. |
|
Provides a container for the vertex data. |
Exceptions:
Exception class for errors in field name. |
|
Exception class for when field is unavailable. |
|
|
Exception class for errors in scalar field name. |
|
Exception class for when scalar field is unavailable. |
|
Exception class for errors in surface name. |
|
Exception class for errors in vector field name. |
|
Exception class for when vector field is unavailable. |
Functions:
Populates a new field request. |
|
|
Override function help text. |
|
Error message for unavailable fields. |
- class ansys.fluent.core.services.field_data.BaseFieldData(i_d, data)#
Bases:
object
Contains common properties required by all field data types.
Methods:
__init__
(i_d, data)Attributes:
- __init__(i_d, data)#
- property data#
- property size#
- property surface_id#
- 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])extract_fields
(chunk_iterator)Extracts field data received from Fluent.
- __init__(callbacks_provider=None)#
- class ansys.fluent.core.services.field_data.FacesCentroid(i_d, data)#
Bases:
BaseFieldData
Provides the container for the face centroid data.
Classes:
Centroid
(x, y, z)Stores and provides the face centroid data as a vector.
Methods:
__init__
(i_d, data)- class Centroid(x, y, z)#
Bases:
Vector
Stores and provides the face centroid data as a vector.
Methods:
__init__
(x, y, z)- __init__(x, y, z)#
- __init__(i_d, data)#
- class ansys.fluent.core.services.field_data.FacesConnectivity(i_d, data)#
Bases:
BaseFieldData
Provides the container for the face connectivity data.
Classes:
Faces
(node_count, node_indices)Stores and provides the face connectivity data as an array.
Methods:
__init__
(i_d, data)- class Faces(node_count, node_indices)#
Bases:
object
Stores and provides the face connectivity data as an array.
Methods:
__init__
(node_count, node_indices)- __init__(node_count, node_indices)#
- __init__(i_d, data)#
- class ansys.fluent.core.services.field_data.FacesNormal(i_d, data)#
Bases:
BaseFieldData
Provides the container for the face normal data.
Classes:
Normal
(x, y, z)Stores and provides the face normal data as a vector.
Methods:
__init__
(i_d, data)- class Normal(x, y, z)#
Bases:
Vector
Stores and provides the face normal data as a vector.
Methods:
__init__
(x, y, z)- __init__(x, y, z)#
- __init__(i_d, data)#
- class ansys.fluent.core.services.field_data.FieldData(service, field_info, is_data_valid)#
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[, ...])Get the pathlines field data on a surface.
get_scalar_field_data
(field_name[, ...])Get scalar field data on a surface.
get_surface_data
(data_type[, surface_ids, ...])Get surface data (vertices, faces connectivity, centroids, and normals).
get_vector_field_data
(field_name[, ...])Get vector field data on a surface.
Create a new field transaction.
- __init__(service, field_info, is_data_valid)#
__init__ method of FieldData class.
- get_pathlines_field_data(field_name, surface_ids=None, surface_name=None, additional_field_name='', provide_particle_time_field=False, node_value=True, steps=500, step_size=0.01, skip=0, reverse=False, accuracy_control_on=False, tolerance=0.001, coarsen=1, velocity_domain='all-phases', zones=[])#
Get the pathlines field data on a surface.
- Parameters:
- field_name
str
Name of the scalar field to color pathlines.
- surface_ids
List
[int
],optional
List of surface IDs for pathlines field data.
- surface_name
str
,optional
Surface name for pathlines field 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
.- 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.
- Return type:
- get_scalar_field_data(field_name, surface_ids=None, surface_name=None, node_value=True, boundary_value=False)#
Get scalar field data on a surface.
- Parameters:
- field_name
str
Name of the scalar field.
- surface_ids
List
[int
],optional
List of surface IDs for scalar field data.
- surface_name: str, optional
Surface Name for scalar field 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
False
. WhenTrue
, no slip velocity is provided.
- field_name
- Returns:
Union
[ScalarFieldData
,Dict
[int
,ScalarFieldData
]]If a surface name is provided as input, scalar field data is returned. If surface IDs are provided as input, a dictionary containing a map of surface IDs to scalar field data.
- Return type:
- get_surface_data(data_type, surface_ids=None, surface_name=None, overset_mesh=False)#
Get surface data (vertices, faces connectivity, centroids, and normals).
- Parameters:
- data_type
SurfaceDataType
SurfaceDataType Enum member.
- surface_ids
List
[int
],optional
List of surface IDs for the surface data.
- surface_name
str
,optional
Surface name for the surface data.
- overset_meshbool,
optional
Whether to provide the overset method. The default is
False
.
- data_type
- Returns:
Union
[Vertices
,FacesConnectivity
,FacesNormal
, FacesCentroid,Dict
[int
,Union
[Vertices
,FacesConnectivity
,FacesNormal
,FacesCentroid
]]]If a surface name is provided as input, face vertices, connectivity data, and normal or centroid data are returned. If surface IDs are provided as input, a dictionary containing a map of surface IDs to face vertices, connectivity data, and normal or centroid data is returned.
- Return type:
Union
[Vertices
,FacesConnectivity
,FacesNormal
,FacesCentroid
,Dict
[int
,Union
[Vertices
,FacesConnectivity
,FacesNormal
,FacesCentroid
]]]
- get_vector_field_data(field_name, surface_ids=None, surface_name=None)#
Get vector field data on a surface.
- Parameters:
- Returns:
Union
[VectorFieldData
,Dict
[int
,VectorFieldData
]]If a surface name is provided as input, vector field data is returned. If surface IDs are provided as input, a dictionary containing a map of surface IDs to vector field data is returned.
- Return type:
- new_transaction()#
Create a new field transaction.
- class ansys.fluent.core.services.field_data.FieldDataService(channel, metadata)#
Bases:
StreamingService
FieldData service of Fluent.
Methods:
__init__
(channel, metadata)__init__ method of FieldDataService class.
get_fields
(request)GetFields rpc of FieldData service.
get_scalar_fields_info
(request)GetFieldsInfo rpc of FieldData service.
get_scalar_fields_range
(request)GetRange 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)#
__init__ method of FieldDataService class.
- get_fields(request)#
GetFields rpc of FieldData service.
- get_scalar_fields_info(request)#
GetFieldsInfo rpc of FieldData service.
- get_scalar_fields_range(request)#
GetRange 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)#
Bases:
object
Provides access to Fluent field information.
Methods
get_scalar_fields_range(fields: List[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)__init__ method of FieldInfo class.
Get fields information (field name, domain, and section).
get_scalar_fields_range
(fields[, ...])Get the range (minimum and maximum values) of the field.
Get surfaces information (surface name, ID, and type).
Get vector fields information (vector components).
- __init__(service)#
__init__ method of FieldInfo class.
- get_scalar_fields_info()#
Get fields information (field name, domain, and section).
- get_scalar_fields_range(fields, node_value=False, surface_ids=None)#
Get the range (minimum and maximum values) of the field.
- get_surfaces_info()#
Get surfaces information (surface name, ID, and type).
- exception ansys.fluent.core.services.field_data.FieldNameError#
Bases:
ValueError
Exception class for errors in field name.
- 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[, ...])Add request to get scalar field data on surfaces.
add_surfaces_request
([surface_ids, ...])Add request to get surface data (vertices, face connectivity, centroids, and normals).
add_vector_fields_request
(field_name[, ...])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, surface_ids=None, surface_names=None, additional_field_name='', provide_particle_time_field=False, node_value=True, steps=500, step_size=0.01, skip=0, reverse=False, accuracy_control_on=False, tolerance=0.001, coarsen=1, velocity_domain='all-phases', zones=[])#
Add request to get pathlines field on surfaces.
- Parameters:
- field_name
str
Name of the scalar field to color pathlines.
- surface_ids
List
[int
],optional
List of surface IDs for pathlines field data.
- surface_names
List
[str
],optional
List of surface names for pathlines field 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
.- 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
- Return type:
- add_scalar_fields_request(field_name, surface_ids=None, surface_names=None, node_value=True, boundary_value=False)#
Add request to get scalar field data on surfaces.
- Parameters:
- field_name
str
Name of the scalar field.
- surface_ids
List
[int
],optional
List of surface IDs for scalar field data.
- surface_names: List[str], optional
List of surface names for scalar field 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
False
. WhenTrue
, no slip velocity is provided.
- field_name
- Returns:
- Return type:
- add_surfaces_request(surface_ids=None, surface_names=None, overset_mesh=False, provide_vertices=True, provide_faces=True, provide_faces_centroid=False, provide_faces_normal=False)#
Add request to get surface data (vertices, face connectivity, centroids, and normals).
- Parameters:
- surface_ids
List
[int
],optional
List of surface IDS for the surface data.
- surface_names: List[str], optional
List of surface names for the surface data.
- overset_meshbool,
optional
Whether to get the overset met. The default is
False
.- provide_verticesbool,
optional
Whether to get node coordinates. The default is
True
.- provide_facesbool,
optional
Whether to get face connectivity. The default is
True
.- provide_faces_centroidbool,
optional
Whether to get face centroids. The default is
False
.- provide_faces_normalbool,
optional
Whether to get faces normal. The default is
False
- surface_ids
- Returns:
- Return type:
- add_vector_fields_request(field_name, surface_ids=None, surface_names=None)#
Add request to get vector field data on surfaces.
- get_fields()#
Get data for previously added requests and then clear all requests.
- Returns:
- Return type:
Bases:
RuntimeError
Exception class for when field is unavailable.
- class ansys.fluent.core.services.field_data.ScalarFieldData(i_d, data)#
Bases:
BaseFieldData
Contains scalar field data.
Classes:
ScalarData
(data)Stores and provides the data as a scalar.
Methods:
__init__
(i_d, data)- class ScalarData(data)#
Bases:
object
Stores and provides the data as a scalar.
Methods:
__init__
(data)- __init__(data)#
- __init__(i_d, data)#
- exception ansys.fluent.core.services.field_data.ScalarFieldNameError(field_name, allowed_values)#
Bases:
FieldNameError
Exception class for errors in scalar field name.
- __init__(field_name, allowed_values)#
__init__ method of ScalarFieldNameError class.
Bases:
FieldUnavailable
Exception class for when scalar field is unavailable.
__init__ method of ScalarFieldUnavailable class.
- class ansys.fluent.core.services.field_data.SurfaceDataType(value)#
Bases:
IntEnum
Provides surface data types.
Attributes:
- FacesCentroid = 4#
- FacesConnectivity = 2#
- FacesNormal = 3#
- Vertices = 1#
- exception ansys.fluent.core.services.field_data.SurfaceNameError(surface_name, allowed_values)#
Bases:
ValueError
Exception class for errors in surface name.
- __init__(surface_name, allowed_values)#
__init__ method of SurfaceNameError class.
- class ansys.fluent.core.services.field_data.Vector(x, y, z)#
Bases:
object
Stores the data as a vector
(x, y, z)
.Methods:
__init__
(x, y, z)Attributes:
- __init__(x, y, z)#
- class ansys.fluent.core.services.field_data.VectorFieldData(i_d, data, scale)#
Bases:
BaseFieldData
Provides a container for vector field data.
Classes:
VectorData
(x, y, z)Stores and provides the data as a vector.
Methods:
__init__
(i_d, data, scale)Attributes:
- class VectorData(x, y, z)#
Bases:
Vector
Stores and provides the data as a vector.
Methods:
__init__
(x, y, z)- __init__(x, y, z)#
- __init__(i_d, data, scale)#
- exception ansys.fluent.core.services.field_data.VectorFieldNameError(field_name, allowed_values)#
Bases:
FieldNameError
Exception class for errors in vector field name.
- __init__(field_name, allowed_values)#
__init__ method of VectorFieldNameError class.
Bases:
FieldUnavailable
Exception class for when vector field is unavailable.
__init__ method of VectorFieldUnavailable class.
- class ansys.fluent.core.services.field_data.Vertices(i_d, data)#
Bases:
BaseFieldData
Provides a container for the vertex data.
Classes:
Vertex
(x, y, z)Stores and provides the data as a vector of a vertex.
Methods:
__init__
(i_d, data)- class Vertex(x, y, z)#
Bases:
Vector
Stores and provides the data as a vector of a vertex.
Methods:
__init__
(x, y, z)- __init__(x, y, z)#
- __init__(i_d, data)#
- 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.
Error message for unavailable fields.
- Return type: