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

udf help

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 28, 2008, 03:27
Default udf help
  #1
solomon
Guest
 
Posts: n/a
hello every one

my udf is interpreted well and running but the value of alpha is not updating.my udf goes like this....any guesses ?

thanks in advance

#include "udf.h" #include"mem.h" #include"math.h" #include"complex.h" #include"unsteady.h"

DEFINE_INIT(initial, domain) { cell_t cell; Thread *thread; real x[ND_ND];

thread_loop_c (thread,domain)

{

begin_c_loop_all (cell,thread)

{

C_CENTROID(x,cell,thread);

C_UDMI(cell, thread, 0) = 0.0001;

}

end_c_loop_all (cell,thread)

} }

#define ko 32631.0 #define E 167400.0 #define R 8.314 #define Q 77.5

#define m 0.524 #define n 1.476 #define vof 0.5

DEFINE_SOURCE(heat_gen,cell,thread,ds,eqn) { real x[ND_ND];

real alpha,source;

C_CENTROID(x, cell, thread);

alpha=C_UDMI(cell,thread,0)+(pow(ko*exp(-E/(5*R*C_T(cell,thread))),5))*pow(alpha,m)*pow(alpha ,n);

C_UDMI(cell,thread,0)=alpha;

source=1890*Q*vof*(pow(ko*exp(-E/(5*R*C_T(cell,thread))),5))*pow(alpha,m)*pow(alpha ,n);

ds[eqn]=0;

return source; }
  Reply With Quote

Old   April 29, 2008, 09:17
Default Re: udf help
  #2
Actionhank
Guest
 
Posts: n/a
I am no expert in Fluent but it seems like your alpha is a local variable. So, can it be the case, that alpha is reinitialized every time step? since the calculation of alpha itself depends on alpha, maybe it is always equal to zero on the RHS of your equation.
  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



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