Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!!
Hi
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+FnFsFw)=little value (in converge conditions) But I sure F_FLUX(f,tf) isn't suitabe for this case(twophase); 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("physicaltimestep"); flow_time= RP_Get_Real("flowtime"); 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))>1e10) /*(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=3e7.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*/ } C_UDMI(c,t,2)=C_R(c,t); } end_c_loop(c,t) } /*****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 ; c_face_loop(c,t,i) { f = C_FACE(c,t,i); tf = C_FACE_THREAD(c,t,i); if(BOUNDARY_FACE_THREAD_P(tf)) { convection2 = (F_FLUX(f,tf)); } else if(F_C0(f,tf)==c) { convection2 = (F_FLUX(f,tf)); } else { 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. Asghari 
Re: Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!!
f_flux in interior seems to have a unit of kg/m2s, which is needed to multiply Area.

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. 
All times are GMT 4. The time now is 07:36. 