|
[Sponsors] |
UDF for inlet BC, Free Surface Open Channel Flow VOF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
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: 14 |
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
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
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 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); } Daniele 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: 14 |
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: 14 |
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 |
|
Tags |
free surface, open channel flow, udf, vof |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Thermocapillary free surface flow | zakifoam | OpenFOAM Running, Solving & CFD | 10 | December 12, 2016 12:44 |
Open channel flow | motaba | Main CFD Forum | 4 | March 26, 2011 04:22 |
Open Channel Flow | forsumit | FLUENT | 0 | October 1, 2009 03:01 |
Free surface, open channel | Linda | FLUENT | 2 | April 10, 2006 12:43 |
open channel flow vof model | Yong | Siemens | 3 | June 21, 2005 06:54 |