|
[Sponsors] |
November 15, 2001, 06:22 |
udf for Cd calculation
|
#1 |
Guest
Posts: n/a
|
Hi, I'm trying to use a compiled udf to change the cd coefficient used by Fluent 5.4, but the procedure written on fluent manual doesn't fit with the one described in makefile file, that, in any case, doesn't work. Someone has any suggestion for me? Thanks and best regards Micaela
|
|
November 15, 2001, 10:49 |
udf information
|
#2 |
Guest
Posts: n/a
|
Hi!I'm a Fluent 5 user and i would to known how can to write on a file the value for a variable declaired into the UDF subroutine. Thanks and best regards. Gino
|
|
November 16, 2001, 00:40 |
Re: udf information
|
#3 |
Guest
Posts: n/a
|
try below program , it's correctly, DEFINE_ADJUST(adj_func,domain) is calculated math equation , after the answer deliver transfer into DEFINE_SOURCE(name,c,t,ds,eqn).so DEFINE_ADJUST is subroutine , DEFINE_SOURCE(name,c,t,ds,eqn)is main program . best regards for you
#include "udf.h" Thread *t; cell_t c; real Yo2; real Pc; real Xo2; DEFINE_ADJUST(adj_func, domain) { thread_loop_c(t, domain) { if( THREAD_ID(t) == 4 ) /* "4" shows your fourth floor ID */ { begin_c_loop(c, t) { Yo2 = C_YI(c, t, 0); /* gets cell mass fraction */ Pc = C_P(c, t); /* gets cell pressure */ Xo2 = Yo2*Pc; C_UDMI(c,t,0) = Pc*Xo2; }end_c_loop(c, t) } } } DEFINE_SOURCE(ff,c ,t, dS, eqn) { real source; source = C_UDMI(c,t,0)*12.; dS[eqn] = 12.; return source; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I stop the calculation in UDF | Seyoung Oh | Fluent UDF and Scheme Programming | 1 | September 24, 2013 08:44 |
my UDF can not calculation? | happyrabbit | FLUENT | 0 | October 21, 2010 09:59 |
calculation average pressure in a plane with UDF | Vitalij | FLUENT | 1 | April 10, 2007 04:39 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |
If it's right to use this UDF in DPM calculation? | welch | FLUENT | 0 | May 8, 2004 06:49 |