help: define volume of fraction using UDF in VOF
The following is my udf program. I try to define the volume of fraction of phase-2 by this udf. The contour of volume of fraction shows a result not as I expected after I initiate the solution.
If I changed the sentence in udf, like if xc[2]<0.1, the contour shows volume of fraction of both phases are zero everywhere. what's the problem is? Any help is appreciated. /*"udfmak.c" UDF for specifying an initial liquid volume fraction zone ************************************************** *******/ #include "udf.h" DEFINE_INIT(my_init_function, mixture_domain) { #define Pi 3.14159265 int phase_domain_index; cell_t cell; Thread *cell_thread; Domain *subdomain; real xc[ND_ND]; sub_domain_loop(subdomain,mixture_domain,phase_dom ain_index) { if(DOMAIN_ID(subdomain)==3) thread_loop_c(cell_thread,subdomain) { begin_c_loop_all(cell, cell_thread) { C_CENTROID(xc,cell,cell_thread); if (xc[2]<0) { C_VOF(cell,cell_thread)=0; } if (xc[2]>0) { if (xc[1]<-2.50e-7) { C_VOF(cell,cell_thread) =1; } else if ((xc[1]>=-2.50e-7) && (xc[1]<2.50e-7)) { if (xc[2]<1.50e-7*sin(Pi*xc[1]/5.00e-7+Pi/2.)) { C_VOF(cell,cell_thread)=0; } else { C_VOF(cell,cell_thread)=1; } } if(xc[1]>=2.50e-7) { C_VOF(cell,cell_thread)=1; } } } end_c_loop_all (cell,cell_thread) } } } |
All times are GMT -4. The time now is 20:05. |