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

topoSet

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2025, 12:09
Default topoSet using stl file
  #1
New Member
 
Guanqi
Join Date: Mar 2025
Location: uk
Posts: 8
Rep Power: 2
ofWorld is on a distinguished road
Hi foamers,

I'd like to assign separate patch names to the inner and outer walls of a cylinder tube as attached. I used the topoSet utility to extract faces belonging to the inner wall, followed by createPatch to rename them as a patch. The inner-wall faceSet is successfully created and appears in constant/polyMesh/sets, but after running createPatch, the resulting mesh shows the patch name but with 0 faces.

Has anyone encountered this issue before, or could advise what I might be doing wrong? Is there any idea to help me out with this issue?

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    {
        name    cylinder1;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
	    p1 (0.1554 0 0.1514);
	    p2 (0.1554 0 0.2234);
            radius 0.004;
        }
    }
    /*{
        name    cylinder2;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {

	    p1 (0.1554 0 0.185);
	    p2 (0.2 0 0.185);
            radius 0.003;
        }
    }*/
    {
        name    inner-wall;
        type    faceSet;
        action  new;
        source  cellToFace;

        sourceInfo
        {
            set cylinder1;
            option  all;
        }
    }
    {
        name    inner-wall;
        type    faceSet;
        action  subset;
        source  patchToFace;
        sourceInfo
        {
            name "fluidToSolid";
        }
    }
);

// ************************************************************************* //
Code:
patches
(
    {
        // Name of new patch
        name inner-wall;

        // Dictionary to construct new patch from
        patchInfo
        {
            type wall;
        }

        // How to construct: either from 'patches' or 'set'
        constructFrom set;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        set inner-wall;
    }

);
Many thanks in advance.

Best wishes,
Guanqi
Attached Images
File Type: jpg tube.jpg (22.0 KB, 6 views)

Last edited by ofWorld; November 20, 2025 at 13:19.
ofWorld is offline   Reply With Quote

Old   November 20, 2025, 13:29
Default topoSet using stl
  #2
New Member
 
Guanqi
Join Date: Mar 2025
Location: uk
Posts: 8
Rep Power: 2
ofWorld is on a distinguished road
Hello everyone,

I am trying to create an internal interface patch between the fluid and solid regions generated in OpenFOAM 10. I used an STL file of the internal wall (fluidToSolid.stl) together with topoSet to select the interface faces. However, no matter how I adjust the nearDistance parameter, I only get a partial selection — the resulting patches are incomplete.

Here is the relevant part of my boundary file after running createPatch:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       polyBoundaryMesh;
    location    "1e-05/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

5
(
    fluidGraftInlet
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          32;
        startFace       17454;
    }
    fluidVeinInlet
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          56;
        startFace       17486;
    }
    fluidVeinOutlet
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          44;
        startFace       17542;
    }
    fluidToSolid
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          2;
        startFace       17586;
    }
    solid_to_fluid
    {
        type            patch;
        nFaces          17478;
        startFace       17588;
    }
)

// ************************************************************************* //
Here is the topoSetDict with stl file:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    {
        name    inner-cells;
        type    cellSet;
        action  new;
        source  surfaceToCell;
        sourceInfo
        {
	    file "constant/geometry/fluidToSolid.stl";
	    outsidePoints (
(0.151308 0.00186969 0.208)
);
            includeCut true;
            includeInside true;
            includeOutside false;
            nearDistance 1e-4; // cells with centre near surf
                             // (set to -1 if not used)
            curvature 0; // cells within nearDistance
                            // and near surf curvature
                            // (set to -100 if not used)
        }
    }
    {
        name    inner-wall;
        type    faceSet;
        action  new;
        source  cellToFace;

        sourceInfo
        {
            set inner-cells;
            option  all;
        }
    }
    {
        name    inner-wall;
        type    faceSet;
        action  subset;
        source  patchToFace;
        sourceInfo
        {
            name "fluidToSolid";
        }
    }
);

// ************************************************************************* //
ofWorld is offline   Reply With Quote

Reply

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
[Other] Error: topoSet – create patch from .stl – searchableSurfaceToFaceZone carl_r OpenFOAM Meshing & Mesh Conversion 1 November 18, 2022 18:06
fail to run series of runApplication topoSet -dict jiahui_93 OpenFOAM Programming & Development 1 May 25, 2022 13:56
[mesh manipulation] TopoSet and setSet is showing different result. sunagra27 OpenFOAM Meshing & Mesh Conversion 0 May 10, 2021 11:59
bug : topoSet STOP RESPONDING while trying to make cellzones near to a surface. sk11 OpenFOAM Bugs 0 March 1, 2021 12:49
[snappyHexMesh] TopoSet does not select all faces Mondal131211 OpenFOAM Meshing & Mesh Conversion 3 July 24, 2019 10:39


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