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

How to get the surface area between two phases in VOF model

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By Cloud

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2012, 01:19
Unhappy How to get the surface area between two phases in VOF model
  #1
New Member
 
Cloud Zhang
Join Date: Dec 2010
Posts: 8
Rep Power: 16
Cloud is on a distinguished road
Do anyone know if there has a macro to get the surface area between two phases in VOF model. I used Geo-Reconstrust Discretization for VOF.
I found C_VOF_S(c,t) and Get_Surface_Distance(cell_t c, Thread *t) in "sg_vof.h". I wanted to use them to found what did they return. But always fluent return errors:

Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.

I tried mixture thread and one phase thread for t in C_VOF_S(c,t) and Get_Surface_Distance(cell_t c, Thread *t),but the errors still exist.
Cloud is offline   Reply With Quote

Old   September 10, 2012, 04:34
Default
  #2
New Member
 
Join Date: Nov 2010
Posts: 12
Rep Power: 16
LyngHoo is on a distinguished road
Hi, Cloud,
Have you solve you problem? I need to calculate the interface area in VOF model, and I'm wondering how to implement this. If you've solve this problem, plz help.
Thank you !
LyngHoo is offline   Reply With Quote

Old   February 5, 2013, 16:16
Default any luck?
  #3
New Member
 
Bradley J
Join Date: Jul 2012
Location: Cincinnati, OH
Posts: 12
Rep Power: 14
Blackhawks84 is on a distinguished road
Hi,

I just posted a similar question and I am wondering if you guys have found out how to obtain the area of the interface using an UDF?

Bradley
Blackhawks84 is offline   Reply With Quote

Old   February 17, 2013, 20:27
Default
  #4
vig
New Member
 
anonymous
Join Date: Jan 2011
Posts: 23
Rep Power: 15
vig is on a distinguished road
Interfacial area could be calculated by the following:

Magnitude of Gradient(Alpha) * Volume

Hope it helps.
vig is offline   Reply With Quote

Old   January 10, 2014, 03:41
Default
  #5
New Member
 
Cloud Zhang
Join Date: Dec 2010
Posts: 8
Rep Power: 16
Cloud is on a distinguished road
Quote:
Originally Posted by vig View Post
Interfacial area could be calculated by the following:

Magnitude of Gradient(Alpha) * Volume

Hope it helps.
Thanks! It's helpful. Another question: Which literature can I find this equation ?
Does the fluent help has this equation?
Cloud is offline   Reply With Quote

Old   August 9, 2014, 00:53
Default
  #6
New Member
 
M.C.Qin
Join Date: Dec 2013
Posts: 5
Rep Power: 13
classic1573 is on a distinguished road
Quote:
Originally Posted by Cloud View Post
Thanks! It's helpful. Another question: Which literature can I find this equation ?
Does the fluent help has this equation?

Hi,
I also confused with such a difficult question when i want to simulate the gas-liquid flow in a falling film reactor. how to get the the interface area in a cell using UDF micros? there were an equation in "help" to calculate the area density, area =2.0*[alpha]*the gradient of [alpha]. But this equation may be a wrong one. Besides of this, how to get the gradient of [alpha]? when you use the macro C_VOF_G, there will be notes: access violate.

Are you from China? Maybe we can discuss this problem in Chinese.my e-mail:classic1573@163.com
classic1573 is offline   Reply With Quote

Old   August 21, 2014, 22:31
Default
  #7
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Hi vig,
I wonder if the equation is also applied to the wick-vapor interface?
Regards,
Bill
6863523 is offline   Reply With Quote

Old   April 16, 2016, 08:52
Default Finding interface area
  #8
New Member
 
mehdi
Join Date: Nov 2010
Location: Tehran
Posts: 16
Rep Power: 16
mehdi kamyabi is on a distinguished road
Dear All
Hello
Finding the premier of the interface (in 2-D cases) or surface of interface (in 3-D simulations) is my concern also. I didn't found how I can use Ansys for calculating these parameters. using the equation Area = Magnitude of Gradient(Alpha) * Volume is not straightforward because in addition to non- constant valued of Gradient(Alpha) in all domain, finding its amount has been not predicted in Fluent. So now my question is how I can find the solution for this matter.
Thanks
mehdi kamyabi is offline   Reply With Quote

Old   October 17, 2016, 16:29
Default UDF for surface between 2 phases
  #9
New Member
 
Jean-Sebastien Dick
Join Date: Jul 2015
Location: Montreal
Posts: 3
Rep Power: 11
JS_P&WC is on a distinguished road
Here are 2 different ways of obtaining the area_density between 2 phases :
2.0 * magnitude(gradient(alpha)) * alpha
magnitude(gradient(alpha)) * Cell_Volume
I don't know which one is appropriate, but those 2 were mentioned across Fluent's help guide and within the previous posts :

