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

udf_names.c(7) : error C2059: syntax error : '}'

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2010, 15:26
Default udf_names.c(7) : error C2059: syntax error : '}'
  #1
New Member
 
Mehr
Join Date: Apr 2010
Posts: 3
Rep Power: 16
wingsinblue is on a distinguished road
Dear All,
I just switched to windows7 64bit. I have Fluent 6.3.2 (64bit) installed on my PC with VisualC++2010 Pro RC. and the environment path variables set for VC++ and Fluent.
For a test case I want to run the fluent tutorial model for multiphase flows (VOF). Although I am using SKD to run FLUENT, at the time of compiling the FLUENT UDF, these warnings and errors appear. would you please give me some hints,
Thanks
M

1 file(s) copied.
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\win64\2ddp\makefile")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\2ddp")()
inlet1.c
c:\fluent.inc\fluent6.3.26\src\machine.h(114) : warning C4005: 'stdout' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(160) : see previous definition of 'stdout'
c:\fluent.inc\fluent6.3.26\src\machine.h(115) : warning C4005: 'stderr' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(161) : see previous definition of 'stderr'
c:\fluent.inc\fluent6.3.26\src\machine.h(116) : warning C4005: 'stdin' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(159) : see previous definition of 'stdin'
# Generating udf_names.c because of makefile inlet1.obj
udf_names.c
c:\fluent.inc\fluent6.3.26\src\machine.h(114) : warning C4005: 'stdout' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(160) : see previous definition of 'stdout'
c:\fluent.inc\fluent6.3.26\src\machine.h(115) : warning C4005: 'stderr' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(161) : see previous definition of 'stderr'
c:\fluent.inc\fluent6.3.26\src\machine.h(116) : warning C4005: 'stdin' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(159) : see previous definition of 'stdin'
udf_names.c(7) : error C2059: syntax error : '}'
udf_names.c(8) : warning C4034: sizeof returns 0
Done.
wingsinblue is offline   Reply With Quote

Old   April 28, 2010, 11:59
Default
  #2
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 17
fox000002 is on a distinguished road
Make sure the udf_names.c has been created correctly.

udf_names.c(7) : error C2059: syntax error : '}'
udf_names.c(8) : warning C4034: sizeof returns 0
fox000002 is offline   Reply With Quote

Old   April 28, 2010, 23:53
Default
  #3
New Member
 
Mehr
Join Date: Apr 2010
Posts: 3
Rep Power: 16
wingsinblue is on a distinguished road
Dear Fox
How can I check that?
I followed the commands in makefile and it looks like that it doesnt' understand
the line below,
@sed -n "s/^DEFINE_\([_A-Z]*\)( *\([_a-zA-Z0-9]*\).*)/\{\"\2\", (void (*)())\2, UDF_TYPE_\1\},/p" $(SOURCES) >> $@
But I dont' know what should I do?
wingsinblue is offline   Reply With Quote

Old   April 29, 2010, 01:26
Default
  #4
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 17
fox000002 is on a distinguished road
Can u post the UDF definition, or send it to me?

Last edited by fox000002; April 29, 2010 at 03:32.
fox000002 is offline   Reply With Quote

Old   April 29, 2010, 14:53
Default The UDF file,
  #5
New Member
 
Mehr
Join Date: Apr 2010
Posts: 3
Rep Power: 16
wingsinblue is on a distinguished road
Here is the standard UDF,

#include "udf.h"
#include "sg.h"
#include "sg_mphase.h"
#include "flow.h"
#define PI 3.141592654

DEFINE_PROFILE(membrane_speed, /* function name */
th , /* thread */
nv) /* variable number */
{
face_t f;
real x[ND_ND];
real f_time = RP_Get_Real("flow-time");
begin_f_loop (f,th)
{
F_CENTROID(x,f,th);
if (f_time<=10e-6)
{F_PROFILE(f,th,nv) = 3.58*cos(PI*f_time/30e-6);
}
else
F_PROFILE(f,th,nv) = 0;
}
end_f_loop (f,th)
}
wingsinblue is offline   Reply With Quote

