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

UDF problems

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 6, 2005, 13:44
Default UDF problems
  #1
Paolo Lampitella
Guest
 
Posts: n/a
Hi to everyone (sorry for my english) I'm having some problems with UDFs. The first is: what is a "parse error"? I already had this error for having too much variable declaration in the same row but now Fluent gives me the error for the line:

"c=a+b;" obviously i declared all the variables and defined the values for "a" and "b" so...i don't know how to proceed. The second one is about the threads: can i define, via UDF, a new cell thread specifing what are the cells that i want to put in it?

Thanks
  Reply With Quote

Old   September 6, 2005, 14:09
Default Street Canyon msh file??
  #2
Aykut
Guest
 
Posts: n/a
Hi everybody;

I am a master degree student and I have a thesis topic of "Simulation of a flow in a Street Canyon". So I am a new user of both Gambit and Fluent Softwares. My first aim is to create a 2D and then a 3D Street Canyon Geometry and to mesh it.2D seems easy but with 3D i have no clue. Soooo if any of you have a basic simple 3D street canyon model and share it with me I will be sooooo satisfied. Thanxx for your cooperation. Bye
  Reply With Quote

Old   September 6, 2005, 19:07
Default Re: UDF problems
  #3
Amir
Guest
 
Posts: n/a
it would helpful if you post your UDF here to have a look
  Reply With Quote

Old   September 6, 2005, 21:38
Default Re: UDF problems
  #4
Ahmed
Guest
 
Posts: n/a
the parser reads your c statements and converts them to the equivalent in machine language, if it is not a problem for you go again through the spelling especially the lines before this statment or if you have a C++ compiler (if you are using a UNIX or LINUX machine then it is the cc command, check your man command for details) then transfer the code and recompile it again, if there is a spelling error it will give you better error message and even the line number
  Reply With Quote

Old   September 7, 2005, 11:23
Default UDF problems 2
  #5
Paolo Lampitella
Guest
 
Posts: n/a
Thank you Amir and Ahmed for your help; i solved the problem but now i'm experiencing some other problems, take a look, please:

thread_loop_c(t,domain)

{

begin_c_loop(c,t)

{

C_CENTROID(xc,c,t);

dist=sqrt(pow((xc[0]-bar[0]),2)+pow((xc[1]-bar[1]),2)+pow((xc[2]-bar[2]),2));

if ( dist < d )

{

d=dist;

C_CENTROID(xc1,c,t);

cid=c;

}

}

end_c_loop(c,t)

}

printf("cid = %d\n", cid);

c_node_loop(cid,t,n) /*line 182*/

{

ny=NODE_Y(n);

d2=fabs(ny-bar[1]);

if (d2>d1)

{

d1=d2;

}

}

This is only the final part of my udf (too much big to post it all) but is where i have the error:

"C:\Fluent.Inc tbin tx86\cpp.exe -IC:\Fluent.Inc\fluent6.2.16/src -IC:\Fluent.Inc\fluent6.2.16/cortex/src -IC:\Fluent.Inc\fluent6.2.16/client/src -IC:\Fluent.Inc\fluent6.2.16/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" C:\Fluent.Inc tbin tx86\profili_source.c Error: C:\Fluent.Inc\ntbin\ntx86\profili_source.c: line 182: non-integer subscript expression: unsigned char."

But if i cut the c_node_loop he recognize the value for cid and the UDF works correctly writing it on the screen... oops, i forgot to say that it is a "DEFINE_ON_DEMAND" macro (i don't know if it is important).

Thank you
  Reply With Quote

Old   September 8, 2005, 21:43
Default Re: UDF problems 2
  #6
Ahmed
Guest
 
Posts: n/a
Check the number of the closing braces "}". As I said in a previous posting, use any available C compiler to check your code, most books about the C language that I know about come with MS VC. The C language is one of the most powerful programming tools today, but you have to strictly follow its syntax. Good Luck
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
problems with UDF to set contact angle poiuy219 Main CFD Forum 0 April 30, 2009 11:43
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 12:29


All times are GMT -4. The time now is 04:24.