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

[snappyHexMesh] snappyHexMesh does not create mesh in body volume

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2016, 10:50
Default snappyHexMesh does not create mesh in body volume
  #1
Member
 
Axel
Join Date: May 2016
Location: Augsburg, Germany
Posts: 46
Rep Power: 9
Illmatic is on a distinguished road
Hi,

I am a new OpenFOAM and SHM user. I am trying to mesh a pipe segment with SHM. I created the geometry in Salome and exported all surfaces as stl files. SHM does not give any error message but somehow the interior of the mesh seems to be missing. Additionally the sharp edges are not meshed properly although surfaceFeatureExtract seems to have worked (I have included the feature line object in the images)

I appreciate every help. Thanks in advance!

Code:
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;    // make basic mesh ?
snap            true;    // decide to snap back to surface ?
addLayers       true;   // decide to add viscous layers ?


geometry // Load in STL files here
{
	Inlet.stl {type triSurfaceMesh; name Inlet;}
	Outlet.stl {type triSurfaceMesh; name Outlet;}
	Mantel.stl {type triSurfaceMesh; name Mantel;}
	All_Faces.stl {type triSurfaceMesh; name All_Faces;}
};

castellatedMeshControls
{
    maxLocalCells 1000000;  //max cells per CPU core
    maxGlobalCells 10000000; //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
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command
    features 
    (
	{file "Inlet.eMesh"; level 3;}
	{file "Outlet.eMesh"; level 3;}
	{file "Mantel.eMesh"; level 3;}
    );

    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

    refinementSurfaces // Surface-wise min and max refinement level
    {
	Inlet {level (0 0);}
	Outlet {level (0 0);}
	Mantel {level (3 3);}
    }  

    refinementRegions        // In descending levels of fine-ness
    {
	All_Faces
	{
		mode distance;
		levels ((0.0002 4) (0.0004 3) (0.0008 2));	// was ((0.001 4) (0.003 3) (0.01 2))
	} 
    } 

    resolveFeatureAngle 80;  // Resolve sharp angles // Default 30
    locationInMesh (0 0 0);  //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 false; // was true
    layers
    {
	Walls
         	{nSurfaceLayers 3;}
    }

    expansionRatio 1.3;
    finalLayerThickness 0.0001; //was 0.00016
    minThickness 0.00002; //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;


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

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

convertToMeters 1;

vertices
(
    (-1e-03 -4e-03 -4e-03)
    (15e-03 -4e-03 -4e-03)
    (15e-03 4e-03 -4e-03)
    (-1e-03 4e-03 -4e-03)
    (-1e-03 -4e-03 4e-03)
    (15e-03 -4e-03 4e-03)
    (15e-03 4e-03 4e-03)
    (-1e-03 4e-03 4e-03)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (40 10 10) simpleGrading (1 1 1)
);

edges
(
);

patches
(
	patch minX
	(
		(0 3 7 4)
	)
	patch maxX
	(
		(1 2 6 5)
	)
	patch minY
	(
		(0 4 5 1)
	)
	patch maxY
	(
		(2 3 7 6)
	)
	patch minZ
	(
		(0 1 2 3)
	)
	patch maxZ
	(
		(4 5 6 7)
	)
);

// ************************************************************************* //
Attached Images
File Type: jpg Pipe_mesh_shm.jpg (121.0 KB, 50 views)
File Type: jpg sharp_edge.jpg (189.5 KB, 52 views)
Illmatic is offline   Reply With Quote

Old   July 11, 2016, 21:35
Default
  #2
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
What does the surface mesh of your STL look like?
me3840 is offline   Reply With Quote

Reply

Tags
snappy hex mesh, surfacefeatureextract


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] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
[Gmsh] 3D coil mesh: can't create the volume? RomainBou OpenFOAM Meshing & Mesh Conversion 3 July 18, 2016 05:09
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


All times are GMT -4. The time now is 06:35.