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

question on UDF manual example

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 25, 2009, 11:58
Default question on UDF manual example
  #1
Member
 
Akour
Join Date: May 2009
Posts: 79
Rep Power: 8
ak6g08 is on a distinguished road
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)
}
}
}
ak6g08 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF programming fullmonty FLUENT 5 June 30, 2011 02:40
Quick question RE: UDF Dylan FLUENT 2 August 22, 2007 15:47
UDF question Kerem FLUENT 0 April 3, 2006 19: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


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