|
[Sponsors] |
October 26, 2003, 22:11 |
modify volume fraction
|
#1 |
Guest
Posts: n/a
|
Hi, Everyone,
In Eulerian-Eulerian multiphase model in Fluent, I want to modify the value of volume fraction of the primary or second phase while the solver is iterating. Cloud someone tell me what should I do? Can I use UDF or any other ways? The Macro C_VOF(c, pt[n])can get the value of volume fraction from the Fluent solver but I cannot modify the value and then return it to the solver. Is it? The macro DEFINE_PROFILE can only set the value of volume fraction in boudary! It cannot set the value to the whole fluid domain! Is it? Thank you very much for your kind reply in advance! Best regards, kevin |
|
October 27, 2003, 06:34 |
Re: modify volume fraction
|
#2 |
Guest
Posts: n/a
|
If you want to modify the volume fractions of your phases at every iteration, you can use DEFINE_ADJUST, calling it in the Functions Hooks panel.
To set values in the whole domain, you should use a loop. Here's an example of the structure your function should have: DEFINE_ADJUST(name, domain) { Thread **pt; Thread *thread; // Define here your variables mp_thread_loop_c(thread, domain, pt) { cell_t cell; begin_c_loop_int(cell, thread) { //Put here your commands } end_c_loop_int(cell, thread) } } All macros in FLUENT can be used both to read and to write a value, so you can use C_VOF(cell,pt[n]) to change volume fractions as follows: C_VOF(cell,pt[n]) = your value; Hi ap |
|
October 27, 2003, 20:56 |
Re: modify volume fraction
|
#3 |
Guest
Posts: n/a
|
Dear ap,
I really appreciate your help. But I still have some trouble: 1. It seems to me that I can only access the variales in the mixture-level domain but not the individual phase domain. In Fluent documentation, I read the following text: For multiphase flows, the domain pointer that is passed to the function by the solver is the mixture-level domain pointer. A DEFINE_ADJUST function does not return a value to the solver. 2. I have tried to use: DEFINE_EXCHANGE_PROPERTY(custom_drag, cell, mix_thread, s_col, f_col) #include "udf.h" #include "stdio.h" #define pi 4.*atan(1.) #define diam2 3.e-4 DEFINE_EXCHANGE_PROPERTY(custom_drag, cell, mix_thread, s_col, f_col) { ...... p_vof=&C_VOF(cell, thread_g); *p_vof=0.3; /*C_VOF(cell, thread_g)=0.2;*/ } fprintf(ofp,"%11.8lf\n", C_VOF(cell, thread_g)); fclose(ofp); return k_g_s; } By using the macro above, I can write the drag coefficient, but I have not writen C_VOF(cell, thread_g). Maybe it is a wrong place to write. Do you think so? Thank you very much, Best Regards, kevin |
|
November 11, 2003, 06:48 |
Re: modify volume fraction
|
#4 |
Guest
Posts: n/a
|
If your goal is to change the volume fraction of a phase during iteration, you can't use DEFINE_EXCHANGE_PROPERTY.
The easiest way is to use DEFINE_ADJUST as I showed you in my first answer: DEFINE_ADJUST(name, domain) { Thread **pt; Thread *thread; // Define here your variables mp_thread_loop_c(thread, domain, pt) { cell_t cell; begin_c_loop_int(cell, thread) { //Put here your commands C_VOF(cell, pt[0]) = your_value_for_primary_phase; C_VOF(cell, pt[1]) = your_value_for_1st_sec_phase; //... } end_c_loop_int(cell, thread) } } In order to access the volume fraction of the first (primary) phase you have to use: C_VOF(cell, pt[0]) If you have to access to the second phase, use C_VOF(cell, pt[1]) So, in general use C_VOF(cell, pt[n]), where n = 0 for the primary phase, n=1 for the first secondary phase, n = 2 for the second secondary phase and so on. FLUENT manual tells the macro DEFINE_ADJUST doesn't return a value to the solver. This doesn't mean you can't modify variables inside it, but just that DEFINE_ADJUST has been defined as a void function. Hi P.S. Sorry for the late answer. ap |
|
November 11, 2003, 19:23 |
Re: modify volume fraction
|
#5 |
Guest
Posts: n/a
|
Hey, Dear ap,
I have tried with your valuable sugguestion. It works! Thank you very much. I really highly appreciate your help. kevin |
|
November 12, 2003, 11:38 |
Re: modify volume fraction
|
#6 |
Guest
Posts: n/a
|
My pleasure, Kevin.
ap |
|
April 19, 2011, 06:32 |
Define_adjust
|
#7 |
New Member
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16 |
hello ap.. please help me
as i understand define_adjust can be "used to adjust or modify FLUENT variables that are not passed as arguments". in my 3phase eularian simulation i am required to modify the volume fractions of the two secondary phases, keeping the volume of primary phase same. i have done the calculation as required in define_execute_at_end, to compute how much do the volume fractions change and hence correctly computed the value of global variables 'vf1' and 'vfpr'. my adjust macro: Code:
DEFINE_ADJUST(mt,d) { Thread *t; cell_t c; real volf1, volf2, volf3; real xc[ND_ND]; if (counter == 1) { thread_loop_c(t,d) { begin_c_loop(c,t) { Thread *fr = THREAD_SUB_THREAD(t,1); //1st secondary phase Thread *to = THREAD_SUB_THREAD(t,2); //2nd secondary phase volf1 = C_VOF(c,fr); volf2 = C_VOF(c,to); volf3 = 1-(volf1+volf2); //primary phase volume frac. if(volf1 > 0.01) { C_VOF(c,fr) = volf1 * vf1/vfpr; //modifying the vol.fr. of 1st sec. phase volf1 = C_VOF(c,fr); C_VOF(c,to) = 1-(volf1+volf3); //adjusting the vol. fr. of 2nd sec. phase, keeping the sum of volume fractions unity. volf1 = C_VOF(c,fr); volf2 = C_VOF(c,to); C_CENTROID(xc,c,t); Message("%g\t%g",xc[0],xc[1]); Message("\t%g %g\n",volf1,volf2); } } end_c_loop(c,t) } } } What might be the problem in modifying the variables ?? Is there anything wrong in what i am trying to do? Please suggest an alternative. Can anyone please help me.. Regards |
|
May 20, 2011, 04:35 |
|
#8 |
New Member
M. A.
Join Date: Jul 2010
Posts: 27
Rep Power: 16 |
Hi friends,
I'm simulating a tube with water flow. The tube encounters boiling near the wall. I intend to calculate 'void fraction versus enthalpy' along the channel. Can you help me how to calculate void fraction? I'm in an emergency condition. Waiting for your comments!!! Thanks Everybody |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
alphaEqn.H in twoPhaseEulerFoam | cheng1988sjtu | OpenFOAM Bugs | 15 | May 1, 2016 17:12 |
On the damBreak4phaseFine cases | paean | OpenFOAM Running, Solving & CFD | 0 | November 14, 2008 22:14 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |