|
[Sponsors] |
Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!! |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 7, 2007, 10:08 |
Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!!
|
#1 |
Guest
Posts: n/a
|
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+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*/ } 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 |
|
May 20, 2007, 12:51 |
Re: Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!!
|
#2 |
Guest
Posts: n/a
|
f_flux in interior seems to have a unit of kg/m2-s, which is needed to multiply Area.
|
|
October 28, 2012, 04:03 |
|
#3 |
New Member
Leon Chen
Join Date: Aug 2012
Location: ShenZhen, China
Posts: 9
Rep Power: 14 |
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
HELP! adding a mass source to VOF eqn. by UDF??? | ROOZBEH | FLUENT | 5 | December 3, 2016 18:53 |
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 |
another VOF doubt | some1 | Main CFD Forum | 6 | April 16, 2002 07:52 |
Doubt on VOF | some1 | Main CFD Forum | 12 | April 6, 2002 15:18 |