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:
Raised when field is unavailable. |
Functions:
Populates a new field request. |
|
|
Override function help text. |
- 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)__init__ method of BaseFieldData class.
Attributes:
Returns data.
Returns size of data.
Returns surface ID.
- __init__(i_d, data)#
__init__ method of BaseFieldData class.
- property data#
Returns data.
- property size#
Returns size of data.
- property surface_id#
Returns 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])__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.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)__init__ method of FacesCentroid class.
- class Centroid(x, y, z)#
Bases:
Vector
Stores and provides the face centroid data as a vector.
Methods:
__init__
(x, y, z)__init__ method of Centroid class.
- __init__(x, y, z)#
__init__ method of Centroid class.
- __init__(i_d, data)#
__init__ method of FacesCentroid class.
- 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)__init__ method of FacesConnectivity class.
- 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__ method of Faces class.
- __init__(node_count, node_indices)#
__init__ method of Faces class.
- __init__(i_d, data)#
__init__ method of FacesConnectivity class.
- 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)__init__ method of FacesNormal class.
- class Normal(x, y, z)#
Bases:
Vector
Stores and provides the face normal data as a vector.
Methods:
__init__
(x, y, z)__init__ method of Normal class.
- __init__(x, y, z)#
__init__ method of Normal class.
- __init__(i_d, data)#
__init__ method of FacesNormal class.
- 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=[])#
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:
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.
- get_surface_data(data_types, surfaces, overset_mesh=False)#
Get surface data (vertices, faces connectivity, centroids, and normals).
- Parameters:
- data_types
List
[SurfaceDataType
] |List
[str
], 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:
Vertices
,FacesConnectivity
,FacesNormal
,FacesCentroid
|Dict
[int
,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.
- get_vector_field_data(field_name, surfaces)#
Get vector field data on a surface.
- Parameters:
- Returns:
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.
- 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=[])#
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.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)__init__ method of ScalarFieldData class.
- class ScalarData(data)#
Bases:
object
Stores and provides the data as a scalar.
Methods:
__init__
(data)__init__ method of ScalarData class.
- __init__(data)#
__init__ method of ScalarData class.
- __init__(i_d, data)#
__init__ method of ScalarFieldData class.
- 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'#
- 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)__init__ method of Vector class.
Attributes:
- __init__(x, y, z)#
__init__ method of Vector class.
- 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)__init__ method of VectorFieldData class.
Attributes:
Returns scale of the vector field.
- class VectorData(x, y, z)#
Bases:
Vector
Stores and provides the data as a vector.
Methods:
__init__
(x, y, z)__init__ method of VectorData class.
- __init__(x, y, z)#
__init__ method of VectorData class.
- __init__(i_d, data, scale)#
__init__ method of VectorFieldData 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)__init__ method of Vertices class.
- class Vertex(x, y, z)#
Bases:
Vector
Stores and provides the data as a vector of a vertex.
Methods:
__init__
(x, y, z)__init__ method of Vertex class.
- __init__(x, y, z)#
__init__ method of Vertex class.
- __init__(i_d, data)#
__init__ method of Vertices class.
- 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.