|
[Sponsors] |
[snappyHexMesh] simple sphere with snappyhexmesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 31, 2011, 12:18 |
simple sphere with snappyhexmesh
|
#1 |
New Member
Duncan Roy van der Heul
Join Date: May 2010
Posts: 26
Rep Power: 16 |
I tried to use SHM, but I hope I am doing something wrong, because the result is a bit disappointing. The snapping does not make a good approximation of the actual surface. I played around with the four snapping parameters but their influence is not so great.
Am I missing something, or is this the best SHM can do? The STL file I am using is a very high resolution description of a sphere using triangles. The pictures show the inner surface of the mesh in paraFoam: the castellated case, the snapped case (next time level) and the snapped case together with the geometry. Any ideas would be appreciated! Kind regards. Duncan Last edited by Duncan_vdH; May 31, 2011 at 12:21. Reason: try to make post more clear. |
|
June 22, 2011, 04:31 |
sphere with snappyHexMesh
|
#2 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi Duncan,
It seems that the snapping is not working in your case. I am also trying to mesh a sphere. I get a smooth surface with the snapp function. However I can't manage to add layers. You can have a look at my snappyHexMeshDict and blockMeshDict for this. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Which of the steps to run castellatedMesh true; snap true; addLayers true; geometry { sphere { type searchableSphere; centre (0 0 0); radius 0.1; } }; castellatedMeshControls { maxLocalCells 1000000; maxGlobalCells 2000000; minRefinementCells 0; maxLoadUnbalance 0.10; nCellsBetweenLevels 1; features ( ); refinementSurfaces { sphere { level (2 2); /* regions { secondSolid { level (5 5); } } */ patchInfo { type wall; } } } resolveFeatureAngle 30; refinementRegions { } locationInMesh (0.11 0 0); allowFreeStandingZoneFaces true; } snapControls { nSmoothPatch 3; tolerance 1.0; nSolveIter 30; nRelaxIter 3; } addLayersControls { relativeSizes true; layers { sphere_region0 { nSurfaceLayers 2; } } expansionRatio 1.0; // finalLayerThickness 1e-9; finalLayerThickness 0.01; finalLayerRatio 0.01; minThickness 0; nGrow 1; featureAngle 60; nRelaxIter 5; nSmoothSurfaceNormals 1; nSmoothNormals 3; nSmoothThickness 10; maxFaceThicknessRatio 0.5; maxThicknessToMedialRatio 0.3; minMedianAxisAngle 90; nBufferCellsNoExtrude 0; nLayerIter 50; nRelaxedIter 20; } meshQualityControls { maxNonOrtho 65; maxBoundarySkewness 20; maxInternalSkewness 4; maxConcave 80; minVol 1e-200; minTetQuality 1e-9; minArea -1; minTwist 0.05; minDeterminant 0.001; minFaceWeight 0.05; minVolRatio 0.00001; minTriangleTwist -1; nSmoothScale 4; errorReduction 0.75; relaxed { maxNonOrtho 75; } } debug 0; mergeTolerance 1e-6; // ************************************************************************* // ps. here the sphere is in unit order of length scale but once I get the layers right, I will want to mesh a micro sized sphere. Best regards, Erik Arlemark |
|
June 22, 2011, 08:45 |
|
#3 |
New Member
Duncan Roy van der Heul
Join Date: May 2010
Posts: 26
Rep Power: 16 |
Hi Erik,
Thanks for responding. I found an error in my Blockmeshdict and now have a smooth sphere and layers. And a different opinion on Snappyhexmesh :-). I basically went back to the Iglo tutorial and started from that. Remove all the internal stuff and use the Iglo geometry as the basis. I would recommend starting with all the settings for layer control from that tutorial. I think many of your grid quality parameters are quite different form that testcase. Now I have layers too! If you redirect output to file, is layer generation mentioned in the output? I can send you the files I am using, just email me. |
|
June 22, 2011, 12:12 |
sphere with snappyHexMesh
|
#4 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi Duncan,
Thanks for your reply. I now managed to get layers to the sphere as well. I will also have a look at the Igloo case as you suggested. Maybe I can optimize the mesh for my purpose. picure of mesh and snappyHexMeshDict is attached in case anyone else is interested. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Which of the steps to run castellatedMesh true; snap true; addLayers true; geometry { sphere { type searchableSphere; centre (0 0 0); radius 0.1; } }; castellatedMeshControls { maxLocalCells 1000000; maxGlobalCells 2000000; minRefinementCells 0; maxLoadUnbalance 0.10; nCellsBetweenLevels 1; features ( ); refinementSurfaces { sphere { level (2 1); /* regions { secondSolid { level (5 5); } } */ patchInfo { type wall; } } } resolveFeatureAngle 30; refinementRegions { /* sphere { mode outside; levels ((1.0 1)); } */ } locationInMesh (0.11 0 0); allowFreeStandingZoneFaces true; } snapControls { nSmoothPatch 3; tolerance 1.0; nSolveIter 30; nRelaxIter 5; } addLayersControls { relativeSizes false; layers { sphere_region0 { nSurfaceLayers 2; } } expansionRatio 1.0; // finalLayerThickness 1e-9; finalLayerThickness 0.1; finalLayerRatio 0.01; minThickness 0.002; nGrow 0; featureAngle 30; nRelaxIter 10; nSmoothSurfaceNormals 1; nSmoothNormals 3; nSmoothThickness 10; maxFaceThicknessRatio 0.5; maxThicknessToMedialRatio 0.3; minMedianAxisAngle 40; nBufferCellsNoExtrude 0; nLayerIter 100; nRelaxedIter 20; } meshQualityControls { maxNonOrtho 65; maxBoundarySkewness 20; maxInternalSkewness 4; maxConcave 80; minVol 1e-200; minTetQuality 1e-9; minArea -1; minTwist 0.05; minDeterminant 0.001; minFaceWeight 0.05; minVolRatio 0.01; minTriangleTwist -1; nSmoothScale 4; errorReduction 0.75; relaxed { maxNonOrtho 75; } } debug 0; mergeTolerance 1e-6; // ************************************************************************* // Erik |
|
June 22, 2011, 12:18 |
|
#5 |
New Member
Duncan Roy van der Heul
Join Date: May 2010
Posts: 26
Rep Power: 16 |
Hi Erik,
I also have these small, very slender elements in my mesh like I see in your case, away from the sphere. Do you or anybody else know how to suppress these or make them disappear? I played around with the minimum volume setting, but this had little effect. Cheers, Duncan |
|
June 24, 2011, 04:36 |
|
#6 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi Duncan and all,
Yes indeed, I also would like to get rid of the very small cells and I can not seem to get the minVolRatio entry to control this. Thanks for the advise of looking at the igloo case. I will give this a try. Cheers, Erik |
|
June 29, 2011, 08:32 |
sphere with snappyHexMesh
|
#7 |
Member
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17 |
Hi Duncan and all,
It seems a nice mesh of the sphere (see figure here) can be made for specific configurations of number of cells in x-,y- and z-direction, being set in the blockMeshDict file. If an ill-favored number or background mesh is chosen the small cells appear (as I have posted above). Attached is also a spherical cavity, created by setting the locationInMesh entry to a point inside the created sphere. ps. For the figure attached, I prefer to have only one relatively thick layer next to the sphere but this is not necessary for producing a clean mesh of the sphere with layers. Cheers, Erik |
|
July 6, 2011, 08:11 |
|
#8 |
Senior Member
Join Date: Nov 2010
Posts: 113
Rep Power: 16 |
Hi Erik,
would it be possible that you also post your stl file? it looks quite promising what you did and i would like to give it a try too. Thanks in advance! |
|
July 7, 2011, 03:42 |
|
#9 | |
Member
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 17 |
Quote:
geometry { sphere { type searchableSphere; centre (0 0 0); radius 0.1e-7; } }; Regards Norman |
||
July 7, 2011, 06:13 |
|
#10 |
Senior Member
Join Date: Nov 2010
Posts: 113
Rep Power: 16 |
oh - thanks for the information.. didn't know, that shm has this function too!
|
|
March 20, 2012, 12:47 |
|
#11 |
Senior Member
Join Date: Nov 2010
Posts: 113
Rep Power: 16 |
Hi again,
I was trying to add a boundary layer to my sphere. To compute the flow around a sphere i meshed a quarter of a sphere and wanted to refine the boundary layer. I am not so sure, how to deal with the "addLayersControls" which should do that if I understood everything correct. I added my blockmesh and snappyHexMeshDict. -- Edit: the layers { sphere { nSurfaceLayers 5; } } in the provided SHMDict needs to be sphere_region0 (or?) but it does not change anything... --- Thanks in advance! Last edited by lindstroem; March 20, 2012 at 13:14. |
|
March 20, 2012, 17:13 |
|
#12 |
New Member
Duncan Roy van der Heul
Join Date: May 2010
Posts: 26
Rep Power: 16 |
Hi,
I completely switched over to using SALOME for meshing and have no regrets! You should check it out, it works like a charm. Regards, Duncan |
|
March 30, 2012, 11:14 |
Sphere using blockMeshing
|
#13 |
New Member
Ivo
Join Date: Feb 2012
Posts: 26
Rep Power: 14 |
I think this would be the best place to share my .m4 file of a sphere or spheroid created using several blocks and arc-edges, as opposed to using a utility such as snappyHexMesh. The advantage is that it creates a body-conformal mesh around the spher(e/oid).
Why? I have seen that a droplet on a cylindrical surface created using SHM has an unphysical contact line (see image attached), and if I create a cylinder using blockmeshing only (see tutorial of the chargedWire), the contactline is nice and smooth. In addition, the SHM method did not allow me to use parallel+interDyMFoam, and the blockmesh version does. Hence, I felt that creating a sphere using blockMesh only will also improve results and since it took me a day or so I thought I'd share. |
|
May 17, 2012, 06:04 |
Unable to see Sphere in ParaFoam
|
#14 | |
New Member
Amit Mangtani
Join Date: May 2012
Posts: 5
Rep Power: 14 |
Hi Erik,
I am new to OpenFoam and i've been told to do CFD of the cylinder in which a sphere is placed inside the cylinder as an obstacle... I have been able to make the structured grid for cylinder but still not able to figure out the unstructured grid around the sphere... I have looked your both Dict files and after using them i am not able to see the unstructured grid around sphere in ParaFoam.. Can you please me suggest me the mistake?? No error has been showing in terminal but when i open the ParaFoam i can only see the block domain which is created by blockmesh and nothing else.. So i'm little confused now that what snappyHexMesh does?? Regards, Amit Mangtani Quote:
Last edited by amitmangtani; May 17, 2012 at 09:18. |
||
August 9, 2012, 10:54 |
|
#15 |
New Member
Join Date: Apr 2011
Location: Magdeburg, Germany
Posts: 23
Rep Power: 15 |
Hello Ivo,
I am also doing simulations of a flow around a sphere. I also generated some structured grids, but they did not have a sufficient quality at the sphere surface. But your grids looks really, really good, thanks for the dict at this point. I also tried to understand what you have done and i wanted to add some new blocks for my case. But unfortunately I just got errors during blockMeshing. As you can see in the attached file, I would like to create a wake area behind the sphere in z-direction (about 7*Lenght of the current domain). So can you help me with it, or give me some hints, how do realize this? Thanks in advance. Best regards, Nico |
|
August 9, 2012, 10:59 |
|
#16 |
Senior Member
Join Date: Nov 2010
Posts: 113
Rep Power: 16 |
you need to make sure, that your cells fit the cells of the neighboring block. Maybe that can help you:
http://www.cfd-online.com/Forums/ope...hes-p-t-u.html or you use the same discretization in x and y direction as in the "master"block greetings |
|
August 9, 2012, 11:06 |
|
#17 |
New Member
Ivo
Join Date: Feb 2012
Posts: 26
Rep Power: 14 |
Dear Nico,
As lindstroem mentions, you'd have to connect your other mesh blocks to the same grid. You might want to use pyFoamDisplayBlockMesh to distinguish the different blocks. Once that's fixed and you still get errors, please post the errors so people can have a clue what's going on. Cheers I |
|
August 9, 2012, 12:43 |
|
#18 |
New Member
Join Date: Apr 2011
Location: Magdeburg, Germany
Posts: 23
Rep Power: 15 |
Thank you both for the very quick answers. I now decided to use the extrudeMesh utility, which works fine so far, I hope the results will show that.
|
|
October 7, 2019, 12:21 |
|
#19 | |
New Member
Nafrin
Join Date: Jul 2019
Posts: 6
Rep Power: 7 |
Quote:
|
||
January 18, 2021, 17:56 |
|
#20 | |
Senior Member
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18 |
Quote:
It may look like a simple question, but how was this "cavity-like" configuration made by snappy? I tried to use the attached dictionary for snappy, but it gave me a mesh either inside or outside the sphere. I wonder if there's a way to mesh an open cavity configuration in snappy? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
snappyHexMesh in parallel leads to segmentation fault | ChrisHa | OpenFOAM Pre-Processing | 1 | January 14, 2019 11:04 |
[snappyHexMesh] Sphere in a channel by snappyHexMesh | arsalan.dryi | OpenFOAM Meshing & Mesh Conversion | 0 | November 14, 2016 17:01 |
SIMPLE algorithm in 3D cylindrical coordinates | zouchu | Main CFD Forum | 1 | January 20, 2014 18:02 |
CFX analysis of a sphere - drag too low | Rob Findlay | CFX | 6 | March 26, 2007 11:11 |
meshing F1 front wing | Steve | FLUENT | 0 | April 17, 2003 13:37 |