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/)
-   -   UDF for oscillatory motion (https://www.cfd-online.com/Forums/fluent-udf/137956-udf-oscillatory-motion.html)

NGH June 25, 2014 21:44

UDF for oscillatory motion
 
I have write the following UDF and using NACA 0012 as the fish geometry. The UDF compiled without error in Fluent but the foil does not move at all. Im doing a 2D case. What could be the issue? Any advice is greatly appreciated. Thanks

#include "udf.h"
DEFINE_GRID_MOTION(upper,domain,dt,time,dtime)
{
Thread *tf=DT_THREAD(dt);
face_t f;
Node *v;
real amp,omega, delta_y;
amp=0.05;
omega=5;
int n;
SET_DEORMING_THREAD_FLAG(THREAD_T0(tf));
begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v=F_NODE(f,tf,n);
if(NODE_POS_NEED_UPDATE(v))
{
NODE_POS_UPDATED(v);
delta_y=amp*sin(omega*time);
NODE_Y(v)=NODE_Y(v)+delta_y;
}
}
}
end_f_loop(f,tf);
}


All times are GMT -4. The time now is 22:25.