CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

how surfaceToCell works?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2017, 07:18
Default how surfaceToCell works?
  #1
Member
 
Join Date: May 2017
Posts: 38
Rep Power: 9
decibelle is on a distinguished road
Hello everybody,

I would like to understand how surfaceToCell works in topoSet for a cellSet source.
surfaceToCell is composed of of this arguments:
- surface
- outsidepoint
- cut
- inside
- outside
- near
- curvature

I don't understand the meaning of these arguments except "surface".

Someone can help me?

Thanks in advance
decibelle is offline   Reply With Quote

Old   June 6, 2017, 08:45
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Code:
$ src
$ pwd
$HOME/OpenFOAM/OpenFOAM-4.1/src
$ find . -name 'surfaceToCell.*'
./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.H
./meshTools/lnInclude/surfaceToCell.C
./meshTools/lnInclude/surfaceToCell.H
$ less ./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.H
If you scroll a little bit, you find these comments:

Code:
        //- Name of surface file
        const fileName surfName_;

        //- Points which are outside
        const pointField outsidePoints_;

        //- Include cut cells
        const bool includeCut_;

        //- Include inside cells
        const bool includeInside_;

        //- Include outside cells
        const bool includeOutside_;

        //- Determine inside/outside purely using geometric test
        //  (does not allow includeCut)
        const bool useSurfaceOrientation_;

        //- If > 0 : include cells with distance from cellCentre to surface
        //  less than nearDist.
        const scalar nearDist_;

        //- If > -1 : include cells with normals at nearest surface points
        //  varying more than curvature_.
        const scalar curvature_;
Correspondence between variable names and dictionary arguments can be found in ./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C (though they are quite obvious).
alexeym is offline   Reply With Quote

Old   June 6, 2017, 09:38
Default
  #3
Member
 
Join Date: May 2017
Posts: 38
Rep Power: 9
decibelle is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

Code:
$ src
$ pwd
$HOME/OpenFOAM/OpenFOAM-4.1/src
$ find . -name 'surfaceToCell.*'
./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.H
./meshTools/lnInclude/surfaceToCell.C
./meshTools/lnInclude/surfaceToCell.H
$ less ./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.H
If you scroll a little bit, you find these comments:

Code:
        //- Name of surface file
        const fileName surfName_;

        //- Points which are outside
        const pointField outsidePoints_;

        //- Include cut cells
        const bool includeCut_;

        //- Include inside cells
        const bool includeInside_;

        //- Include outside cells
        const bool includeOutside_;

        //- Determine inside/outside purely using geometric test
        //  (does not allow includeCut)
        const bool useSurfaceOrientation_;

        //- If > 0 : include cells with distance from cellCentre to surface
        //  less than nearDist.
        const scalar nearDist_;

        //- If > -1 : include cells with normals at nearest surface points
        //  varying more than curvature_.
        const scalar curvature_;
Correspondence between variable names and dictionary arguments can be found in ./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C (though they are quite obvious).

Thank you for your help.

but it is not yet clear for me.

If we take for example the motorbike tutorials, the outsidepoints are outside the moto but inside the domain, outside the moto and outside the domain or inside the moto?
About the cut cells, how it is possible to choose the cells cut by motorbike surface?
Inside, I think it's inside the motorbike but, in this case there are not cells inside.
Outside I think it's outside the motorbike but in the domain.
near I understand
and I don't understand the function of curvature.
decibelle is offline   Reply With Quote

Old   June 6, 2017, 10:12
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Now it is not clear to me, what you are asking. You started from cellSet source in topoSet, i.e. you were selecting CELLS. Now you talk about points (though maybe it was my mistake to include this property in example).

You have surface. You can select cells of a computation domain, that are inside this surface, outside this surface, and cut by this surface. To define meaning of "inside" and "outside", you can use either reference point, or surface orientation.

Curvature works only for nearDist. And it means the following:

Code:
            Info<< "    Selecting cells with cellCentre closer than "
                << nearDist_ << " to surface and curvature factor"
                << " less than " << curvature_ << endl;
You can go further into source, to see exact mathematical expression.
betterglobe likes this.
alexeym is offline   Reply With Quote

Old   June 7, 2017, 03:57
Default
  #5
Member
 
Join Date: May 2017
Posts: 38
Rep Power: 9
decibelle is on a distinguished road
in my previous message I wanted to apply surfaceToCell in the motorbike case to understand. But I'm agree with you it wasn't clear. Do you know this tutorial?
decibelle is offline   Reply With Quote

Old   June 7, 2017, 05:12
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
It is MUCH easier to understand if you really try to apply this topoSet to your problem and then post your cognitive dissonances.

I know the tutorial.
alexeym is offline   Reply With Quote

Old   April 22, 2020, 12:42
Default
  #7
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
For future reference, the following tutorials in v1912 contain examples of `surfaceToCell`:

mesh/foamyHexMesh/flange/system/topoSetDict-background
multiphase/interFoam/laminar/waves/mangroveInteraction/system/setFieldsDict

Code:
    surfaceToCell
    {
        file            "./constant/triSurface/seaweed.stl";
        outsidePoints   ((2 0.25 0.15));
        includeCut      true;
        includeInside   true;
        includeOutside  false;
        nearDistance    -1;

        curvature       -100;

        fieldValues
        (
            volScalarFieldValue MangrovesIndex 1
        );
    }
HPE is offline   Reply With Quote

Reply

Tags
cellset, openfoam, surfacetocell, toposet


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
[OpenFOAM.com] Multiple Installation Issue: Parallel Processing No Longer Works dancfd OpenFOAM Installation 11 November 20, 2018 17:08
[GAMBIT] Gambit works on Windows, but not in Linux victorz ANSYS Meshing & Geometry 8 April 14, 2013 21:40
Parallel runs with sonicDyMFoam crashes (works fine with sonicFoam) jnilsson OpenFOAM Running, Solving & CFD 0 March 9, 2012 07:45
git problem: 1.7.x works but 1.6.x not af631717 OpenFOAM Installation 2 August 23, 2010 06:22
ARTICLES AND WORKS CONCERNING CFD OF LIQUID-LIQUID DISPERSION AND DROPS SIZE IN AGITATED SYSTEMS.. tim Main CFD Forum 1 June 22, 1999 09:07


All times are GMT -4. The time now is 14:46.