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

flapping wing udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2016, 08:21
Default flapping wing udf
  #1
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
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

Old   April 19, 2016, 10:19
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by moh_zain View Post
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
you can try it,read the manual, have a look at other examples, build your code, bring the sketch of it and we can try help. no one is going to solve your problems for you.

Last edited by Bruno Machado; April 19, 2016 at 16:59.
Bruno Machado is offline   Reply With Quote

Old   April 21, 2016, 05:57
Default
  #3
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
about the manual i just find manual for ansys 12 and i use ansys 16 is that make any diffrent
moh_zain is offline   Reply With Quote

Old   April 21, 2016, 06:47
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by moh_zain View Post
about the manual i just find manual for ansys 12 and i use ansys 16 is that make any diffrent
No, it should be fine. At every new version they include couple of specific macros, but, in general, old macros remain the same.

At this link you can see the manual (you might find a PDF version of it online)

https://www.sharcnet.ca/Software/Ans...f/flu_udf.html
Bruno Machado is offline   Reply With Quote

Old   April 22, 2016, 04:08
Default
  #5
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
is this code is fine for that






# include “udf.h”
DEFINE_CG_MOTION(motion_wing, dt, v_cg, omega, time , dtime)
{
Thread *t;
Face_t f;
Real NV_VEC (A);
Frequency= 3.0 ; /*frequency in hertz*/
Pi =3.141592654 ; /*pi*/
/* define motion variables */
Ar=30.0; /*roll amplitude of internal wing*/
Ar2=50; /* roll amplitude of external */

Arolldif= 55.0; /* roll amplitude between wings */




Aroll = Ar*pi/180.0; /* conversion to radians*/
Aroll2 = Ar2*pi/180.0; /* conversion to radians*/
Arolldif= Arolldif*pi/180.0; /* conversion to radians*/
w=2.0*pi*frequency; /* omega (radians)*/
T=1.0/frequency; /* period*/
/*ROLL DEFINITION*/
/* THIS IS THE ROLL ANGLE OF THE INTRENAL WING AND ITS HAS TO BE EQUAL TO THAT IN THE DEFINITION OF THE INTRNAL BODY ROLL MOTION */
roll = Aroll*sin(w*time);
droll = w*Aroll*cos(w*time);
}
moh_zain is offline   Reply With Quote

Old   April 22, 2016, 05:19
Default
  #6
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by moh_zain View Post
is this code is fine for that






# include “udf.h”
DEFINE_CG_MOTION(motion_wing, dt, v_cg, omega, time , dtime)
{
Thread *t;
Face_t f;
Real NV_VEC (A);
Frequency= 3.0 ; /*frequency in hertz*/
Pi =3.141592654 ; /*pi*/
/* define motion variables */
Ar=30.0; /*roll amplitude of internal wing*/
Ar2=50; /* roll amplitude of external */

Arolldif= 55.0; /* roll amplitude between wings */




Aroll = Ar*pi/180.0; /* conversion to radians*/
Aroll2 = Ar2*pi/180.0; /* conversion to radians*/
Arolldif= Arolldif*pi/180.0; /* conversion to radians*/
w=2.0*pi*frequency; /* omega (radians)*/
T=1.0/frequency; /* period*/
/*ROLL DEFINITION*/
/* THIS IS THE ROLL ANGLE OF THE INTRENAL WING AND ITS HAS TO BE EQUAL TO THAT IN THE DEFINITION OF THE INTRNAL BODY ROLL MOTION */
roll = Aroll*sin(w*time);
droll = w*Aroll*cos(w*time);
}
how can we possibly know? we have no idea about your problem. the question you asked you can answer yourself by compiling the code and trying it.
Bruno Machado is offline   Reply With Quote

Old   April 24, 2016, 15:26
Default
  #7
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
I have problem with the compiling can you tell me the right way to do that i use ansys 16x64 with win10x64 I tried to solve my problem by searching and reading about similar problems in the web but I didn’t find anything which could help me. i have installed Microsoft visual studio. thanks
moh_zain is offline   Reply With Quote

Old   April 24, 2016, 18:19
Default
  #8
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by moh_zain View Post
I have problem with the compiling can you tell me the right way to do that i use ansys 16x64 with win10x64 I tried to solve my problem by searching and reading about similar problems in the web but I didn’t find anything which could help me. i have installed Microsoft visual studio. thanks
Have a look here

