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

VOF Patch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 5, 2007, 06:01
Default VOF Patch
  #1
Adour
Guest
 
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

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
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 05:04
[Other] 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
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 20:31.