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

How to calculate phase area with UDF in 2D VOF problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 17, 2021, 17:00
Default How to calculate phase area with UDF in 2D VOF problem
  #1
New Member
 
Lagos
Join Date: Mar 2017
Posts: 7
Rep Power: 10
olalekan1986 is on a distinguished road
Hello dear CFD experts.

I have been trying to calculate the area of secondary phase (droplet) using User Defined Function for a 2D problem without success. The MACRO I am using is DEFINE_ADJEST. This is the code that I have written:

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

#define PI 3.142


DEFINE_ADJUST(my_adjust,d)
{
real x[ND_ND];
real total_volume=0;
real area, radius, diam;
real z = 1000000;
int phase_domain_index;
cell_t c;
Thread *t;
Domain *subdomain, *mixture_domain=Get_Domain(1);

sub_domain_loop(subdomain, mixture_domain, phase_domain_index)
{
/* loop if secondary phase */
if (DOMAIN_ID(subdomain) == 3)
{
thread_loop_c (t,subdomain)
{
/* loop over all cells in secondary phase cell threads */
begin_c_loop(c,t)
{
C_CENTROID(x,c,t);
if (C_VOF(c,t)>0.97){
total_volume+=C_VOLUME(c,t)*C_VOF(c,t);
}
}

end_c_loop(c,t)

}
}
}
area = total_volume/z;
radius = sqrt(2*area/PI);
diam = 2*radius;
printf("Diameter: %g\n", area);

}

Thnaks in advance for your contributions
olalekan1986 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Error SIGSEGV using VOF and UDF JERC_UTFSM Fluent UDF and Scheme Programming 14 November 8, 2021 00:17
Problem with reference area alfaben STAR-CCM+ 3 April 21, 2020 10:46
Phase velocity in VOF model UDF baechtel Fluent UDF and Scheme Programming 2 August 4, 2019 12:17
problem in definition of secondary phase volume fraction in UDF hadii FLUENT 9 July 20, 2016 05:46
two phase vof problem, problem with thermophysical properties karthik1414 OpenFOAM 4 March 15, 2011 08:49


All times are GMT -4. The time now is 23:05.