|
[Sponsors] |
Inside, Outside or on the boundary of a Body? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 23, 2004, 12:56 |
Inside, Outside or on the boundary of a Body?
|
#1 |
Guest
Posts: n/a
|
Hi, I have domain of Fluid. I have descritized the domain into finite cells. I have put a body into the domain. The body has been descritized too which means that I have only some finite nodes instead of having the curve of the body. Now I select a random point in my domain. How can I find that this is inside, outside or on the boundary on my body?
What is the effective algorithm for finding that? Thank you in advance. |
|
January 24, 2004, 00:22 |
Re: Inside, Outside or on the boundary of a Body?
|
#2 |
Guest
Posts: n/a
|
||
January 25, 2004, 20:43 |
Re: Inside, Outside or on the boundary of a Body?
|
#3 |
Guest
Posts: n/a
|
You can use a simple ray test. For the point you want to check, extend a ray in any direction from the point (for example, y-direction). If you intersect the body surface only an odd number of times (e.g., 1 time), the point is inside the surface. If it is an even number of times (e.g., 0,2,...) then the point is outside the body.
A few caveats regarding this method: 1) This is only valid for closed bodies. If your body has holes or gaps, the ray-test could fail. 2) The surface intersection check can be difficult in itself. Personally, I've used area comparisons (i.e., compare discretized panel area to same assuming point was inside panel). This type of method requires that you implement a tolerance (e.g., area_check - area_panel <= TOL). 3) The test can fail if the point lies right on the surface - you need to include a method for checking for this. An area check (i.e., 3D panel area vs. 3D area of panel nodes with point) can also be used for this. There are other methods also, I'm sure - the above just represents what I am using for my overset grid generation and solvers. The reference "Handbook of Grid Generation" (availabe from amazon.com) also has a short discussion in the overset grid section regarding these types of tests... Good luck! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rigid body motion + Boundary Layer | Manoj Kumar | FLUENT | 4 | May 26, 2012 11:34 |
CFX does not continue | Shafiul | CFX | 10 | February 17, 2011 08:57 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 11:56 |
Please help with flow around car modelling! | Tudor Miron | CFX | 17 | March 19, 2004 20:23 |
Boundary conditions? | Tom | Main CFD Forum | 0 | November 5, 2002 02:54 |