CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF code

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 16, 2012, 10:46
Question UDF code
New Member
Join Date: Jul 2012
Posts: 9
Rep Power: 7
yahya_azizi is on a distinguished road
I'm simulating a flapping wing aircraft and have designed a rectangular wing to model that. I have to use dynamic motion to model the flapping motion. However, I am not familiar with dynamic mesh. What I know is that I have to use a UDF code to define the motion. I am using the following UDF code which has been posted by a member on the forum to simulate the motion but everytime I compile the code I get an error. has anyone faced this problem before?

#include "udf.h"
#include "dynamesh_tools.h"

DEFINE_CG_MOTION(asymflap, dt, v_cg, omega, time, dtime)

Thread *t;

NV_S(v_cg, =, 0.0);
NV_S(omega, =, 0.0);

if (!Data_Valid_P())


frequency = 3.0;

pi = 3.141592654;

/* define motion variables */

Ar = 30.0; /*roll amplitude*/
Ap = 5.0; /*pitch amplitude*/
Ay = 0.0; /*yaw amplitude*/

Aroll = Ar*pi/180.0; /*conversion to radians*/
Apitch = Ap*pi/180.0; /*conversion to radians*/

w=2.0*pi*frequency; /*omega (radians)*/

roll = Aroll*sin(w*time + pi/2);
droll = w*Aroll*cos(w*time + pi/2);

pitch = Apitch*sin(w*time);
dpitch = w*Apitch*cos(w*time);

/*euler angles initial frame mod 1*/

omega[0] = droll;
omega[1] = dpitch*1.0*cos(roll);
omega[2] = dpitch*1.0*sin(roll);

Message("time:%f omegax:%f omegay:%f omegaz:%f \n", time, omega[0], omega[1],omega[2]);
yahya_azizi is offline   Reply With Quote

Old   July 16, 2012, 10:50
Senior Member
flotus1's Avatar
Join Date: Jun 2012
Location: Germany
Posts: 1,615
Rep Power: 26
flotus1 will become famous soon enoughflotus1 will become famous soon enough
What kind of error do you get when trying to compile the UDF?

Did you try interpreting it instead?
flotus1 is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 13:30
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29
Brownian Motion UDF Code Confuser FLUENT 1 November 1, 2005 11:37

All times are GMT -4. The time now is 11:24.