http://www.cfd-online.com/Forums/flu...e-problem.html
Bruno Machado is offline   Reply With Quote

Old   June 3, 2016, 00:08
Default lift and drag pattern change wit fluent 16 and 13 PISO for same mesh n solver setting
  #9
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 210
Rep Power: 16
arunraj is on a distinguished road
Hello everyone,
I have some doubt regarding simulation using Fluent 13. Previously I used Fluent 16 to simulate the flapping wing. I got correct results by using Fluent 16. Then my supersior asked to simulate the further simulations in Fluent 13 which is installed in the server. So I tried to simulate using the server. But the real problem is I am not able to get the same Cl AND Cd pattern with Fluent 13 for the same settings. I dont understand the error at all. I am loading the same mesh file (created using ANSYS 16) and following the exact same steps in FLUENT13 which I followed in FLUENT16 but I am not able to get the results. The trend of Cl and Cd curve is completely different. So could you tell what could be the reason. I used the following settings in both FLUENT 13 and 16. But in Fluent 13 I am not getting the same result for same mesh file

Pressure based, Transient, absolute and planar
Laminar, air - 1.225 kg/m3 and viscosity 2.45e-4
Boundary condition: pressure outlet
Smoothing: spring based, 0. Boundary layer relaxation 1, convergence 0.0001, iterations: 10000
PISO scheme: skewness correction-1, neighbor correction-1, Lease square cell based, standard , first order upwind, first order implicit, under-relaxation, pressure:0.3, momentum: 0.5.

One more thing, in the global dynamic mesh settings , re-meshing tab the default max cell skewness value is 0.7 in case of Fluent 16 and when I use Fluent 13 for the same mesh file it shows default max cell skewness value is 0.66. I am little curious about this as I am using global settings for my deforming domain.

It would be a great help if you let me know the mistake or changes in settings.
Attached Images
File Type: jpg solver settings.jpg (125.3 KB, 22 views)
File Type: jpg dynamic mesh.jpg (132.2 KB, 24 views)
arunraj is offline   Reply With Quote

Old   June 4, 2016, 05:09
Default
  #10
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
make sure of the axis that you take cl and cd this is one or re-mesh using ansys 13
moh_zain is offline   Reply With Quote

Old   June 4, 2016, 11:41
Default
  #11
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 210
Rep Power: 16
arunraj is on a distinguished road
Hi Moh_zain,

Thank yuo so much for the reply. I found the error. I think PISO scheme of v16 is improved when compared to PISO scheme of v13. So it is not working properly with the same settings. I have to change the settings when I use fluent 13. But even after trying so many changes I am not able to get the same pattern. I dont know how to find the equivalent settings. I have tried more than 20 times, but till now i m able to match only the peak points, pattern is different.
arunraj is offline   Reply With Quote

Old   June 4, 2016, 18:10
Default
  #12
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
try to use second order upwind, second order implicit and green_gauss node based
moh_zain is offline   Reply With Quote

Old   June 5, 2016, 00:45
Default Non-iterative time advancement
  #13
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 210
Rep Power: 16
arunraj is on a distinguished road
Hi Moh_zain,

There is no second order implicit for dynamic mesh in fluent 13. But when I use Non-iterative time advancement I am getting same peak Cl and Cd but the curve is not same. But the convergence graph is totally weird as there are sudden ups and downs.
arunraj is offline   Reply With Quote

Old   June 7, 2016, 19:23
Default
  #14
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
Hi
if you can try to re_mesh using ansys 13 i can not think there is any more problem
moh_zain 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
DEFINE_CG_MOTION for flapping wing UDF xyzch001 Fluent UDF and Scheme Programming 21 February 7, 2022 08:47
Ffd_control_point_2d feiyi SU2 4 September 30, 2019 13:42
Wave Generation via Flapping Wall UDF LenDawg0220 Fluent UDF and Scheme Programming 5 June 26, 2017 17:05
DEFINE_CG_MOTION for flapping wing UDF xyzch001 Fluent UDF and Scheme Programming 0 December 14, 2011 09:39
Modelling flow around a flapping wing balkrishna Main CFD Forum 1 February 19, 2010 00:32


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