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

UDF Error

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 20, 2012, 02:07
Default UDF Error
  #1
New Member
 
Amir sadeghi pour marvi
Join Date: Dec 2011
Posts: 25
Rep Power: 6
Prince of Persia is on a distinguished road
Hi,

I'm trying to create a tranverse velocity profile UDF to use it as velocity inlet boundary condition to simulate flow in a water tank. The UDF is as follows:
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity,thread,index)
{
real x[ND_ND]; /* this will hold the position vector*/
real z;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
z=x[2];
if (0.1<z<0.4)
F_PROFILE(f,thread,index) =0.063*pow((z/(0.1)),0.21)
else
F_PROFILE(f,theard,index)=log((z/(0.8))*0.15/0.41
}
end_f_loop(f,thread)
}

i got the following error when trying to interpret my Velocity2.c file in fluent:
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>" "C:\Users\amir\Desktop\Velocity2.c"
Error: C:\Users\amir\Desktop\Velocity2.c: line 13: parse error.

Thanks in advance!
Prince of Persia is offline   Reply With Quote

Old   July 20, 2012, 02:42
Default
  #2
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,212
Rep Power: 22
flotus1 will become famous soon enoughflotus1 will become famous soon enough
Typo...

F_PROFILE(f,theard,index)=log((z/(0.8))*0.15/0.41
flotus1 is offline   Reply With Quote

Old   July 20, 2012, 03:18
Default
  #3
New Member
 
Amir sadeghi pour marvi
Join Date: Dec 2011
Posts: 25
Rep Power: 6
Prince of Persia is on a distinguished road
thanks my friend...
my problem is not solved yet!!!!!!!!!
Prince of Persia is offline   Reply With Quote

Old   July 20, 2012, 03:31
Default
  #4
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,212
Rep Power: 22
flotus1 will become famous soon enoughflotus1 will become famous soon enough
Try using some ";" at the end of lines
flotus1 is offline   Reply With Quote

Old   July 20, 2012, 03:56
Default
  #5
New Member
 
Amir sadeghi pour marvi
Join Date: Dec 2011
Posts: 25
Rep Power: 6
Prince of Persia is on a distinguished road
it doesn't work!!!

#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity,thread,index)
{
real x[ND_ND]; /* this will hold the position vector*/
real z;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread)
z=x[2];
if (0.1<z<0.4)
F_PROFILE(f,thread,index) =0.063*pow((z/(0.1)),0.21);
else
F_PROFILE(f,thread,index)=log((z./(0.8)).*(0.15./0.41);
}
end_f_loop(f,thread)
}
Prince of Persia is offline   Reply With Quote

Old   July 20, 2012, 07:52
Default
  #6
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,212
Rep Power: 22
flotus1 will become famous soon enoughflotus1 will become famous soon enough
Did you copy parts of the UDF from the manual?

Then it contains "invisible" signs which prevent the UDF from being interpreted properly.
flotus1 is offline   Reply With Quote

Old   July 23, 2012, 13:49
Default
  #7
akm
New Member
 
Join Date: Jan 2010
Location: Netherlands
Posts: 27
Rep Power: 8
akm is on a distinguished road
if (z > 0.1 && z < 0.4) ...
akm 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
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 07:11
Problem with UDF compiling for kTkLW model Wantami FLUENT 0 July 18, 2011 05:11
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 02:32
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 01:44.