CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!!

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   May 7, 2007, 09:08
Default Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!!
Posts: n/a

I have doubt about using this macro: F_FLUX(f,tf)

In the faces and in VOF two phase model , I use a UDF for proving that wether following relation is right or wrong:

D(rho)/D(t)+sigma on faces(Fe+Fn-Fs-Fw)=little value (in converge conditions)

But I sure F_FLUX(f,tf) isn't suitabe for this case(two-phase); I check this UDF in single phase ; results were quiet correct. I present UDF as follows:

/************************************************/ #include "udf.h" /* must be at the beginning of every UDF you write */

#include "mem.h" /* must be writen for accessing to memory */

#include "sg.h" /* needed for secondary gradient macro */

#include "flow.h"

#include "sg_mphase.h" /************************************************** */

DEFINE_ADJUST(my_define_adjust, domain) { /**beginig of define_adjust**/

Thread *tf;

Thread *t;

face_t f;

cell_t c,c0,c1;

real physical_dt,flow_time,convection2;

if(!Data_Valid_P()) return;

physical_dt = RP_Get_Real("physical-time-step");

flow_time= RP_Get_Real("flow-time");

thread_loop_c (t,domain) {

begin_c_loop(c,t) {

C_UDMI(c,t,0)= C_UDMI(c,t,1) ;

C_UDMI(c,t,1)= flow_time;

if(fabs(C_UDMI(c,t,1)-C_UDMI(c,t,0))>1e-10) /*(i.e if(C_UDMI(c,t,1)/=C_UDMI(c,t,0)) ( for discovering of :Is time step new or not? )for geting of density and anthalpy from last iteration in previous time step(dt=3e-7.0)*/


C_UDSI(c,t,0)=C_UDMI(c,t,2) ;

C_UDMI(c,t,5) = (C_UDMI(c,t,4)/C_VOLUME(c,t)+C_UDMI(c,t,3));

/*UDM for indirect accessing to mass imbalance in each cell*/






/*****beginning of Calculation of mass imbalance*****/

thread_loop_c (t,domain)


begin_c_loop (c,t)


C_UDMI(c,t,3)=(C_R(c,t)-C_UDSI(c,t,0))/ physical_dt; /*unsteady term in continuity equation*/

} /*end of computing unsteady term*/

end_c_loop (c,t)


thread_loop_c (t,domain) {

begin_c_loop(c,t) { /***15****/

int i=1 ;

C_UDMI(c,t,4)=0.0 ;



f = C_FACE(c,t,i);

tf = C_FACE_THREAD(c,t,i);



convection2 = (F_FLUX(f,tf));


else if(F_C0(f,tf)==c)


convection2 = (F_FLUX(f,tf));




convection2 = -(F_FLUX(f,tf));


C_UDMI(c,t,4) = C_UDMI(c,t,4)+(convection2);


end_c_loop(c,t) }


/**end of define_adjust**/

You can compare C_UDMI(c,t,5) with real mass imbalance in Display-->contours--->residual--->mass imbalance panel . discrepancy is clarified. Has anybody suggestion about improving of this UDF to take logical results for face fluxes?

For running of UDF, please turn off UDSI solution .

Thanks in advance for any help.

  Reply With Quote

Old   May 20, 2007, 11:51
Default Re: Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!!
Posts: n/a
f_flux in interior seems to have a unit of kg/m2-s, which is needed to multiply Area.
  Reply With Quote

Old   October 28, 2012, 04:03
New Member
Leon Chen
Join Date: Aug 2012
Posts: 9
Rep Power: 5
759599290 is on a distinguished road
Hi @MikeWolf:
i have some problems with what does F_FLUX(f,tf) return in UDF, but i have done some tests, which showed that F_LUX is not equal to vec(velocity) dot vec(face area). so I am really puzzled, hope for your help.
759599290 is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
INTRODUCE A MACRO FOR AVOID SMEARING IN VOF in ccm+ lupoigloo STAR-CCM+ 1 March 11, 2010 11:52
Doubt Regarding macro calculator option in CFX Sridevi CFX 0 December 21, 2005 04:55
HELP! adding a mass source to VOF eqn. by UDF??? ROOZBEH FLUENT 4 May 29, 2003 09:54
another VOF doubt some1 Main CFD Forum 6 April 16, 2002 06:52
Doubt on VOF some1 Main CFD Forum 12 April 6, 2002 14:18

All times are GMT -4. The time now is 03:37.