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] snappy works but does not add layers...why? (https://www.cfd-online.com/Forums/openfoam-meshing/115149-snappy-works-but-does-not-add-layers-why.html)

sandy13 March 25, 2013 05:28

snappy works but does not add layers...why?
 
2 Attachment(s)
Dear foamers,
Please any body can help me. My snappy utility for my work, but it does not add layers. My geometry and the snappy is like in photos, can any one have a go on my snappy dictionary below..
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap true;
addLayers true;

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


castellatedMeshControls
{
maxLocalCells 500000;
maxGlobalCells 1000000;
minRefinementCells 100;
nCellsBetweenLevels 6;
features
();
refinementSurfaces
{
injector
{
level (4 3);
}
}

refinementRegions
{
}
resolveFeatureAngle 200;

locationInMesh (0 0 0);
allowFreeStandingZoneFaces false;
}
snapControls
{
nSmoothPatch 3;
tolerance 4;
nSolveIter 60;
nRelaxIter 5;
}
addLayersControls
{
relativeSizes true;
layers
{
injector
{
nSurfaceLayers 4;
}
}/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap true;
addLayers true;

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


castellatedMeshControls
{
maxLocalCells 500000;
maxGlobalCells 1000000;
minRefinementCells 100;
nCellsBetweenLevels 6;
features
();
refinementSurfaces
{
injector
{
level (4 3);
}
}

refinementRegions
{
}
resolveFeatureAngle 200;

locationInMesh (0 0 0);
allowFreeStandingZoneFaces false;
}
snapControls
{
nSmoothPatch 3;
tolerance 4;
nSolveIter 60;
nRelaxIter 5;
}
addLayersControls
{
relativeSizes true;
layers
{
injector
{
nSurfaceLayers 4;
}
}
expansionRatio 1.0;
finalLayerThickness 0.3;
minThickness 0.1;
nGrow 1;
featureAngle 30;
nRelaxIter 3;
nSmoothSurfaceNormals 1;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedianAxisAngle 130;
nBufferCellsNoExtrude 1;
nLayerIter 50;
}
meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minVol 1e-13;
minTetQuality 1e-30;
minArea -1;
minTwist 0.05;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;
nSmoothScale 4;
errorReduction 0.75;
minFlatness 0.5;
}

debug 0;
mergeTolerance 1e-6;

expansionRatio 1.0;
finalLayerThickness 0.3;
minThickness 0.1;
nGrow 1;
featureAngle 30;
nRelaxIter 3;
nSmoothSurfaceNormals 1;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedianAxisAngle 130;
nBufferCellsNoExtrude 1;
nLayerIter 50;
}
meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minVol 1e-13;
minTetQuality 1e-30;
minArea -1;
minTwist 0.05;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;
nSmoothScale 4;
errorReduction 0.75;
minFlatness 0.5;
}

debug 0;
mergeTolerance 1e-6;

Sandy,

wyldckat March 25, 2013 16:18

Quick answer: Check the second tutorial at this page: http://openfoamwiki.net/index.php/Sn...als_and_Guides - namely the one from the 7th OpenFOAM Workshop

sh.d May 16, 2013 05:17

help
 
hi sandy
i create geometry in solid and save it .stl
but when open in linux its there is wrong
can you help me?

sandy13 May 16, 2013 05:35

ascci stl
 
Quote:

Originally Posted by sh.d (Post 427948)
hi sandy
i create geometry in solid and save it .stl
but when open in linux its there is wrong
can you help me?

Dear sh.d,
In fact I do not why your file does not open with linux, but have you saved your file as an ascci format stl file. I think you should pick ascci when you save the file If you did not and I wish If I can help you more.
Sandy,

sh.d May 17, 2013 08:07

help
 
Hi sandy
Thank you very much for answering my question. But I do not know how to save your file format ascci?
Do you know?

sandy13 May 17, 2013 09:19

ascii format
 
Quote:

Originally Posted by sh.d (Post 428242)
Hi sandy
Thank you very much for answering my question. But I do not know how to save your file format ascci?
Do you know?