/* ######################################
Steps to take to make it work
1. Read in the converged case and data
2. Link the udf (Define->User Defined->Functions->Compiled)
3. Hook adjust funtion (Define->User Defined->Function Hooks->Adjust Function)
4. Define UDM (Define->User Defined->Memory 3)
5. Define UDS (Define->User Defined->Scalars 2)
6. Turn off all equations (Solve->Controls->Solution)
7. Do one iterations
8. Execute store_gradient (Define->User Defined->Execute On Demand)
9. Execute store_area_density_1 (Define->User Defined->Execute On Demand)
10.Execute store_area_density_2 (Define->User Defined->Execute On Demand)
######################################*/
 
# include "udf.h"
# define domain_ID 2
 
DEFINE_ADJUST(adjust_gradient, domain)
{
Thread *t;
cell_t c;
face_t f;
 
domain = Get_Domain(domain_ID);
 
/* Fill UDS with the variable. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{
/* Obtains VOF at cell center and saves it as scalar */
C_UDSI(c,t,0) = C_VOF(c,t);
/* Obtains Cell Volume and saves it as scalar */
C_UDSI(c,t,1) = C_VOLUME(c,t);
}
end_c_loop (c,t)
}
 
thread_loop_f (t,domain)
{
if (THREAD_STORAGE(t,SV_UDS_I(0))!=NULL)
begin_f_loop (f,t)
{
F_UDSI(f,t,0) = F_VOF(f,t);
}
end_f_loop (f,t)
}
 
}
 
DEFINE_ON_DEMAND(store_gradient)
{
Domain *domain;
cell_t c;
Thread *t;
 
domain=Get_Domain(1);
 
/* Fill the UDM with magnitude of gradient. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{
C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0));
}
end_c_loop (c,t)
}
}
 
DEFINE_ON_DEMAND(store_area_density_1)
{
Domain *domain;
cell_t c;
Thread *t;
 
domain=Get_Domain(1);
 
/* Fill the UDM with are_adensity. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{

C_UDMI(c,t,1) = 2.0 * NV_MAG(C_UDSI_G(c,t,0)) * C_UDSI(c,t,0) ;
}
end_c_loop (c,t)
}
}
 
DEFINE_ON_DEMAND(store_area_density_2)
{
Domain *domain;
cell_t c;
Thread *t;
 
domain=Get_Domain(1);
 
/* Fill the UDM with are_adensity. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{

C_UDMI(c,t,2) = NV_MAG(C_UDSI_G(c,t,0)) * C_UDSI(c,t,1) ;
}
end_c_loop (c,t)
}
}

- JS
JS_P&WC is offline   Reply With Quote

Old   October 19, 2016, 21:53
Default
  #10
New Member
 
Cloud Zhang
Join Date: Dec 2010
Posts: 8
Rep Power: 16
Cloud is on a distinguished road
Quote:
Originally Posted by JS_P&WC View Post
Here are 2 different ways of obtaining the area_density between 2 phases :
2.0 * magnitude(gradient(alpha)) * alpha
magnitude(gradient(alpha)) * Cell_Volume
I don't know which one is appropriate, but those 2 were mentioned across Fluent's help guide and within the previous posts :

/* ######################################
Steps to take to make it work
1. Read in the converged case and data
2. Link the udf (Define->User Defined->Functions->Compiled)
3. Hook adjust funtion (Define->User Defined->Function Hooks->Adjust Function)
4. Define UDM (Define->User Defined->Memory 3)
5. Define UDS (Define->User Defined->Scalars 2)
6. Turn off all equations (Solve->Controls->Solution)
7. Do one iterations
8. Execute store_gradient (Define->User Defined->Execute On Demand)
9. Execute store_area_density_1 (Define->User Defined->Execute On Demand)
10.Execute store_area_density_2 (Define->User Defined->Execute On Demand)
######################################*/
 
# include "udf.h"
# define domain_ID 2
 
DEFINE_ADJUST(adjust_gradient, domain)
{
Thread *t;
cell_t c;
face_t f;
 
domain = Get_Domain(domain_ID);
 
/* Fill UDS with the variable. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{
/* Obtains VOF at cell center and saves it as scalar */
C_UDSI(c,t,0) = C_VOF(c,t);
/* Obtains Cell Volume and saves it as scalar */
C_UDSI(c,t,1) = C_VOLUME(c,t);
}
end_c_loop (c,t)
}
 
thread_loop_f (t,domain)
{
if (THREAD_STORAGE(t,SV_UDS_I(0))!=NULL)
begin_f_loop (f,t)
{
F_UDSI(f,t,0) = F_VOF(f,t);
}
end_f_loop (f,t)
}
 
}
 
DEFINE_ON_DEMAND(store_gradient)
{
Domain *domain;
cell_t c;
Thread *t;
 
domain=Get_Domain(1);
 
/* Fill the UDM with magnitude of gradient. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{
C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0));
}
end_c_loop (c,t)
}
}
 
DEFINE_ON_DEMAND(store_area_density_1)
{
Domain *domain;
cell_t c;
Thread *t;
 
domain=Get_Domain(1);
 
/* Fill the UDM with are_adensity. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{

C_UDMI(c,t,1) = 2.0 * NV_MAG(C_UDSI_G(c,t,0)) * C_UDSI(c,t,0) ;
}
end_c_loop (c,t)
}
}
 
DEFINE_ON_DEMAND(store_area_density_2)
{
Domain *domain;
cell_t c;
Thread *t;
 
domain=Get_Domain(1);
 
/* Fill the UDM with are_adensity. */
thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{

C_UDMI(c,t,2) = NV_MAG(C_UDSI_G(c,t,0)) * C_UDSI(c,t,1) ;
}
end_c_loop (c,t)
}
}

