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/)
-   -   Create cylinder around snappyHexMesh for MRF/rotating (http://www.cfd-online.com/Forums/openfoam-meshing/64452-create-cylinder-around-snappyhexmesh-mrf-rotating.html)

linnemann May 12, 2009 04:22

Create cylinder around snappyHexMesh for MRF/rotating
 
1 Attachment(s)
Hi Community

I have a question regarding creating a mesh with SnappyHexMesh (SHM) which is to be used with either moving mesh or MRF solver.

The geometry in mind is a ships propeller/hull, after creating the SHM mesh I would like to create a cylinder around the propeller and split the mesh into two parts, rotating and stationary. As far as I've learned SHM do not support meshing multiple bodies and thus the reason tor creating the cylinder afterward, splitting the mesh.

Do you have any ideas if this is possible using only OpenFOAM tools since I'm not interested in using any commercial software for creating the mesh. I know it could be possible to use CellSet and FaceSet commands, but as far as I know these commands need some sort of body to operate on.

Any hints for this would be most helpfull. An example of the geometry can be seen in the attached picture created in Star CCM+.

Regards Linneman

http://www.cfd-online.com/Forums/att...2&d=1242116412

linnemann November 23, 2009 07:19

To answer my own question the 1.6 version of OpenFOAM has the possibility to use a cylinder shape for the cellSet command.

The interface/outside of the cylinder must have a well defined plane or instability in the flow can occur.

another approach is to create a mesh around the propeller which is a cylinder and have this cut from the bigger domain and use the ggi (general grid interface) features for OpenFOAM-1.5-dev.

I've created such a geometry using a combination of Salome for the geometry and Netgen for the mesh, export the mesh from Netgen to two different case folders and use the mergeMeshes command to combine the meshes. The MRF or dynamic features can then be used depending on quasi-steady or transient analysis.

Best

amgode January 7, 2010 00:09

Hi,

Just to add to the post above............

I have been trying to generate a mesh for stirred tank with a mrf region using snappyHexMesh.
The procedure I adopted goes as:
- define a cylindrical refinement zone (option available in OF-1.6) and use this as a refinement region. This would lead a good enough surface of revolution. (not sure about this, working on it !)
- the using cellSet its possible to extract this as a cellzone and use it as MRF zone.

Please correct me if I am wrong. !!!:)

-- Amol

amgode January 8, 2010 00:18

Another option:

- using ggi and snappyHexMesh
I am presently trying to figure this one out......

Create two different regions mrf region and the tank without the mrf region and then merge the meshes. GGI can then be used at the interface......To obtain a good correspondence between the surfaces I am trying the possibility of using the featureEdge option now available with OF-1.6.........Don't know how far I can get with this approach........

Any comments on the approach are welcome !!!!!!!!!!1


-- Amol

linnemann January 8, 2010 06:09

Quote:

Originally Posted by amgode (Post 241843)
Another option:

- using ggi and snappyHexMesh
I am presently trying to figure this one out......

Create two different regions mrf region and the tank without the mrf region and then merge the meshes. GGI can then be used at the interface......To obtain a good correspondence between the surfaces I am trying the possibility of using the featureEdge option now available with OF-1.6.........Don't know how far I can get with this approach........

Any comments on the approach are welcome !!!!!!!!!!1


-- Amol

This is the approach I'm currently using although I don't use snappy since the featureEdge option is still not present in 1.6 (told at the Barcelona conference in november). And thus snappy fails at capturing circular edges sufficiently.

I use a combo of Salome and Netgen to produce meshes with skewness less than 0.8 and the do as Amol proposed above. Merge meshes and employ ggi and cyclicGgi from the 1.5-dev version.

be_inspired May 29, 2014 06:40

2 Attachment(s)
Dear Niels,

I do not know if you still follow this topic.
The point is that I am trying to follow the same approach but for a different target.
Using a reference mesh of a wind farm ( fine mesh for ABL simulation but coarse mesh for rotorDiskSource model and wake simulation), I want to use snappy and a cylinder (STL) to obtain a hole in my reference mesh. That hole will be filled by a new refined mesh (mergeMeshes) with a cylindrical shape
Then, ggi interface would be used for making the magic.

I have done the snappy step using featureEdge option ( with no luck).
GGi interface is not clear for me. I am using OF2.3.0.

Thank you very much
Marcelino

OvGU October 19, 2014 23:19

I am strugling with a cylinder of 2 radius.I creat a layer but failed to remove badsector. It's only problem on surface, when Im looking inside, it's quite good .......... I can send u case file if u have little bit time

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;//false; // decide to add viscous layers ?


geometry // Load in STL files here
{
inlet_1.stl {type triSurfaceMesh; name inlet_1;}
outlet.stl {type triSurfaceMesh; name outlet;}
inlet_2.stl {type triSurfaceMesh; name inlet_2;}
inlet_3.stl {type triSurfaceMesh; name inlet_3;}
wall.stl {type triSurfaceMesh; name wall;}
//cylinder.stl {type triSurfaceMesh; name volume;}
refineCylinder {type searchableCylinder; point1 (0 0 0); point2 (0 0 2); radius 0.14;}
//refinementBox {type searchableBox; min (-0.5 -0.5 -0.5); max ( 0.5 0.5 0.5);}
};

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 "inlet_1.eMesh"; level 2;}
{file "outlet.eMesh"; level 2;}
{file "wall.eMesh"; level 2;}
{file "inlet_2.eMesh"; level 2;}
{file "inlet_3.eMesh"; level 2;}
);

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

refinementSurfaces // Surface-wise min and max refinement level
{
inlet_1 {level (2 2);}
outlet {level (2 2);}
wall {level (2 2);}
inlet_2 {level (2 2);} // was 4 4
inlet_3 {level (2 2);} // was 4 4
}


resolveFeatureAngle 80; // Resolve sharp angles // Default 30
refinementRegions // In descending levels of fine-ness
{refineCylinder {mode distance; levels ((1E15 2));}} // (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; // was true
layers
{
wall
{nSurfaceLayers 3;} // was 3
//visc_refine_1
// {nSurfaceLayers 3;} // was 3
//visc_refine_2
// {nSurfaceLayers 3;} // was 3
}

expansionRatio 1.0;//1.3;
finalLayerThickness 0.00016; //was 0.00016
minThickness 0.00008; //was 0.00008
nGrow 1; // 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;


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


All times are GMT -4. The time now is 10:25.