Patching Volume Fraction in a sloped channel

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

 March 23, 2011, 11:53 Patching Volume Fraction in a sloped channel #1 New Member   Katey Join Date: Feb 2011 Location: Bozeman, MT Posts: 7 Rep Power: 8 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?

 March 23, 2011, 15:56 #2 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 15 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 ....

 March 23, 2011, 16:05 #3 New Member   Katey Join Date: Feb 2011 Location: Bozeman, MT Posts: 7 Rep Power: 8 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.

 March 24, 2011, 11:44 Use of VOF Multiphase Macro #4 New Member   Katey Join Date: Feb 2011 Location: Bozeman, MT Posts: 7 Rep Power: 8 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.

March 24, 2011, 13:12
#5
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Quote:
 Originally Posted by KateyMT 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;
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 */
{
/* loop over all cells in secondary phase cell threads */
{
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 */
else
/* otherwise initialize to zero */
}
}
}
}```

 March 24, 2011, 13:13 #6 New Member   Katey Join Date: Feb 2011 Location: Bozeman, MT Posts: 7 Rep Power: 8 Thanks. I just found that and I'm running it now. Crossing fingers.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post gopala OpenFOAM Running, Solving & CFD 0 April 27, 2009 10:46 allenzhao OpenFOAM Installation 127 January 30, 2009 20:08 paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14 SSL FLUENT 2 January 26, 2008 12:55 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00

All times are GMT -4. The time now is 01:28.