1
$\begingroup$

I have a 3-D structured grid that I am trying to convert over to an unstructured grid.

Here is a picture of the 2-D structured grid with the nodes shown. It is axisymmetric about the x axis (y = 0). I will rotate this to make it 3-D.

My main concern in this conversion is that I need to output the volume of every cell from the structured grid. But as you can see, my cells are irregular hexa/penta-hedras, with non-parallel opposing faces (correct me if I'm wrong and I really hope I'm wrong, but I don't think I am). Does anyone have any suggestions on how to compute the volume of each cell? I have some ideas, but am open to other ideas. A colleague of mine mentioned that I could break up the volumes into tetrahedras and compute the volume that way. That is my #1 option so far.

My ideas are not so simple and the algorithm can get pretty involved. Does any one have a suggestion on how to compute the volume?

$\endgroup$
2
  • 3
    $\begingroup$ ErrorNoPictureAttached. $\endgroup$ Jul 9, 2015 at 12:29
  • $\begingroup$ I think this would be extremely involved for a 3-D grid. I am coding in MATLAB, and I realized there's a function called "convhulln(X)" where X is a matrix of the indices of a volume, that calculates the volume of a convex hull given it's indices. Anyone familiar with this? If so, I think this function is suitable for my purpose? $\endgroup$
    – user16891
    Jul 9, 2015 at 17:25

2 Answers 2

2
$\begingroup$

Note that for any element shape, you can write (here dimension dim = 2, but 3D is similar) $$ V = \frac{1}{dim}\int\limits_K \nabla \cdot (x,y)^T\,dx = \frac{1}{2}\int\limits_{\partial K} (x,y)^T \cdot \mathbf{n}\,ds $$ Using the second integral, you can loop over the faces of each element and integrate on its boundary to obtain volume $V$.

If you have a list of (unique) mesh faces, you can iterate over all faces and contribute to the volume of left/right element adjacent to each face with a $\pm$ sign depending on the orientation of the normal with respect to the element.

This does not completely solve your problem in the sense that even the cell faces might have other shapes that triangles and quadrilaterals (for which you can find quadrature formulas easily) and hence you might be anyway forced to do some element subdivision. This is perhaps still easier for 2D faces rather than 3D cells.

$\endgroup$
0
$\begingroup$

Take a look at this Efficient Computation of Volume of Hexahedral Cells. It explains several methods to calculating the volume using algebraic equation (instead of integration), and the first method is very straightforward and does not need a complicated algorithm.

And if you have problem for finding the outward normal based on order of points, choose an arbitrary point inside of the hexahedra and use dot product to find the direction of normal vector.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.