Module containing the FluidMeshInfo class.

FluidMeshInfo#

class ansys.dpf.post.mesh_info.FluidMeshInfo(core_mesh_info: MeshInfo)#

Holds the metadata relative to a fluid mesh.

This class describes the available mesh information. Use this to gather information about a large mesh prior to loading it to define requests on limited parts of the mesh for improved performance.

Parameters:

core_mesh_info (MeshInfo) – Hold the information of the mesh region into a generic data container.

Examples

Explore the mesh info from the model

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> files = examples.download_fluent_axial_comp()
>>> simulation = post.FluidSimulation(cas=files['cas'][0], dat=files['dat'][0])
>>> mesh_info = simulation.mesh_info
>>> print(mesh_info)  
Fluid mesh metadata
-------------------
Number of nodes: 16660
Number of faces: 45391
Number of cells: 13856
Cell zones:
    {13: 'fluid-rotor', 28: 'fluid-stator'}
Face zones:
    {2: 'default-interior:0',..., 27: 'stator-per-1-shadow'}
Cell to face zones:
    {13: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],...}
property num_nodes: int#

Returns the number of nodes in the mesh.

Examples

Get the number of nodes in the mesh

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> files = examples.download_fluent_axial_comp()
>>> simulation = post.FluidSimulation(cas=files['cas'][0], dat=files['dat'][0])
>>> mesh_info = simulation.mesh_info
>>> print(mesh_info.num_nodes)
16660
property num_faces: int#

Returns the number of faces in the mesh.

Examples

Get the number of faces in the mesh

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> files = examples.download_fluent_axial_comp()
>>> simulation = post.FluidSimulation(cas=files['cas'][0], dat=files['dat'][0])
>>> mesh_info = simulation.mesh_info
>>> print(mesh_info.num_faces)
45391
property num_cells: int#

Returns the number of cells in the mesh.

Examples

Get the number of cells in the mesh

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> files = examples.download_fluent_axial_comp()
>>> simulation = post.FluidSimulation(cas=files['cas'][0], dat=files['dat'][0])
>>> mesh_info = simulation.mesh_info
>>> print(mesh_info.num_cells)
13856
property face_zones: dict#

Returns a dictionary of face zones in the mesh.

Examples

Get information on the face zones available in the mesh

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> files = examples.download_fluent_axial_comp()
>>> simulation = post.FluidSimulation(cas=files['cas'][0], dat=files['dat'][0])
>>> mesh_info = simulation.mesh_info
>>> print(mesh_info.face_zones)  
{2: 'default-interior:0', 3: 'rotor-hub', ...26: 'stator-per-1', 27: 'stator-per-1-shadow'}
property cell_zones: dict#

Returns a dictionary of cell zones (bodies) in the mesh.

Examples

Get information on the cell zones available in the mesh

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> files = examples.download_fluent_axial_comp()
>>> simulation = post.FluidSimulation(cas=files['cas'][0], dat=files['dat'][0])
>>> mesh_info = simulation.mesh_info
>>> print(mesh_info.cell_zones)  
{13: 'fluid-rotor', 28: 'fluid-stator'}
property cell_zones_to_face_zones: dict#

Returns a map between cell zone (body) IDs and their associated face zone IDs.

Examples

Get the mapping between cell zone IDs and face zone IDs

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> files = examples.download_fluent_axial_comp()
>>> simulation = post.FluidSimulation(cas=files['cas'][0], dat=files['dat'][0])
>>> mesh_info = simulation.mesh_info
>>> print(mesh_info.cell_zones_to_face_zones)  
{13: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
28: [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]}