Old   April 30, 2010, 04:33
Default
  #6
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 17
fox000002 is on a distinguished road
Sed cannot understand your UDF.

Delete the useless comments between UDF name and its parameters, and put them in a single line.

Use the following format.

Code:
DEFINE_PROFILE(membrane_speed,  th,  nv)
fox000002 is offline   Reply With Quote

Old   August 1, 2010, 06:20
Default udf_names.c(7) : error C2059: syntax error : '}'
  #7
Member
 
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16
almostafa67 is on a distinguished road
hi everybody...
i have same error friends,i've defined an udf file and when i compile it,fluent shows me this error message...
thank u in advance
almostafa67 is offline   Reply With Quote

Old   January 25, 2016, 10:10
Default
  #8
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
you cannot have any spaces in DEFINE_UDFNAME(a,b,x) syntax
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   May 25, 2016, 04:33
Default UDF error
  #9
New Member
 
jianshu
Join Date: May 2016
Posts: 2
Rep Power: 0
jianshu gao is on a distinguished road
I have the same problem and do not know what to do. Please help me.

Copied C:\Users\jianshugao\Desktop\UDF\UDWSPF.c to libudf\src
udf_names.c and user_nt.udf files in 2d_host are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\2d_host\makefile" ")
已复制 1 个文件。
(chdir "libudf")(chdir "win64\2d_host")# Generating ud_io1.h
UDWSPF.c
# Generating udf_names.c because of UDWSPF.obj
udf_names.c
udf_names.c(7) : error C2059: 语法错误:“}”
udf_names.c(8) : warning C4034: sizeof 返回 0
udf_names.c and user_nt.udf files in 2d_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\2d_node\makefile" ")
已复制 1 个文件。
(chdir "libudf")(chdir "win64\2d_node")# Generating ud_io1.h
UDWSPF.c
# Generating udf_names.c because of UDWSPF.obj
udf_names.c
udf_names.c(7) : error C2059: 语法错误:“}”
udf_names.c(8) : warning C4034: sizeof 返回 0

Done.
Attached Files
File Type: c UDWSPF.c (4.9 KB, 24 views)
jianshu gao is offline   Reply With Quote

Old   May 25, 2016, 07:23
Default
  #10
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
The Fluent manual has the line:

Code:
UDF_EXPORT WS_Functions WetSteamFunctionList =
Your code has the line:

Code:
UDF_EXPORT WS_Functions WetSteamFunctionList=
That missing space could be very important.
pakk is offline   Reply With Quote

Old   May 25, 2016, 10:11
Default
  #11
New Member
 
jianshu
Join Date: May 2016
Posts: 2
Rep Power: 0
jianshu gao is on a distinguished road
Thanks for your answer.
But it can not help with the missing space added and the same reply is showed as this:
udf_names.c(7) : error C2059: 语法错误:“}”
udf_names.c(8) : warning C4034: sizeof 返回 0
jianshu gao is offline   Reply With Quote

Old   May 25, 2016, 11:59
Default
  #12
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Can you show the content of udf_names.c?
pakk is offline   Reply With Quote

Old   March 29, 2017, 09:55
Default Solution
  #13
New Member
 
yaobenchun
Join Date: Sep 2016
Location: Beijing
Posts: 1
Rep Power: 0
yaobenchun is on a distinguished road
Recently, I wrote a similar code and the same error:
udf_names.c(7) : error C2059: syntax error : '}'
udf_names.c(8) : warning C4034: sizeof returns 0
happened to me. It turned out there is a spece before "DEFINE_PROFILE(membrane_speed,th,nv)". After deleting the space, the code complied smoothly.
yaobenchun 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
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 19:00
compile errors of boundary condition "expDirectionMixed" liying02ts OpenFOAM Bugs 2 February 1, 2010 21:11
error while running paraFoam! padmanathan OpenFOAM 9 October 13, 2009 06:17
attach/detach (valve opening/closing) phsieh2005 OpenFOAM Running, Solving & CFD 2 March 21, 2009 06:18
user defined function cfduser CFX 0 April 29, 2006 11:58


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