i am trying to write a code for trapping particles in a cross flow over a cylinder. but i get parse error in line 17 and it doesn't matter what is in line 17! even it may be an "Enter" or other routine loops. my code is as follow:

it is noticeable that when i activate the #include "udf.h" header, i get "P_POS: undeclared variable" error!
my code is also where my case and data files are. and also the folder doesn't contain "space" in it.

thanks in advance.

vasava

March 13, 2013 06:29

Did compiling or did you interpret the code?

I tried compiling your code and nothing seems to be wrong with it. The fluent manual suggest that UDF with DEFINE_DPM_BC works only after compiling.

taha

March 14, 2013 03:53

hey vasava
i tried to interpret the code, but i repeatedly get the parse error
could you please give me some tips about compiling the code
tanx in advance

vasava

March 14, 2013 04:16

What is the exact error? Can you copy the text here.

Also try to compile some other code and verify that there is no problem with the compiler.

1. Put UDF in the same folder as the case. It seems that your udf is on your desktop.
2. Remove the comment on line-1. I think you will need udf.h file.
3. The macros you are using will give you real numbers so you dont have to declare them as real
4. You can try ‘double R=sqrt(x*x+y*y);’ instead of just ‘R=sqrt(x*x+y*y);’
5. To me ‘R=sqrt(x*x+y*y);’ does not make sense. You are not using R for anything. You can try after removing that line.

That’s the only help I can do now.

flotus1

March 14, 2013 05:05

Edit: should have read the answers too...

Apparently, the macros you are using only work in compiled mode

taha

March 14, 2013 05:18

well thank you vasava
i declared R variable as Double, and moved my .C file into the case folder, but still getting the same parse error!
and about udf.h, when i remove comment from udf.h, i get the "line 16: P_POS: undeclared variable" error.

i am trying to write a code for trapping particles in a cross flow over a cylinder. but i get parse error in line 17 and it doesn't matter what is in line 17! even it may be an "Enter" or other routine loops. my code is as follow:

it is noticeable that when i activate the #include "udf.h" header, i get "P_POS: undeclared variable" error!
my code is also where my case and data files are. and also the folder doesn't contain "space" in it.

thanks in advance.

Hi Taha,

I am having the same error as you are having. It seems that the UDF is not wrong. The origin of the error has to be something else.
I was wondering if you could ever solve this issue?