ansys.fluent.core.file_session#
Provides a module for file session.
Classes:
|
File field data. |
|
File field info. |
File session to read case and data file. |
|
|
Populates field data on surfaces. |
Exceptions:
Raised when a field name is inappropriate. |
|
Raised when multi-phase field name is inappropriate. |
- class ansys.fluent.core.file_session.FileFieldData(file_session, field_info)#
Bases:
object
File field data.
Methods:
__init__
(file_session, field_info)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 and faces connectivity).
get_vector_field_data
(field_name, surfaces)Get vector field data on a surface.
Create a new field transaction.
- __init__(file_session, field_info)#
- get_pathlines_field_data(field_name, surfaces)#
Get the pathlines field data on a surface.
- 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.
- Raises:
InvalidMultiPhaseFieldName
If field name does not have prefix
phase-
for multi-phase cases.
- get_surface_data(data_types, surfaces, overset_mesh=False)#
Get surface data (vertices and faces connectivity).
- Parameters:
- Returns:
Vertices
|FacesConnectivity
|Dict
[int
,Vertices
|FacesConnectivity
]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.
- Raises:
InvalidFieldName
If any field other than
"velocity"
is provided.InvalidMultiPhaseFieldName
If field name does not have prefix
phase-
for multi-phase cases.
- new_transaction()#
Create a new field transaction.
- class ansys.fluent.core.file_session.FileFieldInfo(file_session)#
Bases:
object
File field info.
Methods:
__init__
(file_session)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).
- __init__(file_session)#
- 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
- class ansys.fluent.core.file_session.FileSession#
Bases:
object
File session to read case and data file.
Methods:
__init__
()__init__ method of FileSession class.
read_case
(case_file_name)Read Case file.
read_data
(data_file_name)Read Data file.
Attributes:
Fluent field data on surfaces.
Provides access to Fluent field information.
- __init__()#
__init__ method of FileSession class.
- property field_data#
Fluent field data on surfaces.
- property field_info#
Provides access to Fluent field information.
- read_case(case_file_name)#
Read Case file.
- read_data(data_file_name)#
Read Data file.
- exception ansys.fluent.core.file_session.InvalidFieldName#
Bases:
ValueError
Raised when a field name is inappropriate.
- __init__()#
- exception ansys.fluent.core.file_session.InvalidMultiPhaseFieldName#
Bases:
ValueError
Raised when multi-phase field name is inappropriate.
- __init__()#
- class ansys.fluent.core.file_session.Transaction(file_session, field_info)#
Bases:
object
Populates field data on surfaces.
Methods:
__init__
(file_session, field_info)__init__ method of Transaction 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__(file_session, field_info)#
__init__ method of Transaction class.
- add_pathlines_fields_request(field_name, surfaces)#
Add request to get pathlines field on surfaces.
- 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:
- Raises:
InvalidMultiPhaseFieldName
If field name does not have prefix
phase-
for multi-phase cases.
- 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.
- Parameters:
- Returns:
- Raises:
InvalidMultiPhaseFieldName
If field name does not have prefix
phase-
for multi-phase cases.
- get_fields()#
Get data for previously added requests and then clear all requests.
- Returns:
- Raises:
InvalidFieldName
If any field other than
"velocity"
is provided.