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

Re: UDF(urgent)

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 24, 2003, 19:17
Default Re: UDF(urgent)
  #1
li li
Guest
 
Posts: n/a
Hi, I am using the interpreted UDF in Fluent 6.0.12. The following code is from section 4.3.12(UDF manual). I got error information as following:

line 17: THREAD_STORE: undeclared variable

Can anybody tell me what this means?

Any help will be appreciated.

Li

/************************************************** ********************/ /* UDF that implements a simplified advective term in the */ /* scalar transport equation */ /************************************************** ********************/

#include "udf.h"

DEFINE_UDS_FLUX(my_uds_flux, f, t, i) { Thread *t0, *t1 = NULL; cell_t c0, c1 = -1;

real NV_VEC(psi_vec), NV_VEC(A);

/* neighboring cells of face f, and their (corresponding) threads */

t0 = F_C0_THREAD(f,t); c0 = F_C0(f,t);

if (NULL != F_C1_THREAD(f,t)) /* Alternative: if (! BOUNDARY_FACE_THREAD_P(t)) */

{

t1 = F_C1_THREAD(f,t);

c1 = F_C1(f,t);

} else

{

t1 = NULL;

c1 = -1;

}

/* If Face lies at domain boundary, use face values; */ /* If Face lies IN the domain, use average of adjacent cells. */

if (NULL == t1) /* Alternative: if (BOUNDARY_FACE_THREAD_P(t)) */

{

NV_D(psi_vec, =, F_U(f,t), F_V(f,t), F_W(f,t));

NV_S(psi_vec, *=, F_R(f,t));

} else

{

NV_D(psi_vec, =, C_U(c0,t0), C_V(c0,t0), C_W(c0,t0));

NV_D(psi_vec, +=, C_U(c1,t1), C_V(c1,t1), C_W(c1,t1));

NV_S(psi_vec, /=, 2.); /* averaging. */

NV_S(psi_vec, *=, (((C_R(c0,t0) + C_R(c1,t1)) / 2.)));

}

/* Now psi_vec contains our "psi" from above. */ /* Next, get the face normal vector: */

F_AREA(A, f, t);

/* Finally, return the dot product of both. */ /* Fluent will multiply the returned value */ /* by phi_f (the scalar's value at the face) */ /* to get the "complete" advective term... */

return NV_DOT(psi_vec, A); }

  Reply With Quote

 


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 01:12.