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

[snappyHexMesh] Mesh does not follow feature edges

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2022, 12:08
Default Mesh does not follow feature edges
  #1
New Member
 
Schweiz
Join Date: Aug 2022
Posts: 8
Rep Power: 3
michael3000 is on a distinguished road
Hi all,

I'm relatively new to OpenFOAM, so unfortunately I feel completely lost with the following problem and have no idea which knobs to turn:

The case:
  • windAroundBuildings tutorial.
  • I only use a different OBJ file and adjust the dimensions of
    Code:
    backgroundMesh
    and
    Code:
    refinementBox
    in the
    Quote:
    blockMeshDict
    and
    Code:
    snappyHexMeshDict
    , respectively.

What you see in the screenshot:
  • The grey solid volume is from the OBJ and represents the building.
  • The white lines on the building are the feature edges as extracted by
    Code:
    surfaceFeatureExtract
    .
  • The pink lines come from rendering the VTM file as "Feature Edges" in ParaView.

The problem is that the pink feature edges do not follow the actual features of the building nicely. I suspect that
Code:
snappyHexMesh
needs better refinement, but I don't know which parameter to adjust or whether this is even the correct assessment of the problem.
Attached Images
File Type: png Screenshot 2022-08-12 175009.png (128.8 KB, 22 views)
michael3000 is offline   Reply With Quote

Old   August 14, 2022, 01:47
Default
  #2
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
It does seem that some more refinement could help. You have the following options:
- make a finer background mesh by changing the number of cells in blockMeshDict
- volume refinement (the 'box' you're talking about)
- Refine cells on buildings' surfaces
- Refine cells on edges.

Those options are sorted by number of additional cells they will generate.
I'd recommend the 'surfaces' option, just add refinementSurfaces to castellatedMeshControls, then increase level step by step.

https://www.openfoam.comu/documentat...nementSurfaces

If you share your snappy dict, I can show you more precisely.
__________________
www.damogranlabs.com
kandelabr is offline   Reply With Quote

Old   August 15, 2022, 08:53
Default
  #3
New Member
 
Schweiz
Join Date: Aug 2022
Posts: 8
Rep Power: 3
michael3000 is on a distinguished road
Quote:
Originally Posted by kandelabr View Post
If you share your snappy dict, I can show you more precisely.
Thanks a lot for the help! I inserted the snappy dict below. It's directly taken from the
Code:
windAroundBuildings
example.

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

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

castellatedMesh on;
snap            on;
addLayers       off;

geometry
{
    buildings.obj
    {
        type triSurfaceMesh;
        name buildings;
    }

    refinementBox
    {
        type box;
        min  (-97.1975 -110.911 0.0);
        max  (137.1975 150.911 78.0);
    }
}

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

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

    refinementRegions
    {
        refinementBox
        {
            mode inside;
            levels ((1E15 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
(
    noRefinement
    // scalarLevels
    // layerSets
    // layerFields
);

mergeTolerance 1e-6;


// ************************************************************************* //
michael3000 is offline   Reply With Quote

Old   August 15, 2022, 14:42
Default
  #4
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
Code:
    features
    (
      { file  "buildings.eMesh"; level 1; }
    );

    refinementSurfaces
    {
        buildings
        {
            level (3 3);
            patchInfo { type wall; }
        }
    }
Increase the bold numbers and see what happens. First try to set level 4; in features, then also level (4 4); also in surfaces.
__________________
www.damogranlabs.com
kandelabr is offline   Reply With Quote

Old   August 30, 2022, 07:52
Default
  #5
New Member
 
Schweiz
Join Date: Aug 2022
Posts: 8
Rep Power: 3
michael3000 is on a distinguished road
Thanks, that helped and was also a good starting point to learn more about SnappyHexMesh.
michael3000 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
[snappyHexMesh] snappyHexMesh does not detect highly skewed faces? ptpacheco OpenFOAM Meshing & Mesh Conversion 1 January 4, 2022 12:37
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
[surface handling] surfaceFeatureExtract fails to generate .eMesh file from .stl file buckleup OpenFOAM Meshing & Mesh Conversion 1 August 24, 2018 09:44
3D Hybrid Mesh Errors DarrenC ANSYS Meshing & Geometry 11 August 5, 2013 06:42


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