Register Blogs Members List Search Today's Posts Mark Forums Read

November 18, 2020, 13:06
#1
New Member

Vincenzo Luci
Join Date: Jan 2019
Posts: 9
Rep Power: 7
Hello to every one,
I really appreciate it if anyone could help me. I am facing the problem to create a UDF for a radial velocity in several boundary conditions. I have almost 2000 nozzles under the same boundary condition and I need to set the radial velocity to be relative to the center of each nozzle. The results, attached below (in the figures there are only 4 nozzles but in the real model are almost 2000 nozzles), suggest to me that the rotational axis is always centered on the absolute center axes. I confirmed this theory using a scalar profile with the same UDF. For radial velocity, I think I need to change the local axis or translate in some way the velocity founded but I don't know how to do it. If I set (in this case) 4 velocity inlet with a local cylindrical axis centered in each circle the results will be good, but I cannot in the whole model. Summing up, I need either to set the local axis in the UDF or to find how to translate the radial velocity founded in this way to the center of each circle. Here below, there is the UDF used, someone could help me?

#include "udf.h"
#define Mdot 1 /* flow rate from each nozzle [kg/s]*/
#define theta_max 60 /* angolo di apertura massimo*/
#define R_max 0.05 /* Nozzle radius [m]*/
{
real coor[ND_ND],Ai[ND_ND];
real x,y,z,x1,y1,z1;
real nfaces = 0,Atot = 0.;
real nn = 0;
real dens, area, vci;

real xsum = 0., ysum = 0., zsum = 0.;
real xcen = 0., ycen = 0., zcen1 = 0.;
face_t f;

/*Count number of faces*/
begin_f_loop(f,t)
nn += 1;
nfaces += 1;
F_AREA(Ai, f, t);
area=NV_MAG(Ai);
Atot = area + Atot;
end_f_loop(f,t);

/*Find center of the circle*/
begin_f_loop(f, t)
{
F_CENTROID(coor,f,t);

x = coor[0];
y = coor[1];
z = coor[2];
xsum = xsum + x;
ysum = ysum + y;
zsum = zsum + z;
}
end_f_loop(f, t);

xcen = xsum/nfaces;
ycen = ysum/nfaces;
zcen1 = zsum/nfaces;

begin_f_loop(f, t)
{
F_CENTROID(coor,f,t);

x1 = coor[0];
y1 = coor[1];
z1 = coor[2];
rr = pow( ( pow((x1-xcen),2.)+pow((y1-ycen),2.)+pow((z1-zcen1),2.) ),0.5);
theta = rr * theta_max/ R_max;

dens=F_R(f,t);
vci = Mdot/(dens*Atot);

}
end_f_loop(f, t);
}
Attached Images
 Velocity_dir.jpg (59.0 KB, 10 views) Radial velocity_needtobe.jpg (37.9 KB, 11 views)

 April 8, 2022, 04:13 #2 New Member   pitroda jimesh Join Date: Nov 2021 Posts: 2 Rep Power: 0 did you solve this? it would be good that you share how you solve the problem.