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

[Other] How to mesh inside a sphere?

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By cutter
  • 1 Post By cutter
  • 2 Post By alexeym
  • 1 Post By cutter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2014, 07:05
Default How to mesh inside a sphere?
  #1
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
ssss is on a distinguished road
Hi,

Anyone knows how to create a spherical mesh of the inside of a sphere?

Thank you
ssss is offline   Reply With Quote

Old   October 20, 2014, 08:36
Default
  #2
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi,

have a look at snappyHexMesh (www.openfoam.org/docs/user/snappyHexMesh.php).

There are also some nice explanations at https://sites.google.com/site/snappywiki/. Both the 'cube case' and the 'cylinder case' can be adapted for a sphere.

Cutter
ssss likes this.
cutter is offline   Reply With Quote

Old   October 20, 2014, 08:54
Default
  #3
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
I just played with cfMesh (one of its tools called 'cartesianMesh'). It also did a really good job (see attached image!). Depending on your requirements on the final mesh, there's also a tool called 'tetMesh' for the creation of tetrahedral meshes.

See http://www.c-fields.com/solutions/products/meshing for more infos!

Have fun!

Cutter
Attached Images
File Type: jpg sphere_cartesianMesh.jpg (76.3 KB, 151 views)
ssss likes this.
cutter is offline   Reply With Quote

Old   October 20, 2014, 13:47
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Quote:
Originally Posted by ssss View Post
Anyone knows how to create a spherical mesh of the inside of a sphere?
well, you can surely try to use snapptHexMesh or cfMesh, as cutter suggested. But I think it'll be much easier to use Gmsh (http://gmsh.info).

Here's an example of GEO file to generate fully hexagonal mesh of the sphere:

Code:
l = 1;
r1 = 2;
r2 = 0.5;
n = 20;

Point(1) = {0,0,0,l};
Point(102) = {r2,r2,-r2,l};
Point(103) = {-r2,r2,-r2,l};
Point(104) = {-r2,-r2,-r2,l};
Point(105) = {r2,-r2,-r2,l};
Circle(29) = {103,1,102};
Circle(30) = {102,1,105};
Circle(31) = {105,1,104};
Circle(32) = {104,1,103};
Line Loop(33) = {29,30,31,32};
Ruled Surface(34) = {33};
Rotate { {1,0,0},{0,0,0}, Pi/2 } { Duplicata{ Surface{34}; } }
Rotate { {1,0,0},{0,0,0}, Pi } { Duplicata{ Surface{34}; } }
Rotate { {1,0,0},{0,0,0}, 3*Pi/2 } { Duplicata{ Surface{34}; } }
Rotate { {0,1,0},{0,0,0}, Pi/2 } { Duplicata { Surface{34}; } }
Rotate { {0,1,0},{0,0,0}, -Pi/2 } { Duplicata { Surface{34}; } }

Surface Loop(101) = {35, 40, 45, 34, 51, 50};
Volume(102) = {101};

Transfinite Line {42, 44, 30, 32, 36, 41, 29, 31, 39, 49, 37, 47} = n;
Transfinite Surface "*";
Recombine Surface "*";
Transfinite Volume "*";
Recombine Volume "*";

Physical Surface(100) = {34,35,40,45,50,51};
Physical Volume(103) = {102};
Attached Images
File Type: png sphere.png (54.7 KB, 93 views)
afshinb and ssss like this.
alexeym is offline   Reply With Quote

Old   October 20, 2014, 15:53
Default
  #5
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi Alexey,

thanks for you additions. I haven't used Gmsh for a couple of years now. The last time I used it, the UI was quite unconventionally and somewhat intimidating. After quick and steep learning curve regarding the UI and experimenting with its scripting language I got pretty good meshes though. I liked it, but it didn't work within our toolchain (well, all the other OF tools need custom scripts and proprietary UIs too...). I will definitely have a look at it again!

Creating the sphere geometry (STL) with Salome and meshing the whole thing with cfMesh based on an existing tutorial case took me just a few minutes (less than ten!). Creating the mesh using the Gmsh script from Alexey shouldn't take any longer.

@SSSS: After all you have to find a workflow that works for your special use case (depending on mesh requirements, input files etc.). Now you've got already three of them, there are probably a dozen more ;-)

Cutter
ssss likes this.
cutter is offline   Reply With Quote

Old   October 27, 2014, 09:36
Default
  #6
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
ssss is on a distinguished road
Thank you all of you guys for your help, I finally managed to mesh a sphere, and an sphere section using snappyHexMesh and blockMesh to cut the geometry. The idea was borrowed from iglooTutorial in buoyanBoussinesqSimpleFoam folder

I will have a look at other posibilities mentioned here, thank you all you're awesome.
ssss is offline   Reply With Quote

Reply


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
[snappyHexMesh] Multi Region Mesh of a car filter Zephiro88 OpenFOAM Meshing & Mesh Conversion 3 September 11, 2019 19:34
[snappyHexMesh] problems generating clean mesh Christian_tt OpenFOAM Meshing & Mesh Conversion 2 June 20, 2019 05:39
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


All times are GMT -4. The time now is 09:16.