CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

f_centroid and c_centroid definition

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Balti

Reply
 
LinkBack Thread Tools Display Modes
Old   November 27, 2012, 15:14
Lightbulb f_centroid and c_centroid definition
  #1
New Member
 
Balti
Join Date: Nov 2012
Posts: 16
Rep Power: 4
Balti is on a distinguished road
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
Balti is offline   Reply With Quote

Old   November 27, 2012, 17:28
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 531
Blog Entries: 14
Rep Power: 17
sbaffini will become famous soon enough
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...1999-AIAAJ.pdf

If you need averages of vertex coordinates than you need to compute them by yourselves.
sbaffini is offline   Reply With Quote

Old   November 28, 2012, 09:58
Default
  #3
New Member
 
Balti
Join Date: Nov 2012
Posts: 16
Rep Power: 4
Balti is on a distinguished road
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
Balti is offline   Reply With Quote

Old   November 28, 2012, 10:22
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 531
Blog Entries: 14
Rep Power: 17
sbaffini will become famous soon enough
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://code-saturne.org/cms/sites/de...ry-3.0-b_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
sbaffini is offline   Reply With Quote

Old   November 29, 2012, 06:39
Default
  #5
New Member
 
Balti
Join Date: Nov 2012
Posts: 16
Rep Power: 4
Balti is on a distinguished road
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 !
Balti is offline   Reply With Quote

Old   November 29, 2012, 07:27
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 531
Blog Entries: 14
Rep Power: 17
sbaffini will become famous soon enough
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
sbaffini is offline   Reply With Quote

Old   December 5, 2012, 10:55
Default
  #7
New Member
 
Balti
Join Date: Nov 2012
Posts: 16
Rep Power: 4
Balti is on a distinguished road
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
sbaffini likes this.
Balti is offline   Reply With Quote

Reply

Tags
average, barycentric, centroid

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 16:25.