CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   x and y distance between cell centroids (

ak6g08 June 29, 2009 13:26

x and y distance between cell centroids

I am looking to implement a finite volume equation directly via the connectivity macros available, and ive come across the 'ds' as the distance between centroids. I dont really want a generic distance between centroids however, I would like the dx and dy values...since I have an orthogonal grid, and want to calculate individual vectors.

is there a function which outputs the x distance between two centroids and faces, and the y distance between them as well (as its cycling across all the cells/faces)? grid is non-uniform. ideally i would like to represent cells in terms of a sort of north,south,east,west type coordinate system, but I cant see how to do that with a UDF. can someone please help..


gemini June 30, 2009 02:44


Use C_CENTROID (UDF manual Section 3.2.2) and F_CENTROID (UDF manual Section 3.2.3) to obtain the coordinates of cell center and face center. Then you can easily calculate any distance you wish...

best luck


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