CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Grid motion with UDF (http://www.cfd-online.com/Forums/fluent-udf/74628-grid-motion-udf.html)

fivos April 5, 2010 08:49

Grid motion with UDF
 
Hi to everyone !

I am trying to simulate a moving grid using Fluent dynamic mesh. I have created a structured quad mesh and used layering as a dynamic meshing technique. The grid motion is set from the Dynamic mesh zones Create/Edit menu as User-defined and the UDF supplied is the following :

#include"udf.h"
DEFINE_GRID_MOTION(motion,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(axis);
real displ;
int n;

displ=-17.2*dtime; // grid displacement
NV_D(axis, =, 0.0, 1.0, 0.0);


begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
/* update node if the current node has not been previously
visited when looping through previous faces */
if ( 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);
NV_V_VS(NODE_COORD(v), =, NODE_COORD(v), +, axis,*,displ);
}
}
}
end_f_loop(f,tf);
}

This simple UDF was based on the DEFINE_GRID_MOTION example in the fluent 12 UDF manual. What it actually does is that it displaces the mesh on the Y-axis (axis : 0, 1,0), by -17.2 * time_step (17.2 is the mesh velocity).

The UDF compiles and loads and the mesh moves and new elements are generated/merged at stationary zones.

But my problem is that when I calculate the mesh velocity, by simply finding its displacement between two times, the mesh velocity is substantially lower than the one set in the UDF (~10m/sec instead of 17.2m/sec) !

What I am missing here? Any ideas are welcome.

Thank you in advance.

fivos April 5, 2010 10:44

I am posting myself because I found the cause of the problem. The problem was not the UDF at all, but the wrong time intervals for the extraction of the output data files.

rafik10 February 27, 2011 05:51

can you help me
 
:)have you, sir , tutorials a bout this domain?
my boreblem is to similate fllaping NACA0012 in 2D of tow degree of 2 freedom.
I try to do it with moving gird mesh , but i cant do it :(.
please
email: bouakkaz10@yagoo.fr


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