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

[snappyHexMesh] snappyHexMesh and blockMesh for internal flow (leaking geometry?)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 14, 2014, 12:49
Default snappyHexMesh and blockMesh for internal flow (leaking geometry?)
  #1
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
Hi all,
I'm trying to use snappyHexMesh - I'm a beginner - in order to simulate an internal flow with simpleFoam. I'd like to share my preliminary case (no care for the correct refinement or other) because I'm afraid that something is not correct. I'm not sure if something is wrong with dictionaries or tolerances, maybe the geometry model is not perfectly closed and the mesh 'leaks' out.
This is my procedure:
Code:
blockMesh
decomposePar
foamJob -parallel -screen snappyHexMesh -overwrite
reconstructParMesh - constant
If I check the resulting mesh with ParaView, I see that the internal mesh includes the outside background mesh and the space inside the geometry - and I can see the geometry outline. I already checked the locationInMesh vector.
This is the link to download my preliminary case and the 3D model (the STL file is too large fo the the forum limit). I hope that somone can show me the way to fix the problem.
Attached Images
File Type: jpg resultingMesh.jpg (95.5 KB, 162 views)

Last edited by vaina74; November 15, 2014 at 09:27.
vaina74 is offline   Reply With Quote

Old   November 14, 2014, 16:05
Default
  #2
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
What does your snappyHexmeshDict look like? if you post your case i bet people will help debug it
chegdan is offline   Reply With Quote

Old   November 15, 2014, 09:26
Default
  #3
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
Hi Dan, in my thread I included a link to my Dropbox account to download my preliminary case (also with geometry model, so the archive is too large for the forum attachment limit).
Anyway I attach my dictionaries again. If you can take a look, thank you :-)
Attached Files
File Type: zip dictionaries.zip (4.5 KB, 40 views)
vaina74 is offline   Reply With Quote

Old   November 16, 2014, 17:54
Default
  #4
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Had a look at the case and it seems as though the base mesh size was longer in one direction than the other two. This makes the base mesh not cubic, thus making the meshing process behave badly. Attached is a picture of the domain snapping (not refining near the edges) and the snappyHexMeshDict i used. You will need to do some more to capture those edges and use surfaceFeatureExtract to get the featureLines of domain.

testmesh.jpg

snappyHexMeshDict.txt

I also made the base mesh size 0.2 and did not insert any layers. I hope this helps.
chegdan is offline   Reply With Quote

Old   November 18, 2014, 05:04
Default snappyHexMesh and blockMesh for internal flow (improving tips?)
  #5
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
Thanks for your remark, Daniel. I already knew that a 'cubic' background mesh is required, but I didn't realize that I didn't update the previous z-grading setting :-(
I made some tests yesterday and I encountered some problems, related to refining and snapping features. I think I'll also use Helyx and SwiftSnap in the future, but I want to learn snappyHexMesh first.

Refining

Outwardly, the refinement level in snappyHexMeshDict are not applied and I obtain only a 0 level (0.1 m). I can't understand why the refinementSurface settings for all STL surfaces don't work (level (2 3)).

Snapping

I made a first test with the implicitFeatureSnap option but the result was not so good. I enabled the explicitFeatureSnap, but I think that features are not detected. I also set a level 3 for features refinement in order to evidence the edges meshing - am I correct? - but nothing seems to happen.

This leads to a bad resolution of openings shape because the fillets are not resolved (see img1).
Moreover, the geometry shows a critical point where curved surfaces are tangent to plane surfaces (see img2). I can fix the problem with a more simplified 'chamfered' geometry, but I'd like to know a possible solution for a similar case. I already played a little with maxNonOrtho, maxBoundarySkewness, maxInternalSkewness and maxConcave parameters. Maybe could a different resolveFeatureAngle (I used 30) help?
This is the link to my updated case (and geometry).

UPDATE: maybe it's just a problem of maxGlobalCells? I'm going to check now.
Attached Images
File Type: jpg img1.jpg (38.7 KB, 127 views)
File Type: jpg img2.jpg (49.6 KB, 104 views)
Attached Files
File Type: txt snappyHexMeshDict.txt (12.8 KB, 23 views)
vaina74 is offline   Reply With Quote

Old   November 18, 2014, 08:41
Default
  #6
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Quote:
I think I'll also use Helyx and SwiftSnap in the future
I only employed this because it eliminated simple errors. you can always use these applications to setup cases easily and then tweak them afterwards...which is how i work. (disclaimer, i work for the company that makes HELYX-OS)

Your number of cells grows to a number larger than the a maxGlobalCell count so you may want to raise that a bit.

Because those edges are collapsing, I would put a refinement region around that feature or refine according to an emesh file.

The most common reason for snapping and underresolved regions is the base mesh is not small enough. Raise your maxGlobalCells (along with max local Cells too), lower your base mesh size, and try again.Furthermore you may want to try adding an emesh
chegdan is offline   Reply With Quote

Old   November 19, 2014, 12:26
Default
  #7
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
Hi everybody, just some feedbacks and questions - thank you, Daniel!
I made a lot of tests to improve the refinement and snapping quality of my preliminary case. I also must take account of the limits of my hardware configuration and seek a compromise about the global cells number.
As i posted before, I create a (very little) chamfer between the surfaces with collapsing edges. I was able to obtain a good resolution in the critical area and other zones, but 15 M cells were too much (and almost 4 hours for meshing). So I create a larger chamfer (that doesn't affect the simulation) and bring down the number of cells (see img1). A background mesh spacing of 0.2 m is the minimum to resolve the internal structures (see img2) - the block is 30 m x 25 m x 30 m.
About
Quote:
or refine according to an emesh file.
what do you mean Daniel? Do you mean the features refinement level?

Key values of my snappyHexMeshDict are:
- maxLocalCells 1 000 000
- maxGlobalCells 5 000 000
- nCellsBetweenLevels 1
- refinementSurfaces level (1 2) for inlet and outlet openings and (2 3) for the domain walls
- resolve feature angle 30
- refinementRegions levels (1E15 2) - more searchableBoxes close to inlet and outlet openings
- explicitFeatureSnap true (includedAngle 150)
- features refinement level 3
- maxNonOrtho 80 / maxBoundarySkewness 20 / maxInternalSkewness 5 / maxConcave 80

The checkMesh tool complains only about
Code:
Max skewness = 5.061746, 1 highly skew faces detected which may impair the quality of the results
I'd like to understand all snappyHexMeshDict features, something is not clear to me.

1. I define all boundaries in the snappyHexMesh dictionary and I set
Code:
            patchInfo
            {
                type patch;
            }
for inlet and outlet openings and
Code:
            patchInfo
            {
                type wall;
            }
        }
but in ParaView the domain walls are defined as patch in the Mesh Parts list (and I see a proper wall - group anyway). Is it correct?

2. What does it mean planarAngle 30? I found this setting in the original dictionary I edited.

3. I set explicitFeatureSnap true and implicitFeatureSnap false because I used the explicit feature edge handling method. Is possible to activate both and improving the snapping? Does a method exclude the other one?

4. I set
Code:
    features
    (
        {
            file "domain.eMesh";
            level 3;
        }
    );
and domain walls refinement level is 3 too. Is a feature level 3 consistent? Maybe a level 0 is enough.

5. What does it mean
Code:
writeFlags
(
    layerFields     // write volScalarField for layer coverage
);
Thanks for your help, guys.

PS maybe this thread requires now a suited title, could a moderator change that?
Attached Images
File Type: jpg img1.jpg (97.4 KB, 84 views)
File Type: jpg img2.jpg (87.9 KB, 86 views)
vaina74 is offline   Reply With Quote

Old   November 19, 2014, 13:06
Default
  #8
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Quote:
or refine according to an emesh file.
Refine your mesh in terms of distance from an eMesh.

Code:
features
(
    {
        file "myFile.eMesh";
        levels ( (0.0 3) (0.1 2) (0.7 1) );
    }
)
chegdan is offline   Reply With Quote

Old   November 20, 2014, 07:06
Default
  #9
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
Thanks again, Daniel, now I got it. Anyway I didn't know that it's possibile to set a different feature refinement level for each carthesian direction. I hope that you or someone else can answer to the other questions in my previous post, I can't find anything in the forum.
Have a good day.
vaina74 is offline   Reply With Quote

Old   November 20, 2014, 09:06
Default
  #10
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Quote:
Originally Posted by vaina74 View Post
...Anyway I didn't know that it's possible to set a different feature refinement level for each carthesian direction.
No, that is not possible, though that would be an interesting feature . This is in the form of


Code:
features
(
    {
        file "myFile.eMesh";
        levels ( (<distance1> <desiredlevel>) (<distance2> <desiredlevel2>) (<distance3> <desiredlevel3>) );
    }
)
this needs to be in order of distance.
chegdan is offline   Reply With Quote

Old   November 20, 2014, 09:14
Default
  #11
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
Sorry, I'm an idiot. Too much enthusiasm
vaina74 is offline   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] Cylindrical blockmesh to Improve snappyHexMesh Results nicholas.jones OpenFOAM Meshing & Mesh Conversion 3 May 16, 2019 09:52
[snappyHexMesh] Problem and doubts with blockMesh, snappyHexMesh and multiple geometry luca1992 OpenFOAM Meshing & Mesh Conversion 0 August 23, 2017 11:40
snappyhexmesh remove blockmesh geometry philipp1 OpenFOAM Running, Solving & CFD 2 December 12, 2014 10:58
[snappyHexMesh] Internal geometry invisible and merely reflects on blockMesh sgl OpenFOAM Meshing & Mesh Conversion 15 July 5, 2012 20:25
[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 20:19.