|
[Sponsors] |
July 8, 2014, 15:20 |
SnappyHexMesh Problem
|
#1 |
Senior Member
|
Hello everyone
I am quite new with OpenFoam and I am trying to mesh a cylinder with SnappyHexMesh from inside. I have created an stl file for cylinder in Paraview, then i did changes in snappyHexmeshdict accordingly. I used blockmesh (a cube) to enclose that cylinder. After that i tried to mesh cylinder but in the end I got only that meshed cube. there was no cylinder. Can you please tell me what could be the possible problems. And how can I use snappyhexmesh for cylinder in detail including commands which i have to write in terminal (stepwise). Thank you |
|
July 9, 2014, 05:18 |
|
#2 |
Senior Member
|
Hi,
it'll be easier to get an answer to the question if - you just post case files - (if previous is not possible) post pictures of the cylinder, what you'd like to get from sHM, what you get from sHM. (also if it's just a cylinder, in fact, there's no point in using sHM) |
|
July 9, 2014, 05:46 |
|
#3 |
Senior Member
|
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.2.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // castellatedMesh true; snap true; addLayers false; geometry // Load in STL files here { cylinder.stl {type triSurfaceMesh; name cylinder;} //refinementBox {type searchableBox; min (-0.1 -0.1 -0.05); max ( 0.1 0.1 0.05);} }; castellatedMeshControls { maxLocalCells 1000000; //max cells per CPU core maxGlobalCells 2000000; //max cells to use before mesh deletion step minRefinementCells 10; //was 0 - zero means no bad cells are allowed during refinement stages maxLoadUnbalance 0.10; nCellsBetweenLevels 1; // expansion factor between each high & low refinement zone // Explicit feature edge refinement // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ features // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command ( {file "cylinder.eMesh"; level 3;} ); // Surface based refinement // ~~~~~~~~~~~~~~~~~~~~~~~~ refinementSurfaces // Surface-wise min and max refinement level { cylinder {level (3 3);}// was 0 0 } resolveFeatureAngle 80; // Resolve sharp angles // Default 30 refinementRegions // In descending levels of fine-ness {flange {mode distance; levels ((0.0006 4) (0.002 3) (0.01 2));}} // was ((0.001 4) (0.003 3) (0.01 2)) locationInMesh (0.01 0.01 0.01); //to decide which side of mesh to keep ** allowFreeStandingZoneFaces true; } // Settings for the snapping. snapControls { nSmoothPatch 3; tolerance 4.0; nSolveIter 30; nRelaxIter 5; nFeatureSnapIter 15; // default is 10 // New settings from openfoam 2.2 onwards for SHMesh implicitFeatureSnap false; // default is false - detects without doing surfaceFeatureExtract explicitFeatureSnap true; // default is true multiRegionFeatureSnap false; // deafault is false - detects features between multiple surfaces } // Settings for the layer addition. addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName { relativeSizes true;//false; // was true layers { //visc_main cylinder {nSurfaceLayers 3;} // was 3 } expansionRatio 1.3; finalLayerThickness 0.00016; //was 0.00016 minThickness 0.00008; //was 0.00008 nGrow 0; // was 1 // Advanced settings featureAngle 80; // was 70 //- When not to extrude surface. 0 is flat, 90 is right angle. nRelaxIter 3; //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh. nSmoothSurfaceNormals 1; // Number of smoothing iterations of surface normals nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction nSmoothThickness 10; // Smooth layer thickness over surface patches maxFaceThicknessRatio 0.5; // Stop layer growth on highly warped cells maxThicknessToMedialRatio 0.3; // Reduce layer growth where ratio thickness to medial distance is large minMedianAxisAngle 130; // Angle used to pick up medial axis points nBufferCellsNoExtrude 0; // Create buffer region for new layer terminations nLayerIter 50; // Overall max number of layer addition iterations } // Generic mesh quality settings. At any undoable phase these determine // where to undo. meshQualityControls { maxNonOrtho 65; maxBoundarySkewness 20; maxInternalSkewness 4; maxConcave 80; minFlatness 0.5; minVol 1e-13; minTetQuality 1e-9; minArea -1; minTwist 0.02; minDeterminant 0.001; minFaceWeight 0.02; minVolRatio 0.01; minTriangleTwist -1; // Advanced nSmoothScale 4; errorReduction 0.75; } // Advanced debug 0; // Merge tolerance. Is fraction of overall bounding box of initial mesh. // Note: the write tolerance needs to be higher than this. mergeTolerance 1E-6; // ************************************************** *********************** // |
|
July 9, 2014, 23:03 |
|
#4 | |
Senior Member
|
Hi,
Can you verify that cylinder.stl from PARAVIEW is OK? STL files exported from paraview might not closed. You can open the exported STL files to see how it looks like. I think it is better to use other software to create STL files. You can create basic shapes using snappyHexMesh itself. Just adding the following lines inside the geometry section of snappyHexMeshDict. cylinder { type searchableCylinder; point1 (0 0 0); // center of bottom circle point2 (2 0 0); // center of top circle radius 2.5; // radius } snappyWiki is a good starting point. https://sites.google.com/site/snappywiki/ Quote:
|
||
July 10, 2014, 06:51 |
|
#5 | |
Senior Member
|
thank you very much. I have checked my geometry it was not closed. Can you please tell me
1) If I use searchable cylinder in snappyHexMesh, then do I need any stl file in trisurface folder or shall I leave that folder empty. Also can I add patches if I use it 2) What other open source can I use to create stl file for simple geometry in which I could add patches e.g for inlet and outlet Quote:
|
||
March 4, 2015, 05:57 |
|
#6 |
New Member
Daniel Duque
Join Date: Jan 2011
Location: ETSIN, Madrid
Posts: 28
Rep Power: 15 |
Hi,
Did you get an answer to your questions? I have run into the same difficulties. The searchableCylinder idea works fine, but the snappy complains about the features entry. With a valid stl, the file in this entry can be built with the surfaceFeatureExtract utility (not longer runs at command line, I enclose its dictionary below). But, of course one does NOT have an stl if the cylinder is defined within searchableCylinder. What I've ended up doing is saving a crappy, open cylinder with paraview, running surfaceFeatureExtract on it, putting the resulting cyl.eMesh where it should be, constant/triSurfaces, and then not using that at all, by adding these lines in my snappy dict: features ( { file "cyl.eMesh"; levels ((0.01 0)); } ); Not very elegant, but in my case the "cylinder" is just a simulation box, and I'm nor really worried about the edges. About freeware alternatives, there's blender, but that's quite a complicated piece of software. /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object surfaceFeatureExtractDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // cyl.stl { // How to obtain raw features (extractFromFile || extractFromSurface) extractionMethod extractFromSurface; extractFromSurfaceCoeffs { // Mark edges whose adjacent surface normals are at an angle less // than includedAngle as features // - 0 : selects no edges // - 180: selects all edges includedAngle 150; } // Write options // Write features to obj format for postprocessing writeObj yes; } // ************************************************** *********************** // |
|
March 4, 2015, 14:53 |
|
#7 |
Senior Member
|
Hello dduque
I got the answer of question. I didn't understand your question. Will you please little bit elaborate your question. Thank you |
|
April 28, 2015, 05:43 |
|
#8 |
Member
Sachin
Join Date: Aug 2014
Location: India
Posts: 84
Rep Power: 11 |
Hi Foamers,
Iam Getting an error while trying to mesh a model using Snappy Hexmesh. Can anyone help me out with what this error is?? ERROR: In /home/openfoam/OpenFOAM/ParaView-4.1.0/VTK/IO/Geometry/vtkSTLReader.cxx, line 435 vtkSTLReader (0x739fa90): STLReader error reading file: /home/sachin/OpenFOAM/sachin-2.3.1/run/20pax/skeg/constant/triSurface/wigley-scaled-oriented.stl Premature EOF while reading solid. |
|
April 28, 2015, 05:49 |
|
#9 |
Senior Member
|
Hello
There is a problem with your STL file, can you please attach your STL file here Regards |
|
April 28, 2015, 08:25 |
|
#10 |
Member
DanielP
Join Date: Jan 2015
Posts: 33
Rep Power: 11 |
Hello,
If you give my your email, i'll send you my complete cylinder case. Thanks, Daniel |
|
April 28, 2015, 17:04 |
|
#11 |
Senior Member
|
||
May 7, 2015, 00:29 |
|
#12 |
Member
Sachin
Join Date: Aug 2014
Location: India
Posts: 84
Rep Power: 11 |
Hi all,
Iam recieveing an error message when iam trying to mesh my geometry...what could be the possible issue?? *** Error in `snappyHexMesh': corrupted double-linked list: 0x000000002a34f710 *** Thanks in advance |
|
May 7, 2015, 02:01 |
|
#13 |
Member
Sachin
Join Date: Aug 2014
Location: India
Posts: 84
Rep Power: 11 |
Another error message is :
#0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 cfree in "/lib/x86_64-linux-gnu/libc.so.6" |
|
May 7, 2015, 02:02 |
|
#14 |
Member
Sachin
Join Date: Aug 2014
Location: India
Posts: 84
Rep Power: 11 |
#4 Foam::List<int>:: operator=(Foam:: List<int> const&) at ??:?
#5 Foam::List<Foam:: face>:: List(Foam:: List<Foam:: face> const&) at ??:? #6 Foam:: polyTopoChange::reorderCompactFaces(int, Foam:: List<int> const&) at ??:? #7 Foam:: polyTopoChange::compact(bool, bool, int&, Foam::List<int>&, Foam::List<int>&) at ??:? #8 Foam:: polyTopoChange::compactAndReorder(Foam:olyMesh const&, bool, bool, bool, int&, Foam::Field<Foam::Vector<double> >&, Foam::List<int>&, Foam::List<int>&, Foam::List<Foam:: objectMap>&, Foam::List<Foam:bjectMap>&, Foam::List<Foam:bjectMap>&, Foam::List<Foam:: objectMap>&, Foam::List<Foam:: objectMap>&, Foam::List<Foam:: objectMap>&, Foam::List<Foam:: objectMap>&, Foam::List<Foam:bjectMap>&, Foam::List<Foam:: Map<int> >&, Foam::List<int>&, Foam::List<int>&, Foam::List<Foam::Map<int> >&) at ??:? #9 Foam:olyTopoChange::changeMesh(Foam:olyMesh&, bool, bool, bool, bool) at ??:? #10 Foam::meshRefinement::refine(Foam::List<int> const&) at ??:? #11 Foam::meshRefinement::balanceAndRefine(Foam::strin g const&, Foam::decompositionMethod&, Foam::fvMeshDistribute&, Foam::List<int> const&, double) at ??:? #12 Foam::autoRefineDriver::surfaceOnlyRefine(Foam::re finementParameters const&, int) at ??:? #13 Foam::autoRefineDriver::doRefine(Foam::dictionary const&, Foam::refinementParameters const&, Foam::snapParameters const&, bool, Foam::dictionary const&) at ??:? #14 at ??:? #15 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #16 at ??:? Segmentation fault (core dumped) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Problem with decomposePar, snappyHexMesh | luca1992 | OpenFOAM Meshing & Mesh Conversion | 12 | August 23, 2017 19:06 |
[snappyHexMesh] snappyHexMesh problem | cfdsolver1 | OpenFOAM Meshing & Mesh Conversion | 0 | June 23, 2016 10:09 |
[snappyHexMesh] Problem handling with subdictionary in SnappyHexMesh | Lorenzo92 | OpenFOAM Meshing & Mesh Conversion | 0 | November 21, 2015 13:57 |
[snappyHexMesh] Problem with snappyhexMesh: modelling a pore chamber and pore throat model | Saideep | OpenFOAM Meshing & Mesh Conversion | 5 | May 10, 2015 14:46 |
[snappyHexMesh] Problem with snappyHexMesh | giack | OpenFOAM Meshing & Mesh Conversion | 2 | September 18, 2014 10:03 |