CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

Single volume Mesh gmsh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 2, 2013, 10:51
Default Single volume Mesh gmsh
  #1
New Member
 
Peter Hagan
Join Date: Oct 2011
Posts: 8
Rep Power: 5
PeteH is on a distinguished road
Hey all,
I was hoping somebody could help me out with my meshing problem.

I am trying to refine a mesh for the large box in my model you see attached. It is labeled as Volume(1). I do not want to affect the meshing in the two pipes coming out of Volume 1 though.
Does anyone know a way to specifically refine 1 volume from a model with multiple volumes? I'm using gmsh 2.8

Thanks,
Pete
Attached Images
File Type: png Screen Shot 2013-08-02 at 10.45.49 AM.png (24.0 KB, 49 views)
PeteH is offline   Reply With Quote

Old   August 5, 2013, 06:04
Default
  #2
New Member
 
Philip Brown
Join Date: Jun 2013
Posts: 25
Rep Power: 4
Phizz82 is on a distinguished road
Hi Peter. Have you tried altering the characteristic lengths related to the middle cube? This should allow you to have a fine mesh within this volume whilst the two pipes will mesh as before.
Phizz82 is offline   Reply With Quote

Old   August 5, 2013, 07:26
Default
  #3
New Member
 
Peter Hagan
Join Date: Oct 2011
Posts: 8
Rep Power: 5
PeteH is on a distinguished road
Thanks for the reply! I have been trying to use that method but I don't know how to change the characteristic length for just that volume. Can you explain shortly how to change the cl for 1 volume?
I've tried using a Box field but it is working for some reason.

Thanks,
Pete
PeteH is offline   Reply With Quote

Old   August 5, 2013, 08:43
Default
  #4
New Member
 
Philip Brown
Join Date: Jun 2013
Posts: 25
Rep Power: 4
Phizz82 is on a distinguished road
Would you be able to post the code from the .geo file? That way I can see how you made the volume originally and give you more advice on how to change the cl.
Phizz82 is offline   Reply With Quote

Old   August 5, 2013, 08:54
Default
  #5
New Member
 
Peter Hagan
Join Date: Oct 2011
Posts: 8
Rep Power: 5
PeteH is on a distinguished road
Here is my code for the project. I am trying to learn the functions of gmsh which is taking longer than expected.
I have imported the tutorial files into OpenFoam and even they have meshing errors so I'm a little suspicious.

Code:
// Gmsh project created on Fri Aug  2 08:51:13 2013
Point(1) = {0, 0, 0, 1.0};
Point(2) = {0.5, 0, 0, 1.0};
Point(3) = {0.5, 0.5, 0, 1.0};
Point(4) = {0, 0.5, 0, 1.0};
Point(5) = {0.2, 0.3, 0, 1.0};
Point(6) = {0.3, 0.3, 0, 1.0};
Point(7) = {0.3, 0.2, 0, 1.0};
Point(8) = {0.2, 0.2, 0, 1.0};
Point(9) = {.25, .25, 0, 1.0};
Circle(1) = {5, 9, 8};
Circle(2) = {8, 9, 7};
Circle(3) = {7, 9, 6};
Circle(4) = {6, 9, 5};
Line(5) = {4, 3};
Line(6) = {3, 2};
Line(7) = {2, 1};
Line(8) = {1, 4};
Line Loop(9) = {5, 6, 7, 8};
Line Loop(10) = {4, 1, 2, 3};

Plane Surface(11) = {9};
Extrude {0, 0, -1} {
  Surface{11};
}
Plane Surface(34) = {10};
Extrude {0, 0, .5} {
  Surface{34};
}
Point(33) = {.25, .1, -1, 1.0};
Point(36) = {.25, .2, -1, 1.0};
Point(37) = {.2, .15, -1, 1.0};
Point(39) = {.3, .15, -1, 1.0};
Point(40) = {.25, .15, -1, 1.0};

Circle(57) = {36, 40, 39};
Circle(58) = {39, 40, 33};
Circle(59) = {33, 40, 37};
Circle(60) = {37, 40, 36};
Line Loop(61) = {60, 57, 58, 59};
Plane Surface(62) = {61};

Extrude {0, 0, -.25} {
  Surface{62};
}
Physical Volume(85) = {2};

lc2 = .001;
Physical Surface(88) = {32};
Physical Surface(89) = {28};
Physical Surface(90) = {24};
Physical Surface(91) = {20,lc2};
Physical Surface(94) = {55, 47, 43, 51};
Physical Surface(95) = {56};
Physical Surface(96) = {71, 75, 79, 83};
Physical Surface(97) = {84};
Line Loop(98) = {13, 14, 15, 16};
Plane Surface(99) = {61, 98};
Plane Surface(100) = {9, 10};
Physical Surface(101) = {99};
Physical Surface(102) = {100};
Physical Volume(105) = {1};
Physical Volume(106) = {2};
Physical Volume(107) = {3};


