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

no matter what I do, geometry looks rough!

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 14, 2012, 19:18
Default no matter what I do, geometry looks rough!
  #1
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
This was generated with snappyhex.
I tried the settings from the motorbike tutorial, also added region refinements for the entire surface.
Attached Images
File Type: jpg snappyhex.jpg (98.7 KB, 68 views)
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 15, 2012, 12:32
Default
  #2
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Increase you mesh surface refinement and use featureEdges:
http://www.cfd-online.com/Forums/ope...ture-edge.html
lovecraft22 is offline   Reply With Quote

Old   March 15, 2012, 13:09
Default
  #3
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
lovecraft, that has improved the leading edge appearance a bit, but not perfect.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 15, 2012, 13:15
Default
  #4
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
What changes did you make in term of values of refinement?
Also, are you using snappyHexMesh -overwrite? Or just snappyHexMesh? If you're using the latter then you're looking at the wrong time in paraview.
lovecraft22 is offline   Reply With Quote

Old   March 15, 2012, 13:58
Default
  #5
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
I am using overwrite.
I attached the SHM dict.
thank you!
Attached Files
File Type: txt snappyHexMeshDict.txt (1.9 KB, 16 views)
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 15, 2012, 14:02
Default
  #6
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
The levels you set inside the SHMDict depend upon the number of divisions you set for your domain, this is stored inside you blockMeshDict file so please, post that one as well.

How big is this mesh at the end?

Last edited by lovecraft22; March 15, 2012 at 14:33.
lovecraft22 is offline   Reply With Quote

Old   March 15, 2012, 14:08
Default
  #7
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
here is the blockMeshDict and a screenshot showing ParaFoam view with mesh statistics
Attached Images
File Type: jpg meshissue.JPG (95.9 KB, 44 views)
Attached Files
File Type: txt blockMeshDict.txt (884 Bytes, 8 views)
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 15, 2012, 14:29
Default
  #8
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Hi Mihai;

first of all, your domain is composed by blocks that are not cubic. This is something you should probably take care of and make them equal in every direction.

Your block mesh says:

Code:
vertices
(
	(-381.2447	-103.8126	-391.1601)
	(408.2403	-103.8126	-391.1601)
	(408.2403	107.8419	-391.1601)
	(-381.2447	107.8419	-391.1601)
	(-381.2447	-103.8126	391.1601)
	(408.2403	-103.8126	391.1601)
	(408.2403	107.8419	391.1601)
	(-381.2447	107.8419	391.1601)
);
blocks
(
	hex (0 1 2 3 4 5 6 7) (44 44 43) simpleGrading (1 1 1)
);
That means you have 44 subdivision in x and y and 43 in z. Now, since your domain dimensions are (x,y,z)=(789,212,782) m, that means that every cell on the wall domains (level 0) have these dimension: (x,y,z)=(789/44, 212/44, 782/43)=(17,4,18) m.

If you want to keep 18m as the level 0 dimension, than I would suggest you to change the last of the above mentioned lines to:

Quote:
hex (0 1 2 3 4 5 6 7) (44 12 43) simpleGrading (1 1 1)
So, starting from this point, let's evaluate the size of every box on the surface. The maximum level you have is 6 so you'll get:
level 0 --> 18m
level 1 --> 9m
level 2 --> 4.5m
level 3 --> 2.75m
level 4 --> 1.125m
level 5 --> 0.56m
level 6 --> 0.28m --> this is probably to coarse to get the details of the airfoils so I would probably suggest to raise your level up to (7 8) at least.
This should give you a better resolution.

You may also want to change your blockMesh divisions, but this is something I'd do later on and only if you can afford a cell number increase .

So, to summarize, what I'd do now would be:
1. change your blockMesh as mentioned above (increase the number of subdivisions)
2. change your snappyHexMeshDict as mentioned above (increase the level on the plane)
3. run blockMesh
4. run snappyHexMesh

Hope this helps…
lovecraft22 is offline   Reply With Quote

Old   March 15, 2012, 16:34
Default
  #9
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
thanks lore, that has greatly alleviated the problem. I'm going to try levels 8,9.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 15, 2012, 16:36
Default
  #10
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
I'd like to see a picture of the final result if for you is ok.
lovecraft22 is offline   Reply With Quote

Old   March 16, 2012, 09:13
Default
  #11
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
hi lore, it seems that using anything beyond 8 for the top refinement level causes SHM to crash with the current 2000000 max cells global and 100000 local. I'll try to repeat the test on a different machine and get a log.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 16, 2012, 15:46
Default
  #12
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
ok, this is with refinement levels 8 9. Still can see a bit of roughness on the LE.


Here are my SHM dictionary entries:

maxLocalCells 100000;
maxGlobalCells 2000000;
minRefinementCells 0;
maxLoadUnbalance 0.1000;
nCellsBetweenLevels 1;

