CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Internal flow using stl file with snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 23, 2023, 09:18
Default Internal flow using stl file with snappyHexMesh
  #1
New Member
 
Björn
Join Date: Jun 2023
Posts: 2
Rep Power: 0
Björnpork is on a distinguished road
Hi everyone
I have a stl file of a swirl separator. I want to simulate the inner flow in OpenFoam. I’m very sure that I have to use snappyHexMesh and therefore I need a “box” in which the model placed. But for some reason whenever I run simulation or just want to have a look at the model in paraview I only see the box without the model. What am I missing?
I have the stp file of the swirl separator from here:
https://grabcad.com/library/zyklonabscheider-1
Following are the files snappyHexMeshDict and blockMeshDict.
snappyHexMeshDict:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 10 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object autoHexMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
castellatedMesh true;
snap true;
addLayers true;
geometry
{
Cyclone-Mesh_230622_GSI.stl
{
type triSurfaceMesh;
name cyclone;
}
};
castellatedMeshControls
{
maxLocalCells 8000000;
maxGlobalCells 10000000;
minRefinementCells 0;
maxLoadUnbalance 0.0;
nCellsBetweenLevels 1;

features
(
{
file "ImageToStl.com_zyklonabscheider-3-38.eMesh";
level 3;
}
);

refinementSurfaces
{
cyclone
{
level (3 3);
faceZone insideFaces;
cellZone insideZone;
cellZoneInside insidePoint;
insidePoint (0.0 0.0 0.0);
}
inlet_block
{
level ( 0 0 );
patchInfo
{
type patch;//wall;
}
}
outlet_block
{
level ( 0 0 );
patchInfo
{
type patch;//wall;
}
}
walls_block
{
level ( 0 0 );
patchInfo
{
type patch;//wall;
}
}
}

resolveFeatureAngle 30;

refinementRegions
{
}

locationInMesh (0 0 0);
allowFreeStandingZoneFaces false;
}


snapControls
{
nSmoothPatch 5;
tolerance 1.0;
nSolveIter 300;
nRelaxIter 10;
nFeatureSnapIter 5;
implicitFeatureSnap false;
explicitFeatureSnap true;

multiRegionFeatureSnap false;
}

addLayersControls
{
relativeSizes false;
layers
{

insideZone_to_outsideZone
{

nSurfaceLayers 3;
}
}

expansionRatio 1.005;

finalLayerThickness 0.0001;
minThickness 0.00005;
nGrow 0;
featureAngle 85;
slipFeatureAngle 25;
nRelaxIter 5;
nSmoothSurfaceNormals 4;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.2;
minMedianAxisAngle 90;
nBufferCellsNoExtrude 0;

nLayerIter 50;
}
meshQualityControls
{
maxNonOrtho 65.0;
maxBoundarySkewness 20.0;
maxInternalSkewness 4.0;
maxConcave 80.0;
minVol 1.0E-14;
minTetQuality 1.0E-20;
minArea -1.0;
minTwist 0.02;
minTriangleTwist -1.0;
minDeterminant 0.01;
minFaceWeight 0.05;
minVolRatio 0.01;
minVolCollapseRatio 0.1;
nSmoothScale 4;
errorReduction 0.75;
relaxed
{
maxNonOrtho 75.0;
}
}
writeFlags
(
scalarLevels
layerSets
layerFields
);
mergeTolerance 1e-6;
// ************************************************** ****************** //

blockMeshDict:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 10 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1; //This gives you the scale: 0.001 would mean all units in this file are [mm]

vertices //list of vertices defining the geometry
(
(-1000 -1000 -1000) //This is point 0. Not 1!
(1000 -1000 -1000) //This is point 1
(1000 1000 -1000) //point 2
(-1000 1000 -1000) //point 3
(-1000 -1000 1000) //point 4
(1000 -1000 1000) //point 5
(1000 1000 1000) //point 6
(-1000 1000 1000) //point 7
);

blocks //defining the block which the geometry is made out of
(
hex (0 1 2 3 4 5 6 7) (50 25 50) simpleGrading (1 1 1)
//this means that the only block in the geometry is defined by vertices (0 1 2 ...), there are 100, 10
//and 1 cells in the x, y, and z direction and that in each direction all the cells have the same length
);

//edges
//(
// spline 0 1
// (
// (5 -2 0)
// )
// spline 4 5
// (
// (5 -2 0.1)
// )
//);

boundary (
inlet_block
{
type patch;
faces (
(3 7 4 0)
);
}
outlet_block
{
type patch;
faces (
(2 1 5 6)
);
}
walls_block
{
type wall;
faces (
(1 2 3 0)
(7 6 5 4)
(0 4 5 1)
(2 6 7 3)
);
}
);


// ************************************************** *********************** //
Björnpork is offline   Reply With Quote

Old   July 6, 2023, 00:43
Default
  #2
New Member
 
FOAMraj
Join Date: Apr 2021
Posts: 19
Rep Power: 5
BIRAJ is on a distinguished road
Make sure to check the scale factor in blockMesh and the location in mesh in snappyHexMeshDict.
BIRAJ is offline   Reply With Quote

Reply

Tags
mesh, openfoam, snappyhexmesh, stl


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] Tabulated thermophysicalProperties library chriss85 OpenFOAM Community Contributions 62 October 2, 2022 04:50
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 19:13
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 22:53
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18


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