|
[Sponsors] |
How to give the coordinates of the centroid of a parabolic profil in UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 2, 2016, 10:03 |
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 |
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 |
|
December 5, 2016, 04:11 |
|
#2 |
Member
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10 |
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); ... |
|
|
|
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 |