CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Open Source Meshers: Gmsh, Netgen, CGNS, ... (http://www.cfd-online.com/Forums/openfoam-meshing-open/)
-   -   Single volume Mesh gmsh (http://www.cfd-online.com/Forums/openfoam-meshing-open/121668-single-volume-mesh-gmsh.html)

PeteH August 2, 2013 10:51

Single volume Mesh gmsh
 
1 Attachment(s)
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

Phizz82 August 5, 2013 06:04

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.

PeteH August 5, 2013 07:26

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

Phizz82 August 5, 2013 08:43

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.

PeteH August 5, 2013 08:54

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

Phizz82 August 5, 2013 09:09

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.

PeteH August 5, 2013 09:15

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

Phizz82 August 6, 2013 04:50

Hi Pete. Just wanted to check how you got on.

PeteH August 6, 2013 08:32

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

Phizz82 August 6, 2013 08:54

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.


All times are GMT -4. The time now is 04:56.