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

A Problem of Fluent Interpreted UDF: parse error

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

Like Tree2Likes
  • 1 Post By Galileo
  • 1 Post By nnvoro

Reply
 
LinkBack Thread Tools Display Modes
Old   February 19, 2010, 16:42
Unhappy A Problem of Fluent Interpreted UDF: parse error
  #1
New Member
 
PengYun
Join Date: Feb 2010
Posts: 1
Rep Power: 0
knight is on a distinguished road
Hello guys!
I am a newly learner of Fluent, I got some problems with my UDF file when I compiled it in Fluent.
I don't want to bother you, while I really searched everywhere but didn't find a good solution. I hope someone could help me

my fluent path:
C:\Fluent.Inc\fluent\ntbin\ntx86\fluent.exe -r6.2.16

Model exported by GAMBIT path:
E:\dissertation\fluent模型\2010-2-5\A11\a11.msh

Udf file(it is a peroidical velocity inlet)
E:\dissertation\fluent模型\2010-2-5\A11\velocity2.c

run FLUENT, READ CASE--A11.MSH,Done!
Then,DEFINE--UDF---INTERPRETED UDF---velocity2.c
It is reported that:

cpp -IC:\Fluent.Inc\fluent\fluent6.2.16/src
-IC:\Fluent.Inc\fluent\fluent6.2.16/cortex/src
-IC:\Fluent.Inc\fluent\fluent6.2.16/client/src
-IC:\Fluent.Inc\fluent\fluent6.2.16/multiport/src -I.
-DUDFCONFIG_H="<udfconfig.h>"
E:\dissertation\fluen 模型\2010-2-5\A11\velocity2.c
Error: E:\dissertation\fluent模型\2010-2-5\A11\velocity2.c: line 1: parse
error.


It's said that there is one PARSE ERROR in line 1,then I opened this velocity.c in VC++

-----------------------------------------------------------------------
#include "udf.h"
#include "stdio.h"
#include "math.h"
#include "stdlib.h"

DEFINE_PROFILE(inlet_velocity1, thread, i)
{
Domain *domain;
Thread *f_thread ;
face_t f;
float time;

// float inlet_d=0.397e-3;
// float ave_v=1.0;

// x0=-0.528e-3;
// y0=0.00000;
// z0=0.00000;
time=CURRENT_TIME;

begin_f_loop(f, thread)
{
F_PROFILE(f, thread, i) = abs(0.003*sin(2*6.283*time));
}
end_f_loop(f, thread)
}
----------------------------------------------------------------------
When compiling, VC said:
e:\dissertation\fluent模型\2010-2-5\a11\velocity2.c(1) : fatal error C1083:
Cannot open include file: 'udf.h': No such file or directory
error when running cl.exe

I remember there is no need to compile udf in VC. Just compiling it in fluent is Ok, because fluent will find the udf.h in its directory. But it seems my Fluent wouldn't cooperate. It turned the error to my velocity.c

Expecting help!
Sincerely thanks

Knight
knight is offline   Reply With Quote

Old   April 19, 2010, 20:17
Default
  #2
New Member
 
sourav singh
Join Date: Apr 2010
Posts: 1
Rep Power: 0
souravsingh1987 is on a distinguished road
I am facing in the same problem.. can someone please help..
souravsingh1987 is offline   Reply With Quote

Old   May 24, 2010, 03:04
Default
  #3
New Member
 
Pacheo
Join Date: Apr 2009
Posts: 7
Rep Power: 8
pacheo is on a distinguished road
Quote:
Originally Posted by knight View Post
Hello guys!
I am a newly learner of Fluent, I got some problems with my UDF file when I compiled it in Fluent.
I don't want to bother you, while I really searched everywhere but didn't find a good solution. I hope someone could help me

my fluent path:
C:\Fluent.Inc\fluent\ntbin\ntx86\fluent.exe -r6.2.16

Model exported by GAMBIT path:
E:\dissertation\fluent模型\2010-2-5\A11\a11.msh

Udf file(it is a peroidical velocity inlet)
E:\dissertation\fluent模型\2010-2-5\A11\velocity2.c

run FLUENT, READ CASE--A11.MSH,Done!
Then,DEFINE--UDF---INTERPRETED UDF---velocity2.c
It is reported that:

cpp -IC:\Fluent.Inc\fluent\fluent6.2.16/src
-IC:\Fluent.Inc\fluent\fluent6.2.16/cortex/src
-IC:\Fluent.Inc\fluent\fluent6.2.16/client/src
-IC:\Fluent.Inc\fluent\fluent6.2.16/multiport/src -I.
-DUDFCONFIG_H="<udfconfig.h>"
E:\dissertation\fluen 模型\2010-2-5\A11\velocity2.c
Error: E:\dissertation\fluent模型\2010-2-5\A11\velocity2.c: line 1: parse
error.


It's said that there is one PARSE ERROR in line 1,then I opened this velocity.c in VC++

-----------------------------------------------------------------------
#include "udf.h"
#include "stdio.h"
#include "math.h"
#include "stdlib.h"

