CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

C_VOF_G in three phase model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 8, 2023, 12:37
Default C_VOF_G in three phase model
  #1
New Member
 
Join Date: Oct 2022
Posts: 12
Rep Power: 4
cfd_Matrix is on a distinguished road
Hi all,
I am modeling Sun heating oil layer on top of water in three phase vof model (air as primary phase).. the solar flux (w/m2) is incorporated as heat source at the interface for oil vof >=0.5. I using DEFINE ADJUST to store VOF gradiant in C_UDMI; Display C_UDMI shows both interfaces (air/oil and water/oil). when I Run the calculation seem like it don't apply the heat source at all.
my question is why the CUDMI save both interfaces a,d how to force the SOURCE term at the air/oil interface (F(oil) >= 0.5.
Thanks in advance

#include "udf.h"
#include "sg_mphase.h"

#define Sun_flux 1120 /* average solar heat flux on earth surface (W/m2) */



DEFINE_ADJUST(my_adjust, mixture_domain)
{
int phase_domain_index=0.;
Thread *t;

cell_t c;

mixture_domain= Get_Domain(2);

thread_loop_c (t,mixture_domain)
if (THREAD_STORAGE(t,SV_UDM_I)!=NULL)

begin_c_loop (c,t)
{

/*To store gradient of volume fraction in a user defined memory*/
C_UDMI(c,t,0)=sqrt((C_VOF_G(c,t)[0])*(C_VOF_G(c,t)[0])+(C_VOF_G(c,t)[1])*(C_VOF_G(c,t)[1]));
}
end_c_loop (c,t)
}


DEFINE_SOURCE(heat, cell, mix_th, dS, eqn)
{
Thread *pri_th, *sec_th;
real source;

pri_th = THREAD_SUB_THREAD(mix_th, 0);
sec_th = THREAD_SUB_THREAD(mix_th, 1);

if (C_VOF(cell,pri_th)>0.05 && C_VOF(cell,pri_th)<0.5)
{

source= Sun_flux*C_UDMI(cell,mix_th,0);
dS[eqn] = 0.0;
}
return source;
}

Last edited by cfd_Matrix; December 15, 2023 at 02:29.
cfd_Matrix is offline   Reply With Quote

Old   December 10, 2023, 18:57
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
if you defined domain in header
Code:
DEFINE_ADJUST(my_adjust, mixture_domain)
you don't need to reinitialize it
Code:
mixture_domain= Get_Domain(2);
compile code and you will see errors
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 11, 2023, 02:31
Default
  #3
New Member
 
Join Date: Oct 2022
Posts: 12
Rep Power: 4
cfd_Matrix is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
if you defined domain in header
Code:
DEFINE_ADJUST(my_adjust, mixture_domain)
you don't need to reinitialize it
Code:
mixture_domain= Get_Domain(2);
compile code and you will see errors
Dear AlexanderZ Thank you for your reply, I compilE the UDF, and it compile with no error, the problem i am facing is with DEFINE SOURCE, which describe the absorbed heat at the oil/air interface (heat flux * mag(grad(F)), either it apply the eat source to both interfaces or it does not apply it at all, the problem is with :
if (C_VOF(cell,pri_th)>0.05 && C_VOF(cell,pri_th)<0.5)
how to force the SOURCE term at the air/oil interface and for (F(oil) >= 0.5
any clue on how to solve this problem ?
cfd_Matrix is offline   Reply With Quote

Old   December 12, 2023, 01:27
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
I can hardly understand what you a talking about
Code:
if (C_VOF(cell,pri_th)>0.05 && C_VOF(cell,pri_th)<0.5)
{

source= Sun_flux*C_UDMI(cell,mix_th,0);
dS[eqn] = 0.0;
}
return source;
there is no else statement for C_VOF(cell,pri_th)> 0.5 actually

Code:
if (C_VOF(cell,pri_th)>0.05 && C_VOF(cell,pri_th)<0.5)
{
..........
}
else
{
.............
}
return source;
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 12, 2023, 16:44
Default
  #5
New Member
 
Join Date: Oct 2022
Posts: 12
Rep Power: 4
cfd_Matrix is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
I can hardly understand what you a talking about
Code:
if (C_VOF(cell,pri_th)>0.05 && C_VOF(cell,pri_th)<0.5)
{

source= Sun_flux*C_UDMI(cell,mix_th,0);
dS[eqn] = 0.0;
}
return source;
there is no else statement for C_VOF(cell,pri_th)> 0.5 actually

Code:
if (C_VOF(cell,pri_th)>0.05 && C_VOF(cell,pri_th)<0.5)
{
..........
}
else
{
.............
}
return source;
Dear AlexanderZ; what i mean by if statament is to force the heat source at the air/oil interface (not oil/water interface ) and it should be applied for cells belong to the interface with F(oil) >= 0.5 / Then the if statemnt should be like this:

if (C_VOF(cell,sec_th)>0.5) /* oil is the first secondary phase*/
{

source= Sun_flux*C_UDMI(cell,mix_th,0);
dS[eqn] = 0.0;
}
else
{

source= 0.0;
dS[eqn] = 0.0;
}
return source;
cfd_Matrix is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Fluent VOF and Lee model to simulate mass transfer of two phase Albert Lee FLUENT 1 May 2, 2019 09:01
Transient Phase Change Model: Explodes at low vapor quality evcelica CFX 0 August 28, 2018 11:55
Condensation/Evaporation Model (Phase Change) oliveira1820 CFX 0 May 29, 2018 03:07
How to access only one phase in multiphase model by UDF wersoe Fluent UDF and Scheme Programming 1 January 4, 2017 08:11
Problems bout CFD model of biomass gasification, Downdraft gasifier wanglong FLUENT 2 November 26, 2009 00:27


All times are GMT -4. The time now is 14:58.