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

[snappyHexMesh] snappyHexMesh not respecting the STL defined location

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2020, 03:33
Default snappyHexMesh not respecting the STL defined location
  #1
New Member
 
Join Date: Jun 2019
Posts: 5
Rep Power: 2
Voulet is on a distinguished road
Hi everybody. I try to study how wind is going inside a building.

I'm trying to mesh a volume containing a building (ensemble.stl) which have open vent (ie the .stl has hole)


Here is my blockMesh for a 100x100x100 cube area (50 cells in each direction for now)


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

vertices
(
    (0 0 0)         //0
    (0 100 0)       //1
    (100 100 0)     //2
    (100 0 0)       //3
    (0 0 100)         //4
    (0 100 100)       //5
    (100 100 100)     //6
    (100 0 100)       //7
);

blocks
(
    hex (0 3 2 1 4 7 6 5)
    (50 50 50)
    simpleGrading
    (
        1                  // x-direction expansion ratio
        (
            (0.5 0.5 1)    // 20% y-dir, 38% cells, expansion = 10
            (0.5 0.5 1)    // 80% y-dir, 61% cells, expansion = 1
        )
        1                  // z-direction expansion ratio
    )
);
// http://openfoamwiki.net/index.php/Scripts/blockMesh_grading_calculation
edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 4 5 1)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (3 7 6 2)
        );
    }
    sol
    {
        type wall;
        faces
        (
            (0 3 7 4)
        );
    }
    haut
    {
        type outlet;
        faces
        (
            (5 6 2 1)
        );
    }
    frontAndBack
    {
        type outlet;
        faces
        (
            (0 1 2 3)
            (4 7 6 5)
        );
    }
);

// ************************************************************************* //
And here is my snappyHexMeshDict:


Code:
FoamFile
{
    version 2.0;
    format ascii;
    class dictionary;
    location system;
    object snappyHexMeshDict;
}

    castellatedMesh true;
    snap false;
    addLayers false;
    geometry
    {
        bat
        {
            type triSurfaceMesh;
            file "ensemble.stl";
            centre (25  25 25);
            convertToMeter 1000;
        }
    }

castellatedMeshControls
    {
        maxLocalCells 100000;
        maxGlobalCells 2000000;
        minRefinementCells 0;
        maxLoadUnbalance 0.10;
        nCellsBetweenLevels 3;
        features
        (
        );
        refinementSurfaces
        {
            bat
            {
                level (2 2);
                patchInfo
                {
                    type wall;
                }
            }

        }

        resolveFeatureAngle 30;
        refinementRegions
        {
        }

        locationInMesh (30 30 30 );
        allowFreeStandingZoneFaces false;
    }

    snapControls
    {
        nSmoothPatch 3;
        tolerance 2.0;
        nSolveIter 30;
        nRelaxIter 5;
        nFeatureSnapIter 10;
        implicitFeatureSnap false;
        explicitFeatureSnap true;
        multiRegionFeatureSnap false;
    }

    addLayersControls
    {
        relativeSizes true;
        layers
        {
            "bat.*"
            {
                nSurfaceLayers 3;
            }

        }

        expansionRatio 1.0;
        finalLayerThickness 0.3;
        minThickness 0.1;
        nGrow 0;
        featureAngle 60;
        slipFeatureAngle 30;
        nRelaxIter 3;
        nSmoothSurfaceNormals 1;
        nSmoothNormals 3;
        nSmoothThickness 10;
        maxFaceThicknessRatio 0.5;
        maxThicknessToMedialRatio 0.3;
        minMedianAxisAngle 90;
        nBufferCellsNoExtrude 0;
        nLayerIter 50;
        writeVTK false;
        noErrors false;
        layerRecovery 1;
        growZoneLayers false;
        projectGrownUp 0.0;
    }

    meshQualityControls
    {
        #include "meshQualityDict"
        relaxed
        {
            maxNonOrtho 75;
        }
        nSmoothScale 4;
        errorReduction 0.75;
    }

    writeFlags ( scalarLevels layerSets layerFields );
    mergeTolerance 1e-6;
For now i'm locating the stl a (25 25 25) flying on the cube with:
Code:
geometry
    {
        bat
        {
            type triSurfaceMesh;
            file "ensemble.stl";
            centre (25  25 25);
            convertToMeter 1000;
        }
    }
Then, doeing only castellatedMesh, the resulting building is located at (0 0 0) and it doesn't look like to my .stl at all

Here is my STL:

Here is a view of the resulting building:

Here is a view of its location through the outlet of my cube:

Do you have any idea or directions where i can investigate ?

Thanks.
Voulet is online now   Reply With Quote

Old   February 9, 2020, 12:39
Default
  #2
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
HPE is on a distinguished road
I think you forgot to attach the last set of items.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Old   February 10, 2020, 08:01
Default picture stl
  #3
New Member
 
Join Date: Jun 2019
Posts: 5
Rep Power: 2
Voulet is on a distinguished road
Here are some link to the related pictures:
https://framapic.org/9cocT3wYeE2h/fQY30CBLkzXv.png
https://framapic.org/QPAf8ksJSkWS/fRGTy17ye08p.png
https://framapic.org/7fCXTEwUFL7M/g3DmJkEqEemN.png
https://framapic.org/0vJHEhZWhywx/VF2RHqhE5q0m.png


Here is a link for sharing my case (.tar.gz)
https://framadrop.org/r/ANx42G_5E1#P...sqIrGA3HxpM0c=


(I don't kown why but my previous message was erased, can a moderator tell me what happened ? I'm seen as spam ?)
Voulet is online now   Reply With Quote

Old   February 10, 2020, 08:13
Default
  #4
New Member
 
Join Date: Jun 2019
Posts: 5
Rep Power: 2
Voulet is on a distinguished road
Quote:
Originally Posted by HPE View Post
I think you forgot to attach the last set of items.

Yes indeed, could you tell me how to share some links ? Is it allowed on the forum ? When i post links from picture uploading site or file uploading site to share my files, the post is deleted after 3 or 4 minutes. Also when i try to embeded the picutre in my post with the bbcodeform possibilitys, i don't have the right to post the message i've an error message:



Forbidden

You don't have permission to access /Forums/newreply.php on this server.
Voulet is online now   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
[snappyHexMesh] snappyHexMesh cannot achieve smooth surface from stl alex::cfd OpenFOAM Meshing & Mesh Conversion 2 October 22, 2018 13:39
[snappyHexMesh] snappyHexMesh: How to add layers to part of an STL? Dreoasteh OpenFOAM Meshing & Mesh Conversion 0 May 14, 2018 11:59
[snappyHexMesh] Why does SnappyHexMesh snap out pieces of my stl file? jordan.tracey OpenFOAM Meshing & Mesh Conversion 1 April 21, 2017 07:06
[snappyHexMesh] snappyHexMesh is not using the stl file a_habib OpenFOAM Meshing & Mesh Conversion 8 December 16, 2014 17:50
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21


All times are GMT -4. The time now is 10:08.