Recently, I am doing VOF simulation on Fluent 6.3, But I can not init the mass-fraction in define_INIT()
————————–reply from fluent tech support———————
the Patching option in the GUI panel of Fluent which is more easier and straight forward compared to UDF Hook.(init hook)
—————-this is how this been done:—————–
25.14.2 Patching Values in Selected Cells
In the patching option, you can locate the region through
ADAPT > REGION > select Quad (Inside)
> define x & y values > Click on "Mark" on the panel,
Caution"!!!: do NOT click "Adapt", it will change mesh.
Now in the solution intialization, you can patch the region with the defined VOF value to the region.
Select “Register to patch” , NOT fluid in “Zone to patch”(global zone)
Please refer to the link below for more details on Patching,
If the value is not uniform, you can use the Custom Field function to calculate the initial value, usually, only the coordination info is needed
C_VOF(cell,cell_thread) may never be able to be set a value!
—————————–my example UDF , it does NOT work ————————–
/* domain pointer that is passed by INIT function is mixture domain */
//Domain *d= Get_Domain(3);
real vof = 1.0;
//real x,y; /* the coord */
/* loop over all subdomains (phases) in the superdomain (mixture) */
sub_domain_loop(subdomain, d, phase_domain_index)
/* loop if secondary phase */
if (DOMAIN_ID(subdomain) == 3)
/* loop over all cell threads in the secondary phase domain */
/* loop over all cells in secondary phase cell threads */
if( (xc >0.0 && xc<0.0178 ) && (xc>0.0 && xc<0.0275) )
C_VOF(cell,cell_thread)=vof; // VOF mass fraction, if species is used,C_YI()
CC-BY-NC 4.0 licensed free for non-commercial usage
Author: Qingfeng XIA
copyright (C) 2011-2020
please keep the original link in your reference.