-
-
March 28, 2023 at 12:36 amKenneth.FungSubscriber
Hi,
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 pmRobForum Moderator
The 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 pmKenneth.FungSubscriber
My 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 amRobForum Moderator
Are 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 pmKenneth.FungSubscriber
I'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 amKenneth.FungSubscriber
I’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 pmRobForum Moderator
A 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.
-
- The topic ‘Determine cell and face centroids of HDF5 Fluent files in Python using h5py’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- error udf
- Script error Code: 800a000d
- Fluent fails with Intel MPI protocol on 2 nodes
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Encountering Error in Heterogeneous Surface Reaction
-
1191
-
518
-
488
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.