CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Macro to access MEAN volume fraction (http://www.cfd-online.com/Forums/fluent/96234-macro-access-mean-volume-fraction.html)

yashmash January 17, 2012 00:38

Macro to access MEAN volume fraction
 
Hello all,

I am running an eulerian model on Fluent using unsteady statistics. Could anyone please tell me what is the macro to access the MEAN volume fraction for a specific phase? I know from the manual that for an instantaneous case the macro is C_VOF(c,pt[n]), but i cannot find anything regarding the MEAN value.

Any help would be much appreciated,

Thanks!!

Yashmash

Sixkillers January 17, 2012 04:25

I don't if such macro exists, but there is possibility to compute mean fraction by your own. You can iterate through all cells in you domain and determine volume that is occupied by particular phase and then divide it by total volume.

shk12345 January 17, 2012 10:24

if you need the mean volume fraction
go to reports>>volume intergral>>volume average >>phases
and there you can see the phase volume in your domain

regards
shk

yashmash January 18, 2012 01:21

thanks guys but what I'm looking for is the MACRO for TIME AVERAGED or MEAN value of volume fraction so I can use it in my UDF.

shk12345 January 18, 2012 04:25

Quote:

Originally Posted by yashmash (Post 339845)
thanks guys but what I'm looking for is the MACRO for TIME AVERAGED or MEAN value of volume fraction so I can use it in my UDF.

All the udf in fluent calculates the value to the cell centered value .
you cannot get the mean value with udf in an entire domain . you have to calculate the value using some loop function inside your udf.

regards
shk

yashmash January 25, 2012 04:56

Hi Shoeb,

I was hoping you could help me with the following UDF. I am running a time dependent eulerian model with 3 phases. My udf is to store into a UDS the time-averaged volume fraction of one of the phases. However the values that are returned are the time-averaged volume fractions divided by a constant (constant is 74). I have no idea why this happens!
Please see my UDF below:

#include "udf.h"
#define Rtio2 4260
DEFINE_ON_DEMAND(TiO2_loading_gm3)
{
Thread *thread_ti;
Thread *t;
Thread *mix_thread;
cell_t c;
real vof_ti = 0;
Domain *d;
d = Get_Domain(3);
/* Loop over all cell threads in the domain */

thread_loop_c(thread_ti,d)
{
/*thread_ti = THREAD_SUB_THREAD(mix_thread, 3);*/
/* Loop over all cells */
begin_c_loop(c,thread_ti)
{
vof_ti = C_STORAGE_R(c,thread_ti,SV_VOF_MEAN);

C_UDSI(c, thread_ti, 0) = vof_ti;
}
end_c_loop(c,thread_ti)

}
}

Your assistance is much appreciated,

Thanks,

Yash

shk12345 January 25, 2012 09:50

hi
the problem may be i am saying may be
that the domain udf has to be 2 for 3rd phase as domain id starts from 0 1 and 2 for phase 1 2 and 3.

kindly make the changes and see whether the simulation is working fine.

also try to use the subthread for the thread of the phase of which you want the value for the vof of the fluid.
Thread *subthread=THREAD_SUB_THREAD(mix_thread, p_d_index);

Regards
Shk


All times are GMT -4. The time now is 20:08.