CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

problems with sHM: it doesn't snap!

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 13, 2013, 07:26
Default problems with sHM: it doesn't snap!
  #1
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
Dear Foamers,

I'm writing because I'm having many troubles with snappyHexMesh: it doesn't snap!
I know this is "common": looking around in the forum, I found many others who have had similar problems, but none of the suggested solutions seems working in my case!

My best results are:
- one in which, starting from a very coarse background mesh, it does the snap stage, but the final mesh is useless for the simulation;
- another that would be good for the simulation (I think) but it doesn't snap, so all the surface is done by steps!

The strange thing in the second case is that in the log file of sHM I don't find the typical sentence "did not succesfully snap mesh. Giving up", and in the checkMesh I have no errors!

I tried many different combinations with the Dicts (blockMeshDict and snappyHexMeshDict):
- increasing or decreasing the intial number,
- increasing or decreasing the number of levels in sHMDict, directly for the refinementSurface or in the feature obteined with the command surfaceFeatureExtract,
- increasing the parameters in the subDict "snapControls".

Often it doesn't snap, saying "did not succesfully snap mesh. Giving up"; sometimes it doesn't say anithing, but it similarly doesn't snap!

I have no ideas now about what I can do, and about what is wrong!

I attach these two cases I obtained, with some images.
I hope someone could help me!


Best regards,
Claudio
Attached Images
File Type: png with steps 1.png (92.7 KB, 82 views)
File Type: png with steps 2.png (62.6 KB, 80 views)
File Type: png partially snapped.png (78.9 KB, 98 views)
Attached Files
File Type: zip doesn't snap.zip (34.9 KB, 12 views)
File Type: zip too coarse.zip (33.9 KB, 4 views)
Claudio87 is offline   Reply With Quote

Old   August 13, 2013, 09:27
Default
  #2
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
While this doesn't answer all your problems it may help: in the "partially snapped case" I would try reducing the tolerance in snap control to an even lower number (your uploaded case has it at 1.0). I have had similar problems with a fine mesh resolution in the past and it seemed to have helped. I think the problem here might be that the mesh does snap but too many or too few points are attracted to the surface.
Artur is offline   Reply With Quote

Old   August 13, 2013, 10:12
Default
  #3
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
Dear Artur,

thank you for your quick answer!
Effectively, I didn't try to reduce tolerance less than 1: I will! Do you say to try changing just that value, or maybe some other snap parameter? (I tried yet increasing the different numbers of iterations, but nothing seems to change!)

Thank you,
Claudio
Claudio87 is offline   Reply With Quote

Old   August 13, 2013, 10:15
Default
  #4
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
Personally I try to change them one by one because that makes it easier to figure out what the effect of each of them is on your mesh. I would try keeping them as they are at the moment and see where it gets you.
Artur is offline   Reply With Quote

Old   August 14, 2013, 11:18
Default
  #5
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
Dear Artur,

I tried to reduce the tolerance in snap control, as you suggested, but nothing seems changed . In the log of sHM I find a very very long list of warnings like this:

--> FOAM Warning :
From function autoSnapDriver::calcNearestSurface(..)
in file autoHexMesh/autoHexMeshDriver/autoSnapDriver.C at line 914
For point:16 coordinate0.0464325 0.0225236 -0.00174957) did not find any surface within:8.66976e-07 meter.

I tried this with both the cases, partially snapped and without snap stage done.
So, I didn't any new step, as you can see from the pictures attached.
I accept any other suggestion!
Attached Images
File Type: gif toll(0.01).gif (50.9 KB, 31 views)
File Type: gif toll(0.02).gif (92.8 KB, 46 views)
Claudio87 is offline   Reply With Quote

Old   August 14, 2013, 11:33
Default
  #6
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
This warning indicates that the tolerance is reduced too much and so the algorithm can't find a point which is close to the surface and hence it doesn't snap. In which case I'm not sure what's wrong, I'm afraid. If you want you can send me your case by email or upload here and I can have a quick look at it tomorrow.
Artur is offline   Reply With Quote

Old   August 14, 2013, 11:45
Default
  #7
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
I think I could send you my case by email, because the stl is too big to be uploaded here.
If you could have a look I'd be really grateful, because are about 3 weeks I'm fighting with this mesh!
Claudio87 is offline   Reply With Quote

Old   August 15, 2013, 07:57
Default
  #8
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
Try this.

