-
-
March 28, 2023 at 12:36 am
K
SubscriberHi,
I have a bunch of data files which I would like to post-process in Python. To do this, I use the h5py library to import the data files.
Does anyone know how to determine the centroids of the cells and boundary faces from the mesh, case, or data files?
Using the HDF5 viewer, I found that the mesh and case files contains nodal coordinates under "/meshes/1/nodes/coords/3404", but I could not find any information which indicates which cell/face corresponds to which collection of nodes.
-
March 28, 2023 at 2:12 pm
Rob
Ansys EmployeeThe best way to figure things like this out is to create a very simple model (10-20 cells) with a simple result (initialise to constant values) and then start working through what's written out. Some of the data structures are covered here https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_ug/flu_ug_chp_fileformat.html
-
March 28, 2023 at 10:34 pm
K
SubscriberMy issue is with the groups in the case data file. Under "/meshes/1/cells", there's "ctype" and "zoneTopology", neither of which seems to give information about the actual connectivity of the mesh. In the link you posted, it also seems that the case file under "/meshes/1/cells" in Figure 1 is different to that shown in Figure 3. My case file resembles Figure 3, where there the "/meshes/1/cells/nodes" group doesn't exist, so I'm rather confused by this.
-
March 29, 2023 at 8:46 am
Rob
Ansys EmployeeAre you using 2d or 3d? I know people who've been tinkering with the case and data files for "stuff" but no details, and nothing other than DOC that I can share. This assumes there's nothing in Minerva or Optislang documentation as those tools take Fluent data for various purposes.
-
March 29, 2023 at 10:57 pm
K
SubscriberI'm using 3d. I'm using it to perform some calculations on the data, which would be easier to do with Python than a UDF.
-
March 30, 2023 at 4:45 am
K
SubscriberI’ve figured out a workaround to get the cell and face centroids: I can just assign the x,y,z centroid locations to 3 UDM memory locations.
However, I also need to get the node coordinates corresponding to each boundary face for some other calculations. Are you able to help me confirm whether my following 2 interpretations of the HDF5 case file groups are correct?
1. I first need to determine whether or not a face is a boundary face. Boundary faces will have only have c0, but not c1. Based on analyzing a few faces on the boundary, I believe that the indexing in “/meshes/faces/c0/1” indexes boundary faces first, followed by interior faces. E.g. if there’s 10 faces and 3 of them are boundary faces, then index 0 to 2 corresponds to boundary faces, and index 3 to 9 correspond to interior faces). Is this correct?
2. Once I know the boundary faces, I need to determine their corresponding node locations. The case file has 2 groups in “/meshes/1/faces/nodes/1/”: “nnodes” and “nodes”. “nnodes” seems to correspond to the number of nodes of each face. I’m not quite sure what the integers in “nodes” represents – however, the size of the array seems to match up if I sum up all the numbers in “nnodes”, so my guess is that these are the node numbers corresponding to each face. E.g. if there’s 4 nodes per face, then index 0 to 3 contains the node indices of face 1, index 4 to 7 contains the node indices of face 2, etc. Is this correct?
-
March 30, 2023 at 1:18 pm
Rob
Ansys EmployeeA boundary face will only have C0 (check the UDF manual as it's in there), but a boundary cell could have more than one external facet.
I don't know about the node index, some nodes will be shared but I don't know how they're defined.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5242
-
3299
-
2469
-
1308
-
988
© 2023 Copyright ANSYS, Inc. All rights reserved.