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

[snappyHexMesh] SnappyHexMesh refuses to refine certain edges

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By SirWombat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2012, 09:49
Default SnappyHexMesh refuses to refine certain edges
  #1
New Member
 
Tom Potters
Join Date: Jul 2009
Posts: 14
Rep Power: 17
TomP is on a distinguished road
Dear all,

I have the following problem. I'm trying to mesh a radial fan with snappyHexMesh and for some reason it refines certain edges in the emesh file while it refuses to do it for others. Basically the blades are ok but the edges on the plates are not refined at all. Below you can find a picture of the mesh and the emesh file. The snappyHexMeshDict is also included in attachement. Anybody experienced this problem before?



Tom
Attached Images
File Type: jpg mesh.jpg (99.3 KB, 1156 views)
File Type: jpg feature.jpg (50.8 KB, 746 views)
Attached Files
File Type: txt snappyHexMeshDict.txt (10.9 KB, 188 views)
TomP is offline   Reply With Quote

Old   May 2, 2012, 13:41
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Have you checked the eMesh files to ensure that the edge has been detected? Other than that, you may want to try changing the includedAngle option when running surfaceFeatureExtract. 91 seems to work pretty well for sharp edges.
mturcios777 is offline   Reply With Quote

Old   May 3, 2012, 03:48
Default
  #3
New Member
 
Tom Potters
Join Date: Jul 2009
Posts: 14
Rep Power: 17
TomP is on a distinguished road
I investigated the issue somewhat further and so far this is what I found:
  • The edge is properly detected as can be seen in the second picture of my previous post. I used an angle of 150º which should detect all angles smaller than this value.
  • when I run snappyHexMesh it recognizes the feature edges but isn't able to find any featurePoints for the plates. I don't know what the definition of a featurePoint is but it seems to be the spot where a feature line starts. Because the feature edge is a circle there is no start and no end and therefore no FeaturePoints.
  • I can resolve it by setting the feature angle to 179. At that point the featureEdges are those of a cylinder with a certain number of sides (see the attached figures).
Personally I find this a rather bad fix (this setting also detect nearly every triangle in the blades) and I'm still wondering whether I'm doing something wrong or this just is a bug.

Tom
Attached Images
File Type: jpg mesh-plate.jpg (88.9 KB, 693 views)
File Type: png feature-plate.PNG (54.4 KB, 450 views)
TomP is offline   Reply With Quote

Old   May 3, 2012, 05:46
Default
  #4
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
Quote:
Originally Posted by TomP View Post
I don't know what the definition of a featurePoint is but it seems to be the spot where a feature line starts. Because the feature edge is a circle there is no start and no end and therefore no FeaturePoints.

I don't know either what FeaturePoints are, but you might try the following (as you probably already did for viewing the features in parafoam):

surfaceFeatureConvert TLR200x62E-real.eMesh TLR200x62E-real.obj

Then import the "TLR200x62E-real.obj" in Blender (www.blender.org).
  • Use MouseRightClick (==RMC) to select the Objects.
  • Use "A" to deselect.
  • Use "del" to delete objects, e.g. that standard box in the center.

Now enter Edit Mode by hitting "tab". You may now select single vertices on your "circle"-feature-edge and delete a few, so not to have a full circle.


After that, leave the Edit Mode by hitting "tab" again. Select all lines on screen using "Shift+RMC" or hit "A" twice. Then use "File -> Export -> Wavefront (.obj)" to export.

You may now convert the .obj back to your .eMesh file by using

surfaceFeatureConvert blender_edited_file.obj TLR200x62E-real.eMesh

I know this is a little tricky, especially when not having used Blender before, but it's a good way to get exactly those feature lines you want.

You may just attach your "stl", so we could give it a try.

Greets from Berlin,
SirWombat
elvis, Tobi and dickcruz like this.
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   May 3, 2012, 10:51
Default
  #5
New Member
 
Tom Potters
Join Date: Jul 2009
Posts: 14
Rep Power: 17
TomP is on a distinguished road
I agree that this is a workaround but not one I want to use when there are lots of these loops in my geometry. Also in blender I would not delete vertices because this removes the conected edges. It is better to select an edge (in edge select mode) an then press 'y'. This will separate this edge from the loop, effectively interupting the loop without loosing any valuable geometry. When you export to obj be sure to uncheck the export materials.
The resulting obj file isn't usable as such. Blender puts and f (probably from face) in front of the line definitions. This was quickly resolved by a find and replace in a text editor but it constitutes and extra step. Now you can convert the obj file back to the emesh format. But this file can't be used by snappyHexMesh. In the the header the time of creation is mentioned just before the object name. In a regular emesh file this is the location and snappyHexMesh needs the location or at least it doesn't like the creation date before the object name.
The result of this procedure is shown below. For the ring I interupted the edges and for the plate I did not. Still I think snappyhexMesh should recognize edge loops for refinement. I also added the stl file with the plates in attachement.
Attached Images
File Type: jpg mesh-blender.jpg (85.2 KB, 407 views)
Attached Files
File Type: zip TLR200x62E-plate.zip (20.1 KB, 23 views)
TomP is offline   Reply With Quote