It seems it was one of the mesh quality parameters. Didn't have time to verify which one exactly but I've indicated which ones I changed so you can work it out yourself if you so wish.
Attached Files
File Type: gz newSHM.tar.gz (6.8 KB, 36 views)

Last edited by Artur; August 15, 2013 at 11:33. Reason: Spelling
Artur is offline   Reply With Quote

Old   August 15, 2013, 11:31
Default
  #9
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
Thank you very much Artur. I'll try this tonight, then I'll give you a feedback.
Claudio87 is offline   Reply With Quote

Old   August 16, 2013, 07:53
Default
  #10
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
Dear Artur,

I tried using your suggestions, unfortunely without good results.
I have run it not in parallel, but I don't think this can be the problem. Did you try it and it worked correctly?!

As you can see opening the sHM log files attached, it doesn't snap (the typical sentence "Did not succesfully snap mesh. Giving up." appears!), and I don't understand why: apparently, there are no errors.
The unique warnig gived is like this:

--> FOAM Warning : Displacement (-5.47403e-07 9.12509e-07 3.62186e-06) at mesh point 551088 coord (0.0485061 0.0227736 -0.00144371) points through the surrounding patch faces

after Morph iteration 0.

Moreover, another "error" appear: some closed regions are now meshed, thing doesn't desired! (you can see the difference comparing the images).
Now I'm tring replacing the old control parameters, once per time, to understand which one is the "guilty"!
However, remain my problem: it doesn't snap!


Thank you for your patience!

Claudio
Attached Images
File Type: jpg previous.jpg (21.4 KB, 48 views)
File Type: jpg now.jpg (20.2 KB, 45 views)
Attached Files
File Type: gz sHM log files.tar.gz (16.0 KB, 2 views)
Claudio87 is offline   Reply With Quote

Old   August 16, 2013, 08:13
Default
  #11
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 445
Rep Power: 14
linnemann will become famous soon enough
Hi

Is it possible for you to share the full case with the geometry file etc?

Otherwise the help can get very lengthy if we can play around with all possible options.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   August 16, 2013, 08:29
Default
  #12
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
Just to make sure, I re-ran your case on a single core with the exact same settings as the ones I posted and here's the result. No error messages, checkMesh ok. sHM log says it didn't snap successfully for some reason but by inspecting it I'd say it's snapped. I am running 2.2.0. Perhaps you are using a different version and that's where the problems are coming from?
Attached Images
File Type: jpg screen1.jpg (91.6 KB, 74 views)
File Type: jpg screen2.jpg (90.9 KB, 69 views)
File Type: jpg screen3.jpg (93.6 KB, 71 views)

Last edited by Artur; August 16, 2013 at 08:29. Reason: spelling
Artur is offline   Reply With Quote

Old   August 16, 2013, 09:22
Default
  #13
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
@Artur:

I'm running OF 2.1.0, but looking the images you posted, the result seems the same. I'm just worried about sHM log says it didn't snap successfully. With the snap stage completed I'd expected a smooth surface, instead of that kind of waves on it; but I can't be sure, because my experience is still limited!
If you think this is good enough to try a simulation, I'll start with the next step.

What about the unwanted mesh in the closed zones? Do they appear also to you?


@Niels:

Hi.
Thank you for your answer.
Unfortunately, the geometry file (STL) is too big to post the full case on the forum. But if you want, I can send you it by email (if you give me your address), as I did with Artur.
Claudio87 is offline   Reply With Quote

Old   August 16, 2013, 09:57
Default
  #14
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 226
Rep Power: 6
Artur is on a distinguished road
This setup gives you better snapping and no warnings but for me it produced a few highly skewed faces (although tolerable I think with max skewness 4.5).
Attached Images
File Type: jpg screen1.jpg (93.9 KB, 62 views)
File Type: jpg screen2.jpg (92.3 KB, 61 views)
File Type: jpg screen3.jpg (92.4 KB, 54 views)
Attached Files
File Type: txt snappyHexMeshDict.txt (3.1 KB, 87 views)
Artur is offline   Reply With Quote

Old   August 16, 2013, 10:04
Default
  #15
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
I'll try also this one; it seems better !
Claudio87 is offline   Reply With Quote

Old   August 17, 2013, 06:19
Default
  #16
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 445
Rep Power: 14
linnemann will become famous soon enough
Could you not just use one of the file sharing options we have nowadays like dropbox, box, google drive, skydrive, etc.

They all make it possible to share a public link to a file.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   August 19, 2013, 12:29
Default
  #17
