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

[snappyHexMesh] snappyHexMesh, surfaceFeatureExtract, geometry edge not captured

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By HakikiCanakkaleli
  • 1 Post By HakikiCanakkaleli
  • 1 Post By einstein_zee
  • 1 Post By HakikiCanakkaleli
  • 1 Post By einstein_zee

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2018, 18:38
Default snappyHexMesh, surfaceFeatureExtract, geometry edge not captured
  #1
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Hi everyone,

I'm trying to mesh a semi-sphere. Thus, there is a sharp angle at the trailing edge of my geometry which I need to capture nicely in order to replicate some experiments. The phenomena I'm studying is heavily dependent on geometry definition.

I have tried with several parameters in the snappyHexMeshDict file, and what you see in the files attached is the best I could get.

Any hints, please?
Attached Images
File Type: png geom_andEdges_crop.png (42.7 KB, 146 views)
File Type: png snap_crop.png (75.7 KB, 254 views)
Attached Files
File Type: zip dictionaries.zip (5.2 KB, 25 views)
aerospain is offline   Reply With Quote

Old   March 5, 2018, 10:32
Default
  #2
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
HakikiCanakkaleli is on a distinguished road
Hi,

I had a very quick look:

1. Could you please put a snapshot of the extracted 'features'?

2. Increase

Code:
nFeatureSnapIter   5;
several orders of magnitude? Say 30?

3. Do you really need `features level 11`?

Sorry for very quick observations. I will try to have a look more thoroughly when I have more time.
aerospain likes this.
HakikiCanakkaleli is offline   Reply With Quote

Old   March 9, 2018, 06:19
Default
  #3
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thanks for the reply and questions Hakiki,

I've answered your questions below. I am trying other approaches and will post soon my progress.

cheers!
Quote:
1. Could you please put a snapshot of the extracted 'features'?
The first snapshot, where I show the geometry defined by the STL file, includes the extracted features in red, i.e. the circumference around the base edge.

2. Increase nFeatureSnapIter 5; several orders of magnitude? Say 30?
It doesn't help, I still get a "snatched" edge.

3. Do you really need `features level 11`?
I just went "buzzinga" with this level trying to capture the edge perfectly. My objective was to tweak other variables in that Dict file after that was achieved.
aerospain is offline   Reply With Quote

Old   March 10, 2018, 09:23
Default
  #4
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
HakikiCanakkaleli is on a distinguished road
Hi,

Could you please turn off 'addLayers' and give a shot?

In addition, please reduce
- Explicit feature edge refinement level (considerably)
- Refinement region and surface levels
- nCellsBetweenLevels

and increase several orders:
- maxGlobalCells
- maxLocalCells

If possible, it would be helpful if you share the output streams from the commands.
aerospain likes this.
HakikiCanakkaleli is offline   Reply With Quote

Old   March 10, 2018, 18:00
Default
  #5
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Hello Hakiki,

I have followed your steps. Actually, I had done so already with some of them before you proposed them ;-).
Still no luck!

addLayers has no effect since this command appears after snapping, and it is at this point when we want the edges to be reproduced correctly.

I have reduced and increased the values you mentioned with no effect on the mesh.

I am already looking in using some external software to create the mesh and import it afterwards. Such a 'simple' operation shouldn't be that hard, specially when any relevant geometry, even in the most basic experiments in academia, has sharp edges.

thanks for your time
C.
ps: I'm attaching the logs from each step, i.e. blockMesh - surfaceFeatureExtract - snappyHexMesh - checkMesh
aerospain is offline   Reply With Quote

Old   March 10, 2018, 18:07
Default
  #6
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
HakikiCanakkaleli is on a distinguished road
Hi,

Could you please surfaceCheck your STL file and qualitatively inspect this? Could you please also check wheter STL file and feature's coordinates coincide?

It definitely shouldnt be a problem for snappyHex!
HakikiCanakkaleli is offline   Reply With Quote

Old   March 12, 2018, 08:05
Default
  #7
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Sending zip file with logs from surfaceCheck and surfaceFeatureConvert in order to plot both, the stl and the eMesh files in paraview.

And, two zoomed in views of the geometry, gray surface and blue surface mesh, with the Feature, in white, showing matching at edge.

