|
[Sponsors] |
[Gmsh] GmshToFoam: Problem meshing a circle in a square |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 9, 2016, 14:13 |
GmshToFoam: Problem meshing a circle in a square
|
#1 |
New Member
Paul
Join Date: Jun 2016
Posts: 21
Rep Power: 10 |
Hi guys,
I'm trying to make a simple 2D (well, 3D in OpenFOAM!) mesh using Gmsh. Here's how I've written it: Code:
//Inputs w=1;//m h=1;//m r=0.3;//m gridsize=w/20; Point(1) = {0, 0, 0, gridsize}; Point(2) = {w, 0, 0, gridsize}; Point(3) = {w, h, 0, gridsize}; Point(4) = {0, h, 0, gridsize}; Point(5) = {w/2, h/2, 0, gridsize}; Point(6) = {(r+w/2), h/2, 0, gridsize}; Point(7) = {w/2, (r+h/2), 0, gridsize}; Point(8) = {(-r+w/2), h/2, 0, gridsize}; Point(9) = {w/2, (-r+h/2), 0, gridsize}; Line(1) = {4, 3}; Line(2) = {3, 2}; Line(3) = {2, 1}; Line(4) = {1, 4}; Circle(5) = {8, 5, 7}; Circle(6) = {7, 5, 6}; Circle(7) = {6, 5, 9}; Circle(8) = {9, 5, 8}; Line Loop(1) = {5, 6, 7, 8}; Line Loop(2) = {4, 1, 2, 3}; Ruled Surface(1) = {1}; Plane Surface(2) = {2, 1}; surfaceVector[] = Extrude {0, 0, 0.1} { Surface{1,2}; Layers{1}; Recombine;}; Physical Volume("internal") = surfaceVector[1]; Physical Surface("LeftWall")=surfaceVector[2]; Physical Surface("RightWall")=surfaceVector[4]; Physical Surface("BottomWall")=surfaceVector[5]; Physical Surface("TopWall")=surfaceVector[3]; Cheers. |
|
July 9, 2016, 19:45 |
|
#2 |
Senior Member
|
Hi,
Can not reproduce your error with Gmsh 2.12.0 and neither with OpenFOAM 4.x, nor with OpenFOAM 2.4.x. Though one of peculiarities of your geo file is that gmsh -3 produces only mesh inside circle, so, guess, you need to describe what you are trying to achieve, since "meshing a circle in a square" is rather vague. |
|
July 10, 2016, 09:32 |
|
#3 |
New Member
Paul
Join Date: Jun 2016
Posts: 21
Rep Power: 10 |
Hi Alexey, thanks for your reply.
Apologies for the vagueness - on a second read of the post it is a bit lacking! What I'm trying to make is a mesh of a 'unit cell' in a nuclear reactor, i.e., a circular fuel pin surrounded by a square region of coolant. However, I'm not actually interested in the CFD aspects, rather the neutronics and hence I'm trying to mesh both of these parts of the cell together, albeit as regions with ultimately different properties. Also, I want to ensure that this mesh only has one layer as it's a 2D simulation I intend to run. I now realise that while I did indeed get it to successfully mesh, it only meshes either the circular or square region with a hole, depending upon the order the surfaces are written in the extrude command. From there, placing the .msh file in the system folder, when I run gmshToFoam XXXX.msh in the case file the segFault occurs: Code:
Create time #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::PtrList<Foam::polyPatch>::operator[](int) const at ??:? #4 ? at ??:? #5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #6 ? at ??:?Segmentation fault (core dumped) |
|
July 10, 2016, 10:10 |
|
#4 |
Senior Member
|
Hi,
The error you are mentioning in the last message is caused by non-existent XXXX.msh, since you put it into system folder and run gmshToFoam (I guess) from case folder. Either put XXXX.msh into case folder, or run gmshToFoam system/XXXX.msh. |
|
July 10, 2016, 10:46 |
|
#5 |
New Member
Paul
Join Date: Jun 2016
Posts: 21
Rep Power: 10 |
Knew it was something stupid - thank you very much Alexey.
If anyone happens to know how I might combine the circular and square meshes that would also be brilliant although I do suspect it won't prove too difficult in the end! |
|
July 10, 2016, 11:14 |
|
#6 |
Senior Member
|
Oh, I have missed second.
The reason for fancy meshing could be usage of the hole during construction of plane. Usually I try to avoid this functionality and split plane into continuous pieces. You can find example attached to the message. Differences from your geo in your initial are: - Mesh center is in (0, 0, 0). - Sizes of cells are controlled by variables d1 (point density on the outer lines), d2 (points density on the internal lines), d3 (points density on the circle arcs) rather than by parameter in points definition. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ANSYS Meshing] ANSYS Meshing Problem | Saikat_FM | ANSYS Meshing & Geometry | 1 | September 15, 2016 03:25 |
[ICEM] Problem with meshing half NACA0009 in 3D | Eizo | ANSYS Meshing & Geometry | 30 | February 17, 2013 03:40 |
[snappyHexMesh] snappyHexMesh: problem meshing baffle (surface with zero thickness) | julien.decharentenay | OpenFOAM Meshing & Mesh Conversion | 7 | June 16, 2012 09:12 |
[GAMBIT] 3D boundary layer and meshing problem in GAMBIT 2.4.6 | prashanthreddyh | ANSYS Meshing & Geometry | 1 | December 20, 2011 01:35 |
GAMBIT meshing problem | Gauthier Lambert | Main CFD Forum | 1 | August 3, 2000 10:22 |