CFD Online URL
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

UDF error

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

Like Tree1Likes
  • 1 Post By Amir

Reply
 
LinkBack Thread Tools Display Modes
Old   October 6, 2011, 05:02
Default UDF error
  #1
Member
 
^^
Join Date: Aug 2011
Posts: 70
Rep Power: 5
colopolo is on a distinguished road
Hi all,

I interpreted the below udf file in Fluent.
I got parse error during interpreting.


cpp -I"C:\Fluent.Inc\fluent6.3.26/src" -I"C:\Fluent.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent.Inc\fluent6.3.26/client/src" -I"C:\Fluent.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<udfconfig.h>" "E:\Gambit\1106VIV01\motion.c"
Error: E:\Gambit\1106VIV01\motion.c: line 3: parse error.

I could not find what is wrong with udf file.

Please leave any comments on this problem.


#include "udf.h"

static real v_prev = 0.0;

DEFINE_CG_MOTION(osc,dt,vel,omega,time,dtime)
{
Thread *t;
Domain *d = Get_Domain(1);
real x_cg[3], force[3], moment[3];
real accl, dv;
real mass = 0.2;
real wn = 12.0;
real k= mass * wn*wn;
real c = 2*mass*wn*0.00;
int i;

NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
t = DT_THREAD(dt);
for(i=0;i<3;i++)
x_cg[i]=DT_CG(dt)[i];

Compute_Force_And_Moment(d, t, x_cg, force, moment, TRUE);
force[1] += -k*x_cg[1] - c*vel[1];

accl = force[1]/mass;
dv = accl*dtime;
v_prev+=dv;
vel[1] = v_prev;
printf("Computed force: %g \n", force[1]);
printf("Velocity: %g\n", vel[1]);
}
colopolo is offline   Reply With Quote

Old   October 6, 2011, 16:11
Default
  #2
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 6
m2montazari is on a distinguished road
hi,
as the error says, the problem is with line 3. and in the udf you've post, definition of v_prev is the problem. try normal real(not static) definition. maybe fluent has some problems with static parameters!? then try renaming v_prev to vprev. all the things that could make problem is these two!
nothing else....
yours,
mohammad
m2montazari is offline   Reply With Quote

Old   October 6, 2011, 16:23
Default
  #3
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 737
Blog Entries: 1
Rep Power: 13
Amir is on a distinguished road
Hi,
You cannot interpret such UDFs even if you will solve error (line 3). You have to compile it.

Bests,
saurav2012 likes this.
__________________
Amir
Amir is offline   Reply With Quote

Old   October 6, 2011, 16:59
Default
  #4
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 6
m2montazari is on a distinguished road
hi,
I agree with amir.
m2montazari is offline   Reply With Quote

Old   October 6, 2011, 20:33
Default
  #5
Member
 
^^
Join Date: Aug 2011
Posts: 70
Rep Power: 5
colopolo is on a distinguished road
Thank you guys.

Last edited by colopolo; October 6, 2011 at 21:12.
colopolo is offline   Reply With Quote

Reply

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
Problem with UDF compiling for kTkLW model Wantami FLUENT 0 July 18, 2011 06:11
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Accessing phi from a fvPatchField at same patch johndeas OpenFOAM 1 September 13, 2010 21:23
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 03:32
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


All times are GMT -4. The time now is 12:36.