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

[snappyHexMesh] Howto set mesh size tolerance

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2012, 13:39
Default Howto set mesh size tolerance
  #1
Member
 
ms
Join Date: Mar 2009
Location: West London
Posts: 47
Rep Power: 17
anothr_acc is on a distinguished road
Hi everyone,

I'm using the snappyHexMesh castellatedMesh step on its own, to refine up to 7 or 8 levels from an original blockMesh with nCellsBetweenLevels 3. I have a surface defined in an STL file. The surface is being picked up ok but as I increase my refinement level beyond 6 I start getting 0 determinant cells and checkMesh tells me I have nearPoints (closer than 1.5e-06 apart). Yet, inspection of the problem cells in paraFoam shows good looking cubes that are in reasonable places. It is possible that snappy is stopping before full refinement has occurred but I wonder:

How can I tighten the spatial tolerances in snappy?

I have adjusted my controlDict writePrecision to 8 and my mergeTolerance in snappyHexMeshDict to 1E-8 but this seems not to help. Any pointers would be welcome!

Best regards,

Mark.
anothr_acc is offline   Reply With Quote

Old   July 20, 2012, 12:05
Default
  #2
Member
 
ms
Join Date: Mar 2009
Location: West London
Posts: 47
Rep Power: 17
anothr_acc is on a distinguished road
I also set minVol to -1E30 to turn off the minimum volume checker: still the same effect.

Please, if anyone has any comment, I'd like to hear it! Snapping to the .stl is working wonderfully, the mesh looks good and I've almost got layer addition working but if I can't beat this single, zero determinant cell this is a no-go!

Cheers,

Mark.
anothr_acc is offline   Reply With Quote

Old   July 20, 2012, 15:23
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Mark,

Did you see this at the bottom of "snappyHexMeshDict"?
Code:
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;


edit: I advise you to use "binary" mode in "controlDict", instead of "ascii".

Best regards,
Bruno
__________________

Last edited by wyldckat; July 20, 2012 at 15:37. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   July 23, 2012, 02:55
Default
  #4
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
I advise you to use "binary" mode in "controlDict", instead of "ascii".
Hi Bruno,

Could you explain why ?

Best regards,
Rider.
Rider is offline   Reply With Quote

Old   July 23, 2012, 05:23
Default
  #5
Member
 
ms
Join Date: Mar 2009
Location: West London
Posts: 47
Rep Power: 17
anothr_acc is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Mark,

Did you see this at the bottom of "snappyHexMeshDict"?
Code:
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;


edit: I advise you to use "binary" mode in "controlDict", instead of "ascii".

Best regards,
Bruno
Hi Bruno, thanks for responding.

I did spot that parameter and experimented with it. I'd convinced myself it wasn't helping. I'll try again. Regarding binary mode, I hadn't considered it. Great idea!

Thanks again,

Mark.
anothr_acc is offline   Reply With Quote

Old   July 23, 2012, 10:19
Default
  #6
Member
 
ms
Join Date: Mar 2009
Location: West London
Posts: 47
Rep Power: 17
anothr_acc is on a distinguished road
My single zero determinant is now a tiny determinant: 7E-46. Thanks for the tip.

As for the difference between ascii and binary mode:

ascii: 164 Mb per time-step.
binary: 79Mb per time-step.

Lovely.
anothr_acc is offline   Reply With Quote

Old   July 23, 2012, 17:19
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!
Quote:
Originally Posted by anothr_acc View Post
My single zero determinant is now a tiny determinant: 7E-46. Thanks for the tip.

As for the difference between ascii and binary mode:

ascii: 164 Mb per time-step.
binary: 79Mb per time-step.

Lovely.
Yep, if the mesh needs high detail, you'll need to preserve as much information as possible for the mesh in question, as well as the results for the simulation.

Quote:
Originally Posted by Rider View Post
Hi Bruno,

Could you explain why ?

Best regards,
Rider.
ASCII is a nice format for:
  • Debugging manually the results, using a text editor.
  • Getting higher compression ratios when using gzip.
But it's cumbersome if you need precision. Binary saves the full 8 bytes in double precision, which would require ASCII about 14 digits and 6 more characters for the (almost) same precision: 0.12345678901234e-308

And as confirmed by Mark, the more precision you have for the mesh, the merrier the user

Best regards,
Bruno
__________________

Last edited by wyldckat; July 23, 2012 at 17:22. Reason: typo
wyldckat is offline   Reply With Quote

Old   July 24, 2012, 10:32
Default
  #8
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
Thank you both for your clarification
Rider is offline   Reply With Quote

Old   July 25, 2012, 04:51
Default Update
  #9
Member
 
ms
Join Date: Mar 2009
Location: West London
Posts: 47
Rep Power: 17
anothr_acc is on a distinguished road
I've now changed to binary format in all my simulations. Great tip, Bruno. I've also adjusted my tolerances. However, the zero determinant that turned into a tiny determinant with a change of tolerances, vanished when I changed my snappyHexMeshDict:castellatedMeshControls parameter,

Code:
refinementSurface { anemometer { level (7 7); } }
to

Code:
refinementSurface { anemometer { level (8 8); } }
This occurs at the castellation phase.

In fact, I get something like the following:

Code:
level       minimum 
            determinant
(2 2)            1
(3 3)            1
(4 4)            1
(5 5)            1
(6 6)            1
(7 7)            0 (or very small with tight spatial tolerances
(8 8)            1
I am going to use (8 8) for now and accept that my mesh is overly refined. Hopefully my y+ won't get too small. In short, I have another problem and I don't know why it occurs but am moving on as results are required. Still, I improved my Openfoam! Thanks for your help.

Best regards,

Mark.
anothr_acc is offline   Reply With Quote

Old   July 25, 2012, 13:46
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Mark,

I've picked up on this post which should help you a lot:
Quote:
Originally Posted by elvis View Post
there is a brilliant tutorial (download and untar it "tar -xzf ") I believe it will guide you throught most of your SHM questions
The full link to where the tutorial is: http://www.openfoamworkshop.org/2012...enedeVilliers/

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 28, 2012, 13:17
Default
  #11
Member
 
ms
Join Date: Mar 2009
Location: West London
Posts: 47
Rep Power: 17
anothr_acc is on a distinguished road
Read it and digested. Cheers Bruno.
anothr_acc 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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Meshing & Mesh Conversion 14 December 12, 2018 08:07
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 07:21


All times are GMT -4. The time now is 23:47.