# UDF for inlet BC, Free Surface Open Channel Flow VOF

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

 February 20, 2012, 06:39 UDF for inlet BC, Free Surface Open Channel Flow VOF #1 New Member   Arshiya Hoseyni Chime Join Date: Feb 2012 Posts: 11 Rep Power: 5 Hi everyone I am working on an open channel flow problem. I used the VOF model and successfully simulated a free surface flow over a bump! But, I figured that Fluent assigns a velocity to both water and air! However, I want to set the inlet velocity of air to zero. My advisor wants me to write a UDF to set a parabolic velocity for water flow from bottom to free surface and then set air velocity on top to zero! This is the UDF I came up with but it doesn't work! (0,0) is the left bottom corner of a rectangle (0.1x0.6 m) . Free surface is at 0.05m and has 2m/s velocity. #include "udf.h" #define Ui 2.0 DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x, f, thread); y=x[1]; } if (y<0.05.) { F_PROFILE(f, thread, position)= Ui*(y*y)/(0.05*0.05); } else F_PROFILE(f,thread, position)=0; end_f_loop(f,thread); } I will appreciate any help Best regards Arshiya

February 20, 2012, 08:02
#2
Senior Member

Daniele
Join Date: Oct 2010
Location: Italy
Posts: 899
Rep Power: 15
Hi!
Delete the point after 0.05 and include the if cycle into the begin_f_loop and your udf will be fine.

Here is the corrected udf:

Code:
```#include "udf.h"
#define Ui 2.0
{
real x[ND_ND];
real y;
face_t f;
{
y=x[1];

if (y<0.05)
{
}
else
}
}```
..and attached your resulting inlet x velocity after some iterations.

Daniele
Attached Images
 velocity.jpg (36.7 KB, 81 views)

Last edited by ghost82; February 20, 2012 at 09:05.

 February 20, 2012, 22:51 #3 New Member   Arshiya Hoseyni Chime Join Date: Feb 2012 Posts: 11 Rep Power: 5 Thank you Danielle. It worked

March 6, 2012, 19:13
problem encountered with UDF
#4
New Member

Arshiya Hoseyni Chime
Join Date: Feb 2012
Posts: 11
Rep Power: 5
I used the UDF in a simple channel flow with the following Boundary Conditions:

My shape is 0.6x0.15 m

Inlet:
- Velocity: UDF (max velocity gets to 1.2m/s at free surface)
- Free surface level: 0.07m

Outlet:
-Free Surface: Use from neighboring cell

Sides of the rectangular: no slip

The idea of writing this UDF is to set the velocity of air to zero and give a parabolic velocity for water inlet. But, once I run the Fluent, velocity profile shows that velocity of mixture is about zero on the bottom and about 7.5 m/s for air! Also Velocity vectors imply that air moves faster than water! Although, I set air Temperature to zero at the inlet!!!!

I've attached my velocity profile, velocity vector, and defined profile.

I would appreciate any help.

Arshiya
Attached Images
 parabolic velocity_interpolated data.jpg (42.4 KB, 42 views) parabolic velocity_streamlines.jpg (60.8 KB, 64 views) parabolic velocity.jpg (80.0 KB, 53 views)

 Tags free surface, open channel flow, 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 zakifoam OpenFOAM Running, Solving & CFD 6 August 24, 2014 03:24 motaba Main CFD Forum 4 March 26, 2011 04:22 forsumit FLUENT 0 October 1, 2009 02:01 Linda FLUENT 2 April 10, 2006 11:43 Yong CD-adapco 3 June 21, 2005 05:54

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