|
[Sponsors] |
October 24, 2010, 15:05 |
Udf, define_profile, vof
|
#1 |
New Member
Grzegorz Kondora
Join Date: Oct 2010
Posts: 13
Rep Power: 16 |
Hello all,
Let's assume that we have a Eulerian multiphase simulation. Number of phases is n_phases. For the velocity inlet for each phase we would like to specify volume fraction, which is calculated somewhere within UDF and written to global variable. To do that, we must use DEFINE_PROFILE macro, whose arguments are: DEFINE_PROFILE(vof_profile,t,i), so: name, thread and position/index of variable being set. Let say that we would like to create only one universal function DEFINE_PROFILE, which will be hooked in B.C. panel for each phase other than 1. Here's part of my code: Code:
some code DEFINE_PROFILE(vof_profile,t,i) { #if !RP_HOST /* SERIAL or NODE */ int ii; face_t f; Thread *mixture_thread = THREAD_SUPER_THREAD(t); Thread **pt; pt = THREAD_SUB_THREADS(mixture_thread); for(ii = 1; ii < n_phases+1; ii++) { if(pt[ii] == t) { Message("\Found it!!!, DOMAIN_PHASE_INDEX is, ii = %d\n", ii); } } begin_f_loop(f,t) { F_PROFILE(f,t,i) = alpha[ii-1]; /* global array whose elements are calculated in other function and having indices according to: ii = PHASE_DOMAIN_INDEX - 1 */ } end_f_loop(f,t) #endif /* !RP_HOST */ } Code:
DEFINE_PROFILE(vof_profile,t,i) { Domain *domain = GET_DOMIAN_POINTER_HAVING_GIVEN_PHASE_THREAD(t); ... } Last edited by kondora; October 24, 2010 at 15:14. Reason: Changed title |
|
Tags |
define_profile, udf, vof |
|
|
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 |
UDF Defining VOF Free Surface at Outlet | Alex | Fluent UDF and Scheme Programming | 13 | August 8, 2012 17:50 |
HELP! UDF sinusoidal wave, VOF model, porous face! | A8anato_psofimi | FLUENT | 2 | November 10, 2009 15:42 |
UDF to read data from a file for VOF model | Pablo | FLUENT | 0 | October 23, 2008 08:02 |
writing UDF for modelig mass transfer for VOF | ardalan soleymani | FLUENT | 0 | July 11, 2007 02:09 |