CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

One velocity profile for multiple inlets

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2018, 12:25
Question One velocity profile for multiple inlets
  #1
New Member
 
moein vh
Join Date: Aug 2017
Posts: 13
Rep Power: 8
moeinvh is on a distinguished road
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.
moeinvh is offline   Reply With Quote

Old   March 16, 2018, 12:29
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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.
LuckyTran is offline   Reply With Quote

Old   March 16, 2018, 12:35
Default
  #3
New Member
 
moein vh
Join Date: Aug 2017
Posts: 13
Rep Power: 8
moeinvh is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
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.
Thank you for your answer,

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...
moeinvh is offline   Reply With Quote

Old   March 16, 2018, 12:52
Default
  #4
New Member
 
moein vh
Join Date: Aug 2017
Posts: 13
Rep Power: 8
moeinvh is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
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.
For instance, I guess one way is finding the maximum and minimum values of y and z components for each hole that the center of the hole is their average but, I don't have any idea about finding the max and min values of y and z components for each inlet hole.

After that, how can I set the found center point as a new origin?
moeinvh is offline   Reply With Quote

Reply

Tags
define_profile, multi-inlets, udf


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 03:44
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 9 June 25, 2016 19:08
[boundary condition] logarithmic velocity profile cfdworker FLUENT 2 April 17, 2009 23:36
velocity profile for two inlets shubham208011 FLUENT 0 April 6, 2009 15:21
udf for velocity profile in a geometry having two inlets shubham208011 Fluent UDF and Scheme Programming 0 April 6, 2009 15:13


All times are GMT -4. The time now is 12:19.