CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Flapping Wing motion (http://www.cfd-online.com/Forums/fluent/75141-flapping-wing-motion.html)

balkrishna April 17, 2010 07:03

Flapping Wing motion
 
I am doing a CFD analysis of flapping wing motion in FLUENT . For the same I have written a UDF which looks like :
Code:

#include "udf.h"

DEFINE_CG_MOTION(myudf, dt, v_cg, omega, time, dtime)
{

    Thread *t;


    real c=0.2;

    real omega_t=6.28;
    NV_S(v_cg, =, 0.0);
    NV_S(omega, =, 0.0);

    t=DT_THREAD((Dynamic_Thread *)dt);

    v_cg[1]=2*3.14*c*cos(omega_t*time);
    omega[2]=3.14*3.14*sin(omega_t*time)/4;

    Message("time:%f vx_cg:%f vy_cg:%f omegaz:%f \n",time, v_cg[0],v_cg[1],omega[2]);
}

Which is the code given in Adrien Pesenti's website . However I have troubles hooking this udf to FLUENT. My airfoil doesnt move (change its angle) when I check mesh motion under Solve-> Mesh Motion. Please can anyone help me out with this ....
Also another option is actually defining the path taken by the CG in time ..... writing a profile file .... . How does one actually write a profile file ???

almostafa67 August 3, 2010 03:13

rotation about z axis
 
hi dear balkrishna...
long ago you were studying a case that contained flapping wing motion, now i'm working on something like that,i sent you two images that both of them are kind of peristaltic pump,i want to rotate two/one small cylinder about z axis,i should write an udf,i've written an udf for this but does not work;I will be thankful if you could help me out
looking forward to ur help.:o

almostafa67 August 3, 2010 03:14

rotation about z axis
 
2 Attachment(s)
sorry I forgot to attach images;

balkrishna August 3, 2010 03:17

Yes write a UDF ... it will be simpler ... please attach the UDF ... or paste the code ....

almostafa67 August 3, 2010 03:29

rotation about z axis
 
dear balkrishna,it's kind of you to reply my post:)

i use the following udf

# include "udf.h"
# include "dynamesh_tools.h"
DEFINE_CG_MOTION(pump,dt,vel,omega,time,dtime)
{
Thread *t;

real freq_t;
NV_S(vel,=,0.0);
NV_S(omega,=,0.0);
if(!Data_Valid_P())
return;
freq_t = 4.0;
t= DT_THREAD((Dynamic_Thread*)dt);
vel[0] = 0.0;
vel[1] = 0.0;
vel [2] = 0.0;
omega [0] = 0.0;
omega [1] = 0.0;
omega [2] = freq_t;
}

in your opinion is that what i want,if yes what's the problem that it does not work,if not plz help me write an appropriate udf...

balkrishna August 3, 2010 03:31

what doesnt work in this ... the udf is fine .... what are the errors you are getting ?
are you getting negative volumes in the mesh ? Also use cg_vel and cg_omega for the variables vel and omega .....

almostafa67 August 3, 2010 03:34

rotation about z axis
 
no i mean the small circle does not rotate about center of bigger circle,i have problem in motion!

balkrishna August 3, 2010 03:35

yes ... i faced a similar problem .... use cg_vel instead of vel and cg_omega instead of omega

almostafa67 August 3, 2010 03:39

rotation about z axis
 
plz explain it more, how should i do it in udf,how can cg_vel rotate small circle about z axis???

balkrishna August 3, 2010 03:41

try this udf ....
Code:

# include "udf.h"
# include "dynamesh_tools.h"
DEFINE_CG_MOTION(pump,dt,cg_vel,cg_omega,time,dtime)
{
    Thread *t;

    real freq_t;
    NV_S(vel,=,0.0);
    NV_S(omega,=,0.0);
    if(!Data_Valid_P())
        return;
    freq_t = 4.0;
    t= DT_THREAD((Dynamic_Thread*)dt);
    cg_vel[0] = 0.0;
cg_vel[1] = 0.0;
    cg_vel [2] = 0.0;
    cg_omega [0] = 0.0;
    cg_omega [1] = 0.0;
    cg_omega [2] = freq_t;
}


balkrishna August 3, 2010 03:54

yes it can ....

almostafa67 August 3, 2010 04:50

rotation about z axis
 
dear balkrishna...
i compiled ur udf and three images that i sent u are results,as u can see small cylinder changes its position so small, i want to move center of the cylinder on the inner edge of bigger cylinder,how can i do this large displacement??
Attachment 4299

Attachment 4300

http://www.4shared.com/file/R2SbkdqT...ltic-pump.html

balkrishna August 3, 2010 04:55

i have dans guardian banning the attachment download .... read the documentation for larger displacement .... ....

almostafa67 August 3, 2010 07:08

i did not understand ur post,i had another post in mind:rolleyes:

balkrishna August 3, 2010 07:10

check the fluent docs ....

Vidit Sharma November 1, 2012 11:20

hi,

I am trying to move a 2d cylinder in y direction by using UDF:-
# include "udf.h"
# include "dynamesh_tools.h"
DEFINE_CG_MOTION(pump,dt,cg_vel,cg_omega,time,dtim e)
{
Thread *t;
real freq_t;
NV_S(cg_vel,=,0.0);

if(!Data_Valid_P())
return;
freq_t = 0.01;
t= DT_THREAD((Dynamic_Thread*)dt);
cg_vel[0] = 0.0;
cg_vel[1] = freq_t;

}

But I am having a problem while compiling it in Visual Studio Command Prompt. While executing nmake command to compile an error is appearing which is saying NMAKE : fatal error U1077: "sed" :return code '0X1'

can anybody tell how to eliminate this error???? :confused::confused:

Thank You

Regards

Vidit Sharma

balkrishna November 1, 2012 11:34

try interpreting it .... do not compile it.

Vidit Sharma November 1, 2012 11:41

Quote:

Originally Posted by balkrishna (Post 389681)
try interpreting it .... do not compile it.

Dear Sir,

I tried to interprete it but it says "line8: structure reference not implemented"
Fluent user guide also says to compile the moving mesh macros.

Thank You,

regards


All times are GMT -4. The time now is 08:59.