CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Cell centres (http://www.cfd-online.com/Forums/main/6199-cell-centres.html)

Tom June 4, 2003 02:41

Cell centres
 
Hi, what is the most accurate method to calculate the centre of a general polyhedral cell?

John June 4, 2003 05:28

Re: Cell centres
 
Divide it into tetrahedrals and calculate the individual tetra center: the polyhedral center is sumup(ViCi)/sumup(Vi), where Vi is volume of each tetra, and Ci is the center of each tetra.

Tom June 4, 2003 08:56

Re: Cell centres
 
Thank you. Will do, but how do I calculate the centre of a tet?

Tom June 4, 2003 09:04

Re: Cell centres
 
...and the volume of a tet for that matter?

thank you

Ananda Himansu June 4, 2003 12:28

Re: Cell centres
 
the centroid of a tet (or any simplex, the tet being a 3D simplex) is the arithmetic average of [the position vectors representing] its vertices. note that such a statement is not in general true for polytopes other than simplices, which is why you have to decompose a general polyhedron into tets.

pick any vertex of the tet. label it "O". label, in any order, the other three vertices "A", "B", "C". denote the vector from O to A by the label "a", from O to B by "b", similarly "c". the volume of the tet is one-sixth of the magnitude of the scalar or "box" product of the three vectors a, b, c. that is, volume(OABC)=|a.(bxc)|/6. (the analogous formula for a triangle embedded in 3D is that the area of triangle OAB is half the magnitude of the cross-product of a and b, that is, area(OAB)=||axb||/2.)

the decomposition of general polyhedra into the union of tetrahedra with plane faces is not in general exact. for example, if a polyhedron has a quadrilateral for a side, the vertices of the quad need not lie in a plane. then the decomposition of the quad into two or more tets is only an approximation.

these issues have been noted in old papers, and are probably discussed in any CFD text that explains unstructured meshes. also probably covered previously in this forum (do a search).

john June 4, 2003 14:54

Re: Cell centres
 
Another means is to calculate the determinate of the following expression:

V=(1/6)*|x1 y1 z1 1 |

|x2 y2 z2 1 |

|x3 y3 z3 1 |

|x4 y4 z4 1 |

where the x, y & z's are the coordinates of the respective points defining the tetrahedron. Note that the volume will always be positive, even though the value of the determinate might be negative depending upon the ordering of the points.



All times are GMT -4. The time now is 13:19.