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

parse error in DEFINE_PROFILE line

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2012, 11:28
Default parse error in DEFINE_PROFILE line
  #1
New Member
 
Kestas
Join Date: May 2009
Location: Lithuania
Posts: 13
Rep Power: 17
Kestas is on a distinguished road
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
Kestas is offline   Reply With Quote

Old   September 16, 2012, 04:44
Default
  #2
Member
 
eng_s_sadeghi's Avatar
 
Join Date: Mar 2011
Posts: 64
Rep Power: 15
eng_s_sadeghi is on a distinguished road
Hi.
I have checked your file. It is correct. Your UDF file may not be in the same folder as your case file.
__________________
Saeed Sadeghi
Ansys Fluent CFD Consultant
eng_s_sadeghi is offline   Reply With Quote

Old   September 16, 2012, 11:43
Default
  #3
New Member
 
Kestas
Join Date: May 2009
Location: Lithuania
Posts: 13
Rep Power: 17
Kestas is on a distinguished road
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?
Kestas is offline   Reply With Quote

Old   September 16, 2012, 12:07
Default
  #4
Member
 
eng_s_sadeghi's Avatar
 
Join Date: Mar 2011
Posts: 64
Rep Power: 15
eng_s_sadeghi is on a distinguished road
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.
__________________
Saeed Sadeghi
Ansys Fluent CFD Consultant
eng_s_sadeghi is offline   Reply With Quote

Old   October 8, 2012, 05:49
Default
  #5
Senior Member
 
Join Date: Nov 2009
Posts: 125
Rep Power: 17
mactech001 is on a distinguished road
Hi Saeed,

what is a teamviewer software please?

regards,
mactech001
mactech001 is offline   Reply With Quote

Old   October 8, 2012, 05:53
Default
  #6
Member
 
eng_s_sadeghi's Avatar
 
Join Date: Mar 2011
Posts: 64
Rep Power: 15
eng_s_sadeghi is on a distinguished road
Quote:
Originally Posted by mactech001 View Post
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.
__________________
Saeed Sadeghi
Ansys Fluent CFD Consultant
eng_s_sadeghi is offline   Reply With Quote

Old   December 17, 2012, 17:18
Default were you able to finally solve the problem?
  #7
CMA
New Member
 
Join Date: Oct 2012
Posts: 8
Rep Power: 14
CMA is on a distinguished road
I am getting the same error; were you able to finally solve the parse error problem?


Quote:
Originally Posted by Kestas View Post
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
CMA is offline   Reply With Quote

Old   December 18, 2012, 03:26
Default
  #8
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 15
msaeedsadeghi is on a distinguished road
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.
msaeedsadeghi is offline   Reply With Quote

Old   January 13, 2013, 08:14
Default
  #9
Senior Member
 
Join Date: Nov 2009
Posts: 125
Rep Power: 17
mactech001 is on a distinguished road
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.
__________________
Thank you for your kind attention.

Kind regards,
mactech001
Currently using: ANSYS v13
mactech001 is offline   Reply With Quote

Old   March 1, 2013, 16:23
Default
  #10
Member
 
Hooman
Join Date: Apr 2011
Posts: 35
Rep Power: 15
hooman.4028 is on a distinguished road
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 is offline   Reply With Quote

Old   March 2, 2013, 16:37
Default
  #11
Member
 
Hooman
Join Date: Apr 2011
Posts: 35
Rep Power: 15
hooman.4028 is on a distinguished road
Any comments? I need to hear from you experts...
hooman.4028 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
8x icoFoam speed up with Cufflink CUDA solver library kmooney OpenFOAM Running, Solving & CFD 42 November 6, 2012 12:37
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 flakid OpenFOAM Installation 16 December 28, 2010 09:48
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 05:26
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 20:14.