CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

help: define volume of fraction using UDF in VOF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2006, 16:58
Default help: define volume of fraction using UDF in VOF
  #1
gogo
Guest
 
Posts: n/a
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)

}

} }

  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[POLYFLOW] How to define VOF initial fluid fraction? cutejerk ANSYS 7 June 6, 2013 09:47
Volume Fraction in VOF model Saima Main CFD Forum 2 April 12, 2009 20:22
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Volume Fraction in VOF Hendawi Mohamed FLUENT 0 April 7, 2003 05:25


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