|
[Sponsors] |
March 16, 2018, 13:25 |
One velocity profile for multiple inlets
|
#1 |
New Member
moein vh
Join Date: Aug 2017
Posts: 13
Rep Power: 9 |
Hi friends,
I have the following problem with UDF for velocity inlet: I have 64 holes as "inlet" which all of them have the same velocity profile. The velocity profile is in the form of 1-r^2 (if the origin was at the center of each hole). I wrote the following UDF for x-component inlet velocity: #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y, z, D; face_t f; D = 0.03; /* inlet diameter in m */ begin_f_loop(f,thread) { F_CENTROID(x, f, thread); y = 2.*x[1]/D; /* non-dimensional y coordinate */ z = 2.*x[2]/D; /* non-dimensional z coordinate */ F_PROFILE(f, thread, position) = 10. *(1.0-y*y-z*z); } end_f_loop(f, thread) } The problem is that this profile works correctly only for the centroid hole because, in other holes, y and z components are not equal to zero at the center of the hole. In other words, I need to define new origins at the center of all inlet holes. Is there any idea to solve the problem and generalize the UDF for all inlets? Thank you. |
|
March 16, 2018, 13:29 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,762
Rep Power: 66 |
To generalize it, you would need to calculate the centers on the fly based on the grid and not any user input. So you'd have to loop over the face cells, get all the x,y,z's and calculate the center.
|
|
March 16, 2018, 13:35 |
|
#3 | |
New Member
moein vh
Join Date: Aug 2017
Posts: 13
Rep Power: 9 |
Quote:
But, would you please tell me what exactly I should do, step by step? For instance, I don't know what does the "fly based" means and so on... |
||
March 16, 2018, 13:52 |
|
#4 | |
New Member
moein vh
Join Date: Aug 2017
Posts: 13
Rep Power: 9 |
Quote:
After that, how can I set the found center point as a new origin? |
||
Tags |
define_profile, multi-inlets, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[UDF] Relative coordinates in logarithmic velocity profile | cfdworker | Fluent UDF and Scheme Programming | 25 | July 13, 2017 04:44 |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
[boundary condition] logarithmic velocity profile | cfdworker | FLUENT | 2 | April 18, 2009 00:36 |
velocity profile for two inlets | shubham208011 | FLUENT | 0 | April 6, 2009 16:21 |
udf for velocity profile in a geometry having two inlets | shubham208011 | Fluent UDF and Scheme Programming | 0 | April 6, 2009 16:13 |