Field[1] = Box;
Field[1].VIn = 0.1;
Field[1].VOut = 0.05;
Field[1].XMax = 0.45;
Field[1].XMin = 0.05;
Field[1].YMax = 0.45;
Field[1].YMin = 0.05;
Field[1].ZMax = 0.95;
Field[1].ZMin = 0.05;
Thanks,
Pete
PeteH is offline   Reply With Quote

Old   August 5, 2013, 09:09
Default
  #6
New Member
 
Philip Brown
Join Date: Jun 2013
Posts: 25
Rep Power: 4
Phizz82 is on a distinguished road
Can I assume that points 1 to 4 create one side of the box?

For a point the syntax seems to be
point(a) = {x,y,z,cl}

so if you change the cl at the end of these, the characteristic length pulls through all the way through the extrusion and the labelling of physical surfaces and volumes.

Hope this helps. I have found it quite difficult to find a comprehensive tutorial and so I have been mostly searching for tutorials and doing a bit of trial and error.
Phizz82 is offline   Reply With Quote

Old   August 5, 2013, 09:15
Default
  #7
New Member
 
Peter Hagan
Join Date: Oct 2011
Posts: 8
Rep Power: 5
PeteH is on a distinguished road
Thats right, the first 4 points make a side.

Thats a good tip, I didn't realize the cl would be pulled through the volume. I'll try that now, thanks!

Pete
PeteH is offline   Reply With Quote

Old   August 6, 2013, 04:50
Default
  #8
New Member
 
Philip Brown
Join Date: Jun 2013
Posts: 25
Rep Power: 4
Phizz82 is on a distinguished road
Hi Pete. Just wanted to check how you got on.
Phizz82 is offline   Reply With Quote

Old   August 6, 2013, 08:32
Default
  #9
New Member
 
Peter Hagan
Join Date: Oct 2011
Posts: 8
Rep Power: 5
PeteH is on a distinguished road
Thanks for checking in.
That trick with the original points did it. I meshed each volume with separate characteristic lengths.
The problem I am having now is with the gmshToFoam process.
the output in terminal reads many lines that say:
Code:
Unhandled element 1 at line 2548
Unhandled element 1 at line 2549
Mapping region 91 to Foam patch 0
Mapping region 90 to Foam patch 1
Mapping region 89 to Foam patch 2
Mapping region 88 to Foam patch 3
Mapping region 94 to Foam patch 4
Mapping region 95 to Foam patch 5
Mapping region 96 to Foam patch 6
Mapping region 97 to Foam patch 7
Mapping region 101 to Foam patch 8
Mapping region 102 to Foam patch 9
Mapping region 105 to Foam cellZone 0
Mapping region 85 to Foam cellZone 1
Mapping region 107 to Foam cellZone 2
Cells:
    total:4439
    hex  :0
    prism:0
    pyr  :0
    tet  :4439

CellZones:
Zone	Size
    0	2673
    1	1044
    2	722

Skipping tag  at line 9578
Patch 0 gets name patch0
Patch 1 gets name patch1
Patch 2 gets name patch2
Patch 3 gets name patch3
Patch 4 gets name patch4
Patch 5 gets name patch5
Patch 6 gets name patch6
Patch 7 gets name patch7
Patch 8 gets name patch8
Patch 9 gets name patch9

--> FOAM Warning : 
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 619
    Found 2582 undefined faces in mesh; adding to default patch.
Finding faces of patch 0
Finding faces of patch 1
Finding faces of patch 2
Finding faces of patch 3
Finding faces of patch 4
Finding faces of patch 5
Finding faces of patch 6
Finding faces of patch 7
Finding faces of patch 8
--> FOAM Warning : 
    From function gmshToFoam
    in file gmshToFoam.C at line 968
    Could not match gmsh face 3(281 1122 1297) to any of the interior or exterior faces that share the same 0th point
--> FOAM Warning : 
    From function gmshToFoam
    in file gmshToFoam.C at line 968
    Could not match gmsh face 3(281 1297 282) to any of the interior or exterior faces that share the same 0th point
--> FOAM Warning : 
    From function gmshToFoam
    in file gmshToFoam.C at line 968
    Could not match gmsh face 3(1122 1123 1297) to any of the interior or exterior faces that share the same 0th point

I'm not sure if the "Unhandled elements" have anything to do with the subsequent warnings.

Any idea on how to take care of these "FOAM Warning"s

Thanks,
Pete
PeteH is offline   Reply With Quote

Old   August 6, 2013, 08:54
Default
  #10
New Member
 
Philip Brown
Join Date: Jun 2013
Posts: 25
Rep Power: 4
Phizz82 is on a distinguished road
U nfortunately, I am not all the good with OpenFoam as yet. Perhaps try running checkMesh and posting the results for people to have a look. This might help.
Phizz82 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] Negative volume error in hybrid mesh siw ANSYS Meshing & Geometry 4 September 3, 2014 05:25
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 07:47
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24
mesh missing after import in fluent morteza08 FLUENT 0 July 23, 2010 02:22


All times are GMT -4. The time now is 07:54.