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

Error udf - define_profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 9, 2013, 16:58
Angry Error udf - define_profile
  #1
New Member
 
Join Date: Feb 2013
Posts: 4
Rep Power: 4
Mr.H is on a distinguished road
Hi everybody,

I'm trying to interpreted an UDF-file but from fluent I get error all the time. It writes this error:

Error: C:\BFS_channel\inlet_z_velocity.c: line 1: parse error.


My UDF file looks like this:

#include "udf.h"
#define DELTA 0.003 /*thickness of boundary layer [m]*/
#define W 20. /*velocity in free streem [m/s]*/
#define P 1./7. /*exponent of power*/
DEFINE_PROFILE(inlet_z_velocity,thread,position)
{
real x [ND_ND], b;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
b=x[1];
if (b <= DELTA)
{
F_PROFILE(f,thread,position)=W*pow(b/DELTA,b);
}
else
{
F_PROFILE(f,thread,position)=W
}
}
end_f_loop(f,thread)
}

Can anybody help me please? I think I tried everything what I know and still can't find parse error in 1st line.

Thank you for your help

Best regards H.
Mr.H is offline   Reply With Quote

Old   August 12, 2013, 00:56
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 11
blackmask will become famous soon enough
You missed a semicolon at the end of
Code:
F_PROFILE(f,thread,position)=W;
but otherwise the code seems to be OK. Try to create a new text file, copy&paste the code to that file and try to re-compile that file.
blackmask is offline   Reply With Quote

Old   August 12, 2013, 11:28
Default
  #3
New Member
 
Join Date: Feb 2013
Posts: 4
Rep Power: 4
Mr.H is on a distinguished road
Thank you for your answer but it doesn't work anyway. So i think I will do it in CFX it will be much easier.
Mr.H is offline   Reply With Quote

Old   August 14, 2013, 07:01
Default
  #4
New Member
 
alireza
Join Date: May 2013
Location: shiraz
Posts: 11
Rep Power: 4
alireza9359300 is on a distinguished road
I tested this code and worked
---------------------------------------
#include "udf.h"
#define DELTA 0.003 /*thickness of boundary layer [m]*/
#define W 20. /*velocity in free streem [m/s]*/
#define P 1./7. /*exponent of power*/
DEFINE_PROFILE(inlet_z_velocity,thread,position)
{
real x [ND_ND], b;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
b=x[1];
if (b <= DELTA)
F_PROFILE(f,thread,position)=W*pow(b/DELTA,b);
else
F_PROFILE(f,thread,position)=W;
}
end_f_loop(f,thread)
}
---------------------------------------------
when you are using (if) doesn't need {{}}
alireza9359300 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
GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM 300 October 29, 2014 19:00
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 18:43
attach/detach (valve opening/closing) phsieh2005 OpenFOAM Running, Solving & CFD 2 March 21, 2009 06:18
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50
user defined function cfduser CFX 0 April 29, 2006 10:58


All times are GMT -4. The time now is 15:35.