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

udf for Cd calculation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2001, 06:22
Default udf for Cd calculation
  #1
Micaela Demichela
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
  Reply With Quote

Old   November 15, 2001, 10:49
Default udf information
  #2
gino
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
  Reply With Quote

Old   November 16, 2001, 00:40
Default Re: udf information
  #3
joby
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; }
  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
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


All times are GMT -4. The time now is 15:17.