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

Particles wall distance

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 24, 2022, 20:34
Default Particles wall distance
  #1
New Member
 
angelo
Join Date: Apr 2022
Posts: 8
Rep Power: 4
angel_97 is on a distinguished road
hello guys, i'm running this udf and i want to find the minimum distance of the particle respect to the wall. but when i print the value in the console are printed nall the values and not the minimum. someone can help me?
/* UDF adding an external body force to the particles */
#include "udf.h"
#include "dpm.h"
#include "dpm_mem.h"
#include "surf.h"
DEFINE_DPM_BODY_FORCE(particle_body_force, p, i)
{
/* declaration of variables */
double w, Dh, Ufx, Ufy, Ufz, Gx, rho, a, F_L, c_height, c_length,
c_volume, side, H, W, f_height_total, Renx, Reny, Renz, crDh, mu, aUfx, aUfy, aUfz, C1, C2, C3, C4, C_Ly, C_Lz, z, y, distancewall;
int ID=9;
real xw[ND_ND];
real vec[ND_ND];
Domain* d;
cell_t c;
Thread* t;
face_t f; //f is the face index that is inside the face thread t(our wall). You will extract the face area vector from f index
d = Get_Domain(1);
c = P_CELL(p); //cell in witch the particle is currently in
t = Lookup_Thread(d,ID); //9 is the ID number of the upper wall. t is the thread index(pointer) of the wall boundary surface 9
distancewall=100; //i'm setting an generic initial value
begin_f_loop(f,t)
{
F_CENTROID(xw,f,t); //center of each face
NV_VV(vec,=,xw,-,P_POS(p)); //vector connecting the particle to the face center that is placed at the wall. The NV_VV do the operation between 2 vectors vec=xw-P_POS(p))
//now you want to calculate the minimum distance between particle and wall, and so you want to find the minimum of the vector vec doing the loop over all the boundary face
if(distancewall>=NV_MAG(vec))
{
distancewall=NV_MAG(vec);
}
}
end_f_loop(f, t)
Message0("the wall distance is: %g\n", distancewall);
return 0;
}
angel_97 is offline   Reply With Quote

Old   April 24, 2022, 21:32
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Wrong forum - try the Fluent UDF forum.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks 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
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 15:33
Particles are not hitting the wall CedricVH OpenFOAM Bugs 23 May 19, 2016 20:29
Wall Distance in CFX davidwilcox CFX 1 September 22, 2014 21:01
DPM particles cross wall & pressure inlet blackstyle FLUENT 0 August 14, 2014 09:10
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 12:03


All times are GMT -4. The time now is 23:55.