Okay, you mad your geometry by solid works and saved it in STL. now go to linux and use blender software. In blender import this STL file and open it you will see your geometry the export it as an STL and in the exporting window there is option of ascii, pick this option and unpick apply modifiers, so you will get it and then you can use it in OF.
Sandy,

sh.d May 17, 2013 10:01

Quote:

Originally Posted by sandy13 (Post 428265)
Okay, you mad your geometry by solid works and saved it in STL. now go to linux and use blender software. In blender import this STL file and open it you will see your geometry the export it as an STL and in the exporting window there is option of ascii, pick this option and unpick apply modifiers, so you will get it and then you can use it in OF.
Sandy,

thank you very very much sandy:)

sh.d May 17, 2013 10:42

1 Attachment(s)
Quote:

Originally Posted by sh.d (Post 428286)
thank you very very much sandy:)

Dear sany
i import my geometry in blender but i cant see it!!!!!!!!!!!!!!!!!!
?
:(


i open it
the all normal face is (0 0 0)
is it right?

sandy13 May 20, 2013 06:18

It is working
 
Quote:

Originally Posted by sh.d (Post 428296)
Dear sany
i import my geometry in blender but i cant see it!!!!!!!!!!!!!!!!!!
?
:(


i open it
the all normal face is (0 0 0)
is it right?

Hi, I imported your geometry, it is working, I do not know what is going on with you, It should work...,
Sandy

sh.d May 25, 2013 09:56

Hi Sandy
Do you know how to use Add layer?
thanks a lot

sandy13 May 26, 2013 06:29

Add layers
 
Quote:

Originally Posted by sh.d (Post 429982)
Hi Sandy
Do you know how to use Add layer?
thanks a lot

Hi, I never succeeded in adding layers, sorry I can not help you that much about it but If you manged to do it please post me...
Sandy,

nimasam May 26, 2013 06:39

Quote:

Originally Posted by sh.d (Post 429982)
Hi Sandy
Do you know how to use Add layer?
thanks a lot

first :
Code:

addLayers      true;
second: in addLayersControls
Code:


    layers
    {

        ".*" //put your patch name here
        {
            nSurfaceLayers 1; //put numbers of your layers here
        }

    }


sandy13 May 26, 2013 09:25

Quote:

Originally Posted by nimasam (Post 430085)
first :
Code:

addLayers      true;
second: in addLayersControls
Code:


    layers
    {

        ".*" //put your patch name here
        {
            nSurfaceLayers 1; //put numbers of your layers here
        }

    }


Hi, thank you so much for your post, I tried to do the same without any success, may be I have something wrong some where. Thank you so much.
Sandy,

nimasam May 26, 2013 10:44

1 Attachment(s)
Hello

look at the following test case:

sh.d May 26, 2013 14:27

hi sandi
probably your name of addlayer is wrong
i think its true:
injector.stl_injector
second injector is the name in .stl file and not geometry

sh.d May 27, 2013 01:44

1 Attachment(s)
hello
sandy look at the .stl file and name it in the file and name add layer in snappyHexMeshDict file

sh.d May 28, 2013 04:06

snap
 
hi
i want to create 2d mesh around airfoil
but when i use checkMesh is this error:Number of edges not aligned with or perpendicular to non-empty directions
and the surface of airfoil not snap
can you help me please?

nimasam May 28, 2013 04:26

Quote:

Originally Posted by sh.d (Post 430427)
hi
i want to create 2d mesh around airfoil
but when i use checkMesh is this error:Number of edges not aligned with or perpendicular to non-empty directions
and the surface of airfoil not snap
can you help me please?

did you try to use extrudeMesh ?

sandy13 May 28, 2013 07:16

Quote:

Originally Posted by nimasam (Post 430434)
did you try to use extrudeMesh ?

Dear searcher,
Sorry I can not help you that much about this error, and I did not use extrudeMesh before, sorry again and good luck with your research.
Sandy,

sh.d May 28, 2013 07:30

snap
 
1 Attachment(s)
Hi nimasam
yes i use the extrudMesh
please look at the my testcase

sh.d May 28, 2013 09:03

snap
 
is it right:?
1:run blockMesh
2:snappyhexMeshDict -overwite
3:extrudeMesh

sh.d May 28, 2013 09:06

is it right?
1:run blockMesh
2:run snappyHexMeshDict -overwrite
3:run extrudeMesh

sandy13 May 28, 2013 09:57

Quote:

Originally Posted by sandy13 (Post 430475)
Dear searcher,
Sorry I can not help you that much about this error, and I did not use extrudeMesh before, sorry again and good luck with your research.
Sandy,

Dear nimasam,
Could you please help me with something.. I am trying to do simulation for a swirl atomization with OF 2.1.1, interFoam solver. My geometry is like in the attached picture, I want to use blockMesh to construct the mesh but I have a problem in defining the internal walls for the mixing region.
Sandy,

sandy13 May 28, 2013 10:00

Quote:

Originally Posted by nimasam (Post 430434)
did you try to use extrudeMesh ?

Hi nimasam,
this is my geometry
https://www.dropbox.com/home/openfoam-shear
Sandy,

nimasam May 29, 2013 06:42

Quote:

Originally Posted by sh.d (Post 430477)
Hi nimasam
yes i use the extrudMesh
please look at the my testcase

Hi
i saw your test case, good job ;), whats the problem?
its 2D now and there are several layers around airfoil.

nimasam May 29, 2013 06:45

Quote:

Originally Posted by sh.d (Post 430511)
is it right:?
1:run blockMesh
2:snappyhexMeshDict -overwite
3:extrudeMesh

yep its right
1- blockMesh
make your base mesh
2- snappyHesMesh -overwrite
extract your airfoil in it

3- extrudeMesh
you can derive one cell thick geometry

nimasam May 29, 2013 06:48

Quote:

Originally Posted by sandy13 (Post 430530)
Hi nimasam,
this is my geometry
https://www.dropbox.com/home/openfoam-shear
Sandy,

Dear Sandy

i guess, you need to make a public link in dropBox, then i would access your link ;)
now i can not see any thing :)

