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

UDF problem...

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 15, 2005, 09:08
Default UDF problem...
  #1
Laura
Guest
 
Posts: n/a
Hi,

For transient calculations of a non reacting system with 2 inlets (one for gas A and one for gas B) and one outlet for a mixture A+B,

I have to report the mass fraction of B as a function of time step for all the cells at the outlet.

Any one know hows to start/writte an UDF to make that possible?

I tried to use your udf that cg suggested to me as an interpreted one but I got the following error message :

cpp -ID:\FLUENT.INC\fluent6.0/src -ID:\FLUENT.INC\fluent6.0/cortex/src -ID:\FLUENT.INC\fluent6.0/client/src -ID:\FLUENT.INC\fluent6.0/multiport/src -I.

-DUDFCONFIG_H="<udfconfig.h>" C:\FLUENT\projects\udf.cError: C:\FLUENT\projects\udf.c: line 11: parse error. Error: C:\FLUENT\projects\THALES\udf.c: line 20: f_loop_last: undeclared variable

I tried also to use it as a compiled one and got the following error message : Opening library "libudf"...

Error: open_udf_library:....

is there a path problem?

Here is the udf :

______________________________________

#include "udf.h"

DEFINE_ON_DEMAND(species_mass_flow) {

Domain *domain = Get_Domain(1);

Thread *t; face_t f;

thread_loop_f(t,domain);

real f

real smf

if( THREAD_TYPE(t)==THREAD_F_POUTLET )

begin_f_loop (f,t)

{

real smf = F_FLUX(f,t)*F_YI(f,t);

}

end_f_loop(f, thread)

Message("%i %e\n",f,smf);

}

end_f_loop (f,t) }

_________________________________________

any one can help ? Thanks.
  Reply With Quote

Old   June 15, 2005, 11:21
Default Re: UDF problem...
  #2
Alec Eiffel
Guest
 
Posts: n/a
Hi Laura

There is a couple of syntax errors in UDF. Try compiling this version

#include "udf.h"

DEFINE_ON_DEMAND(species_mass_flow)

{

real smf;

int species_index = 0;

Domain *domain = Get_Domain(1);

Thread *t; face_t f;

thread_loop_f(t,domain)

{

if( THREAD_TYPE(t)==THREAD_F_POUTLET )

{

begin_f_loop (f,t)

{

smf = F_FLUX(f,t)*F_YI(f,t,species_index);

Message("%i %e\n",f,smf);

}

end_f_loop(f, thread)

}

}

}

you might have to change the species index depeding on which you want to report. hope this helps!
  Reply With Quote

Old   June 16, 2005, 04:43
Default Re: UDF problem...
  #3
Laura
Guest
 
Posts: n/a
Hi Alek !

Thanks for the answer.

I still get the same error when i compile my udf: Opening library "C:\FLUENT\projects\libudf"... Error: open_udf_library: Le fichier spécifié est introuvable (that means : file not found).

If you agree I can send you my case\data file and the udf (but I don't have your email adress? or may be you prefer to contact : rumba5@voila.fr ?).

May be you can check it if you have time.

Many thanks in advance.

Laura.
  Reply With Quote

Old   June 16, 2005, 06:05
Default Re: UDF problem...
  #4
Laura
Guest
 
Posts: n/a
Error when I compile my udf as interpreted :

cpp -ID:\FLUENT.INC\fluent6.0/src -ID:\FLUENT.INC\fluent6.0/cortex/src -ID:\FLUENT.INC\fluent6.0/client/src -ID:\FLUENT.INC\fluent6.0/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" C:\FLUENT\projects\fraction.cError: C:\FLUENT\projects\fraction.c: line 19: structure reference not implemented

any help please?
  Reply With Quote

Old   June 16, 2005, 08:34
Default Re: UDF problem...
  #5
Mahesh
Guest
 
Posts: n/a
variables in () of f _loop are not matching.
  Reply With Quote

Old   June 16, 2005, 09:05
Default Re: UDF problem...
  #6
Laura
Guest
 
Posts: n/a
what do you mean please?
  Reply With Quote

Old   June 16, 2005, 15:12
Default Re: UDF problem...
  #7
dirk
Guest
 
Posts: n/a
Hello,

you declare the variable smf twice (in lines 7 and 11) and there are some semicolons missing. By the way: can't you do this report with a surface integral ?

Dirk
  Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 01:31
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


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