CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   .stl to OF Problems (http://www.cfd-online.com/Forums/openfoam-meshing/80223-stl-problems.html)

ozzythewise September 19, 2010 21:29

.stl to OF Problems
 
Hello all,

I'm just trying to figure out how to import solid models from a modelling program (in my case solidworks) in openfoam. The particular case I'm looking at is a simple 2D airfoil. I created the shape in SW, saved it as a .stl file. At the moment I'm trying to use enGrid to import into OF, but if someone has a different suggestions I'd be happy to hear it. My issue is really that I have no idea how to use it, how do I define my BCs around the airfoil that I will use in OF? I did the tutorial for engrid (valve model) but that was internal flow and I'm really confused about external flow. If anyone has any suggestions for documentation that I can read or if they know of a simpler way to do it I would really appreciate that.

Thanks
- J

colinB September 20, 2010 02:03

Hi ozzy,
try to use snappyHexMesh.
Together with blockMesh and snappyHexMesh you have two preinstalled tools in OF that you can use for implementing your .stl file in OF.
As tutorial use the motorBike tutorial in OF ( /tutorials/incompressible/simpleFoam/motorBike ) and also in the documentation under chapter 5 meshing you find a section dealing with snappyHexMesh

I hope I could help you

regards Colin

elvis September 20, 2010 02:12

Hello,

what about going http://engits.eu/phpBB3/ to ENGRID discussion boardforum,
there should be experienced users like Oliver Gloth it`s originator

maybe as a start reading
http://engits.eu/phpBB3/viewtopic.php?f=2&t=106

and post your questions there

just my 2 cents

elvis

ozzythewise September 20, 2010 20:13

1 Attachment(s)
Hey,

I'm trying now to just use snappyHexMesh to import my shape in (an airfoil that I'm trying to make into a 2D simulation). I have my .stl file in the triSurface subdictionary, the snappyHexMeshDict file in the system directory and I created the hex mesh using blockMeshDict. Here is a printout of what my snappyHexMeshDict file looks like. I'm just trying to get it working right now so I tried making it as simple as possible:

castellatedMesh true;
snap true;
addLayers true;
mergeTolerance 1e-06;
debug 0;

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

};

castellatedMeshControls
{

locationInMesh (0 0 0.0005);
maxLocalCells 1000000;
maxGlobalCells 2000000;
minRefinementCells 0;
nCellsBetweenLevels 1;
resolveFeatureAngle 30;


features
(

);

refinementSurfaces
{
NACA0010.stl
{

level (2 2);
}
}

}

snapControls
{

nSmoothPatch 3;
tolerance 4.0;
nSolveIter 30;
nRelaxIter 5;
}

addLayersControls
{

relativeSizes true;

layers
{
airfoil
{
nSurfaceLayers 1;
}pected int found on line 37 the do

}

expansionRatio 1.0;
finalLayerThickness 0.3;
minThickness 0.25;
nGrow 1;
featureAngle 60;
nRelaxIter 5;
nSmoothSurfaceNormals 1;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedianAxisAngle 130;
nBufferCellsNoExtrude 0;
nLayerIter 50;
}

meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minArea -1;
minTwist 0.05;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;
nSmoothScale 4;
errorReduction 0.75;
}


It compiles fine but when I try to view it in paraview, I don't get anything, it just looks like a grid with no shape in it (see picture attached). Does anyone have any suggestions for this?

Thanks a million
-J

colinB September 21, 2010 03:29

Hi I had the same problem that I stated already here and some other questions on sHM.
But the more I think of it I get the impression that paraFoam is just printing the blockMesh part of the mesh (well obviously it does as seen on the picture, but I mean that it doesn't print anything created by sHM at all and only refers to the results of blockMesh)
But any help on this topic is appreciated as well as on my other questions I stated in the previous mentioned topic
best regards
Colin

ozzythewise September 21, 2010 12:34

apparently the error was that instead of just calling "snappyHexMesh" I needed to call "snappyHexMesh -overwrite" without the quotes. It seems that when you do that it puts the new information in the polyMesh file which then paraView reads from.

ozzythewise September 21, 2010 12:43

1 Attachment(s)
Okay, now I have a new question about this problem. I do have it working now, but the meshing isn't as accurate as I would like it to be. Here is a printout of my snappyHexMeshDict file:


castellatedMesh true;
snap true;
addLayers true;
mergeTolerance 1e-06;
debug 0;

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

refinementBox
{
type searchableBox;
min (-0.25 -0.1 0);
max ( 0.75 0.1 0.001);
}
};

castellatedMeshControls
{

locationInMesh (-0.25 0 0.0005);
maxLocalCells 1000000;
maxGlobalCells 2000000;
minRefinementCells 0;
nCellsBetweenLevels 1;
resolveFeatureAngle 30;

refinementRegions
{
refinementBox
{
mode inside;
levels ((1E15 5));
}
}

features
(

);

refinementSurfaces
{
NACA0010
{

level (4 5);
}
}

}

snapControls
{

nSmoothPatch 3;
tolerance 4.0;
nSolveIter 30;
nRelaxIter 5;
}

addLayersControls
{

relativeSizes true;

layers
{
airfoil
{
nSurfaceLayers 1;
}
}

expansionRatio 1.0;
finalLayerThickness 0.3;
minThickness 0.25;
nGrow 1;
featureAngle 45;
nRelaxIter 8;
nSmoothSurfaceNormals 3;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedianAxisAngle 130;
nBufferCellsNoExtrude 0;
nLayerIter 50;
}

meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minArea -1;
minTwist 0.05;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;
nSmoothScale 4;
errorReduction 0.75;
}

And attached I have some pictures of my shape. You can see in the pictures that the airfoil shape looks wavy which will definitely mess up my results. Any suggestions for how I can get rid of that?

Thanks
-J


All times are GMT -4. The time now is 22:36.