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] Scaling issues with STL file and snappy hex mesh . (https://www.cfd-online.com/Forums/openfoam-meshing/203481-scaling-issues-stl-file-snappy-hex-mesh.html)

pradyumnsingh June 28, 2018 19:25

Scaling issues with STL file and snappy hex mesh .
 
1 Attachment(s)
I am very new to OpenFoam :o
I am trying to put a stl file in domain space created by blockMesh utility.
However , snapping isn't really happening . The mesh generated after snapping dosent really have my model from the stl file. I have scaled both blockMesh and Snappy Hex Dict to 0.001 as mentioned below to mm .
The domain space was very carefully made , i suspect that I am having a scaling issue.

I am also attaching the files. Thanks for taking time to help me out :)

BloxkMeshDict

backgroundMesh
{
xMin -260; //
xMax 26;
yMin -5; //
yMax 66;
zMin -5;
zMax 37;
xCells 286;
yCells 71;
zCells 10;
}

convertToMeters 0.001; // for mm 0.001

SnappyHexMeshDict


geometry
{
hemisphere.stl
{
type triSurfaceMesh;
scale 0.001;
name hemisphere;
}
//refinementBox
//{
//type searchableBox;
//min (-0.5 -0.2 -0.5);
//max (2.5 0.5 2.5);
//}

};

castellatedMeshControls
{
maxLocalCells 1000000;
maxGlobalCells 2000000;
minRefinementCells 100;
resolveFeatureAngle 42;
nCellsBetweenLevels 10;
features
(
{
file "hemisphere.eMesh";
scale 0.001;
level 1;

}
);
refinementSurfaces
{
hemisphere
{
// Surface-wise min and max refinement level
level (1 1);
}
//
}

OtavioDuarte July 17, 2018 11:52

Quote:

Originally Posted by pradyumnsingh (Post 697589)
I am very new to OpenFoam :o
I am trying to put a stl file in domain space created by blockMesh utility.
However , snapping isn't really happening . The mesh generated after snapping dosent really have my model from the stl file. I have scaled both blockMesh and Snappy Hex Dict to 0.001 as mentioned below to mm .
The domain space was very carefully made , i suspect that I am having a scaling issue.

I am also attaching the files. Thanks for taking time to help me out :)

BloxkMeshDict

backgroundMesh
{
xMin -260; //
xMax 26;
yMin -5; //
yMax 66;
zMin -5;
zMax 37;
xCells 286;
yCells 71;
zCells 10;
}

convertToMeters 0.001; // for mm 0.001

SnappyHexMeshDict


geometry
{
hemisphere.stl
{
type triSurfaceMesh;
scale 0.001;
name hemisphere;
}
//refinementBox
//{
//type searchableBox;
//min (-0.5 -0.2 -0.5);
//max (2.5 0.5 2.5);
//}

};

castellatedMeshControls
{
maxLocalCells 1000000;
maxGlobalCells 2000000;
minRefinementCells 100;
resolveFeatureAngle 42;
nCellsBetweenLevels 10;
features
(
{
file "hemisphere.eMesh";
scale 0.001;
level 1;

}
);
refinementSurfaces
{
hemisphere
{
// Surface-wise min and max refinement level
level (1 1);
}
//
}

OpenFoam works in meters, be careful with that. In addition, to generate the mesh you need some care, the geometry used must be inside the cube generated by BlockMesh, as close as possible to their faces to be able to converge. Another error is your stl file in binaries, but in snappyHexMesh it is ascii, convert your file to ascii.

pradyumnsingh July 18, 2018 16:17

Quote:

Originally Posted by OtavioDuarte (Post 699559)
OpenFoam works in meters, be careful with that. In addition, to generate the mesh you need some care, the geometry used must be inside the cube generated by BlockMesh, as close as possible to their faces to be able to converge. Another error is your stl file in binaries, but in snappyHexMesh it is ascii, convert your file to ascii.

Thanks for your reply !

I did figure out the issue a while ago and it was exactly as you said. The stl file was in binaries and I needed to convert it into ASCII . It works like a charm now.


All times are GMT -4. The time now is 19:51.