|
[Sponsors] |
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: 15 |
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, 16:05 |
|
#3 |
New Member
Katey
Join Date: Feb 2011
Location: Bozeman, MT
Posts: 7
Rep Power: 15 |
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: 15 |
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
|
Quote:
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) } } } |
||
March 24, 2011, 13:13 |
|
#6 |
New Member
Katey
Join Date: Feb 2011
Location: Bozeman, MT
Posts: 7
Rep Power: 15 |
Thanks. I just found that and I'm running it now. Crossing fingers.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
interDyMFoam - change in volume fraction | gopala | OpenFOAM Running, Solving & CFD | 0 | April 27, 2009 11: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 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |