CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Cell centroid and cell volume in general, and in Fluent (https://www.cfd-online.com/Forums/main/69158-cell-centroid-cell-volume-general-fluent.html)

zmester October 13, 2009 18:07

Cell centroid and cell volume in general, and in Fluent
 
Hi

Is there anyone who can explain me how do the cell centroid(c_centroid) and cell volume(C_Volume) functions of Fluent work? What method they use to calculate the centroid and the volume of a cell. Im writing my code, and would like to create functions similar to these.Thanks.

esozer October 17, 2009 10:09

I don't how fluent does this but the following will work for arbitrary cell geometries:

Code:

Loop faces
  Loop face nodes
    Form a triangle using two subsequent face nodes and a point within the face (e.g  average of face nodes)
    Calculate the resulting triangle area
    Add to face area
    Form a tetra using the triangle and a point within the cell volume
    Calculate tetra volume
    Add to cell volume
    Tetra centroid is known (google it)
    cell_centroid=cell_centroid+tetra_volume*tetra_centroid
  End face node loop
End face loop

cell_centroid=cell_centroid/cell_volume

Hope this helps.

zmester October 17, 2009 10:55

Thank you for your answer. Since i asked i have already find an other method using the divergence theorem (Gauss) to transform volume integrals to surface integrals.

esozer October 17, 2009 11:05

Right, that will work too. I preferred the method I described since it will give the face areas, face centroids, cell volumes and cell centroids in one swipe.

Good luck with your code.


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