CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Help me with the grid motion of udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 13, 2012, 14:49
Default Help me with the grid motion of udf
  #1
New Member
 
James Yuan
Join Date: Apr 2012
Posts: 3
Rep Power: 14
yuanyeyzygo is on a distinguished road
I want to simulate about a kind of airfoil in the fluent. the motion of this airfoil is flexible. So i am told that the "rigid body" cannot be used. So i use the user defined and use the function of "define grid motion".But i can hardly see the wall moved when i click the display zone motion.
so...
please help me.
here is my udf file.and that is my only udf files, did i need to use another function to identify the "THREAD"????

help me~~~


#include "udf.h"
#include "dynamesh_tools.h"


DEFINE_GRID_MOTION(udf, domain, dt, time, dtime)
{
face_t f;
Thread *tf; /* pointer to a thread*/
real NV_VEC (omega), NV_VEC (axis), NV_VEC (dx);
real NV_VEC (origin), NV_VEC (rvec);
int n;
Node *v;
real sign,x,y,z,p;
tf=DT_THREAD(dt);

/* set deforming flags */
SET_DEFORMING_THREAD_FLAG (THREAD_T0(tf));


sign = sin (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);
y=NODE_Y(v);
x=NODE_X(v);
if(x<0.3)
{
if(NODE_POS_NEED_UPDATE(v))
{
NODE_POS_UPDATED(v);

y =sign *(0.01*x+3.8*sin(0.3768*x)+3.5+2*cos(0.5652*x));
NV_VV (rvec, =, NODE_COORD (v), -, origin);
NV_S (dx, *=, dtime);
NV_V (NODE_COORD (v), +=, dx);


}
}
}
}
end_f_loop (f, tf);
}
yuanyeyzygo is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF problem: incorrect grid motion Fil FLUENT 5 December 19, 2020 10:16
Simulating Particle motion in tube using UDF alib022 Fluent UDF and Scheme Programming 6 March 27, 2017 05:49
please help valve motion UDF g-wagon Fluent UDF and Scheme Programming 0 December 28, 2011 23:21
MapFields to New Grid For Extreme Grid Deformations due to Body Motion albcem OpenFOAM 0 May 5, 2009 15:17
fluent probelm"mesh motion udf" bestrcsekhar Main CFD Forum 0 November 2, 2008 02:38


All times are GMT -4. The time now is 21:51.