|
[Sponsors] |
Set local radial axis for radial velocity with UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 18, 2020, 13:06 |
Set local radial axis for radial velocity with UDF
|
#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]*/ DEFINE_PROFILE(Radial_velocity,t,i) { 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 rr, theta, theta_rad; 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; theta_rad = theta *M_PI/180.; dens=F_R(f,t); vci = Mdot/(dens*Atot); F_PROFILE(f,t,i) = vci* sin(theta_rad); } end_f_loop(f, t); } |
|
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.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
courant number increases to rather large values | 6863523 | OpenFOAM Running, Solving & CFD | 22 | July 6, 2023 00:48 |
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" | bigphil | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 686 | December 22, 2022 10:10 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 14:58 |
How to set angular velocity in wall and axis of rotation? | sachinlb | OpenFOAM Running, Solving & CFD | 0 | January 19, 2012 10:02 |
Variables Definition in CFX Solver 5.6 | R P | CFX | 2 | October 26, 2004 03:13 |