The look of the base of my geomtry is the one I get from CAD program when exporting to STL file. But, the log file shows the geometry is closed. I remember I did some fixing a couple of weeks ago, I don't remember how now, sorry.
Attached Images
File Type: png viewRear.png (25.3 KB, 78 views)
File Type: png viewSide.png (14.8 KB, 65 views)
Attached Files
File Type: zip surfChecksLogs.zip (2.4 KB, 4 views)
aerospain is offline   Reply With Quote

Old   March 12, 2018, 17:26
Default
  #8
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Dear Kutalmis,

I came back to snappy and trusted your faith in the algorithm Actually, if people were able to do it, why wasn't I able? So, I've dedicated today to find the solution.

I have found it by declaring implicitFeatureSnap true; This way, the rear edge of my hemisphere, and future projectiles, is neatly defined. Right now, the size of the cells on my body's surface are defined by a refinementRegions{ ... } in mode inside;, and I cannot convince SHM to follow the values set in refinementSurfaces{ ... }, and feature{ ... } when explicitFeatureSnap true;.

My workaround for that has been to define a new refinementRegions{ ... } closer to the surface, but this method doesn't allow me to have higher cell size in areas of the body surface where gradients are not strong (to save some mesh size).

Now, my problem is to be able to define a finer mesh around the rear edge of the hemisphere, which I think is related to the cell size around that region.

I'm attaching a snapshot, logs and dictionary.

thanks!
C.
Attached Images
File Type: png closeLookToBL.png (30.0 KB, 129 views)
Attached Files
File Type: zip SHM.logs.zip (11.6 KB, 4 views)
File Type: zip snappyHexMeshDict.zip (4.0 KB, 33 views)
aerospain is offline   Reply With Quote

Old   March 14, 2018, 18:04
Default
  #9
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Dear Kutalmis,

Let me share some initial results with you.

Hemisphere colored with wallShearStress (poor mesh quality near the rear edge)
Streamlines, both 2D from line source and 3D from point source, colored with U
and a z=0 cut plane to show the (very poor) boundary layer mesh.

I am attaching the snappyHexMeshDict too in case you may be able to help me with my next challenge. To be able to increase the level of discretisation near the rear edge. Right now, the fastest solution that comes to my mind is to define a thin cylinder to enclose a region a bit downstream, a bit upstream, and a bit above, the edge, and increase the level of discretisation inside. But, I will be increasing the cell count at the hemisphere rear surface.

Once, I resolve that small challenge, I will be able to perform a mesh convergence study properly.

thanks!
Carlos
Attached Images
File Type: jpg bullet_ar000_meshconv01_someResults.jpg (167.7 KB, 161 views)
Attached Files
File Type: zip meshDicts.zip (5.3 KB, 15 views)
aerospain is offline   Reply With Quote

Old   March 15, 2018, 04:01
Default
  #10
Member
 
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 93
Rep Power: 14
einstein_zee is on a distinguished road
Quote:
Originally Posted by aerospain View Post
Dear Kutalmis,

Let me share some initial results with you.

Hemisphere colored with wallShearStress (poor mesh quality near the rear edge)
Streamlines, both 2D from line source and 3D from point source, colored with U
and a z=0 cut plane to show the (very poor) boundary layer mesh.

I am attaching the snappyHexMeshDict too in case you may be able to help me with my next challenge. To be able to increase the level of discretisation near the rear edge. Right now, the fastest solution that comes to my mind is to define a thin cylinder to enclose a region a bit downstream, a bit upstream, and a bit above, the edge, and increase the level of discretisation inside. But, I will be increasing the cell count at the hemisphere rear surface.

Once, I resolve that small challenge, I will be able to perform a mesh convergence study properly.

thanks!
Carlos
Sorry if it is irrelevant to your question but have you given a shot with cfMesh already?
aerospain likes this.
einstein_zee is offline   Reply With Quote

Old   March 15, 2018, 06:16
Default
  #11
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
HakikiCanakkaleli is on a distinguished road
Hi,

I will take a stab at it when I will have some free time.

Thanks for your understanding in advance
aerospain likes this.
HakikiCanakkaleli is offline   Reply With Quote

