CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   How Fluent calculates the C_Centroid for 3D cell (http://www.cfd-online.com/Forums/fluent-udf/118399-how-fluent-calculates-c_centroid-3d-cell.html)

 yiphome May 27, 2013 05:54

How Fluent calculates the C_Centroid for 3D cell

Hello all,

I am programming a UDF to input cell-wise heat source. I obtained the C_CENTROID from UDF and try to match with the cell center location calculated by myself, but some cells come out a difference in 1e-4 m in cell size of ~1e-3 m.

I calculated the cell center in this way: Centroid_X = (x1+x2+ ...+ Xn)/n, Centroid_Y=... . It is a correctly way to calculate the coordinates of Centroid? How Fluent calculates C_Centroid for polyhedron 3D cells?

Best regards,
yiphome

 flotus1 May 27, 2013 06:34

So the xn in your equation are the coordinates of the cell vertices and you evaluate the cell centroid as their average?

Think of a hexahedron where you split one of the six faces into lots of smaller faces, creating many vertices.
Now the more you split the face, the more the cell centroid turns into the centroid of the face.
To prevent this, you could calculate a weighted average instead, using the area of the adjacent faces as weighting factors.

I actually dont know what fluent does. Isnt this somewhere in the manual?

 yiphome May 27, 2013 09:02

Yes you are right. But in case of PYRA5 I get different center point with Fluent. That is strange.

Best regareds,
Yuefeng

 blackmask May 27, 2013 20:50

You agreed with Alex, yet you do nothing more than repeating that your question. What is the way FLUENT calculates the centroid and how do you know it? What is your algorithm?

 All times are GMT -4. The time now is 08:20.