CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] no matter what I do, geometry looks rough! (https://www.cfd-online.com/Forums/openfoam-meshing/98618-no-matter-what-i-do-geometry-looks-rough.html)

mihaipruna March 14, 2012 18:18

no matter what I do, geometry looks rough!
 
1 Attachment(s)
This was generated with snappyhex.
I tried the settings from the motorbike tutorial, also added region refinements for the entire surface.

lovecraft22 March 15, 2012 11:32

Increase you mesh surface refinement and use featureEdges:
http://www.cfd-online.com/Forums/ope...ture-edge.html

mihaipruna March 15, 2012 12:09

lovecraft, that has improved the leading edge appearance a bit, but not perfect.

lovecraft22 March 15, 2012 12:15

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.

mihaipruna March 15, 2012 12:58

1 Attachment(s)
I am using overwrite.
I attached the SHM dict.
thank you!

lovecraft22 March 15, 2012 13:02

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?

mihaipruna March 15, 2012 13:08

2 Attachment(s)
here is the blockMeshDict and a screenshot showing ParaFoam view with mesh statistics

lovecraft22 March 15, 2012 13:29

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…

mihaipruna March 15, 2012 15:34

thanks lore, that has greatly alleviated the problem. I'm going to try levels 8,9.

lovecraft22 March 15, 2012 15:36

I'd like to see a picture of the final result if for you is ok.

mihaipruna March 16, 2012 08:13

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.

mihaipruna March 16, 2012 14:46

2 Attachment(s)
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?

lovecraft22 March 16, 2012 18:31

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…

mihaipruna March 16, 2012 18:57

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.

lovecraft22 March 16, 2012 19:03

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!

mihaipruna March 17, 2012 09:34

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?

lovecraft22 March 17, 2012 12:27

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.

mihaipruna March 17, 2012 17:54

thank you for all your help!

lovecraft22 March 17, 2012 17:55

You're welcome!

mihaipruna March 18, 2012 16:12

1 Attachment(s)
here's what i got, 1000000 max cells, symmetry on 0 Z normal plane.


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