Old   March 15, 2018, 07:23
Default
  #12
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Quote:
Originally Posted by einstein_zee View Post
Sorry if it is irrelevant to your question but have you given a shot with cfMesh already?
cfMesh not ready yet to work in Ubuntu 17.10. They've told me to give it another shot in a couple of months, they will let me know when new version is ready

Thanks!
aerospain is offline   Reply With Quote

Old   March 15, 2018, 07:24
Default
  #13
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Quote:
Originally Posted by HakikiCanakkaleli View Post
Hi,

I will take a stab at it when I will have some free time.

Thanks for your understanding in advance
Thanks to you for your time!!!! I'll keep trying other things and sharing them.

C.
aerospain is offline   Reply With Quote

Old   March 15, 2018, 07:59
Default
  #14
Member
 
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 93
Rep Power: 14
einstein_zee is on a distinguished road
Quote:
Originally Posted by aerospain View Post
cfMesh not ready yet to work in Ubuntu 17.10. They've told me to give it another shot in a couple of months, they will let me know when new version is ready

Thanks!
Are you talking about cfMesh Pro ? cause I don't think using cfMesh itself has anything to do with your linux distribution. You can take a look here "https://cfmesh.com/cfmesh-now-adjusted-to-latest-version-openfoam/" which says that the opensource cfMesh is already adapted to OF4.0. And with a little bit of tweak you might also compile it with OF5.0/1712. This means you can simply download it here "https://sourceforge.net/p/cfmesh/code/ci/development/tree/" and use it
aerospain likes this.
einstein_zee is offline   Reply With Quote

Old   March 15, 2018, 08:03
Default
  #15
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Quote:
Originally Posted by einstein_zee View Post
Are you talking about cfMesh Pro ? cause I don't think using cfMesh itself has anything to do with your linux distribution. You can take a look here "https://cfmesh.com/cfmesh-now-adjusted-to-latest-version-openfoam/" which says that the opensource cfMesh is already adapted to OF4.0. And with a little bit of tweak you might also compile it with OF5.0/1712. This means you can simply download it here "https://sourceforge.net/p/cfmesh/code/ci/development/tree/" and use it
Thanks H.,

I've stepped into that page a couple of weeks ago. At this time, I don't have the time to learn how to tweak source codes before compiling them. Too much on my plate these days

But, thank you very much for the links!!!

C.
aerospain is offline   Reply With Quote

Old   March 17, 2018, 07:34
Default
  #16
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Progress update ...

I have decided to use two searchableCylinder to refine regions of my geometry where to expect higher gradients, i.e. front/stagnation area, and rear 90º edge.

Already running mesh convergence, and moderately happy with results.

I'm still concerned with the shape of the BoundaryLayer mesh next to the rear edge. Next step: use relativeSize false. This way, I may prevent shrinking the BoundaryLayer cells. Warning!!! I must be really carefull with first/last cell size, or total BL-layer size. I should NOT forget about surrounding cells level of refinement

Any thoughts???

Attaching images, and example snappyHexMeshDict.
Attached Images
File Type: png mesh_conv_03_frontPerspective_00.png (131.6 KB, 127 views)
File Type: png mesh_conv_03_rearPerspective_00.png (87.9 KB, 119 views)
File Type: png mesh_conv_03_rearPerspective_01.png (43.2 KB, 101 views)
Attached Files
File Type: zip snappyHexMeshDict.zip (4.0 KB, 26 views)
aerospain 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 - geometry does not appear in Mesh czhongrong OpenFOAM Meshing & Mesh Conversion 1 January 20, 2016 05:26
snappyhexmesh remove blockmesh geometry philipp1 OpenFOAM Running, Solving & CFD 2 December 12, 2014 10:58
[snappyHexMesh] SnappyHexMesh Internal Flow Example (Diesel Injector) Irish09 OpenFOAM Meshing & Mesh Conversion 23 July 15, 2013 07:45
[snappyHexMesh] snappyHexMesh keeping internal geometry ThibaudB OpenFOAM Meshing & Mesh Conversion 9 March 22, 2012 15:59
vitual _ real deneb FLUENT 3 January 22, 2007 04:31


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