CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for Pitching and Oscillating 2D Airfoil (http://www.cfd-online.com/Forums/fluent-udf/126491-udf-pitching-oscillating-2d-airfoil.html)

 vigii November 19, 2013 07:40

UDF for Pitching and Oscillating 2D Airfoil

Hi Everyone,

I'm trying to simulate the pitching and oscillating motion of the airfoil.

I'm bit confused in defining the equations for oscillating motion and pitching in UDF.

How should I go about writing the UDF for the following equations.

h(t)=a*sin(wt)

where,
a=0.25; w=2*pi*0.2

Pitching happens at 1/3 length of the chord of equation

theta(t)=a*sin(wt+d)

Where,
a=pi/6; d=pi/2

Regards,
Vignesh

 pakk November 20, 2013 09:58

Which aspect is giving you problems?

 vigii November 21, 2013 04:48

Dynamic mesh

Hi,

My problem looks like this Video.

My case is a 2D Problem with airfoil. Here,I should oscillate the airfoil at 1/3 rd of the chord length. The equations which are defined above are responsible for its motion. I don't know how to proceed with the UDF. I know that I should use CG_Motion. But I'm not getting how to put my equations.

Code:

```#include "udf.h" DEFINE_CG_MOTION(airfoil, dt, vel, omega, time, dtime) { real a, w, p, pi; pi = 3.14159265; /* define motion variables */ a = pi/6;                        /*        Amplitude                        */ w = 2 * pi *0.2;        /*        Angular Frequency        */ p = pi / 2;                /*        Phase                                */ /* define airfoil motion */ omega[2] = a*sin(w*time+p); /* z-component of angular velocity */ }```
Regards,
Vignesh

 pakk November 21, 2013 04:59

 pakk November 21, 2013 10:57

Now you have more chance of getting an answer.
I don't think I can help you much further (I don't even know what pitching means, and I have never used CG_MOTION), but somebody else might...

-Does the udf you listed give any errors?
-Does the udf you listed have an effect on the results?
-If it has an effect, what is wrong with it?

Code:

`pi = 3.14159265;`
you can use the constant M_PI, wich is defined as 3.14159... automatically.

 mooncfd December 2, 2013 15:47

1- i have simulated an oscillating airfoil in fluent 13 used UDF (visual studio c 2008) under windows 7 32bit i have a result of Cp=0.72 (result correct and valid with literature ) .
2- the same case in 1 with the same parameters in fluent 13 used UDF (visual studio c 2008) under windows 7 64 bit i have a result of Cp=0.3 (result non valide)
.
why the results are different ?

 mooncfd December 2, 2013 15:58

FLUENT oscillating airfoil HELP

1- I've simulated an oscillating airfoil in fluent 13 used UDF (visual studio c 2008) under windows 7 32bit i have a result of Cp=0.72 (result correct and valid with literature ) .
2- the same case in 1 with the same parameters in fluent 13 used UDF (visual studio c 2008) under windows 7 64 bit i have a result of Cp=0.3 (result non valide)
.
I dond't understand Why the results are different ?

 fkanyako February 12, 2014 10:41

Which equation to use

I'm attempting to analyze a 2D airfoil in a pitching motion. However I have seen so many UDF defining the pitching motion like these...

/* define motion variables */
pitchampl = 45 * pi / 180; /* 45-degree pitch amplitude */
w = 2 * pi * 25; /* 25 Hz frequency */

/* define airfoil motion */
(1) omega[2] = w * pitchampl * cos(w * time);

(2) omega[2] = w * pitchampl * sin(w * time);

I have also seen this equation

(3) omega[2] = 0.5 * pitchampl * sin(w*time);

Please I need help with the difference between these equations(1,2 and 3), which is the correct one for pitching motion of airfoil ? Is it sin or cos ?

Thanks

 pakk February 12, 2014 10:59

Go and read something about sinusoids and amplitudes, then it should become clear. They represent different situations, they can all be correct in the right situations. (1) and (2) seem strange to me, but I can imagine cases where they work. In this case, 'sin' and 'cos' are equally correct, they describe two possible motions.

 fkanyako February 18, 2014 06:41

Quote:
 Originally Posted by pakk (Post 474668) Go and read something about sinusoids and amplitudes, then it should become clear. They represent different situations, they can all be correct in the right situations. (1) and (2) seem strange to me, but I can imagine cases where they work. In this case, 'sin' and 'cos' are equally correct, they describe two possible motions.
Thanks Pakk, after some review I think you are right about equation 1 and 2. which is the angular velocity. I have seen many papers using either of them. But the third equation is basically the pitch angle. Using it as omega is wrong. You have to take the time derivative of equation(3) before using it as UDF. This is my understand so far I hope my simulation proves that and let me know if am on point.