CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

Plotting coordinates of face centroids

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

LinkBack Thread Tools Display Modes
Old   May 7, 2009, 07:19
Default Plotting coordinates of face centroids
O.D.Y.'s Avatar
Join Date: Mar 2009
Posts: 49
Rep Power: 10
O.D.Y. is on a distinguished road
Hi @all,

I'm trying to display the coordinates of the face centroids of a wall zone via UDM in contur plot panel. I'm using the following UDF to determine the coordinates and to put them into UDMs:

#include "udf.h"

Domain *d;
Thread *t;
face_t f;
real x[ND_ND];

int domain_id, blade_id;

domain_id = 1;
blade_id = 17;

/* get the domain pointer to the flow_domain */
d = Get_Domain(domain_id);

/* get the thread pointer to the bladethread */
t = Lookup_Thread(d,blade_id);


Message("y-coord: %f \n", F_UDMI(f,t,1));



As you can see, I print the y-coordinate to the screen which works perfectly. But when I want to display the UDMs in the contour plot panel, all the values are zero. Can anyone tell where my mistake is?

I'd really appreciate any help.

O.D.Y. is offline   Reply With Quote

Old   May 7, 2009, 08:21
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 10
Daniel Tanner is on a distinguished road
This is a bit painful. Basically the contour plot in fluent only displays cell-centered data, i.e., it interpolates the cell-centre value to the face and then displays it. If you are using F_UDMI you are not storing the values at the cell centre - hence, it will be zero!

You could use C_UDMI instead but I am not sure if the value you save needs to be adjusted to account for the interpolation. See this link for details on using the C_UDMI for displaying face variables:
Daniel Tanner is offline   Reply With Quote

Old   May 7, 2009, 08:47
O.D.Y.'s Avatar
Join Date: Mar 2009
Posts: 49
Rep Power: 10
O.D.Y. is on a distinguished road
Hey Daniel,

that was exactly the hint I needed, thanks a lot!!!!!

O.D.Y. is offline   Reply With Quote


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
BlockMeshmergePatchPairs hjasak OpenFOAM Native Meshers: blockMesh 11 August 15, 2008 07:36
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15

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