CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

minimum particle wall distance

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 24, 2023, 02:51
Default minimum particle wall distance
  #1
New Member
 
NewtonianGuy
Join Date: Jun 2020
Posts: 9
Rep Power: 5
NewtonianGuy is on a distinguished road
I have the following method using the wallDist Class to compute the minimum distance to a wall from a particle position with a correction factor based on particle position within a cell. However, I want to know which PatchID is the closest ? There is a member function of the WallDist Class named PatchIDLists but it has all wall patchIDs...

Code:
//Minimum distance to wall from cell position
const scalar yw_cell = wallDist::New(this->owner().mesh()).y()[p.cell()];
	//Cell position
const vector cell_pos = this->owner().mesh().C()[p.cell()];
	// Particle position
const vector p_pos = p.position();
	// Wall normal in
const vector normal_wall = -wallDist::New(this->owner().mesh()).n()[p.cell()];
const scalar projection = (p_pos - cell_pos) & normal_wall;
	
scalar distanceWall = 0;
if (projection >0)
	{
		distanceWall = yw_cell + projection;
	}
else 
	{
		distanceWall = yw_cell - mag(projection);
	}
Thank you
NewtonianGuy is offline   Reply With Quote

Reply

Tags
lagrangian, particles

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Particle Wall Distance Joseph19 FLUENT 0 July 21, 2022 11:16
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 15:33
Particle tracking error alchem OpenFOAM Bugs 5 May 6, 2017 16:30
Dimensionless wall distance messik Main CFD Forum 4 March 15, 2014 06:55
forced to sticking of soot particle kmgraju CFX 0 November 27, 2012 09:08


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