|
[Sponsors] |
June 15, 2005, 09:08 |
UDF problem...
|
#1 |
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. |
|
June 15, 2005, 11:21 |
Re: UDF problem...
|
#2 |
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! |
|
June 16, 2005, 04:43 |
Re: UDF problem...
|
#3 |
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. |
|
June 16, 2005, 06:05 |
Re: UDF problem...
|
#4 |
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? |
|
June 16, 2005, 08:34 |
Re: UDF problem...
|
#5 |
Guest
Posts: n/a
|
variables in () of f _loop are not matching.
|
|
June 16, 2005, 09:05 |
Re: UDF problem...
|
#6 |
Guest
Posts: n/a
|
what do you mean please?
|
|
June 16, 2005, 15:12 |
Re: UDF problem...
|
#7 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 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 00:31 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 07:14 |
UDF problem | chiseung | FLUENT | 4 | January 10, 2002 09:58 |