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

[snappyHexMesh] blockMesh/snappyHexMesh for refining a coarse mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Marpole

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 29, 2020, 05:05
Exclamation blockMesh/snappyHexMesh for refining a coarse mesh
  #1
Member
 
Tom Waits
Join Date: Aug 2018
Posts: 38
Rep Power: 7
TomWaits is on a distinguished road
I want to have a mesh that is very coarse (to save on computational costs) except for a cylinder in the middle which I want to be very finely meshed.

I use blockMesh to generate a cube with few grid points
Code:
blocks
(
    hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
);
and then I use snappyHexMesh with

Code:
 geometry
 {
     cylinder
     {
         type    searchableCylinder;
         point1  (0.0 0.0 0.0);
         point2  (0.0 0.0 10);
         radius  1.0;
     }
  }
and
Code:
    refinementRegions
    {

        cylinder
        {
            mode inside;
            levels ((10 10));
        }
     }
in my snappyHexMeshDict. The issue is that because the blockMesh is so coarse, snappyHexMesh can't find the cylinder, and the mesh isn't refined. I can add more grid points in each direction in blockMesh in which case it works but then the mesh far away from the cylinder is too fine.

What is the best workflow for this? How do I create a (very) fine cylinder surrounded by very coarse elements?

Many thanks,

Tom Waits
TomWaits is offline   Reply With Quote

Old   October 29, 2020, 10:14
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
The problem with refinementRegions is, that cells must lay inside to be refined. If your blockMesh is too coarse, nothing happens. What you can do is go and grab a CAD tool like FreeCAD, model your cylinder there and import it as slt file. Then you can specify refinementSurfaces to get to your level no matter what the background mesh looks like. I guess you gonna need a cellZone so snappy doesnt cut away the cells inside the cylinder.



Are you sure you want level 10? This might give you an insanely high number of cells.
AtoHM is offline   Reply With Quote

Old   November 1, 2020, 23:35
Default refineMesh
  #3
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
First, I would suggest to make the background mesh relative coarse but not too coarse. With a proper background mesh size, the region refinement can work better.



And I might also want to try refineMesh before snappyHexMesh. You can refer to tutorial DTCHullMoving.
ufocfd likes this.
__________________
Charles L.
Marpole is offline   Reply With Quote

Old   February 10, 2023, 13:57
Default
  #4
Member
 
Giles Richardson
Join Date: Jun 2012
Location: Cambs UK
Posts: 98
Rep Power: 13
ufocfd is on a distinguished road
This is a good reply - I have not used refineMesh before, but in the DTCHull case its used to refine the mesh after blockMesh but before snappyHexMesh. I have a similar issue recently with a coarse blockMesh (1m cells) and then trying to do surface refinement of a sphere STL geometry which is also 1m diameter, and it doesn't get refined (at all) because the background mesh is too coarse.

The issue can be resolved (a workaround) by increasing the size of the sphere to 2m diameter OR reducing the size of the background mesh to 0.5m cells. This seems like a flaw in snappyHexMesh, but the use of refineMesh before snappyHexMesh could also be an good option. Another workaround is to use the feature edges instead to refine the whole surface - this can be done by changing your surfaceFeaturesDict includedAngle from 150 to say 179. This has the effect of selecting all edges of your geometry, as long as you specify the feature edge refinement level needed within SHMDict too.

I wonder how many other people have fallen foul of this quirky behaviour in SHM?

Last edited by ufocfd; February 11, 2023 at 06:03.
ufocfd 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] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 04:17
Star CCM Overset Mesh Error (Rotating Turbine) thezack Siemens 7 October 12, 2016 11:14
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


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