CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Sos!!! Udf code (

Jo_vivian_lee August 8, 2012 08:53

Sos!!! Udf code
Hi there,
I am working on a UDF CODE which is as below, but it doesn`t work for me, could you please check what mistakes I have made? Thank you in advance.
I think the problem is the function what I used, I want to describe that power 1/6 of (0.003125-fabs(x)), how? and also, x should be an absolute value

#include "udf.h"
real pos[ND_ND];
real x, t;
face_t f;
begin_f_loop(f, thread)
F_CENTROID(pos, f, thread);
F_PROFILE(f,thread,index) =pow((0.003125-fabs(x)),(1/6))*39.75287884+0.3*15.2*sin(1600*3.1415926*t);
end_f_loop(f, thread)

blackmask August 16, 2012 00:09

Use 1.0/6 instead of 1/6, the latter is 0 which may not what you expected. Also make sure that abs(x) does not exceed 0.003125

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