CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Nv-s ?? Nv-d ?? Help!!! (https://www.cfd-online.com/Forums/fluent-udf/79904-nv-s-nv-d-help.html)

oilsok September 8, 2010 06:33

Nv-s ?? Nv-d ?? Help!!!
 
Quote:

#include "udf.h"
DEFINE_GRID_MOTION(plate,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(omega), NV_VEC(axis), NV_VEC(dx);
real NV_VEC(origin), NV_VEC(rvec);
real sign;
int n;
/* set deforming flag on adjacent cell zone */
SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));
sign = -5.0 * sin (26.178 * time);
Message ("time = %f, omega = %f\n", time, sign);
NV_S(omega, =, 0.0);
NV_D(axis, =, 0.0, 1.0, 0.0);
NV_D(origin, =, 0.0, 0.0, 0.152);

begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
/* update node if x position is greater than 0.02
and that the current node has not been previously
visited when looping through previous faces */
if (NODE_X(v) > 0.020 && NODE_POS_NEED_UPDATE (v))
{
/* indicate that node position has been update
so that it’s not updated more than once */
NODE_POS_UPDATED(v);
omega[1] = sign * pow (NODE_X(v)/0.230, 0.5);
NV_VV(rvec, =, NODE_COORD(v), -, origin);
NV_CROSS(dx, omega, rvec);
NV_S(dx, *=, dtime);
NV_V(NODE_COORD(v), +=, dx);
}
}
}
end_f_loop(f,tf);
}
I don't know that means. I didn't find a whole day in google and UDF manual.

please explain to me..

dmoroian September 10, 2010 07:02

NV_S(omega,=,0.0); is equivalent to: omega[0] = 0.0; omega[1] = 0.0; omega[2] = 0.0;
NV_D(axis,=,0.0,1.0,0.0); is equivalent to: axis[0] = 0.0; axis[1] = 1.0; axis[2] = 0.0;


All times are GMT -4. The time now is 10:02.