|
[Sponsors] |
June 25, 2009, 12:58 |
question on UDF manual example
|
#1 |
Member
Akour
Join Date: May 2009
Posts: 79
Rep Power: 17 |
Hello everyone,
can anyone explain to me why C_UDSI_G is multiplied by the cell volume in the following UDF example? (in the udf manual, pasted below). Is this necessary if we want to write a scalar in terms of the derivative of another scalar?? i.e. say Ive got a UDS equation solving for some scalar H and another one solving for some scalar I, say a source term appears in the equation for scalar I, which is given by DH/DX...do i need to write this as C_VOLUME*C_UDSI_G(c,t,index of scalar H)? Thanks for your help AK /************************************************** ****************** UDF for defining user-defined scalars and their gradients ************************************************** *******************/ #include "udf.h" DEFINE_ADJUST(adjust_fcn,d) { Thread *t; cell_t c; real K_EL = 1.0; /* Do nothing if gradient isn't allocated yet. */ if (! Data_Valid_P()) return; thread_loop_c(t,d) { if (FLUID_THREAD_P(t)) { begin_c_loop_all(c,t) { C_UDSI(c,t,1) += K_EL*NV_MAG2(C_UDSI_G(c,t,0))*C_VOLUME(c,t); } end_c_loop_all(c,t) } } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF programming | fullmonty | FLUENT | 5 | June 30, 2011 03:40 |
Quick question RE: UDF | Dylan | FLUENT | 2 | August 22, 2007 16:47 |
UDF question | Kerem | FLUENT | 0 | April 3, 2006 20:24 |
DEFINE_DPM_OUTPUT macro UDF HELP | Puneet | FLUENT | 3 | November 28, 2003 11:55 |
a question about UDF | Wenbin | FLUENT | 0 | November 12, 2003 11:24 |