Old   May 4, 2012, 04:24
Default
  #6
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
Thx for the detailed description of the conversion from Blender .obj to OpenFOAM .eMesh I totally forget about that.
Seperating the edge instead of deleting a vertex seems a perfekt idea!
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   May 10, 2012, 09:15
Default
  #7
New Member
 
Tom Potters
Join Date: Jul 2009
Posts: 14
Rep Power: 17
TomP is on a distinguished road
A small update:
Feature points are points that are connected to more than 2 edges (e.g. corners of a cube). They are not the cause of the problems, because interrupting a loop actually brings down the number of connected edges.
So far edge refinement works as long as we interrupt the loop or we detect nearly every edge in the geometry. We just don’t know why.

There is something else I noticed. In the duct geometry for the fan I isolated the rim edge as a separate surface so that I could set a separate refinement level for it. Initially I only set the feature edge refinement level (of the rim) to a higher value but it didn’t refine near the rim. When I also raised the surface refinement level of the rim it still didn’t refine. Apparently I had to refine the attached housing geometry up to a certain level before it even noticed the rim. Once it “knows” it’s there everything again works as expected. Any thoughts on this?
Attached Images
File Type: png rim.PNG (76.1 KB, 494 views)
TomP is offline   Reply With Quote

Old   May 10, 2012, 10:14
Default
  #8
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
This may be a silly question but have you tried increasing this value here:

Quote:
nFeatureSnapIter 10;
lovecraft22 is offline   Reply With Quote

Old   June 13, 2012, 09:45
Default
  #9
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Resolved.

http://www.openfoam.org/mantisbt/view.php?id=552
kalle is offline   Reply With Quote

Old   October 24, 2013, 11:31
Default
  #10
Member
 
R. P.
Join Date: Jul 2010
Posts: 73
Rep Power: 16
Rophys is on a distinguished road
Hi all,

I'm having some problems to get a very defined curve using the sHM. Please, see images attached. Anyone have some idea in how to improve this part of my mesh ?

I already tried the surfaceFeatureExtract and it didn't work.

Thanks a lot.
Attached Images
File Type: jpg fig1.jpg (86.1 KB, 557 views)
File Type: jpg fig2.jpg (36.2 KB, 479 views)
File Type: jpg fig2zoom.jpg (23.8 KB, 453 views)
Rophys is offline   Reply With Quote

Old   October 25, 2013, 07:13
Default
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Rophys,

you have to refine the cells in this Region.
Therefor you have a lot of opportunitys to do that.

a) Refine the surface there
b) build a closed surface around this Corner and refine the Region there
c) normally it should be possible to do it with the featureEdges (but as you said it is not working)

Your Problem does not depend on the "surfaceFeatureExtract". This tool is for exploding the edges out of your geometry so that openfoam can snap the cell vertex to that lines. But if you have just one cell that goes around the whole curve it is not possible to get a better resolution

Regards Tobi
Tobi is offline   Reply With Quote

Old   October 25, 2013, 07:34
Default
  #12
Member
 
R. P.
Join Date: Jul 2010
Posts: 73
Rep Power: 16
Rophys is on a distinguished road
Thanks Tobi,

I'll try your hints.
Rophys is offline   Reply With Quote

Old   February 8, 2014, 05:58
Default
  #13
New Member
 
Nejc Brelih
Join Date: Apr 2013
Posts: 5
Rep Power: 13
NejcB is on a distinguished road
Quote:
Originally Posted by Rophys View Post
Hi all,

I'm having some problems to get a very defined curve using the sHM. Please, see images attached. Anyone have some idea in how to improve this part of my mesh ?

I already tried the surfaceFeatureExtract and it didn't work.

Thanks a lot.
Hi Rophys,

Maybe you could try with the minVolCollapseRatio enabled under meshQualityControls.

Regards,
Nejc
NejcB is offline   Reply With Quote

Old   November 14, 2014, 22:39
Default surface refinement problem
  #14
New Member
 
sd
Join Date: May 2014
Posts: 14
Rep Power: 12
OvGU is on a distinguished road
I was able to creat a layer and refinement over surface but still found some refinement problem on surface. If anybody can give some idea ...........


FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true; // make basic mesh ?
snap true; // decide to snap back to surface ?
addLayers true;//false; // decide to add viscous layers ?


geometry // Load in STL files here
{
inlet_1.stl {type triSurfaceMesh; name inlet_1;}
outlet.stl {type triSurfaceMesh; name outlet;}
inlet_2.stl {type triSurfaceMesh; name inlet_2;}
inlet_3.stl {type triSurfaceMesh; name inlet_3;}
wall.stl {type triSurfaceMesh; name wall;}
//cylinder.stl {type triSurfaceMesh; name volume;}
refineCylinder {type searchableCylinder; point1 (0 0 0); point2 (0 0 2); radius 0.13;}
//refinementBox {type searchableBox; min (-0.5 -0.5 -0.5); max ( 0.5 0.5 0.5);}
};

