CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   3D wing (flapping elastically) flexing UDF problem (

djan February 20, 2012 11:49

3D wing (flapping elastically) flexing UDF problem
1 Attachment(s)
Hello, Im trying to simulate the flexing( flapping up and down elastically) of a wing in 3D. But im having problems with the UDF, its just rotating the wing along the x direction instead of updating the y position based on the position of the z position to flap it down. I'd be very happy if somebody could help me with it. Im attaching a picture showing only the wing to help with axis. The UDF im using is as follows:

DEFINE_GRID_MOTION(wing, domain, dt, time, dtime)
Thread *tf = DT_THREAD (dt);
face_t f;
Node *v;
real NV_VEC (axis), dy;
real NV_VEC (origin);

int n;

/* set deforming flag on adjacent cell zone */

Message (
"time = %f\n", time);

NV_D (axis, =, 0.0, 0.0, 1.0);
NV_D (origin, =, 0.0, 0.0, 0.0);

begin_f_loop (f, tf)
f_node_loop (f, tf, n)
v = F_NODE (f, tf, n);
/* update node if z position is greater than 0.000
and that the current node has not been previously
visited when looping through previous faces */
if (NODE_Z (v) > 0.000 && NODE_POS_NEED_UPDATE (v))
/* indicate that node position has been update
so that it's not updated more than once */
dy = (0.0271*pow (NODE_Z (v), 2)) + (0.2496*NODE_Z (v)) + 0.1396;
NODE_Y (v) = NODE_Y (v) + dy;
end_f_loop (f, tf);

hhh February 27, 2012 02:28

3D flapping wing
Dear djan,
i am also trying to do analysis in flapping wing(dragonfly),i draw cad model in catia,and i did mesh in gambit right now i am trying to write udf and compile in fluent ,i dont know how to write, i saw your post i want some help from you i am starting stage only for write udf.kindly guide me

cdf_user March 16, 2012 03:37

either something wrong with your equation
or the way you update ur nodes

I think it has something to do with updating the nodes

imbaasat March 30, 2012 11:37

function probably seem to be parabolic. for flapping, sinsusoidal is required. moreover time varation be also included.

All times are GMT -4. The time now is 19:53.