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

Flapping Wing motion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2010, 07:03
Default Flapping Wing motion
  #1
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
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 ???
balkrishna is offline   Reply With Quote

Old   August 3, 2010, 03:13
Default rotation about z axis
  #2
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
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.
almostafa67 is offline   Reply With Quote

Old   August 3, 2010, 03:14
Default rotation about z axis
  #3
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
sorry I forgot to attach images;
Attached Images
File Type: jpg 1.JPG (68.2 KB, 114 views)
File Type: jpg 2.JPG (79.1 KB, 78 views)
almostafa67 is offline   Reply With Quote

Old   August 3, 2010, 03:17
Default
  #4
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
Yes write a UDF ... it will be simpler ... please attach the UDF ... or paste the code ....
balkrishna is offline   Reply With Quote

Old   August 3, 2010, 03:29
Default rotation about z axis
  #5
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
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...
almostafa67 is offline   Reply With Quote

Old   August 3, 2010, 03:31
Default
  #6
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
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 .....
balkrishna is offline   Reply With Quote

Old   August 3, 2010, 03:34
Default rotation about z axis
  #7
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
no i mean the small circle does not rotate about center of bigger circle,i have problem in motion!
almostafa67 is offline   Reply With Quote

Old   August 3, 2010, 03:35
Default
  #8
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
yes ... i faced a similar problem .... use cg_vel instead of vel and cg_omega instead of omega
balkrishna is offline   Reply With Quote

Old   August 3, 2010, 03:39
Default rotation about z axis
  #9
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
plz explain it more, how should i do it in udf,how can cg_vel rotate small circle about z axis???
almostafa67 is offline   Reply With Quote

Old   August 3, 2010, 03:41
Default
  #10
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
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 is offline   Reply With Quote

Old   August 3, 2010, 03:54
Default
  #11
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
yes it can ....
balkrishna is offline   Reply With Quote

Old   August 3, 2010, 04:50
Default rotation about z axis
  #12
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
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
almostafa67 is offline   Reply With Quote

Old   August 3, 2010, 04:55
Default
  #13
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
i have dans guardian banning the attachment download .... read the documentation for larger displacement .... ....
balkrishna is offline   Reply With Quote

Old   August 3, 2010, 07:08
Default
  #14
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
i did not understand ur post,i had another post in mind
almostafa67 is offline   Reply With Quote

Old   August 3, 2010, 07:10
Default
  #15
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
check the fluent docs ....
balkrishna is offline   Reply With Quote

Old   November 1, 2012, 10:20
Default
  #16
Member
 
Vidit Sharma
Join Date: Aug 2012
Location: Delhi, India
Posts: 32
Rep Power: 14
Vidit Sharma is on a distinguished road
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????

Thank You

Regards

Vidit Sharma
Vidit Sharma is offline   Reply With Quote

Old   November 1, 2012, 10:34
Default
  #17
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
try interpreting it .... do not compile it.
balkrishna is offline   Reply With Quote

Old   November 1, 2012, 10:41
Default
  #18
Member
 
Vidit Sharma
Join Date: Aug 2012
Location: Delhi, India
Posts: 32
Rep Power: 14
Vidit Sharma is on a distinguished road
Quote:
Originally Posted by balkrishna View Post
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
Vidit Sharma is offline   Reply With Quote

Old   April 13, 2016, 05:16
Default flapping wings
  #19
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
I am doing a CFD analysis of flapping wing motion in FLUENT and I need udf code to define the motion I do not know how to write it can any one help me with it thanks
moh_zain is offline   Reply With Quote

Old   April 13, 2016, 16:42
Default CFD udf code fluent
  #20
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
[QUOTE=moh_zain;594803]I am doing a CFD analysis of flapping wing motion in FLUENT and I need udf code to define the motion I do not know how to write it can any one help me with it thanks
moh_zain is offline   Reply With Quote

Reply

Tags
flapping, fluent, profile, udf, wing


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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Modelling flow around a flapping wing balkrishna Main CFD Forum 1 February 19, 2010 00:32
ask help about flapping wing UDF aeropeng Fluent UDF and Scheme Programming 0 December 24, 2009 23:09
Flapping wing by moving frame loogtaan FLUENT 1 October 11, 2007 03:48
Help on the flapping wing Kearney Main CFD Forum 1 May 28, 2003 10:50


All times are GMT -4. The time now is 05:31.