castellatedMeshControls
{
maxLocalCells 1000000; //max cells per CPU core
maxGlobalCells 2000000; //max cells to use before mesh deletion step
minRefinementCells 10; //was 0 - zero means no bad cells are allowed during refinement stages
maxLoadUnbalance 0.10;
nCellsBetweenLevels 1; // expansion factor between each high & low refinement zone

// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

features // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command
(
{file "inlet_1.eMesh"; level 2;}
{file "outlet.eMesh"; level 2;}
{file "wall.eMesh"; level 3;}
{file "inlet_2.eMesh"; level 2;}
{file "inlet_3.eMesh"; level 2;}
);

// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~

refinementSurfaces // Surface-wise min and max refinement level
{
inlet_1 {level (2 2);}
outlet {level (2 2);}
wall {level (5 5);}
inlet_2 {level (2 2);} // was 4 4
inlet_3 {level (2 2);} // was 4 4
}


resolveFeatureAngle 80; // Resolve sharp angles // Default 30
refinementRegions // In descending levels of fine-ness
{refineCylinder {mode distance; levels ((1E15 2));}} // (0.002 3) (0.01 2));}} // was ((0.001 4) (0.003 3) (0.01 2))
locationInMesh (0.01 0.01 0.01); //to decide which side of mesh to keep **
allowFreeStandingZoneFaces true;
}


// Settings for the snapping.
snapControls
{
nSmoothPatch 3;
tolerance 4.0;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 15; // default is 10

// New settings from openfoam 2.2 onwards for SHMesh

implicitFeatureSnap false; // default is false - detects without doing surfaceFeatureExtract
explicitFeatureSnap true; // default is true
multiRegionFeatureSnap false; // deafault is false - detects features between multiple surfaces

}



// Settings for the layer addition.
addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName
{
relativeSizes false; // was true
layers
{
wall
{nSurfaceLayers 3;} // was 3
//visc_refine_1
// {nSurfaceLayers 3;} // was 3
//visc_refine_2
// {nSurfaceLayers 3;} // was 3
}

expansionRatio 1.3;
finalLayerThickness 0.00016; //was 0.00016
minThickness 0.00008; //was 0.00008
nGrow 0; // was 1


// Advanced settings

featureAngle 80; // was 70 //- When not to extrude surface. 0 is flat, 90 is right angle.
nRelaxIter 3; //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh.
nSmoothSurfaceNormals 1; // Number of smoothing iterations of surface normals
nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction
nSmoothThickness 10; // Smooth layer thickness over surface patches
maxFaceThicknessRatio 0.5; // Stop layer growth on highly warped cells
maxThicknessToMedialRatio 0.3; // Reduce layer growth where ratio thickness to medial distance is large
minMedianAxisAngle 130; // Angle used to pick up medial axis points
nBufferCellsNoExtrude 0; // Create buffer region for new layer terminations
nLayerIter 50; // Overall max number of layer addition iterations
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minTetQuality 1e-9;
minArea -1;
minTwist 0.02;
minDeterminant 0.001;
minFaceWeight 0.02;
minVolRatio 0.01;
minTriangleTwist -1;

// Advanced

nSmoothScale 4;
errorReduction 0.75;
}

// Advanced

debug 0;


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;
Attached Images
File Type: jpg mesh.jpg (59.5 KB, 312 views)
OvGU is offline   Reply With Quote

Old   August 30, 2017, 11:19
Default Corner edge of cube are not detecting Sharply by snappy Hexamesh
  #15
New Member
 
Shadab Mohammed
Join Date: Aug 2017
Posts: 14
Rep Power: 12
Shadab is on a distinguished road
Hello every one,

I have a simple Geometry of cube containing inlet , outlet and a solid cube, I am interested in studying the heat transfer by using chtMultiregionSimpleFoam. I have tried to mesh the geometry by by snappyHexamesh. The edges of the cube is not capturing properly by snappyHexamesh, the view of mesh is given below. I have changed the include angle from 150 to 180, still I am unable to solve this problem.

I am attaching my blockMeshDict, snappyHexamesh and surfaceFeatureextractDict.

I also have a problem of giving 10 layers with in a total layer thickness of 0.04m which is also failing. In another case it forms 7 layers on 0.5 maximum layer thickness and it is not forming at the corners of cube.


Thanks In Advance
Shadab
Attached Images
File Type: png mesh.png (159.5 KB, 147 views)
File Type: png mesh_innerview.png (83.5 KB, 158 views)
Attached Files
File Type: gz blockMeshDict.tar.gz (650 Bytes, 5 views)
File Type: gz snappyHexMeshDict.tar.gz (3.8 KB, 10 views)
File Type: gz surfaceFeatureExtractDict.tar.gz (571 Bytes, 8 views)
Shadab is offline   Reply With Quote

Reply

Tags
edge, feature, snappyhexmesh


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 sticking point natty_king OpenFOAM Meshing & Mesh Conversion 11 February 20, 2024 10:12
[snappyHexMesh] SnappyHexMesh running killed! Mark JIN OpenFOAM Meshing & Mesh Conversion 7 June 14, 2022 02:37
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 18:16
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 04:23


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