|
[Sponsors] |
September 12, 2012, 04:51 |
velocity profile for inlet with UDF
|
#1 |
New Member
selim
Join Date: Sep 2009
Location: UK
Posts: 19
Rep Power: 17 |
Dear all,
I want to impose a velocity at the inlet which is parabolic at the bottom and top and constant in the middle of the inlet. But flunet does not regonize the locations correctly, so what is wrong in my UDF, pls help!! Here is my udf, #include "udf.h" #define S 0.038 #define V1 10.86 DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; if (y<=S) F_PROFILE(f, thread, index) = 249.384*y*y+249.384*y; else if (S<=y<=3*S) F_PROFILE(f, thread, index) = V1; else if (3*S<=y<=4*S) F_PROFILE(f, thread, index) = -83.514*y*y-83.514*y+14.6238; } end_f_loop(f, thread) } Thank you, -Selim |
|
September 12, 2012, 05:51 |
|
#2 |
New Member
Zhi-Gang Zhai
Join Date: Sep 2012
Location: karlsruhe, Germany
Posts: 7
Rep Power: 14 |
pls show the mesh and what is the wrong result ? thank you!
|
|
September 12, 2012, 06:45 |
|
#3 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
Hi,
the following udf will produce the following velocity-y coordinate chart; velocity will be a function of the only y coordinate. Take care to operators <=, >= etc.: in your udf, if for example y=S both F_PROFILE(f, thread, index) = 249.384*y*y+249.384*y; F_PROFILE(f, thread, index) = V1; are valid Code:
#include "udf.h" #define S 0.038 #define V1 10.86 DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; if (y<=S) /* y=S is included */ F_PROFILE(f, thread, index) = 249.384*y*y+249.384*y; else if (S<y<3*S) /* y=S and y=3S are not included */ F_PROFILE(f, thread, index) = V1; else /* no need for another else if, 3S is included here */ F_PROFILE(f, thread, index) = -83.514*y*y-83.514*y+14.6238; } end_f_loop(f, thread) } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF problems - velocity profile | Oli | Fluent UDF and Scheme Programming | 6 | October 24, 2016 11:38 |
UDF Unsteady velocity profile | Rashad | FLUENT | 0 | February 27, 2008 15:57 |
How to specify the Velocity profile (eqn) by UDF | Anant | FLUENT | 1 | February 27, 2008 15:54 |
Multi step transient UDF velocity profile problem | William177 | FLUENT | 1 | February 3, 2008 07:47 |
UDF problem : inlet velocity in cyl. coord. system | Jongdae Kim | FLUENT | 0 | June 15, 2004 12:21 |