CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF velocity profile at nodes (

Emad January 22, 2009 02:13

UDF velocity profile at nodes
Dear All How apply the fuction for velocity profile in nodes not face_t or centroed for face. I need aply this fuction at nodes. can any one to help me many thanks emad

KJ Larsen January 28, 2009 09:17

Re: UDF velocity profile at nodes
Hello Emad

As I guess this profile is on a plane you want to change the nodal values of certain faces. There is an example of Looping over Nodes of a Face (f_node_loop) (also Cell separately) in the UDF Manual:

face_t f; Thread *t; int n; Node *node; f_node_loop(f,t,n) { . . . node = F_NODE(f,t,n); . . . }

Also NODE_X(node) returns the x co-ordinate of the node pointed to by *node. (similar macros for y and z) so the position can be found.

Afraid I can't see how to change any of the node values let alone the 'i'th property.

Hope this was some help. Kris

Emad January 29, 2009 07:35

Re: UDF velocity profile at nodes
Dear Mr. Kris Many thanks for reply. but if appled your advice for velocity profile in inlet 2d duct (1 * 10)m. if plot velocity at inlet duct and taking node values under options for xy plot for fluent the data appear as

vel y-coor ---- ------ 0.108 1 0.192 0.9 0.252 0.8 0.288 0.7 0.3 0.6 0.288 0.5 0.252 0.4 0.192 0.3 0.108 0.2 0 0.1 0 0

at y=1 should be velocity aqual to zero. My UDF for velocity profile as:- //--------------------------------------------------------------------------- #include "udf.h"

//u=Uave*(3/2)*(1-(y-h/2)/h/2)**2) //taking h=1 and Uave=0.2 m/s DEFINE_PROFILE(vel2d_inlet_velocity,t,i)


real x[ND_ND]; real rady; real py; //real z,y; face_t f; Node *v; int n; begin_f_loop(f,t) { f_node_loop(f,t,n)


v = F_NODE(f,t,n);

py=(NODE_Y(v)-0.5)/0.5; rady = (1.0-pow(py,2));

F_PROFILE(f,t,i) = 0.2*(3.0/2.0)*rady; } } end_f_loop(f,t) }

Many thanks agains for help me emad

All times are GMT -4. The time now is 14:49.