# UDF for BCs in VOF model

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

 September 29, 2011, 07:46 UDF for BCs in VOF model #1 New Member   Join Date: Apr 2010 Posts: 5 Rep Power: 7 Hi all, I am having difficulties in finding a way to write down a specific UDF for a boundary in VOF model and I hope someone could give an hint. Let us consider a cube (phase 1): inlet, outlet and symmetry on all other faces. Now I introduce a second phase by udf on one of the symmetry faces, say a 2D ellipse. I would like to "fix" the 2D second phase on its plane, say imposing a local no-slip condition only for the 2nd phase while keeping symmetry on the rest of the face. Any idea on how to do it? Up to now, my ideas: 1. Use DEFINE_PROFILE on the face, no possibility to hook UDF to symmetry; 2. Substitute symmetry with wall, DEFINE_PROFILE to set zero shear outside the 2nd pahse -> no way; 3. Use DEFINE_ADJUST to set zero velocity to the 2nd phase only -> this would be called at each iteration (looks to me not worth) and not sure about the results. Any suggestion would be greatly appreciated, cheers!

 September 29, 2011, 15:53 #2 Senior Member   Mohammad Join Date: Feb 2010 Location: Shiraz, Iran Posts: 108 Rep Power: 7 hi clint, I think your second option is a good choice. you can specify any shear profile in udf. for example if you want to have no slip outside of an ellipse and slip inside of it, simply write an if condition inside loop and set it. if I'm wrong or I didnt understood the problem well, tell me more! yours, mohammad

 October 5, 2011, 02:44 #4 New Member   Join Date: Apr 2010 Posts: 5 Rep Power: 7 mohammad, thanks for your help, but I am still stuck with this problem as I am getting ACCESS VIOLATION with this UDF. #include "udf.h" DEFINE_PROFILE(myname,t,i) { face_t f; real xc[ND_ND]; begin_f_loop(f,t) { if (F_VOF(f,t)==0) // here is VOF -> zero to 1 { F_CENTROID(xc,f,t); if (pow(xc[0],2) + pow(xc[1],2) > pow(0.1e-3,2)) /*primary phase, say air*/ F_PROFILE(f,t,i)=0.0; /*this achieves symmetry*/ } else F_PROFILE(f,t,i)= /*inside the circle I want no-slip for secondary phase, say water -> how to impose it? infinite shear??*/ } end_f_loop(f,t) } I think the solver gives access error cos it doesn't know what phase to consider (F_VOF is defined for both phases an is complementary). I don't know if I have to refer to the mixture or specifically to each phase. Please anyone can help with this? Thanks!

 October 5, 2011, 14:54 #5 Senior Member   Mohammad Join Date: Feb 2010 Location: Shiraz, Iran Posts: 108 Rep Power: 7 hi, for no slip condition you can simply use the main formula for it: miu*du/dy just define cell and use c_u and it would be delta u for u=0 on wall. then having cell size(or using some macro to extract it in udf) tau=miu*c_u/(cell size /2) and about f_vof, I think it returns the phase no. for example 0 means primary phase and 1 means secondary phase. so you can separate phases using it. finally about access violation, I dont have any idea now!! just recheck it and try to debug if it return error in compiling process(or interpreting process). yours, mohammad

 Tags boundary conditions, symmetry, udf, vof

 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 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36 Attesz CFX 7 January 5, 2013 04:32 emad Fluent UDF and Scheme Programming 0 May 19, 2009 12:46 ardalan soleymani FLUENT 0 July 11, 2007 01:09 Z Main CFD Forum 0 February 17, 2005 04:07

All times are GMT -4. The time now is 04:52.