sandy13 May 30, 2013 06:17

Quote:

Originally Posted by nimasam (Post 430704)
Dear Sandy

i guess, you need to make a public link in dropBox, then i would access your link ;)
now i can not see any thing :)

Dear nimasam,
I am sorry, this the link again and hope it is working

https://www.dropbox.com/s/9o0bpfehxpp2cwz/img007.jpg

Sandy,

nimasam May 30, 2013 07:12

dear sandy :) i suggest to use snappyHexMesh, you can create your mesh in a CAD software, then easily with snappyHexMesh you can mesh your geometry

sandy13 May 30, 2013 08:15

blockMesh
 
Quote:

Originally Posted by nimasam (Post 430954)
dear sandy :) i suggest to use snappyHexMesh, you can create your mesh in a CAD software, then easily with snappyHexMesh you can mesh your geometry

Dear nimasam,
Thank you for your advice. So as you suggested there is no way to use blockMesh and the only way is CAD and snappy . It is impossible or possible but very difficult by blockMesh?
Sandy,

nimasam May 30, 2013 08:20

i guess its possible, you should define several blocks, but it would not be easy tasks :) and you need to be patient enough :D

sandy13 May 30, 2013 09:04

blockMesh
 
Quote:

Originally Posted by nimasam (Post 430968)
i guess its possible, you should define several blocks, but it would not be easy tasks :) and you need to be patient enough :D

Thank you so much, I will try to do it by blockMesh, can I ask you If I stuck or had a problem in it?
Sandy,

nimasam May 30, 2013 09:11

you can post your problems here, forum users will try to help you :D

mp717 November 19, 2020 15:23

Try this...it should work
 
In snappHexMeshDict, do not forget to add this part otherwise snappyHexMesh will work but still layers wont be added.

features
(
{
file "yourcase.eMesh";
level yourinput;
}
);

Example:

features
(
{
file "motorbike.eMesh";
level 6;
}
);

The thread is too old still posting if someone got stuck like I was due to this.
Hope it helps
Thank you !


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