CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   udf & uds (

joby November 11, 2001 13:19

udf & uds
Hi, I am doing some modeling work by Fluent, there is a problem for me to call the result from one subroutine to another for further calculation, could any one kindly tell me how to do it? Thanks. Here is part of my program, I need to call the result of F_UDSI from UDS_FLUX when doing the calculation of source in SOURCE.

DEFINE_UDS_FLUX(a,f,t,i) { face_t f; Thread *t=Look_Thread(domain,ID);





return F_UDSI(f,t,0); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DEFINE_SOURCE(qq_source,c,thread,ds,eqn) {

cell_t c;

face_t f;

Thread *t;

real source,I0,w;




return source; } thanks

Greg Perkins November 11, 2001 21:38

Re: udf & uds
You should note that for each cell there are multiple faces - so generally your source term will require some integration over all these faces - see Gauss divergence theorem in math books, which is the normal way of doing this.

Alternatively, you can use adjacent cell information to interpolate to a face.

You need to remeber that Fluent doesn't necessarily store face data - for many variables only cell data is stored. Look at the macro definitions in .h files and you'll see that the face definitions and cell definitions are often the same!


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