
[Sponsors] 
November 27, 2012, 15:14 
f_centroid and c_centroid definition

#1 
New Member
Balti
Join Date: Nov 2012
Posts: 17
Rep Power: 7 
Hi
I used F_CENTROID(x,f,t) and C_CENTROID(cell,c,t) but I want to obtain  in one hand, simple centres (average of vertices)  in other hand, barycentric/geometric centres who can explain me how do the cell centroid(c_centroid) and f_centroid functions of Fluent work? Is it barycentric/geometric centres or just average of vertices ? Thanks 

November 27, 2012, 17:28 

#2 
Senior Member

What a FV method needs as face (volume) centroid is the point around which the first order moments of the face (volume) are nullified, in order for the approximation made in using it being 2nd order. By definition, this points are the centroids of the face (volume) and not the averages of the vertices; indeed, for general polygonal faces and polyhedral volumes, the two are different. For more information, refer to this:
http://www.public.iastate.edu/~zjw/p...1999AIAAJ.pdf If you need averages of vertex coordinates than you need to compute them by yourselves. 

November 28, 2012, 09:58 

#3 
New Member
Balti
Join Date: Nov 2012
Posts: 17
Rep Power: 7 
Dear Sbaffini, Thanks a lot for your very fast answer.
I read the paper and if I well understand:  to obtain the centroid of a face, it is decomposed into triangle and the center of the face is equal to SUM_triangle ( the center of triangle x area of the triangle )  SUM_triangle area of Triangle  but for the calculation of the centroid of a cell, it is more complicated, I don't understand very well, but is it correct to say to obtain the centroid of a cell, it is decomposed into tetrahedra (not pyramid) and the center of the cell is equal to SUM_tetra ( the center of the tetra x Volume of the tetra )  SUM_tetra Volume of Tetra C_centroid do that ? Thanks again 

November 28, 2012, 10:22 

#4 
Senior Member

Yeah, you are correct, but the idea of the proposed algorithm is to avoid computing the volumes of all the tetrahedra, which can be a lot.
Take also a look at how Code_Saturne (EDF open code) does it: http://codesaturne.org/cms/sites/de...ry3.0b_0.pdf under Mesh Handling Algorithms (pag. 352). Last edited by sbaffini; November 28, 2012 at 10:26. Reason: Made an error in evaluating the proposed reference 

November 29, 2012, 06:39 

#5 
New Member
Balti
Join Date: Nov 2012
Posts: 17
Rep Power: 7 
Thanks again.
For the center of face I obtain the same results that F_CENTROID method (thanks) But for the center of cell, I have some problems To calculate the centroid I implemented  the (new) Saturn Code method: SUM_i AreaSurf_i VectorCente_i / SUM_i AreaSurf_i  the (old) Saturn Code method: 1/N*SUM_i CoordinateVertex_i  the WANG (AIAA Vol 37) method  the method that I described above  also a simple average of the vertices (to test it)  also a simple average of the face center (to test it) First the results are all different and none of these methods give the same result that C_CENTROID... So I wonder what is the definition of C_CENTROID used by Fluent ? I'm very frustated to use C_CENTROID without understand what this method calculate really ! 

November 29, 2012, 07:27 

#6 
Senior Member

Dear Balti,
welcome to the Fluent users club!!! Jokes apart, i never tried this test (i did it for the mass fluxes and the results is as astonishing as yours for the cell centroid). What i can say is: 1) Try first with a regular cartesian mesh, where they should be all equal (i think) 2) The Wang method is the only exact one from the above ones. Consider that, in applying it, you should first split every face in triangles and apply it over them. Also, as i remember, these triangles can't be oriented randomly but such that, going over them, you go trough the face perimeter in one sense and this sense is in accordance with the right hand rule and the face outward normal... that is, signs matter. 3) The methods we discussed above are, by no means, inclusive of all the possible approaches to compute the cell centroid. As also discussed in the Code_Saturne manual, they were also using a different (incorrect) method before switching to the present one. As a matter of fact, in FV methods, cell centroids are only useful to know the location of the variables; the second order accuracy is obtained if it is the real centroid but if an incorrect method worked for Code_Saturne (which still was proved to be 2nd order) than i guess it can work for Fluent too. Last edited by sbaffini; November 29, 2012 at 07:34. Reason: Made a wrong assumption in point 3 

December 5, 2012, 10:55 

#7 
New Member
Balti
Join Date: Nov 2012
Posts: 17
Rep Power: 7 
Dear sbaffini,
Thanks a lot for your advices. I generate some trivial mesh with two cells and planar faces (and also some more complicated meshes). I found some error in my code and my conclusion is: to find the center of the cell closest to the result given by C_CENTROID(...) I need to  for TETRA, I directly calculated it  for other cells:  decomposed into tetrahedra (not pyramid) using * a common apex equal to the average of vertices of the cell (first estimation of the center) * the (not triangular) faces are shared into triangle using a first estimation of the center of face given by the average of vertices of the face  and the center of the cell is equal to SUM_tetra ( the center of the tetra x Volume of the tetra )  SUM_tetra Volume of Tetra 

Tags 
average, barycentric, centroid 
Thread Tools  
Display Modes  