and...

resolveFeatureAngle 30;
refinementRegions
{
refinementBox
{
mode inside;
levels ((1E15 4));
}
test
{
mode distance;
levels ((0.0001 6) (0.001 5) (0.01 4) (0.1 3) (0.2 2));
}
}

and ...

snapControls
{
nSmoothPatch 3;
tolerance 4.0000;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 10;
}
addLayersControls
{
}
meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minVol 1.000000e-013;
minTetQuality 1.000000e-030;
minArea -1;
minTwist 0.0200;
minDeterminant 0.0010;
minFaceWeight 0.0200;
minVolRatio 0.0100;
minTriangleTwist -1;
nSmoothScale 4;
errorReduction 0.7500;
}
debug 0;
mergeTolerance 1.000000e-00



Any way I can make this faster while still creating a good snapping?
Attached Images
File Type: jpg airplanerefinementlevel89.JPG (88.1 KB, 32 views)
File Type: jpg airplanerefinementlevel89zoom.JPG (86.9 KB, 32 views)
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 16, 2012, 19:31
Default
  #13
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
I see from your pictures you're running your case on a virtual machine on a mac, the same I am actually doing so I have some experience about that and what I can tell is:

there's no way you can run your case nor your mesh that way.

Let's think about it this way:
from what I see from your blockMesh you're trying to run a whole plane.
Now, your mesh depends on a lot of factors, one of these is your plane attitude (cruise, landing, take off). Let's consider the easiest: cruise at 0° AoA so that the wake would be minimal-->wake refinement boxes the smallest.
In this conditions you'll need at least 100.000.000 cells (and yes, that's correct, we are talking about one hundred million cells), no way you can even mesh it on a normal machine, let alone a virtual machine! You'll need a cluster with, at least, 48 processors and it'll still take 7ish hour to mesh.

So, if you want your mesh to get to the end faster you'll need:
1. a cluster (even amazon cloud cluster would be fine if you don't have such a hardware at home/office);
2. to run the process in parallel after decomposing your domain with decomposePar.

If you still want to run it on a virtual machine then:
1. Reduce the size of your domain which is huge (but it must be that way), your results would not be so accurate due to domain blockage;
2. Get rid of your refinement regions, this too will affect your final results.
3. Separate the parts for which the mesh may be coarse (the fuselage) from the ones for which it must be fine (ie the wings) and from the ones for which it must be even finer (ie the wings' trailing and leading edges) to different stl parts/surfaces ad apply to each a different refinement;
4. accept your mesh to be slightly coarse.

I think on a good machine if you use a virtual machine you may be able to run up to 2 million cells, probably no more…
lovecraft22 is offline   Reply With Quote

Old   March 16, 2012, 19:57
Default
  #14
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
thanks for the advice lore.
it is a VM but on Win XP, on a laptop
I need this to look good for a demo. I am creating the case files programmatically.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 16, 2012, 20:03
Default
  #15
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
If you are trying to learn OpenFoam then you should probably start with something smaller…A simple car for instance…

Also, I did not mentioned this but, since your plane is not a bluff body for which alternate vortex shedding occurs, then you can save half the cells by running only a half of your domain and then reflect it on paraview during the post process. That would help a lot!
lovecraft22 is offline   Reply With Quote

Old   March 17, 2012, 10:34
Default
  #16
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
thanks, symmetry will probably be the next step, it's just setting one of the patches in blockMesh to a symmetry condition and only intersecting half the domain of the plane, right?
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 17, 2012, 13:27
Default
  #17
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
That's right, just move one of the lateral planes to the mid of your domain and set it as a symmetry plane. You don't need to adjust your cad files nor you refinement blocks accordingly. Just make sure you point inside the mesh is in the right part of your domain.
lovecraft22 is offline   Reply With Quote

Old   March 17, 2012, 18:54
Default
  #18
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
thank you for all your help!
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   March 17, 2012, 18:55
Default
  #19
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
You're welcome!
lovecraft22 is offline   Reply With Quote

Old   March 18, 2012, 17:12
Default
  #20
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
here's what i got, 1000000 max cells, symmetry on 0 Z normal plane.
Attached Images
File Type: jpg airplane symmetry.jpg (88.4 KB, 43 views)
__________________
Mihai Pruna's Bio
mihaipruna 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
Problem Importing Geometry ProE to CFX fatb0y CFX 3 January 14, 2012 20:42
[DesignModeler] Error while Loading a Geometry JD944 ANSYS Meshing & Geometry 0 October 25, 2011 14:51
Problem meshing an imported geometry Alicia Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 March 30, 2010 04:53
Simulation of Flow through Complex 3D Geometry EmersonKB CFX 5 July 2, 2009 08:17
vitual _ real deneb FLUENT 3 January 22, 2007 05:31


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