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

How to give the coordinates of the centroid of a parabolic profil in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2016, 10:03
Question How to give the coordinates of the centroid of a parabolic profil in UDF
  #1
New Member
 
Join Date: Sep 2011
Posts: 15
Rep Power: 15
djing is on a distinguished road
Hello dear colleagues ,

I'm going to simulate a flow throughout a geometry which is composed of many velocity inlet as boundary conditions BC , i have to give an UDF of parabolic profile in each BC , so i have to use the F_Centroid command but the problem is that for this command '' assumes that the grid is generated such that the origin is at the geometric center of the boundary zone to which the UDF is to be applied '' which is not possible in my case because i have many boundary zones where i want to apply this UDF for parabolic profile and also the surfaces of the boundary zone are not conventional ( see the fig attached the Udf is working but the point in the bottom of the inlet face was token as the center of the profile where the max value is applied because it's is the origin of the geometry) .

Is there any possibility to introduce in the UDF or otherwise the coordinates of the center point of the parabolic profile .

Udf for parabolic profil in 3D :
#include "udf.h"//file that contains definitions for define functions and fluent operations

DEFINE_PROFILE(inlet_z_velocity,th,i)
{
real x[ND_ND]; /* an array for the coordinates */
real xx, y, d,velmax;
real t=RP_Get_Real("flow-time");
face_t f; /* f is a face thread index */
r = 0.01; /* inlet radius in m */
begin_f_loop(f,th)
{
xx = x[0]; /* x coordinate */
y = x[1]; /* y coordinate */
F_CENTROID(x,f,th);
velmax=10;
F_PROFILE(f,th,i) =velmax*(1.-(y*y+xx*xx)/(r*r));

}
end_f_loop(f,th)
}


I'd really appreciate any help.
Best
Djing
Attached Images
File Type: jpg fig1.jpg (123.1 KB, 31 views)
djing is offline   Reply With Quote

Old   December 5, 2016, 04:11
Default
  #2
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10
kirmaks is on a distinguished road
Hallo,

You can specify the center coordinates of Your profile as You wish, it is just a simple math. You can introduce one or several additional constants or array if You have many inlets and put there something like:

Code:
y_center = ...;
x_center = ...;
...
xx=x[0]-x_center;//check signs
y=x[1]-y_center;//check signs
rr = xx^2+y^2;
F_PROFILE(f,th,i) =velmax*(1.-(y*y+xx*xx)/rr); 
...
Regards, Maks
kirmaks is offline   Reply With Quote

Reply


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 parabolic velocity inlet with unsteady case Faruk Beyca FLUENT 4 June 24, 2022 11:45
UDF Unsteady velocity parabolic profile Rashad FLUENT 3 October 1, 2018 16:27
Simple parabolic velocity UDF with symmetry - what am I not understanding!?! NPGrad FLUENT 1 September 30, 2016 12:42
how can give UDF for mass (m_dot=m0*cos(omega*t)) for Periodic BC raj kumar saini Fluent UDF and Scheme Programming 1 August 9, 2011 11:44
would someone give me a example of udf for 6DOF? conan FLUENT 3 January 24, 2011 22:10


All times are GMT -4. The time now is 17:06.