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

[snappyHexMesh] stl does not appear

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By matejfor

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 30, 2021, 08:51
Default stl does not appear
  #1
Member
 
Gabriel
Join Date: Aug 2021
Posts: 37
Rep Power: 4
daylen is on a distinguished road
Hi, I run snappyHexMesh but stl does not appear.
Steps that i have done:
1. create stl in salome
2. put it in geometry folder
3. modify blockmesh for a smaller domain
4. modify surfacefeaturesdict and snappyhexmeshdict with name of the stl
5. run blockmesh, surfacefeatures and shm.


Im using openfoam v9, modified windaroundbuildings tutorial



i attach relevant files:

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

surfaces ("cylinder.stl");

#includeEtc "caseDicts/surface/surfaceFeaturesDict.cfg"

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

#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"

castellatedMesh on;
snap            on;
addLayers       off;

geometry
{
    cylinder
    {
        type triSurfaceMesh;
        file "cylinder.stl";
    }

   /* refinementBox
    {
        type searchableBox;
        min  (  0   0   0);
        max  (250 180  90);
    }*/
};

castellatedMeshControls
{
    features
    (
      { file  "cylinder.eMesh"; level 1; }
    );

    refinementSurfaces
    {
        buildings
        {
            level (3 3);
            patchInfo { type wall; }
        }
    }

    refinementRegions
    {
        refinementBox
        {
            mode    inside;
            level   2;
        }
    }

    locationInMesh (1 1 1);
}

snapControls
{
    explicitFeatureSnap    true;
    implicitFeatureSnap    false;
}

addLayersControls
{
    layers
    {
        "CAD.*"
        {
            nSurfaceLayers 2;
        }
    }

    relativeSizes       true;
    expansionRatio      1.2;
    finalLayerThickness 0.5;
    minThickness        1e-3;
}

meshQualityControls
{}

writeFlags
(
    // scalarLevels
    // layerSets
    // layerFields
);

mergeTolerance 1e-6;

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

backgroundMesh
{
    xMin   -10;//-20; // L = 350
    xMax   10;//330;
    yMin   -10;//-50; // L = 280
    yMax   10;//230;
    zMin   -10;
    zMax   10;//140;
    xCells  10;//25;
    yCells  10;//20;
    zCells  10;//10;
}

convertToMeters 1;

vertices
(
    ($!backgroundMesh/xMin $!backgroundMesh/yMin $!backgroundMesh/zMin)
    ($!backgroundMesh/xMax $!backgroundMesh/yMin $!backgroundMesh/zMin)
    ($!backgroundMesh/xMax $!backgroundMesh/yMax $!backgroundMesh/zMin)
    ($!backgroundMesh/xMin $!backgroundMesh/yMax $!backgroundMesh/zMin)

    ($!backgroundMesh/xMin $!backgroundMesh/yMin $!backgroundMesh/zMax)
    ($!backgroundMesh/xMax $!backgroundMesh/yMin $!backgroundMesh/zMax)
    ($!backgroundMesh/xMax $!backgroundMesh/yMax $!backgroundMesh/zMax)
    ($!backgroundMesh/xMin $!backgroundMesh/yMax $!backgroundMesh/zMax)
);

blocks
(
    hex (0 1 2 3 4 5 6 7)
    (
        $!backgroundMesh/xCells
        $!backgroundMesh/yCells
        $!backgroundMesh/zCells
    )
    simpleGrading (1 1 1)
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 3 7 4)
        );
    }

    outlet
    {
        type patch;
        faces
        (
            (1 5 6 2)
        );
    }

    ground
    {
        type wall;
        faces
        (
            (0 1 2 3)
        );
    }

    frontAndBack
    {
        type symmetry;
        faces
        (
            (0 4 5 1)
            (3 2 6 7)
            (4 7 6 5)
        );
    }

);

// ************************************************************************* //
Attached Files
File Type: zip cylinder.stl.zip (15.7 KB, 1 views)
daylen is offline   Reply With Quote

Old   November 30, 2021, 12:44
Default
  #2
Senior Member
 
matej forman
Join Date: Mar 2009
Location: Brno, Czech Republic
Posts: 182
Rep Power: 17
matejfor is on a distinguished road
In your snappyHexMeshDict in section refinementSurfaces - you forgot to update the surface names. your stl is called cylinder, but you are having buildings surface name in refinementSurfaces.

Make this consistent and things should be better.
daylen likes this.
matejfor is offline   Reply With Quote

Old   November 30, 2021, 15:30
Default
  #3
Member
 
Gabriel
Join Date: Aug 2021
Posts: 37
Rep Power: 4
daylen is on a distinguished road
wow it works!, thank you
daylen 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
[mesh manipulation] How to split stl file? sunagra27 OpenFOAM Meshing & Mesh Conversion 5 March 18, 2021 11:00
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 06:01
[ICEM] STL file! How is it useful? bidi ANSYS Meshing & Geometry 0 December 26, 2016 21:33
[ICEM] Work with imported STL geometry KateEisenhower ANSYS Meshing & Geometry 2 July 9, 2015 10:46
[snappyHexMesh] Experimentally obtained STL file for internal Flow SnappyHexMesh Irish09 OpenFOAM Meshing & Mesh Conversion 9 April 7, 2012 08:50


All times are GMT -4. The time now is 12:20.