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

Ray intersecting BoundaryMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2016, 10:30
Default Ray intersecting BoundaryMesh
  #1
Member
 
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16
David* is on a distinguished road
Hi,

I try to compute the intersection point of a given line (2 points) and the polyBoundaryMesh of my OF case.

Following this thread (http://www.cfd-online.com/Forums/ope...-openfoam.html), I'm using an object of type Foam::indexedOctree<treeDataTriSurface>. I construct the required triSurface from the STLs used to generate the mesh.

Unfortunately, the STLs are not exactly identical to the BoundaryMesh, causing errors. Therefore, I tried to construct a Foam::indexedOctree<treeDataPrimitivePatch> from the BoundaryMesh patches to use as a basis, but failed. It should look something like this:
Code:
Foam::indexedOctree<treeDataPrimitivePatch>& octree1(???);
Foam::pointIndexHit pHit = octree1.findLine(insideP, outsideP);
Can you tell me how to create my object "octree1"? Or any alternative way of computing the intersection?

Thanks a lot!
David

Last edited by David*; January 21, 2016 at 10:17.
David* is offline   Reply With Quote

Old   February 16, 2016, 04:50
Default
  #2
Member
 
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16
David* is on a distinguished road
sorry for reply, the edit button is gone...
I fixed it using
Code:
#include "volFields.H"          // Diverse fields called by fvCFD.H
#include "fvCFD.H"              // OpenFOAM Finite Volume tools
#include "treeDataFace.H"       // Search faces

using namespace Foam;

...

    Foam::point outsideP(xEnd, yEnd, zEnd);
    Foam::point insideP(xStart, yStart, zStart);
    const Foam::fvPatchList& patches = mesh.boundary();

    forAll(patches, patchI)
    {
        const polyPatch& polyPatch1 = patches[patchI].patch();

        treeBoundBox allBoundingBox(polyPatch1.points());

        const indexedOctree<treeDataFace> octree1
        (
            treeDataFace(false, polyPatch1),
            allBoundingBox, // overall search domain
            8,      // maxLevel
            10,     // leafsize
            3.0     // duplicity
        );

        pointIndexHit pHit = octree1.findLine(insideP, outsideP);

    ...
    }
Cheers,
David
David* 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
Solar Ray Tracing and non conformal interface AlexBene FLUENT 2 July 16, 2018 05:33
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 11:05
Ray tracing gorlcjstk FLUENT 0 August 4, 2011 08:04
ray intersection with a curved surface gama Main CFD Forum 0 August 3, 2006 14:53
Self intersecting Carlos Saraiva Siemens 0 January 23, 2003 08:33


All times are GMT -4. The time now is 19:27.