CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   VOF Initialization (http://www.cfd-online.com/Forums/fluent/101828-vof-initialization.html)

narendra.gadwal May 15, 2012 06:39

VOF Initialization
 
I have a circle. I meshed it as a whole domain.
I need to give some level of water at the bottom.
I know the value of upper Y co-ordinate of the interface and the lower Y co-ordinate at the bottom of the circle.
Can anyone help me out how to patch those elements as water ?

Thanks in advance !!

fevi84 May 15, 2012 14:22

Example
 
I understand that do you want do a cylinder of water. Following have you a UDF for initialization of volume fraction in 3D.

#include "udf.h"

#define Xc 0.0
#define Yc 0.0
#define Zmax 0.02
#define Zmin 0.0
#define r 0.01

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

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

thread_loop_c(ct,sd)
{
begin_c_loop_all (c,ct)
{
C_CENTROID(X,c,ct);
if (X[2]<=Zmax && sqrt((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)
}
}
}

In this case, ID=3 is the secondary phase. ID=2 is for first phase.

narendra.gadwal May 15, 2012 23:06

Thank you !!!


All times are GMT -4. The time now is 11:47.