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

.stl to OF Problems

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 19, 2010, 21:29
Default .stl to OF Problems
  #1
Senior Member
 
jeff osborne
Join Date: Mar 2010
Posts: 108
Rep Power: 7
ozzythewise is on a distinguished road
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
ozzythewise is offline   Reply With Quote

Old   September 20, 2010, 02:03
Default
  #2
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
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
colinB is offline   Reply With Quote

Old   September 20, 2010, 02:12
Default
  #3
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 577
Blog Entries: 5
Rep Power: 13
elvis is on a distinguished road
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
elvis is offline   Reply With Quote

Old   September 20, 2010, 20:13
Default
  #4
Senior Member
 
jeff osborne
Join Date: Mar 2010
Posts: 108
Rep Power: 7
ozzythewise is on a distinguished road
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
Attached Images
File Type: jpg Grid.jpg (95.3 KB, 15 views)
ozzythewise is offline   Reply With Quote

Old   September 21, 2010, 03:29
Default
  #5
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
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
colinB is offline   Reply With Quote

Old   September 21, 2010, 12:34
Default
  #6
Senior Member
 
jeff osborne
Join Date: Mar 2010
Posts: 108
Rep Power: 7
ozzythewise is on a distinguished road
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 is offline   Reply With Quote

Old   September 21, 2010, 12:43
Default
  #7
Senior Member
 
jeff osborne
Join Date: Mar 2010
Posts: 108
Rep Power: 7
ozzythewise is on a distinguished road
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
Attached Images
File Type: jpg Airfoil.jpg (100.4 KB, 31 views)
ozzythewise is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SnappyHexMesh .stl Jochem OpenFOAM 7 August 3, 2012 06:20
Needed Benchmark Problems for FSI Mechstud Main CFD Forum 4 July 26, 2011 12:13
Problem with importing .stl file RJD Phoenics 5 May 15, 2010 03:18
Two-phase air water flow problems by activating Wall Lubrication Force challenger85 CFX 5 November 5, 2009 06:44
Some problems with Star CD Micha CD-adapco 0 August 6, 2003 13:55


All times are GMT -4. The time now is 00:04.