CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   set up of volume fraction of the thrid phase in VOF (http://www.cfd-online.com/Forums/fluent/100655-set-up-volume-fraction-thrid-phase-vof.html)

 fevi84 April 27, 2012 17:22

set up of volume fraction of the thrid phase in VOF

Hi, I need help.

I have three phase: water (first phase, ID=2), air (second phase, ID=3) and CO2 (second phase, ID=4). I can not set up of the volume fraction initial of CO2. The air phase I set up through a UDF, but for the CO2 phase I try with a UDF and Adapt Region, but not work.

//UDF volume fraction initial of air

#include "udf.h"

#define Xc 0.0
#define Yc 0.09
#define r 0.0085
#define ls 0.06

DEFINE_INIT(vol_fraction_bala,mixture_domain)
{
int phase_domain_index;
cell_t c;
Domain *sd;
real X[ND_ND];

sub_domain_loop(sd,mixture_domain,phase_domain_ind ex)
{
if (DOMAIN_ID(sd) == 3)

{
begin_c_loop_all(c,ct)
{
C_CENTROID(X,c,ct);
if (X[1]>=ls && X[1]<=Yc && X[0]>=-r && X[0]<=r)
C_VOF(c,ct)=1.;
else if (X[1]>Yc && sqrt(ND_SUM(pow(X[0]-Xc,2),pow(X[1]-Yc,2)))<r)
C_VOF(c,ct)=1.;

else
C_VOF(c,ct)=0.;
}
end_c_loop_all(c,ct)

}
}
}

//UDF volume fraction initial of CO2

DEFINE_INIT(vol_fraction_slug,mixture_domain)
{
int phase_domain_index;
cell_t c;
Domain *sd;
real X[ND_ND];

sub_domain_loop(sd,mixture_domain,phase_domain_ind ex)
{
if (DOMAIN_ID(sd) == 4)

{
begin_c_loop_all(c,ct)
{
C_CENTROID(X,c,ct);
if (X[1]>=0.001 && X[1]<ls && X[0]>=-r && X[0]<=r)
C_VOF(c,ct)=0.25;
else
C_VOF(c,ct)=0.;
}
end_c_loop_all(c,ct)

}
}
}

 All times are GMT -4. The time now is 17:45.