CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF file for oscillating 2D airfoil (https://www.cfd-online.com/Forums/fluent/249975-udf-file-oscillating-2d-airfoil.html)

YFUO28 May 19, 2023 04:24

UDF file for oscillating 2D airfoil
 
hey,

For transient simulation of oscillating 2D airfoil I am using dynamic mesh. The airfoil need to oscillating between -5deg to 5deg.

The change of the angle of attack define by UDF file.

this is the UDF I wrote:
/************************************************** ********************
UDF for specifying a transient Oscillating 2D Airfoil
************************************************** *********************/

#include "udf.h"
#define Freq 0.0527
#define angular_freq 2.0*M_PI*Freq
#define tetmax (5.0-(-5.0))*M_PI/180

DEFINE_CG_MOTION(shm, dt, cg_vel, cg_omega, time, dtime)
{
real omega;

omega = tetmax*angular_freq*cos(angular_freq*time);

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

cg_omega[0] = 0.0;
cg_omega[1] = 0.0;
cg_omega[2] = omega;
}



Now when I check the motion with DISPLAY ZONE MOTION in the fluent (inside the dynamic mesh task page) the airfoil moving only on the positive side of omega.

someone can say what wrong with me UDF file or something I need to change?

Thx for the help.

YFUO28 May 19, 2023 06:56

Ok, I find what wrong. the equation in time 0 start at 5 deg and then the range of the angle of attack between 0 deg to 10 deg.

Someone know who to fix this? who the airfoil start in time 0 at angle of 0 deg?


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