|
[Sponsors] | |||||
|
|
|
#1 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
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]);
}
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 ??? |
|
|
|
|
|
|
|
|
#2 |
|
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 17 ![]() |
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.
|
|
|
|
|
|
|
|
|
#3 |
|
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 17 ![]() |
sorry I forgot to attach images;
|
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
Yes write a UDF ... it will be simpler ... please attach the UDF ... or paste the code ....
|
|
|
|
|
|
|
|
|
#5 |
|
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 17 ![]() |
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... |
|
|
|
|
|
|
|
|
#6 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
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 ..... |
|
|
|
|
|
|
|
|
#7 |
|
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 17 ![]() |
no i mean the small circle does not rotate about center of bigger circle,i have problem in motion!
|
|
|
|
|
|
|
|
|
#8 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
yes ... i faced a similar problem .... use cg_vel instead of vel and cg_omega instead of omega
|
|
|
|
|
|
|
|
|
#9 |
|
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 17 ![]() |
plz explain it more, how should i do it in udf,how can cg_vel rotate small circle about z axis???
|
|
|
|
|
|
|
|
|
#10 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
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;
}
|
|
|
|
|
|
|
|
|
#11 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
yes it can ....
|
|
|
|
|
|
|
|
|
#12 |
|
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 17 ![]() |
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 |
|
|
|
|
|
|
|
|
#13 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
i have dans guardian banning the attachment download .... read the documentation for larger displacement .... ....
|
|
|
|
|
|
|
|
|
#14 |
|
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 17 ![]() |
i did not understand ur post,i had another post in mind
|
|
|
|
|
|
|
|
|
#15 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
check the fluent docs ....
|
|
|
|
|
|
|
|
|
#16 |
|
Member
Vidit Sharma
Join Date: Aug 2012
Location: Delhi, India
Posts: 32
Rep Power: 15 ![]() |
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 |
|
|
|
|
|
|
|
|
#17 |
|
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 18 ![]() |
try interpreting it .... do not compile it.
|
|
|
|
|
|
|
|
|
#18 |
|
Member
Vidit Sharma
Join Date: Aug 2012
Location: Delhi, India
Posts: 32
Rep Power: 15 ![]() |
||
|
|
|
|
|
|
|
#19 |
|
Member
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 11 ![]() |
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
|
|
|
|
|
|
|
|
|
#20 |
|
Member
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 11 ![]() |
[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
|
|
|
|
|
|
![]() |
| Tags |
| flapping, fluent, profile, udf, wing |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |