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

UDF Airfoil SHM flapping motion not executing, rather rotating 360degs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 4, 2020, 01:59
Exclamation UDF Airfoil SHM flapping motion not executing, rather rotating 360degs
  #1
New Member
 
AfreedFaizan
Join Date: Dec 2020
Posts: 2
Rep Power: 0
AfreedFaizan is on a distinguished road
I'm working on oscillating airfoils based on flapping wings. In order to do so, I took a simple airfoil and made the geometry. I had no issues while building the "udflib" and the code which I used given below. Once I set the CG location and preview the motion. It is rotating 360 degs at a very fast rpm rather than executing slow shm. I'm pretty sure it's something to do with the software rather than the code. Please help me because this is my uni project.

#include "udf.h"
#define Freq 5 % defining flapping frequency i.e 5, 6, 7, 8, 9 and 10Hz
#define PI 22/7
#define angular_freq 2.0*PI*Freq % defining angular frequency
#define tetmax 30.0*PI/180 % defining angular amplitude
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;
}
AfreedFaizan is offline   Reply With Quote

Old   February 18, 2024, 08:11
Default
  #2
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
hey any fixes? im facing the exact same issue.
bored_bot is offline   Reply With Quote

Old   February 18, 2024, 10:06
Lightbulb
  #3
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
Quote:
#define PI 22/7
#define angular_freq 2.0*PI*Freq % defining angular frequency
#define tetmax 30.0*PI/180 % defining angular amplitude
You could try the following things:
1) change the PI macro definition, instead of that you invoke M_PI instead
2) the reason it rotates instead of executing a simple harmonic motion is because the angles are inconsistent.

so here's the fixed code:
Code:
#define angular_freq 2.0*Freq*M_PI/180
#define tetmax 30.0*PI/180
Hope this fixed your code!
bored_bot is offline   Reply With Quote

Reply

Tags
airfoil pitching 2d, fluent - udf, fluent - udf - parallel, shm not snapping, udf cg motion


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
How to define movement/deformation relative to a rigid body motion in Fluent by udf? eagle_001 Fluent UDF and Scheme Programming 6 May 17, 2022 04:41
SU2 AOA optimization 454514566@qq.com SU2 9 March 7, 2022 17:17
trying to write a UDF for rigid body motion niteshrajput Fluent UDF and Scheme Programming 4 December 17, 2014 01:29
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
UDF for Airfoil in Circular motion (2D) sohail_27 Fluent UDF and Scheme Programming 4 October 4, 2010 14:36


All times are GMT -4. The time now is 04:51.