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

Strange error building UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By villager

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2012, 10:32
Default Strange error building UDF
  #1
rik
New Member
 
Join Date: Jan 2012
Posts: 5
Rep Power: 14
rik is on a distinguished road
Hi!

I'm trying to build an UDF with Fluent, but when I want to build it, it appears a strange error :

1 file(s) copied.
1 file(s) copied.
(system "copy "C:\PROGRAMS\FLUENT_121\v121\fluent"\fluent12.1.4\ src\makefile_nt.udf libudf\win64\3d\makefile")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\3d")()
# Generating ud_io1.h
transfert_temp.c
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2143: syntax error : missing '{' before ':'
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2059: syntax error : ':'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2061: syntax error : identifier 'CX_DLL_GetProc'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : ';'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : 'type'

Done.

With this UDF, I want to copy wall temperature from a wall to another.
My UDF looks like that :
#include "udf.h"
#define ID1 3
#define ID_TWIN1 13
#define MYDEBUG 1

DEFINE_ON_DEMAND(compute_twin)
{
Domain *d=Get_Domain(1);
face_t f,f_twin;
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
Thread *tf=Lookup_Thread(d,ID1);

real y_translation[]={0,-88,0};
real y_twin[3],y[3];
real dist=1e20;

begin_f_loop(f,tf)
{

F_CENTROID(y,f,tf);

NV_VV(y,=,y,-,y_translation);

begin_f_loop(f_twin,t_twin)
{

F_CENTROID(y_twin,f_twin,t_twin);

NV_VV(y_twin,=,y,-,y_twin);


if (NV_MAG(y_twin)<dist)
{
dist=NV_MAG(y_twin);
F_UDMI(f,tf,0)=f_twin;
#if MYDEBUG
C_UDMI(F_C0(f,tf),THREAD_T0(tf),0)=f_twin;
#endif
}
}
end_f_loop(f_twin,t_twin)
}
end_f_loop(f,tf)
}

DEFINE_PROFILE(apply_temp,tf,nv)
{
Domain *d=Get_Domain(1);
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
face_t f,f_twin;

begin_f_loop(f,tf)
{
f_twin=(int)F_UDMI(f,tf,0);
F_PROFILE(f,tf,nv)=F_T(f_twin,t_twin);
}
end_f_loop(f,tf)
}

What should have to do to erase this error? Do you have any idea?

Thanks for the help.

Ryk
rik is offline   Reply With Quote

Old   February 17, 2012, 18:04
Smile Maybe..
  #2
Member
 
vlg
Join Date: Jul 2011
Location: My home :)
Posts: 81
Rep Power: 18
villager is on a distinguished road
Try this
http://www.cfd-online.com/Forums/flu...tml#post271119

You might have this problem, all error messages are the same.
"The Problem was that you didn't check the box "Visual c++ compilers" when I installed the SDK. Reinstall SDK checked that box, that will solve your problem."

I've searched in Google this string:
src\config.h error C2143: syntax error : missing '{ 'before ':'
rik likes this.

Last edited by villager; February 20, 2012 at 18:12.
villager is offline   Reply With Quote

Old   February 19, 2012, 20:19
Default
  #3
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Maybe you have used some non-English/unicode folder. You'd better put the case in English folders without space in folder name.


Quote:
Originally Posted by rik View Post
Hi!

I'm trying to build an UDF with Fluent, but when I want to build it, it appears a strange error :

1 file(s) copied.
1 file(s) copied.
(system "copy "C:\PROGRAMS\FLUENT_121\v121\fluent"\fluent12.1.4\ src\makefile_nt.udf libudf\win64\3d\makefile")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\3d")()
# Generating ud_io1.h
transfert_temp.c
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2143: syntax error : missing '{' before ':'
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2059: syntax error : ':'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2061: syntax error : identifier 'CX_DLL_GetProc'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : ';'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : 'type'

Done.

With this UDF, I want to copy wall temperature from a wall to another.
My UDF looks like that :
#include "udf.h"
#define ID1 3
#define ID_TWIN1 13
#define MYDEBUG 1

DEFINE_ON_DEMAND(compute_twin)
{
Domain *d=Get_Domain(1);
face_t f,f_twin;
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
Thread *tf=Lookup_Thread(d,ID1);

real y_translation[]={0,-88,0};
real y_twin[3],y[3];
real dist=1e20;

begin_f_loop(f,tf)
{

F_CENTROID(y,f,tf);

NV_VV(y,=,y,-,y_translation);

begin_f_loop(f_twin,t_twin)
{

F_CENTROID(y_twin,f_twin,t_twin);

NV_VV(y_twin,=,y,-,y_twin);


if (NV_MAG(y_twin)<dist)
{
dist=NV_MAG(y_twin);
F_UDMI(f,tf,0)=f_twin;
#if MYDEBUG
C_UDMI(F_C0(f,tf),THREAD_T0(tf),0)=f_twin;
#endif
}
}
end_f_loop(f_twin,t_twin)
}
end_f_loop(f,tf)
}

DEFINE_PROFILE(apply_temp,tf,nv)
{
Domain *d=Get_Domain(1);
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
face_t f,f_twin;

begin_f_loop(f,tf)
{
f_twin=(int)F_UDMI(f,tf,0);
F_PROFILE(f,tf,nv)=F_T(f_twin,t_twin);
}
end_f_loop(f,tf)
}

What should have to do to erase this error? Do you have any idea?

Thanks for the help.

Ryk
gearboy is offline   Reply With Quote

Old   February 21, 2012, 09:38
Default
  #4
rik
New Member
 
Join Date: Jan 2012
Posts: 5
Rep Power: 14
rik is on a distinguished road
Hy,

I've solved my problem.

I install Microsoft SDK 7.1 and Visual Studio Professionnal 2010 for windows 64 bit, and I launch Fluent with the Visual studio command prompt x64.

Thanks all for the help.

Ryk
rik is offline   Reply With Quote

Old   December 5, 2018, 09:35
Unhappy
  #5
New Member
 
amirhossein gharagoz
Join Date: Dec 2018
Posts: 2
Rep Power: 0
sadone is on a distinguished road
Quote:
Originally Posted by rik View Post
Hy,

I've solved my problem.

I install Microsoft SDK 7.1 and Visual Studio Professionnal 2010 for windows 64 bit, and I launch Fluent with the Visual studio command prompt x64.

Thanks all for the help.

Ryk
hey there ive done exact as u said and same problem
sadone 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
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 07:12
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
Need help: strange problem of unsteady B.C. UDF Z. T. FLUENT 0 April 11, 2003 20:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 22:26.