- JS
Thanks a lot. I will work on this UDF.
Cloud is offline   Reply With Quote

Old   January 26, 2017, 09:03
Default vof gradient
  #11
New Member
 
Alex Machado
Join Date: Feb 2014
Location: Brazil
Posts: 8
Rep Power: 12
amachado is on a distinguished road
I am using this code, it works and you don't need UDS.

Code:
#include "udf.h"
#define CON 1

DEFINE_ADJUST(store_gradient, domain)
{
Thread *t;
Thread **pt;
cell_t c;
int phase_domain_index = 0.;
Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index);
{
Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL);
Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,
Vof_Deriv_Accumulate);
}


mp_thread_loop_c (t,domain,pt)
if (FLUID_THREAD_P(t))
{
Thread *ppt = pt[phase_domain_index];

begin_c_loop (c,t)
{
C_UDMI(c,t,0) = C_VOF_G(c,ppt)[0];
}
end_c_loop (c,t)
}
Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
}
amachado is offline   Reply With Quote

Old   March 6, 2018, 05:19
Default
  #12
New Member
 
Doruk Yelkenci
Join Date: Apr 2017
Posts: 20
Rep Power: 9
doruk is on a distinguished road
Quote:
Originally Posted by JS_P&WC View Post
Here are 2 different ways of obtaining the area_density between 2 phases :
2.0 * magnitude(gradient(alpha)) * alpha
magnitude(gradient(alpha)) * Cell_Volume
I don't know which one is appropriate, but those 2 were mentioned across Fluent's help guide and within the previous posts :

I looked for everywhere for the VOF area density functions in Fluent User Guide but I couldnt find these equations. Can anyone guide me to find those pages ?
doruk is offline   Reply With Quote

Old   March 11, 2018, 21:36
Smile
  #13
New Member
 
xiatiantian
Join Date: Dec 2017
Posts: 5
Rep Power: 9
xiatt is on a distinguished road
Quote:
Originally Posted by doruk View Post
I looked for everywhere for the VOF area density functions in Fluent User Guide but I couldnt find these equations. Can anyone guide me to find those pages ?
Hi,have your problem been solved? I need your help.
xiatt is offline   Reply With Quote

Old   March 12, 2018, 03:57
Default
  #14
New Member
 
Doruk Yelkenci
Join Date: Apr 2017
Posts: 20
Rep Power: 9
doruk is on a distinguished road
I am sorry but i also couldnt fix my problem
doruk is offline   Reply With Quote

Old   March 12, 2018, 04:30
Smile
  #15
New Member
 
xiatiantian
Join Date: Dec 2017
Posts: 5
Rep Power: 9
xiatt is on a distinguished road
Quote:
Originally Posted by doruk View Post
I am sorry but i also couldnt fix my problem
thank you. if you fix your problem someday, please tell me
xiatt is offline   Reply With Quote

Old   September 12, 2018, 10:53
Default interface surface area
  #16
Member
 
tahir
Join Date: May 2010
Posts: 35
Rep Power: 16
ENGRTAHIR is on a distinguished road
Quote:
Originally Posted by xiatt View Post
thank you. if you fix your problem someday, please tell me
Hi if you have fix the problem. Let me know also
I am also doing the same calculation
ENGRTAHIR is offline   Reply With Quote

Old   September 20, 2018, 12:22
Default Why Fluent says that the periodic condition is not compatible with the VOF model ?
  #17
New Member
 
cesar
Join Date: Dec 2016
Posts: 4
Rep Power: 10
julio is on a distinguished road
[QUOTE=LyngHoo;381000]Hi,
I realized a simulation of a free surface flow in the presence of periodic roughness with the VOF model. I remarked that when we impose the pressure gradient for the entire domain, the velocity of the air phase will be 100 x the velocity of the water phase.
Is it for this reason Fluent says that the periodic condition is not compatible with VOF?
To avoid this problem I used a UDF to impose this pressure gradient only in the water phase and I solved the problem.
Is the procedure I followed is logical?
How to contact Fluent for this problem?
julio is offline   Reply With Quote

Reply

Tags
udf, vof


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
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
[Gmsh] boundaries with gmshToFoam‏ ouafa OpenFOAM Meshing & Mesh Conversion 7 May 21, 2010 13:43
Multiphase flow. Dispersed and free surface model Luis CFX 8 May 29, 2007 19:13
Surface Tension Force Model Miguel CFX 7 October 2, 2006 06:30
free surface of VOF and melting model? wanghong FLUENT 3 March 13, 2006 10:57


All times are GMT -4. The time now is 16:04.