Error message udf file
Hello,
i want to introduce a velocity profile at the inlet of a 3D tube. My udf file is: #include "udf.h" DEFINE_PROFILE(inlet_z_velocity,thread,index) { real z[ND_ND]; real x; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(z,f,thread); x = x[0]; y = x[1]; F_PROFILE(f,thread,index) = 0.217*pow(pow((pow(y,2)+pow(x,2)),0.5)/3.9,1/7); } end_f_loop(f,thread) } When i put it in fluent i've got the message line11: subscripted expression is not an array or pointer : double Thks for your help |
Hi,
I think z = x[2]; has to be added. Check and see. |
Now fluent read the file but it is not what i expect
To be more precise, the face is on the XY plane and the velocity orientated in the z direction. But if i check the initialization, the profile is flat. I modified the file like that:#include "udf.h" DEFINE_PROFILE(inlet_z_velocity,thread,index) { real z[ND_ND]; real x; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(z,f,thread); x = z[1]; y = z[2]; F_PROFILE(f,thread,index) = 0.217*pow(pow((pow(y,2)+pow(x,2)),0.5)/3.9,1/7); } end_f_loop(f,thread) } |
You want to calculate velocity magnitude in z direction?
If I understand what you want, that could be like that: Code:
#include "udf.h" |
Yes exactly.
It's working well with 1./7 Thanks a lot |
All times are GMT -4. The time now is 13:23. |