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

Patching Volume Fraction in a sloped channel

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 23, 2011, 11:53
Default Patching Volume Fraction in a sloped channel
  #1
New Member
 
Katey
Join Date: Feb 2011
Location: Bozeman, MT
Posts: 7
Rep Power: 6
KateyMT is on a distinguished road
Hello. I'm running an open channel VOF model of a sloped channel and would like to be able to patch a volume fraction of 1 for the area under the water surface. I understand how to do this in a flat channel using region adaption in Fluent. I can't however figure out how to do this for a sloped channel in which the water surface is also sloped at approximately the same angle as the channel bottom.

any suggestions?
KateyMT is offline   Reply With Quote

Old   March 23, 2011, 15:56
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Amir is on a distinguished road
Hi Katey,
you can do that with a simple UDF with DEFINE_INIT macro. loop over all cells and set a condition over y-coordinate ....
Amir is offline   Reply With Quote

Old   March 23, 2011, 16:05
Default
  #3
New Member
 
Katey
Join Date: Feb 2011
Location: Bozeman, MT
Posts: 7
Rep Power: 6
KateyMT is on a distinguished road
Thanks. I will look into that. I'm pretty new at this but I'm finding if I can't intialize the volume fraction for the water portion of the problem it takes a long time to get water through the channel.
KateyMT is offline   Reply With Quote

Old   March 24, 2011, 11:44
Default Use of VOF Multiphase Macro
  #4
New Member
 
Katey
Join Date: Feb 2011
Location: Bozeman, MT
Posts: 7
Rep Power: 6
KateyMT is on a distinguished road
So in order to use the DEFINE_INIT macro I need to find the correct cell macro to initialize the volume fraction in the cell. I believe this is the C_VOF(c,t) macro but I'm a little confused about how to apply it...or I should say how to indicate which phase i'm changing, 1 or 2.

Any help is much appreciated.
KateyMT is offline   Reply With Quote

Old   March 24, 2011, 13:12
Default
  #5
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Amir is on a distinguished road
Quote:
Originally Posted by KateyMT View Post
So in order to use the DEFINE_INIT macro I need to find the correct cell macro to initialize the volume fraction in the cell. I believe this is the C_VOF(c,t) macro but I'm a little confused about how to apply it...or I should say how to indicate which phase i'm changing, 1 or 2.

Any help is much appreciated.
Hi,
the similar code is available in UDF manual that you can use it but your procedure is simpler:
Code:
/*****************************************************************
UDF for initializing phase volume fraction
******************************************************************/
#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] - 0.5,2.),
pow(xc[1] - 0.5,2.),
pow(xc[2] - 0.5,2.))) < 0.25)
/* 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)
}
}
}
Amir is offline   Reply With Quote

Old   March 24, 2011, 13:13
Default
  #6
New Member
 
Katey
Join Date: Feb 2011
Location: Bozeman, MT
Posts: 7
Rep Power: 6
KateyMT is on a distinguished road
Thanks. I just found that and I'm running it now. Crossing fingers.
KateyMT is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
interDyMFoam - change in volume fraction gopala OpenFOAM Running, Solving & CFD 0 April 27, 2009 10:46
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00


All times are GMT -4. The time now is 11:59.