Member
 
Miro
Join Date: Jan 2013
Location: Europe
Posts: 51
Rep Power: 4
miro2000 is on a distinguished road
Hello,

has anyone tried to refine .stl? Your stl should be as fine as possible. Also, you can check if your stl is OK; I use Netgen for that. If your stl passes check in netgen, you can be sure that it is not the problem

sudo apt-get install Netgen
- miro
miro2000 is offline   Reply With Quote

Old   August 19, 2013, 19:27
Default
  #18
Member
 
Claudio
Join Date: Mar 2012
Location: Milano, Italy
Posts: 49
Rep Power: 5
Claudio87 is on a distinguished road
Dear Niels,

here
https://www.dropbox.com/sh/4883og40gjjih86/il5SL7uc0F
there is the link you asked for, with my case (the same I sent to Artur, the one that doesn't snap).
I'm still looking for a better solution, because I did some steps with the help of Artur's suggestions, but it isn't how I would like it!



Dear Miro,

I checked the .stl just using Catia: effectively, there were many "holes" and I had to connect some surfaces. But now it seems to be good; only that, changing some parameters I have the problem I exposed in post #10. I'll check also with Netgen (or gmsh), even if I don't know how to use them...I'll try to learn fast!



Best regards,
Claudio
Claudio87 is offline   Reply With Quote

Old   August 20, 2013, 01:55
Default
  #19
Member
 
Miro
Join Date: Jan 2013
Location: Europe
Posts: 51
Rep Power: 4
miro2000 is on a distinguished road
I'm glad it worked. Note that you should make your .stl as fine as possible.

It's really simple to check stl in netgen. It's something like edit -> checkMesh or something like that. After you import it of-course.

- miro
miro2000 is offline   Reply With Quote

Old   August 22, 2013, 10:14
Default
  #20
Senior Member
 
sivakumar selvaraju
Join Date: Mar 2009
Location: Cape Town - South Africa
Posts: 186
Rep Power: 8
sivakumar is on a distinguished road
Send a message via Skype™ to sivakumar
Dear All,
I have some problem with edge snapping.

the steps I followed is:

1) I executed blockMesh after setting up the case ( 0 cons-> ( poly, trisurf) sys), see fig 1.

2) Secondly, as Bruno's post, the surfaceFeatureExtract command has been executed.
  • surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/fanGeo.stl fanGeo
3) Thirdly, I have edited the sHMDict as below,

castellatedMesh true;
snap true;
addLayers false;

geometry
{
fanGeo.stl
{
type triSurfaceMesh;
name fanGeo;
}

refinementBox
{
type searchableBox;
min (-0.4 0.2 -0.1);
max (0.4 0.8 0.1);
}
};

// Settings for the castellatedMesh generation.
castellatedMeshControls
{

maxLocalCells 2000000;
maxGlobalCells 20000000;
minRefinementCells 3;
maxLoadUnbalance 0.10;
nCellsBetweenLevels 5;

features
(
{
file "fanGeo.eMesh";
level 4;
}
);

refinementSurfaces
{
fanGeo
{
level (4 4);
}
}

// Resolve sharp angles
resolveFeatureAngle 30;

refinementRegions
{

}

locationInMesh (0.15 0.46 1);

allowFreeStandingZoneFaces true;
}

// Settings for the snapping.
snapControls
{
nSmoothPatch 5;
tolerance 1;
nSolveIter 300;
nRelaxIter 5;
nFeatureSnapIter 20;
}

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

nSmoothScale 4;
errorReduction 0.75;
}

I tried many cases, but still the edge of the fan is not on the line. see fig.2 (bladeEdge)

please help me to get the good edge snapping.

Thanks,
Sivakumar
Attached Images
File Type: jpg Fig1.jpg (24.9 KB, 42 views)
File Type: jpg bladeEdge.jpg (64.4 KB, 65 views)
sivakumar is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boundary layer generation problems ivan_cozza OpenFOAM Native Meshers: snappyHexMesh and Others 0 October 6, 2010 13:47
problems with snappyHexMesh StSchiff OpenFOAM 7 August 9, 2010 11:11
snappyHexMesh beginner problems sErik OpenFOAM Native Meshers: snappyHexMesh and Others 1 November 16, 2009 09:47
Two-phase air water flow problems by activating Wall Lubrication Force challenger85 CFX 5 November 5, 2009 06:44
Help required to solve Hydraulic related problems aero CFX 0 October 30, 2006 12:00


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