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 code

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2012, 06:21
Unhappy flapping wing UDF code
  #1
New Member
 
x125012
Join Date: Jul 2012
Posts: 9
Rep Power: 13
yahya_azizi is on a distinguished road
I'm simulating a flapping wing.

The UDF code is as follows:

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

real w, pi, Aroll, Apitch, roll, droll, pitch, dpitch, yaw, dyaw, frequency, T;
real Ar, Ap, Ay;

DEFINE_CG_MOTION(code, dt, v_cg, omega, time, dtime)

{
Thread *t;

NV_S(v_cg, =, 0.0);
NV_S(omega, =, 0.0);

if (!Data_Valid_P())
{
Message("Wrong\n");
return;
}

t=DT_THREAD((Dynamic_Thread*)dt);

frequency = 3.0;

pi = 3.141592654;

/* define motion variables */

Ar = 30.0; /*roll amplitude*/
Ap = 5.0; /*pitch amplitude*/
Ay = 0.0; /*yaw amplitude*/

Aroll = Ar*pi/180.0; /*conversion to radians*/
Apitch = Ap*pi/180.0; /*conversion to radians*/

w=2.0*pi*frequency; /*omega (radians)*/
T=1.0/frequency;

roll = Aroll*sin(w*time + pi/2);
droll = w*Aroll*cos(w*time + pi/2);

pitch = Apitch*sin(w*time+pi/2);
dpitch = w*Apitch*cos(w*time+pi/2);

/*euler angles initial frame mod 1*/

omega[0] = droll;
omega[1] = 0;
omega[2] = 0;

Message("time:%f omegax:%f omegay:%f omegaz:%f \n", time, omega[0], omega[1],omega[2]);

}

I need to consider pitch and roll rotation simultaneously. However, when I add pitch rotation to the code the wing movement becomes wrong.

Any idea what I should do about this?
yahya_azizi is offline   Reply With Quote

Old   July 24, 2012, 06:24
Default
  #2
New Member
 
x125012
Join Date: Jul 2012
Posts: 9
Rep Power: 13
yahya_azizi is on a distinguished road
Is that because of using sinusoid function for pitch rotation or incorrect code?
yahya_azizi is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Brownian Motion UDF Code Confuser FLUENT 3 August 13, 2021 01:14
Wave Generation via Flapping Wall UDF LenDawg0220 Fluent UDF and Scheme Programming 5 June 26, 2017 16:05
udf code for anisotropy turbulence model- square duct Eliasjal Fluent UDF and Scheme Programming 1 August 29, 2012 10:26
UDF Code for energy source dreamchaser Fluent UDF and Scheme Programming 6 July 25, 2012 04:15
UDF code for concentration distribution szw_china Fluent UDF and Scheme Programming 0 July 22, 2012 21:35


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