|
[Sponsors] |
April 28, 2008, 03:27 |
udf help
|
#1 |
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; } |
|
April 29, 2008, 09:17 |
Re: udf help
|
#2 |
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.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|