CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Cell Mass flux (https://www.cfd-online.com/Forums/fluent/27656-cell-mass-flux.html)

 Sandeep Abhyankar May 4, 2000 16:32

Cell Mass flux

In a 2d problem with quad cells, I want to be able to calculate what is the mass flux of fluid flowing across a particular edge of the 2d cell. Is there a way to get this value by UDF's or by anything ?

 Alfonso Ferrandez May 5, 2000 04:11

Re: Cell Mass flux

Hi Sandeep,

the following UDF allows you to calculate the flux across any thread in a 2D domain. If you want to calculate it for a single edge of a 2D Cell, I would recommend creating it as an independent 1D INTERIOR boundary condition. Then you can apply the algorithm below. Perhaps a check for the nodal coordinates of the given cell would also allow for a modification of the function below (Jonas! Another one for the repository! :)

/************************************************** ****************/ /* This function calculates the flux across the given boundary. */

/* We make use of Fluent Macros for this. */

/* Note that the THREAD_ID parameter is the integer value shown as ID by the Boundary Conditions... Menu. */

/* Also, you must have defined domain as a global variable:

*/

/* extern Domain *domain; */

/************************************************** ****************/

{

real flowrate = 0.0;

face_t face;

{

flowrate = flowrate + F_FLUX(face, face_thread);

}

return flowrate;

}

Hope it helps! AL

 Jonas Larsson May 5, 2000 08:51

Re: Cell Mass flux

I've added this UDF to the temporary UDF library at:

ftp://ftp.cfd-online.com/fluent/

I named the file "flux_calculation.c"