modify volume fraction
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 |
Re: modify volume fraction
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 |
Re: modify volume fraction
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 |
Re: modify volume fraction
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 |
Re: modify volume fraction
Hey, Dear ap,
I have tried with your valuable sugguestion. It works! Thank you very much. I really highly appreciate your help. :) kevin |
Re: modify volume fraction
My pleasure, Kevin.
ap :) |
Define_adjust
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) 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 |
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 |
All times are GMT -4. The time now is 14:12. |