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

UDF for initial liquid-vapor interface

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By RAJ KIRAN

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 17, 2016, 21:02
Default UDF for initial liquid-vapor interface
  #1
New Member
 
Join Date: Jun 2016
Posts: 17
Rep Power: 10
Kimia is on a distinguished road
Hi all.
I want to write a UDF code to define a hemisphere interface of a water droplet and vapor phase in surroundings for simulating evaporation. I am a beginner user of UDF. My guessing is that I should use DEFINE_INIT macro. I followed one example in UDf manual, but I am not sure about using loop over cells or faces. I also don't know how to define the boundary. should I use C_vof to define volume fraction for each phase?
Kimia is offline   Reply With Quote

Old   June 18, 2016, 08:22
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Kimia View Post
Hi all.
I want to write a UDF code to define a hemisphere interface of a water droplet and vapor phase in surroundings for simulating evaporation. I am a beginner user of UDF. My guessing is that I should use DEFINE_INIT macro. I followed one example in UDf manual, but I am not sure about using loop over cells or faces. I also don't know how to define the boundary. should I use C_vof to define volume fraction for each phase?
The initial conditions can be looped all over the cells.

To define the boundary, use DEFINE_PROFILE macro.
Bruno Machado is offline   Reply With Quote

Old   June 20, 2016, 15:10
Default
  #3
New Member
 
Join Date: Jun 2016
Posts: 17
Rep Power: 10
Kimia is on a distinguished road
Quote:
Originally Posted by Bruno Machado View Post
The initial conditions can be looped all over the cells.

To define the boundary, use DEFINE_PROFILE macro.
Hi Bruno. Thank you so much for your response.

For defining a hemisphere shape of the initial interphase between liquid and vapor, I am using the code below. Does it seem correct? I could not compile it successfully though. Apparently something is wrong with it.



#include "udf.h"
/* domain pointer that is passed by INIT function is mixture domain */
DEFINE_INIT(my_init_function, mixture_domain)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
real xc[ND_ND];

/* loop over all subdomains (phases) in the superdomain (mixture) */
sub_domain_loop(subdomain, mixture_domain, phase_domain_index)
{
/* loop if secondary phase */
if (DOMAIN_ID(subdomain) == 3)
/* loop over all cell threads in the secondary phase domain */
thread_loop_c (cell_thread,subdomain)
{
/* loop over all cells in secondary phase cell threads */
begin_c_loop_all (cell,cell_thread)
{
C_CENTROID(xc,cell,cell_thread);
if ((sqrt(ND_SUM(pow(xc[0],2.),pow(xc[1]-3,2.),pow(xc[2],2.)))<1.25 && xc[1]>3 ) )

/* set volume fraction to 1 for centroid */
C_VOF(cell,cell_thread) = 1.;
else
/* otherwise initialize to zero */
C_VOF(cell,cell_thread) = 0.;

}
end_c_loop_all (cell,cell_thread)
}
}
}
Kimia is offline   Reply With Quote

Old   June 23, 2016, 10:17
Default
  #4
Member
 
Rajukiran Antham
Join Date: Dec 2012
Location: Sweden
Posts: 41
Rep Power: 14
RAJ KIRAN is on a distinguished road
Initialization can also be done using GUI in fluent

Adapt->Region->Sphere

There you can mark the region and later initialize VOF value using Solution initialization-> Patch
Kimia likes this.
RAJ KIRAN is offline   Reply With Quote

Old   June 24, 2016, 16:49
Default
  #5
New Member
 
Join Date: Jun 2016
Posts: 17
Rep Power: 10
Kimia is on a distinguished road
Quote:
Originally Posted by RAJ KIRAN View Post
Initialization can also be done using GUI in fluent

Adapt->Region->Sphere

There you can mark the region and later initialize VOF value using Solution initialization-> Patch


Thank you so much for your help. I used the patch function and it seems that it is working properly.
Kimia 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
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
RGP file for liquid air eis CFX 0 April 22, 2010 11:34
Evaporation UDF MN FLUENT 0 December 8, 2003 21:37
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 11:55


All times are GMT -4. The time now is 22:07.