CFD Online Logo CFD Online URL
Home > Forums > FLUENT

VOF Patch

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

LinkBack Thread Tools Display Modes
Old   April 5, 2007, 05:01
Default VOF Patch
Posts: n/a
I would like to model a cosine wave of liquid water with air on top in a tank using the VOF model. However I do not want to create the "wave" in Gambit and thus have a uniform 2D quadrilateral mesh. Attached is a UDF that should patch two volume fractions, i.e. below a height of 10 mm patch C_VOF=1 and above 10 mm patch C_VOF=0. This is just a test case and later on I'll replace it with a cosine wave. When I run the UDF and connect it to a Function Hook I get an error when trying to initialize it. Any suggestions?

/************************************************** *************** 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, d) { cell_t cell; Thread *cell_thread; real xc[ND_ND];

/* loop over all cell threads in the domain */ thread_loop_c (cell_thread, d) { /* loop over all cells */ begin_c_loop_all (cell,cell_thread) { C_CENTROID(xc,cell,cell_thread); if (xc[1] < 10.)

/* 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) }

  Reply With Quote


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
Using starToFoam clo OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 33 September 26, 2012 04:04
StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 03:34
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12

All times are GMT -4. The time now is 03:26.