CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Why topoSet does work incorrectly? (https://www.cfd-online.com/Forums/openfoam-solving/235090-why-toposet-does-work-incorrectly.html)

Reptider March 31, 2021 13:49

Why topoSet does work incorrectly?
 
3 Attachment(s)
Hello!
There is mesh created by cartesianMesh (meshDict) with surfaceMeshRefinement. I need to assign cells restricted by "obj_2.stl" to cellZone using topoSetDict (picture1.png). It must be done by surfaceToCell. But I've got the case that works incorrectly. Two outside points noticed in the piece of code should show the outside of stl file. So it must assign internal cells in cellZone (red points, picture0.png). However, this operation is done only boundary cells (picture2.png). Internal zone is ignored. I don't understand what's wrong. Could you help me?
Attachment 83613

Attachment 83614

Attachment 83615
The file can be downloaded from the cloud:

https://drive.google.com/file/d/1xT4...ew?usp=sharing

Code:

actions
(
    {
    name    supportCellSet_1;
    type    cellSet;
    action  new;
    source  surfaceToCell;
    file    "obj_2.stl";
    outsidePoints
    (
        (-27.755749702453613 -14.90625 0.1956501007080078)
        (4.457550048828125 -6.677660942077637 15.221670150756836)
    );
    includeCut      true;
    includeInside  true;
    includeOutside  false;
    nearDistance    -1;
    curvature      -100;   
    }

    {
        name    cellZone_1;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set supportCellSet_1;
        }
    }
);

I think it occurs due to either bad stl or mesh.

crubio.abujas April 1, 2021 03:38

Try useSurfaceOrientation
 
Hi Reptider,

It seems that the program get confused by the inside/outside definition. I had success using the option "useSurfaceOrientation" to automatically detect inside/outside regions instead of explicitly define the outsidePoints. Let me know if that works for you as well.

Code:

actions
(
    {
        name    supportCellSet_1;
        type    cellSet;
        action  new;
        source  surfaceToCell;
        file    "obj_2.stl";
        outsidePoints ();
        useSurfaceOrientation true;
        includeCut      false;
        includeInside  true;
        includeOutside  false;
        nearDistance    -1;
        curvature      -1;   
    }

    {
        name    cellZone_1;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set supportCellSet_1;
        }
    }
);


Reptider April 1, 2021 04:39

Quote:

Originally Posted by crubio.abujas (Post 800399)
Hi Reptider,

It seems that the program get confused by the inside/outside definition. I had success using the option "useSurfaceOrientation" to automatically detect inside/outside regions instead of explicitly define the outsidePoints. Let me know if that works for you as well.

Hey, crubio. I appreciate your attention for my problem. I know about this method of topoSet. It requires normals to be directed from stl, right?
Can I avoid this?

crubio.abujas April 1, 2021 06:04

You're using OFv1912, right? I've tried it into OF v7 and your approach works fine, so maybe there is a bug ig OFv1912 with this app. If so it is not corrected into v2012 (also tried) so you may consider to report this issue.

I think your options right know are:
a) switch to openFoam Foundation version (at least to do the topoSet, then you can use the defined sets into whatever version you use)
b) Use the useSurfaceOrientation approach.
c) Dig into the source code and find what is wrong.

Quote:

It requires normals to be directed from stl, right?
Can I avoid this?
Yes, it uses the stl normals to it. I don't see how this add any further complexity, why are you willing to avoid this?

Reptider April 1, 2021 07:44

Quote:

Originally Posted by crubio.abujas (Post 800414)
You're using OFv1912, right? I've tried it into OF v7 and your approach works fine, so maybe there is a bug ig OFv1912 with this app. If so it is not corrected into v2012 (also tried) so you may consider to report this issue.

I think your options right know are:
a) switch to openFoam Foundation version (at least to do the topoSet, then you can use the defined sets into whatever version you use)
b) Use the useSurfaceOrientation approach.
c) Dig into the source code and find what is wrong.



Yes, it uses the stl normals to it. I don't see how this add any further complexity, why are you willing to avoid this?

I know that I can get stl that has problems with orientation of normals. For example, some triangle has "wrong" placement of his vertices, so it leads normal of this triangle is directed inside.

Reptider April 1, 2021 09:25

It works if I use the useSurfaceOrientation approach. But I see that insideCut is not necessary. How can I easily tell the topoSet in order to cutted cells at boundaries belong only one cellSet?


All times are GMT -4. The time now is 13:58.