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" DEFINE_PROFILE(unsteady_velocity,thread,index) { real pos[ND_ND]; real x, t; face_t f; begin_f_loop(f, thread) { F_CENTROID(pos, f, thread); x=pos[0]; t=CURRENT_TIME; 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) } |
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 20:41. |