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

[snappyHexMesh] snappyHexMesh works well for full model, but fails for half model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2017, 15:09
Default snappyHexMesh works well for full model, but fails for half model
  #1
New Member
 
Xiaojie Wang
Join Date: Aug 2017
Posts: 9
Rep Power: 8
xuankushuocai is on a distinguished road
I created the stl file from the Solidworks and then put it into OpenFOAM. It really strange that if I use full model, everything is fine. But if I change blockMeshDict and use half model (the model is symmetric, the range in z direction is from -16 to 16 for full model, and 0 to 16 for half model), there is no layer in the center, also layers are not fully added in other places. It's really strange since I only change the blockMeshDict cutting from the symmetry plane. And it works for another model. Is there anyone who can explain it? Is it the problem of stl file or OpenFOAM code? Thanks so much.

I attached the plots I got after finishing snappyHexMesh. The first two pictures are from the full model case (looking from x direction), and later two are from half model case (looking from x and z direction).
Attached Images
File Type: png full-xdirection.PNG (94.2 KB, 69 views)
File Type: jpg half.jpg (63.9 KB, 64 views)
File Type: png model.PNG (10.7 KB, 58 views)
Attached Files
File Type: txt snappyHexMesh.txt (10.5 KB, 8 views)
File Type: txt blockMeshDict.txt (1.4 KB, 11 views)
xuankushuocai is offline   Reply With Quote

Old   September 1, 2017, 00:49
Default
  #2
New Member
 
Frederik
Join Date: Dec 2015
Location: Germany
Posts: 25
Rep Power: 10
a_slow_old_man is on a distinguished road
I had the same problem before, other times it worked just fine. Maybe someone more experienced with snappyHexMesh might help you find the reason for this.

As a temporary fix:

When this problem occured to me I used the full model and ran a second snappyHexMesh job with only a central plane .stl file along the desired axis, no refinement, no layer addition. Just cutting it in half.
a_slow_old_man is offline   Reply With Quote

Old   September 1, 2017, 11:05
Default
  #3
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
Make sure you set the angles in the layer settings wide enough so the prisms truncate on your symmetry plane.

If you only changed the blockMeshDict locations, then your background mesh (the output of blockMesh) is no longer isotropic. You cut the domain in half, you also must halve the number of points in the cut direction.
me3840 is offline   Reply With Quote

Old   September 3, 2017, 19:07
Default
  #4
New Member
 
Xiaojie Wang
Join Date: Aug 2017
Posts: 9
Rep Power: 8
xuankushuocai is on a distinguished road
Hi Frederik, what do you mean "use full model but central plane stl."?
xuankushuocai is offline   Reply With Quote

Old   September 3, 2017, 19:10
Default
  #5
New Member
 
Xiaojie Wang
Join Date: Aug 2017
Posts: 9
Rep Power: 8
xuankushuocai is on a distinguished road
Quote:
Originally Posted by me3840 View Post
Make sure you set the angles in the layer settings wide enough so the prisms truncate on your symmetry plane.

If you only changed the blockMeshDict locations, then your background mesh (the output of blockMesh) is no longer isotropic. You cut the domain in half, you also must halve the number of points in the cut direction.
How to have points in the cut direction?
xuankushuocai is offline   Reply With Quote

Old   September 4, 2017, 01:29
Default
  #6
New Member
 
Frederik
Join Date: Dec 2015
Location: Germany
Posts: 25
Rep Power: 10
a_slow_old_man is on a distinguished road
Quote:
Originally Posted by xuankushuocai View Post
Hi Frederik, what do you mean "use full model but central plane stl."?
Hello Xiaojie,

as an example take the following cylinder [Attachment: 1.png]

You use a "normal" snappyHexMesh job to cut out the 3D geometry [Attachment: 2.png]

Add a second .stl file along the axis you want to use a s a symmetry axis [Attachment: 3.png]

Now use a different, second snappyHexMeshDict, which you run after the first SHM job, with these changes:

Code:
castellatedMesh true;
snap            true;
addLayers       false;

[...]

    refinementSurfaces
    {

        plane
        {
            // No refinement, just cutting the cells along the plane
            level (0 0);
            patchInfo
            {
                type patch;
            }
        }      
    }
And your result should look like [Attachment: 4.png]

The symmetry plane will have the name of your plane.stl file but you can change that in the 0/polymesh/boundary file


As I said, it is a very dirty kind of way to get to results, if someone with better knowledge of SHM knows a better way you should listen to them.
Attached Images
File Type: jpg 1.jpg (15.5 KB, 63 views)
File Type: jpg 2.jpg (94.9 KB, 67 views)
File Type: jpg 3.jpg (17.1 KB, 67 views)
File Type: jpg 4.jpg (63.7 KB, 69 views)
a_slow_old_man is offline   Reply With Quote

Old   September 5, 2017, 11:39
Default
  #7
New Member
 
Xiaojie Wang
Join Date: Aug 2017
Posts: 9
Rep Power: 8
xuankushuocai is on a distinguished road
Quote:
Originally Posted by a_slow_old_man View Post
Hello Xiaojie,

as an example take the following cylinder [Attachment: 1.png]

You use a "normal" snappyHexMesh job to cut out the 3D geometry [Attachment: 2.png]

Add a second .stl file along the axis you want to use a s a symmetry axis [Attachment: 3.png]

Now use a different, second snappyHexMeshDict, which you run after the first SHM job, with these changes:

Code:
castellatedMesh true;
snap            true;
addLayers       false;

[...]

    refinementSurfaces
    {

        plane
        {
            // No refinement, just cutting the cells along the plane
            level (0 0);
            patchInfo
            {
                type patch;
            }
        }      
    }
And your result should look like [Attachment: 4.png]

The symmetry plane will have the name of your plane.stl file but you can change that in the 0/polymesh/boundary file


As I said, it is a very dirty kind of way to get to results, if someone with better knowledge of SHM knows a better way you should listen to them.
Thanks a lot for your explanation. I will try.
xuankushuocai is offline   Reply With Quote

Old   November 21, 2018, 10:04
Default
  #8
New Member
 
Join Date: Jul 2017
Posts: 1
Rep Power: 0
devil_09 is on a distinguished road
would you please attach the two snappyhexmeshdict files , especially the second one, i wasn't quite clear how does it the second one works?
devil_09 is offline   Reply With Quote

Reply

Tags
snappyhexmesh half_model


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
Error while importing Solid Works Model into Star CCM Sandy7 STAR-CCM+ 3 December 19, 2016 11:21
about Subgrid-scale model impecca OpenFOAM Running, Solving & CFD 4 December 20, 2013 10:36
[snappyHexMesh] SnappyHexMesh fails with internal Zones chossfeld OpenFOAM Meshing & Mesh Conversion 1 January 27, 2011 08:29
mulitphase model that works with implicit solver? rabaeto FLUENT 0 August 9, 2005 11:53
How EDM model works in CFX-5? cfd guy CFX 2 June 20, 2002 10:35


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