DEFINE_PROFILE(inlet_velocity1, thread, i)
{
Domain *domain;
Thread *f_thread ;
face_t f;
float time;

// float inlet_d=0.397e-3;
// float ave_v=1.0;

// x0=-0.528e-3;
// y0=0.00000;
// z0=0.00000;
time=CURRENT_TIME;

begin_f_loop(f, thread)
{
F_PROFILE(f, thread, i) = abs(0.003*sin(2*6.283*time));
}
end_f_loop(f, thread)
}
----------------------------------------------------------------------
When compiling, VC said:
e:\dissertation\fluent模型\2010-2-5\a11\velocity2.c(1) : fatal error C1083:
Cannot open include file: 'udf.h': No such file or directory
error when running cl.exe

I remember there is no need to compile udf in VC. Just compiling it in fluent is Ok, because fluent will find the udf.h in its directory. But it seems my Fluent wouldn't cooperate. It turned the error to my velocity.c

Expecting help!
Sincerely thanks

Knight
u'd better not include chinese characters in your work folder.

try again.
pacheo is offline   Reply With Quote

Old   February 21, 2011, 11:42
Default math.h stdio.h stdlib.h udf.h in UDFs of FLUENT
  #4
Member
 
Engr Adeniyi
Join Date: Jan 2011
Posts: 32
Rep Power: 7
Galileo is on a distinguished road
This thread is old, but I faced similar problem and found this thinking the way out would have been discussed.

The way round would be to use this header only
#include "udf.h"

and leave out these headers:
#include "stdio.h"
#include "math.h"
#include "stdlib.h"


udf.h defines most of what is needed.

Hope this helps someone else.
AvaShahrokhi likes this.
Galileo is offline   Reply With Quote

Old   April 7, 2011, 03:45
Default
  #5
Member
 
Join Date: Mar 2011
Posts: 50
Rep Power: 6
cdf_user is on a distinguished road
make sure you include the full path to the file when you select the file through 'browse'. same goes for udf_library in build during compiling
cdf_user is offline   Reply With Quote

Old   March 13, 2012, 05:23
Default
  #6
New Member
 
Nicola
Join Date: Feb 2012
Posts: 5
Rep Power: 5
sirnick is on a distinguished road
Thank you very much Galileo, you save me!!
sirnick is offline   Reply With Quote

Old   April 18, 2013, 12:46
Default
  #7
New Member
 
Join Date: Apr 2013
Posts: 17
Rep Power: 4
nnvoro is on a distinguished road
I need to use Bessel functions and complex numbers in my udf to set womersley profile in the inlet, when I leave only #include "udf.h" in the header Fluent can't interpret my udf. How can I cope with this problem?
nnvoro is offline   Reply With Quote

Old   April 27, 2013, 06:00
Default
  #8
Member
 
Engr Adeniyi
Join Date: Jan 2011
Posts: 32
Rep Power: 7
Galileo is on a distinguished road
Quote:
Originally Posted by nnvoro View Post
I need to use Bessel functions and complex numbers in my udf to set womersley profile in the inlet, when I leave only #include "udf.h" in the header Fluent can't interpret my udf. How can I cope with this problem?

I am not quite clear with what you want to do, but for you to get help, you need to post more details. For example, you need to say what the error is; are you interpreting or compiling; how complex numbers will work in a BC. Unless you are using one of the parts of a complex number, it will be difficult to code z=a+ib.. You need to be able to express the problem in simple equation or the form the equation will take.
Galileo is offline   Reply With Quote

Old   April 28, 2013, 14:10
Default
  #9
New Member
 
Join Date: Apr 2013
Posts: 17
Rep Power: 4
nnvoro is on a distinguished road
Quote:
Originally Posted by Galileo View Post
I am not quite clear with what you want to do, but for you to get help, you need to post more details. For example, you need to say what the error is; are you interpreting or compiling; how complex numbers will work in a BC. Unless you are using one of the parts of a complex number, it will be difficult to code z=a+ib.. You need to be able to express the problem in simple equation or the form the equation will take.
Engr, I really appreciate that you answered me. The problem was that I was trying to write my boundary conditions in a compact form, for that I used expressions which contained imaginary numbers and Bessel functions. I was taking real part of this expression which is than was used for boundary conditions. Thus I needed imaginary numbers in order to avoid bulky expressions in my udf.
Now, my problem is solved, I did the thing I was trying to avoid, I wrote my udf without using imaginary numbers and Bessel functions.
Galileo likes this.
nnvoro is offline   Reply With Quote

Old   May 1, 2013, 05:29
Default
  #10
New Member
 
Wu Zhuo
Join Date: Apr 2013
Posts: 3
Rep Power: 4
mumu678 is on a distinguished road
感觉使用udf.h就可以满足需求
mumu678 is offline   Reply With Quote

Old   May 6, 2013, 06:17
Default salam
  #11
New Member
 
tehran
Join Date: May 2013
Posts: 3
Rep Power: 4
armanrazy is on a distinguished road
because u used a space before include
armanrazy is offline   Reply With Quote

Old   December 8, 2013, 10:00
Default error while building udf
  #12
New Member
 
siddharth mittal
Join Date: Dec 2013
Posts: 3
Rep Power: 3
siddharth12 is on a distinguished road
I am getting error while compiling udf in fluent 13.0.0

error is
module machine type 'x64' conflicts with target machine type 'X86'

please help
please....
siddharth12 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
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 18:54
Version 15 on Mac OS X gschaider OpenFOAM Installation 120 December 2, 2009 11:23
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 18:38
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 16:50.