CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   DEFINE_CG_MOTION for flapping wing UDF (http://www.cfd-online.com/Forums/fluent-udf/95349-define_cg_motion-flapping-wing-udf.html)

xyzch001 December 14, 2011 09:51

DEFINE_CG_MOTION for flapping wing UDF
 
Hi everybody!
I'm a graduate student of mechanical engineering working at a Fluent project for my thesys. I have to write a UDF in order to give a motion law to a flapping wing. By using the UDF "DEFINE_CG_MOTION" I need to specify an angular velocity d(theta)/dt so that the oscillation angle of the flapping wing is: theta(t)=25*sin(2*pi*frequency*t+arcsin(3/5))-15
If I use the derivate d(theta)/dt=50*frequency*pi*cos(2*pi*frequency*t+arcsin(3/5)) I lose the constant "-15" so that the oscillation angle is no more from +10 deg to -40 deg. As a matter of fact the positive peak amplitude must be +10 deg and the negative one must be -40 deg.
How can I solve the problem?
Thank you so much!

pdp.aero December 15, 2011 04:47

Hello xyh001
one point about the writing udf that i remember and i think you should be contain it, its your argument must be in radian!
sorry i don't understood clearly your problem.
i hope its be useful.

xyzch001 December 15, 2011 09:38

Hi pdp.aero! Thank you for your answer! Yes I already know that the argument must be in radian...I wrote the previous formula in degrees for convenience. That is not a problem...The problem is to find a trigonometric function that after being derived, gives me the desired theta(t).

pdp.aero December 15, 2011 10:04

sorry i asked this questions , i curious about your problem!
and what's the problem with those function that you mention for theta(t) and d(theta)/dt...?
in every time-step you have t ,so you can calculate the theta and the angular velocity with those formula.

xyzch001 December 15, 2011 10:28

The problem is that when you derive theta to find the angular velocity you lose the constant, so when Fluent integrates the velocity (DEFINE_CG_MOTION requires the angular velocity, not the angle(t)) it loses the constant "-15", giving the symmetrical function 25*sin(2*pi*frequency*t+arcsin(3/5)). But unfortunately I want an asymmetrical function ranging from +10deg to -40deg.

pdp.aero December 15, 2011 13:15

aha!
you can use this function:
theta(t)=40*sin(2*pi*50*(t+0.4314)+30);
f=50;
arcsin(3/6)=30 deg;
then you got theta=10 deg in t= 0 sec and theta=-40 deg in t=0.33 sec
with time-step=0.0001 sec.
if your flap in your grid have theta=10 deg you haven't problem, but if your flap have theta= 0 deg in t=0 in your grid you must first use cg-motion with diffrent function as udf to move your flap to 10 degree without solve the flow equation just use the Grid motion in Solve panel and then when your flap got the 10 deg use udf with this function to move your flap to -40 deg and solve the equation.
i hope its useful.

xyzch001 December 15, 2011 14:14

Hi! If I use your function I get +33.13 deg for t=0 and -33.13 deg for t=0.33. What am I doing wrong? Anyway the frequency f of the flapping is 6. Thank you

pdp.aero December 16, 2011 05:40

ok! with f=6 for your flap ; use same function with different coefficient!
theta(t)=40.*sin(2.*pi.*6.*(t+3.6)+30)
this gave you theta=10 at t=0 and theta=40 at t=2.7662, be sure its true.
you can plot your function in so many software such as MATLAB. and you can see how your function behave with different t or f or other coefficient. that's easy.

xyzch001 December 16, 2011 05:57

Yes it works! you're great man! but my flap is theta=0 for t=0 how can I solve the problem? How can I use the "grid motion"? thanks a lot!!

pdp.aero December 16, 2011 06:45

in this case you must move your flap smoothly to theta=10 deg with different function and UDF with Cg-motion macro , without solve the flow equation. that's means you must hook your cg-motion UDF with for example this function to move the flap.
theta(t)=1000t.
hook the UDF with this function and then go to the solve> mesh motion in FLUENT,with time-step=0.0001 in 0.01 sec your flap got 10 deg and then unload your UDF and load the second UDF with previous function to move flap in 10 deg to -40 deg.
if you do this your grid maybe change badly and you got bad quality it's depended how small your time-step is.
you have second choice to have 10 deg in t=0 sec.
you can change your geometry with theta=10 for flap and mesh it again.
its depend your self to choice one of this solution for your flap got 10 deg in t=0.
your welcome.

xyzch001 December 18, 2011 15:45

Hi pdp.aero!
Finally I found the solution: this is the function that gives me the desired flapping angles: theta[t] = 0.8409*sin(w*t - 0.2563) + 0.6643*cos(w*t + 0.7741) - 0.000001868*Sin(0.7629*w*t + 0.1884) +0.3773*cos(-0.000002463*w*t + 2.338)
It has no constants so that, when I derive it to find the omega[t] and then Fluent integrates it,Fluent gets back the original theta[t]. I used Matlab "Curve fitting toolbox" to find this function by interpolation of many points.
Anyway thank you for your help!

sanjay January 12, 2012 00:10

can this be simulated in STAR CCM+ ??:rolleyes:

xyzch001 January 12, 2012 06:48

Hi, I don't know STAR CCM+, but I think you can do it.

imbaasat March 30, 2012 11:46

for flapping wing, following is required:

1. use GRID_MOTION instead of CG_MOTION.
2. use sinusoidal function with temporal effect.
3. make one & half wave in wing span direction.

hippiekyle June 20, 2012 12:35

Quote:

Originally Posted by imbaasat (Post 352346)
for flapping wing, following is required:

1. use GRID_MOTION instead of CG_MOTION.
2. use sinusoidal function with temporal effect.
3. make one & half wave in wing span direction.

What's the difference between GRID_MOTION and CG_MOTION ?

pdp.aero June 21, 2012 10:40

Quote:

Originally Posted by hippiekyle (Post 367490)
What's the difference between GRID_MOTION and CG_MOTION ?

GRID_MOTION used for non-rigid object but CG_MOTION used for move the rigid center of gravity object.

hippiekyle June 21, 2012 11:37

I made a fin I want to flap by subtracting the volume from the domain. So it's not an actual volume. More of a void with no slip boundary conditions. Since it has no volume, I should use GRID_MOTION? Or should I remake the the fin with a volume? I want it to be rigid, but I'm not taking gravity into account.


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