CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   parse error in DEFINE_PROFILE line (http://www.cfd-online.com/Forums/fluent-udf/107026-parse-error-define_profile-line.html)

Kestas September 15, 2012 10:28

parse error in DEFINE_PROFILE line
 
Hello,
I am learning using Ansys Fluent 14, tried to interpret UDF example, but I got error:

Code:

cpp -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/client/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/multiport/src" -I. -DUDF
ONFIG_H="<udfconfig.h>" "D:\CFDprojektai\pirmas_files\dp0\FFF\Fluent\udfexample.c"
Error: D:\CFDprojektai\pirmas_files\dp0\FFF\Fluent\udfexample.c: line 8: parse error.

while trying interpret:
Code:

/***********************************************************************
  udfexample.c
  UDF for specifying steady-state velocity profile boundary condition
 ************************************************************************/

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
    real x[ND_ND]; /* this will hold the position vector */
    real y, h;
    face_t f;
    h = 0.016; /* inlet height in m */
    begin_f_loop(f,thread)
    {
      F_CENTROID(x, f, thread);
      y = 2.*(x[1]-0.5*h)/h; /* non-dimensional y coordinate */
      F_PROFILE(f, thread, position) = 0.1*(1.0-y*y);
    }
    end_f_loop(f, thread)
  }

tried so much but error remains, maybe you can see error ?

Thank you,
Kestas

eng_s_sadeghi September 16, 2012 03:44

Hi.
I have checked your file. It is correct. Your UDF file may not be in the same folder as your case file.

Kestas September 16, 2012 10:43

UDF is in same directory where is case files(..\dp0\FFF\Fluent\). I also noticed that if I changed #include "udf.h" on first line, to random, say, "udfasdasdasd.h", I got same error on line 8, not on line 1, isn't strange?

eng_s_sadeghi September 16, 2012 11:07

Really I have tried again, still no error :)
I should connect your computer using teamviewer software to see the problem.
Please email me for more questions.

mactech001 October 8, 2012 04:49

Hi Saeed,

what is a teamviewer software please?

regards,
mactech001

eng_s_sadeghi October 8, 2012 04:53

Quote:

Originally Posted by mactech001 (Post 385462)
Hi Saeed,

what is a teamviewer software please?

regards,
mactech001

It is for connecting to others computer and helping them soling their problems. Like Remote Desktop but much efficient.

CMA December 17, 2012 17:18

were you able to finally solve the problem?
 
I am getting the same error; were you able to finally solve the parse error problem?


Quote:

Originally Posted by Kestas (Post 381922)
Hello,
I am learning using Ansys Fluent 14, tried to interpret UDF example, but I got error:

Code:

cpp -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/client/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/multiport/src" -I. -DUDF
ONFIG_H="<udfconfig.h>" "D:\CFDprojektai\pirmas_files\dp0\FFF\Fluent\udfexample.c"
Error: D:\CFDprojektai\pirmas_files\dp0\FFF\Fluent\udfexample.c: line 8: parse error.

while trying interpret:
Code:

/***********************************************************************
  udfexample.c
  UDF for specifying steady-state velocity profile boundary condition
 ************************************************************************/

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
    real x[ND_ND]; /* this will hold the position vector */
    real y, h;
    face_t f;
    h = 0.016; /* inlet height in m */
    begin_f_loop(f,thread)
    {
      F_CENTROID(x, f, thread);
      y = 2.*(x[1]-0.5*h)/h; /* non-dimensional y coordinate */
      F_PROFILE(f, thread, position) = 0.1*(1.0-y*y);
    }
    end_f_loop(f, thread)
  }

tried so much but error remains, maybe you can see error ?

Thank you,
Kestas


msaeedsadeghi December 18, 2012 03:26

No error. It may have some hidden characters in it that cause error.
Have you copied the UDF from Fluent Help? If yes, there are so much hidden characters in your file that won't allow to be interpretted correctly. Find and delete them.

mactech001 January 13, 2013 08:14

when copying from Help to a notebook/text file, some characters are not recognised by Compiler. so, as Saeed suggests, just delete all the 'spaces' in the text.
reapply the 'ENTER' to make the next line again also.
also first make sure your Compiler is working using simple codings.

hooman.4028 March 1, 2013 16:23

Hi guys,

I have a question, I am trying to move my whole domain in a sinusoidal way. Basically I have a box which is fixed and i am trying to move the whole flow around in a sinusoidal transient way. Which kind of UDF would you suggest me to use?

Thanks for your help

hooman.4028 March 2, 2013 16:37

Any comments? I need to hear from you experts... :)


All times are GMT -4. The time now is 05:38.