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

UDF for Pitching and Oscillating 2D Airfoil

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Edgar Alejandro Martínez

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2013, 07:40
Default UDF for Pitching and Oscillating 2D Airfoil
  #1
Member
 
Vignesh KPV
Join Date: Oct 2011
Location: Bangalore
Posts: 83
Rep Power: 15
vigii is on a distinguished road
Send a message via Skype™ to vigii
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

Please help me in writing a UDF.

Regards,
Vignesh
vigii is offline   Reply With Quote

Old   November 20, 2013, 09:58
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Which aspect is giving you problems?
What did you try already?
The more specific your question is, the more specific your answer will be.
pakk is offline   Reply With Quote

Old   November 21, 2013, 04:48
Default Dynamic mesh
  #3
Member
 
Vignesh KPV
Join Date: Oct 2011
Location: Bangalore
Posts: 83
Rep Power: 15
vigii is on a distinguished road
Send a message via Skype™ to vigii
Hi,

Thanks for your reply.

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.

Please help me. Here is my UDF. Please tell me weather I'm correct.

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

Last edited by vigii; November 21, 2013 at 04:59. Reason: Added UDF for your reference
vigii is offline   Reply With Quote

Old   November 21, 2013, 04:59
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Removed after udf was added

Last edited by pakk; November 21, 2013 at 05:02. Reason: request to add udf no longer needed
pakk is offline   Reply With Quote

Old   November 21, 2013, 10:57
Default
  #5
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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...

However, you could still easily give more information that would make it easier to answer your question.
-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?

I can give you only one advice, which will not help you to solve this problem, but make things easier: instead of
Code:
pi = 3.14159265;
you can use the constant M_PI, wich is defined as 3.14159... automatically.
pakk is offline   Reply With Quote

Old   December 2, 2013, 15:47
Default
  #6
New Member
 
moon
Join Date: Dec 2013
Posts: 2
Rep Power: 0
mooncfd is on a distinguished road
I need your help please:
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 is offline   Reply With Quote

Old   December 2, 2013, 15:58
Default FLUENT oscillating airfoil HELP
  #7
New Member
 
moon
Join Date: Dec 2013
Posts: 2
Rep Power: 0
mooncfd is on a distinguished road
I need your help please:
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 ?
mooncfd is offline   Reply With Quote

Old   February 12, 2014, 10:41
Default Which equation to use
  #8
New Member
 
Musa
Join Date: Mar 2012
Posts: 14
Rep Power: 14
fkanyako is on a distinguished road
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
fkanyako is offline   Reply With Quote

Old   February 12, 2014, 10:59
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Old   February 18, 2014, 06:41
Default
  #10
New Member
 
Musa
Join Date: Mar 2012
Posts: 14
Rep Power: 14
fkanyako is on a distinguished road
Quote:
Originally Posted by pakk View Post
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.
fkanyako is offline   Reply With Quote

Old   February 13, 2016, 04:56
Default Airfoil meshing help required
  #11
New Member
 
Pradip
Join Date: Jan 2016
Location: Mumbai
Posts: 13
Rep Power: 10
pradip.c1000 is on a distinguished road
Hi fkanyako,
I need your help in set up of meshing for airfoil Naca0012 for low Re in dynamic mesh. How to create a mesh for this problem? I am new to Dyn meshing using udf.
pradip.c1000 is offline   Reply With Quote

Old   July 11, 2019, 16:58
Default
  #12
New Member
 
Edgar Alejandro Martínez Ojeda
Join Date: Jul 2019
Posts: 20
Rep Power: 7
Edgar Alejandro Martínez is on a distinguished road
/************************************************** ***************************/
/* pitchingmotion.c */
/* UDF for specifying oscillatory motion */
/* */
/************************************************** ***************************/

#include "udf.h" // UDF header
#define OMEGA 18.67 // angular frequency (rad/sec)
#define AMP 15.00*M_PI/180 // amplitude (15 degrees)

DEFINE_CG_MOTION (pitching, dt, cg_vel, cg_omega, time, dtime)
{
real alpha_prime;

cg_vel[0] = 0.0;
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0] = 0.0; // rotation around the x-axis
cg_omega[1] = 0.0; // rotation around the y-axis

// alpha = alpha_0 + AMP*sin(OMEGA*t)

/* The derivative of alpha is alpha prime. So, the
angular velocity we are looking for is:
alpha_prime = AMP*OMEGA*cos(OMEGA*t) */

alpha_prime = AMP*OMEGA*cos(OMEGA*time);

// alpha_prime is passed to cg_omega[2]:
cg_omega[2] = alpha_prime;
}
Edgar Alejandro Martínez 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
[Other] Oscillating Airfoil and Independently Oscillating Flap dancfd OpenFOAM Meshing & Mesh Conversion 3 August 26, 2010 19:52
Oscillating Airfoil - Dynamic meshing or user-defined velocity profile. DarrenC Main CFD Forum 5 July 19, 2010 23:33
UDF for oscillating airfoil Wissam FLUENT 3 May 11, 2008 05:07
Oscillating airfoil problem ganesh Main CFD Forum 2 June 27, 2005 14:57
UDF for oscillating profile Geremi FLUENT 1 March 6, 2005 12:48


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