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

what is syntax error : missing ')' before ';'

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By `e`

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2011, 14:06
Default what is syntax error : missing ')' before ';'
  #1
Member
 
Join Date: Mar 2011
Posts: 38
Rep Power: 15
aleisia is on a distinguished road
I'm pretty sure that I have no problem with the ‘;’ and ')', but still I got that error. Some said it is because of the compiler, but I followed the ansys technical support's direction, using vs 2010 express edition+windows sdk 7.0+.net framework 3.5 sp1 to start fluent in my win7 64bit system.

Fluent can be smoothly started without problem.


Please help.


Thanks.



Deleted old \MECHSE-JACOB-02\users\meng8\desktop estbed\libudf\win64\3ddp_host\libudf.dll
\MECHSE-JACOB-02\users\meng8\desktop estbed\libudf\win64\3ddp_node\libudf.dll
1 file(s) copied.
(system "copy "C:\ANSYSI~1\v121\fluent"\fluent12.1.4\src\makefil e_nt.udf \MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf\win64\3ddp_h ost\makefile")


1 file(s) copied.
(chdir "\MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf")()

(chdir "win64\3ddp_host")()

C:\Windows\twain.dll
C:\Windows\twain_32.dll
# Generating ud_io1.h
udfsource.c

..\..\src\udfsource.c(102) : error C2065: 'tepflowrate' : undeclared identifier
..\..\src\udfsource.c(102) : warning C4133: 'function' : incompatible types - from 'int *' to 'double *'
..\..\src\udfsource.c(102) : error C2065: 'vol_tot' : undeclared identifier
..\..\src\udfsource.c(102) : warning C4133: 'function' : incompatible types - from 'int *' to 'double *'
..\..\src\udfsource.c(105) : error C2065: 'source' : undeclared identifier
..\..\src\udfsource.c(105) : error C2065: 'tepflowrate' : undeclared identifier
..\..\src\udfsource.c(105) : error C2065: 'vol_tot' : undeclared identifier
..\..\src\udfsource.c(107) : error C2065: 'source' : undeclared identifier
..\..\src\udfsource.c(108) : error C2143: syntax error : missing ')' before ';'
..\..\src\udfsource.c(108) : error C2143: syntax error : missing ';' before ','
..\..\src\udfsource.c(108) : error C2059: syntax error : ')'


'\\MECHSE-JACOB-02\users\meng8\desktop\testbed'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
'\\MECHSE-JACOB-02\users\meng8\desktop\testbed'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.

(system "copy "C:\ANSYSI~1\v121\fluent"\fluent12.1.4\src\makefil e_nt.udf \MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf\win64\3ddp_n ode\makefile")

'\\MECHSE-JACOB-02\users\meng8\desktop\testbed'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
1 file(s) copied.
(chdir "\MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf")()

(chdir "win64\3ddp_node")()

C:\Windows\twain.dll
C:\Windows\twain_32.dll
# Generating ud_io1.h
udfsource.c

..\..\src\udfsource.c(22) : error C2143: syntax error : missing ')' before ';'
..\..\src\udfsource.c(22) : error C2059: syntax error : ')'
..\..\src\udfsource.c(23) : error C2143: syntax error : missing ')' before ';'
..\..\src\udfsource.c(23) : error C2059: syntax error : ')'
..\..\src\udfsource.c(89) : error C2143: syntax error : missing ')' before ';'
..\..\src\udfsource.c(89) : error C2059: syntax error : ')'
..\..\src\udfsource.c(90) : error C2143: syntax error : missing ')' before ';'
..\..\src\udfsource.c(90) : error C2059: syntax error : ')'
aleisia is offline   Reply With Quote

Old   June 29, 2011, 13:29
Default
  #2
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 156
Rep Power: 18
Micael is on a distinguished road
I don't know if that was your case, but there is a C rule that can be very annoying for one that is not aware of it. You should put every declaration before any operation. As an example, this produces the kind of error you got:

Code:
 
 int j;
 j = 1;
 int i;
Micael is offline   Reply With Quote

Old   March 10, 2015, 02:46
Default
  #3
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
I have encountered the same problem.. Have you resolved it?
shivakumar is offline   Reply With Quote

Old   March 10, 2015, 05:59
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
If you have the same error then post your UDF code. The error code states the line number where the error has occurred.
`e` is offline   Reply With Quote

Old   March 10, 2015, 06:02
Unhappy
  #5
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Thanks for the reply.. code is below


#include "udf.h"
#define a 340.26

DEFINE_ON_DEMAND(shock_sensor)
{
Domain *d;
Thread *t;
cell_t c;
d=Get_Domain(1);

real f_shock, velocity;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
velocity=(C_U(c,t)+C_V(c,t));
f_shock = (velocity*C_P_G(c,t))/(a*abs(C_P_G(c,t)));

if(f_shock>=1)
{
C_UDMI(c,t,0)=f_shock;
}
}
end_c_loop(c,t)
}
}

I think I need to change the macro, but not sure...

Thanks
shivakumar is offline   Reply With Quote

Old   March 10, 2015, 06:12
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Are you running in serial or parallel, and what is your error message exactly?
`e` is offline   Reply With Quote

Old   March 10, 2015, 06:15
Default
  #7
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
First of all, you should declare your variables before assigning values to them as pointed out by Micael in this thread we're currently in.

Try:

Code:
Domain *d;
Thread *t;
cell_t c;
real f_shock, velocity;
d=Get_Domain(1);
pakk likes this.
`e` is offline   Reply With Quote

Old   March 10, 2015, 12:08
Smile
  #8
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Quote:
Domain *d;
Thread *t;
cell_t c;
real f_shock, velocity;
d=Get_Domain(1);
Thank you. Awesome suggestion, my errors reduced but still got 3 errors. I think I need to change the macro, not sure. I'm running on serial right now and will attach my sensor and viscous algorithm.

UDF is this

#include "udf.h"
#define A 340.26

DEFINE_ON_DEMAND(shock_sensor)
{
Domain *d;
Thread *t;
cell_t c;
real f_shock, velocity;
d=Get_Domain(1);


thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
velocity=(C_U(c,t)+C_V(c,t));
f_shock = (velocity*C_P_G(c,t))/(A*fabs(C_P_G(c,t)));

if(f_shock>=1)
{
C_UDMI(c,t,0)=f_shock;
}
}
end_c_loop(c,t)
}
}



Error is below.


# Generating ud_io1.h
shock_sensor.c
..\..\src\shock_sensor.c(18) : error C2297: '*' : illegal, right operand has type 'real [2]'
..\..\src\shock_sensor.c(18) : error C2440: 'function' : cannot convert from 'real [2]' to 'double'
..\..\src\shock_sensor.c(18) : warning C4024: 'fabs' : different types for formal and actual parameter 1

Done.


Thanks in advance
Attached Images
File Type: jpg Capture.JPG (68.1 KB, 23 views)
shivakumar is offline   Reply With Quote

Old   March 10, 2015, 15:42
Default
  #9
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
See my reply in this thread and please do not post duplicate questions in multiple threads.
`e` 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
syntax error on config.h ehooi Fluent UDF and Scheme Programming 3 November 9, 2011 10:05
[Other] Turbogrid power syntax la7low ANSYS Meshing & Geometry 0 January 15, 2011 22:20
OpenFOAM file syntax amtri OpenFOAM 5 August 28, 2010 07:19
Interpolation command '-interp-iv' in syntax file KM CFX 4 October 12, 2007 16:29
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 15:16


All times are GMT -4. The time now is 09:50.