CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   A sample UDF in Fluent Documenation (https://www.cfd-online.com/Forums/fluent/31237-sample-udf-fluent-documenation.html)

majestywzh April 8, 2003 21:03

A sample UDF in Fluent Documenation
 
#include "udf.h"

DEFINE_PROFILE(pressure_profile, t, i) { real x[ND_ND];/* this will hold the position vector*/ real y; face_t f;

begin_f_loop(f, t)

{

F_CENTROID(x,f,t);

y = x[1];

F_PROFILE(f, t, i) = 1.1e5 - y*y/(.0745*.0745)*0.1e5;

} end_f_loop(f, t) }

1.I'd like to know what is mean of"ND_ND"in the declare real x[ND_ND].

2."y = x[1]"returns the y component of cell centroid positioin,but how about the x component and z component?


Alex Munoz April 8, 2003 22:44

Re: A sample UDF in Fluent Documenation
 
hi Majestic friend

the real x [Nd Nd] give you the node coordinates

the second question the centroids is an array of three float values that according with c programming the array start on 0 for the first value and finist on 2 for the thhird value

x=x[0] y=x[1] z=x[2]

Regards

Alex



All times are GMT -4. The time now is 03:16.