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

UDF- parse error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2018, 01:55
Default UDF- parse error
  #1
New Member
 
ahmad
Join Date: Mar 2018
Posts: 21
Rep Power: 8
ahmad_xjtu is on a distinguished road
HI, I am trying to interpret the following UDF. I have searched several different threads having similar issues and tried the provided solutions too, but in vain.

#include "udf.h"
#include "stdlib.h"
#include "stdio.h"
#include "process.h"
#include "malloc.h"
#include "math.h"
DEFINE_PROFILE(wall_2, thread, index)
{
real x[ND_ND];
face_t f;
int count,i;
real w,a,b;
FILE *fpp;
FILE *fp;
fpp=fopen("MianT.dat","w+");
fp=fopen("MianT2.dat","r+");
count=0;
begin_f_loop(f,thread)
{
count=count+1;
fscanf(fp,"%d %f %f %f",&i,&a,&b,&w);
F_CENTROID(x,f,thread);
F_PROFILE(f,thread,index)=w;
fprintf(fpp,"%d %f %f %f %f",count,x[0],x[1],w);
}
end_f_loop(f,thread)
fclose(fpp);
fclose(fp);
}

Error

cpp -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0/src" -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0/client/src" -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0/multiport/src" -I. -DUDF
ONFIG_H="<udfconfig.h>" "I:\reciever-no-walls\reciever-no-walls-meshing_files\dp0\FFF\Fluent\source.c"
Error: C:\\PROGRA~1\\ANSYSI~1\\v150\\fluent\\fluent15.0.0/src/vadefs.h: line 50: parse error.


This is my first time using UDF's, I am still confused how is the file as mentioned in error, (vadefs.h) linked to the UDF.

In another post, some senior advised removing
#include "stdlib.h"
#include "stdio.h"
#include "process.h"
#include "malloc.h"
#include "math.h"
lines, as these are mostly included in "udf.h", I did so but it gave the following error.
The fl process could not be started.
whats the reason for the error? and how to get rid of it?
Expecting help!
Sincerely thanks
ahmad_xjtu is offline   Reply With Quote

Old   March 18, 2018, 20:54
Default tried following things since I posted
  #2
New Member
 
ahmad
Join Date: Mar 2018
Posts: 21
Rep Power: 8
ahmad_xjtu is on a distinguished road
A friend said UDF's having read and write files can't be interpreted, so I must compile it. and it gives the following errors.
Copied I:\reciever-no-walls\reciever-no-walls-meshing_files\dp0\FFF\Fluent/I:\reciever-no-walls\reciever-no-walls-meshing_files\dp0\FFF\Fluent\source.c to libudf\src
udf_names.c and user_nt.udf files in 3d are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3d\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3d")# Generating ud_io1.h
source.c
C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0\src\ math.h(482) : error C2059: syntax error : ','
C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0\src\ math.h(482) : error C2143: syntax error : missing ')' before 'constant'
C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0\src\ math.h(482) : error C2143: syntax error : missing '{' before 'constant'
C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0\src\ math.h(482) : error C2059: syntax error : '<Unknown>'
C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.0\src\ math.h(482) : error C2059: syntax error : ')'

Done.
ahmad_xjtu is offline   Reply With Quote

Reply

Tags
fl process not started, parse error, udf


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
Mesquite - Adaptive mesh refinement / coarsening? philippose OpenFOAM Running, Solving & CFD 94 January 27, 2016 10:40
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." sega OpenFOAM Community Contributions 12 February 17, 2010 10:30
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 03:32
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 18:38


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