2D modelers

Mesh generators, CAD programs, and other tools
Post Reply
Ob's
Posts: 5
Joined: 17 Nov 2012, 14:05
Antispam: Yes

2D modelers

Post by Ob's » 18 Nov 2012, 12:23

Hello,

I don't know which software to use to create a 2D geometry file or a meshed file that could be loaded to Elmer.
I guess it should be wether a .grd or a .in2d file. Thanks for the help you can bring to me.

Following lines are what I tried to do :

I need to study a turbulent flow around a beam in 2D. I have installed Elmer on my Ubuntu 12.04 configuration. I tried then to create the geometry with Elmer modeler but on the Elmer modeler window no command appear but Editor with 2 tabs (one is Points with Idx, x, y, the other is Curve with out, in, pts, p1, p2, p3), and nothing happens by picking with the mouse. I installed then Netgen, but I didn't find any modeler inside, as it seems to be only a mesher. I installed Gmesh, which has a modeler, I draw my geometry, saved in .geo file, (also meshed it and saved in .geo, .bdf, .diff, .inp, .ir3, .mail, .mesh, .med, .msh, .opt, .p3d, .ply2, .stl, .unv, .vtk, .wrl). But no one of the meshed files could be loaded in Elmer. The geometry file could not be open in Elmer as well (a message appears, saying « Unable to mesh, no input data or mesh generator (please make sure that your input file suffix is in lower case) ». I saw then that Elmer likes .grd or .in2d files for 2D geometries, so I tried to load the .geo geometry file to Netgen to create a .in2d file. But by loading into Netgen, an error message appears : « geo-file should start with algebraic 3D ».
I installed Grace for modeler but inside Grace I didn't find the possible extensions for saved files. I installed FreeCAD (on the File tab of the top boarder, only the Quit option appears, the software seems not to be finished) and LibreCAD (saves files in .dxf, .cxf, .lff).

tzwinger
Site Admin
Posts: 87
Joined: 24 Aug 2009, 12:20
Contact:

Re: 2D modelers

Post by tzwinger » 18 Nov 2012, 17:20

Hi,
the most easiest way, if you already have the GMSH mesh, is to export it to a .msh (simply under Mesh-> Save in GMSH; lets assume under name.msh) file and then create a ready made Elmer file using ElmerGrid (standalone outside ElmerGUI)

ElmerGrid 14 2 name.msh -autoclean

That should create you a file directory named name and the mesh files

name/mesh.{header,nodes,elements,boundary}

which should be directly loadable into ElmerGUI as is.

Best wishes,

Thomas

Ob's
Posts: 5
Joined: 17 Nov 2012, 14:05
Antispam: Yes

Re: 2D modelers

Post by Ob's » 22 Nov 2012, 01:25

Thanks Thomas,
your command must be good, but after opening ElmerGrid in a Terminal, typing ElmerGrid 14 2 ancre3 -autoclean
I get : LoadElmerInput: the opening of the mesh file ancre3.msh failed!

I opened the file in a text pad :
$MeshFormat
2.2 0 8
$EndMeshFormat
$ParametricNodes
1094
1 0 0 0 0 1
2 0.05 0.05 0 0 2
3 0.1 0.1 0 0 3
4 0.15 0.15 0 0 4
5 0.2 0.2 0 0 5
6 0.25 0.25 0 0 6
and so on...
1094 0.213877151111816 0.5607934396389993 0 2 21 0.5607934396389993 0.213877151111816
$EndParametricNodes
$Elements
2206
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 15 2 0 4 4
5 15 2 0 5 5
and so on...
2206 2 2 0 21 430 1052 1051
$EndElements

I think my mesh file is not good. In fact I have created points (with z=0), then lines on points, then an area on the lines,
then Mesh>Define>Size field>Boundary layer. I entered values for the boundary layer, Apply,
then Mesh>2D
and it created my mesh but not the boundary layer.
I didn't find how to create a boundary layer on the gmesh website, I am going to search more.
Cheers,
Ob's

mzenker
Posts: 1902
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: 2D modelers

Post by mzenker » 22 Nov 2012, 11:40

Hi,

I would guess that Elmergrid did not find your file. Stupid question: did you cd to the directory where it resides?
Does the file open in gmsh?

Matthias

Ob's
Posts: 5
Joined: 17 Nov 2012, 14:05
Antispam: Yes

Re: 2D modelers

Post by Ob's » 23 Nov 2012, 02:23

Your question was not stupid : I didn't. I am such a beginner...
This time ElmerGrid ran, I got the file with a beautiful boundary layer
(I found out how to create it ), it opens well in Gmsh.
Now I opened it in Elmer GUI, File>open, the design is completly destroyed,
In Mesh>configure I saw that the preferred generator is set on nglib
and not elmergrid. I clicked on the elmergrid option, applied but
when reopening the panel, it remains set on nglib.
I am searching more.
Thank you a lot once again !

I set my Gmsh .geo file for people who would encounter the same difficulties as me :
-not forget to write : Background Field = 1;
-Field[1].EdgesList = {1, 2, 3, 4}; note that 1, 2, 3, 4 must be geometry lines,
for me it didn't work with the physical line 13
-I tried to set smalls values for BL but it didn't run in gmsh, there must be an option,
but maybe better change the scale meters to mm for the point coordinates

Ob's

cl1 = 0.2;
cl2 = 0.5;
Point(1) = {0, 0, 0, cl1};
Point(2) = {3, 3, 0, cl1};
Point(3) = {2.5, 3.5, 0, cl1};
Point(4) = {-0.5, 0.5, 0, cl1};
Point(5) = {-20, -7, 0, cl2};
Point(6) = {10, -7, 0, cl2};
Point(7) = {10, 10, 0, cl2};
Point(8) = {-20, 10, 0, cl2};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line(5) = {5, 6};
Line(6) = {6, 7};
Line(7) = {7, 8};
Line(8) = {8, 5};
Line Loop(11) = {5, 6, 7, 8, -4, -3, -2, -1};
Plane Surface(11) = {11};
Physical Line(13) = {1, 2, 3, 4};
Physical Line(14) = {6};
Physical Line(15) = {8};
Physical Line(16) = {5, 7};
Physical Surface(12) = {11};
Field[1] = BoundaryLayer;
Field[1].EdgesList = {1, 2, 3, 4};
Field[1].NodesList = {1, 2, 3, 4};
Field[1].hfar = 0.5;
Field[1].hwall_n = 0.03;
Field[1].hwall_t = 0.2;
Field[1].ratio = 1.1;
Field[1].thickness = 0.1;
Background Field = 1;

mzenker
Posts: 1902
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: 2D modelers

Post by mzenker » 23 Nov 2012, 12:00

Hi,

I can open the mesh in ElmerGUI without problem. Here is what I did:

* Open the geo file with gmsh
* Mesh (1D and 2D)
* Save as .msh
* Open ElmerGUI
* Load the .msh file with File->Open

That's all.

Only if you have problems when loading the .msh directly with ElmerGUI, you can try to use the commandline ElmerGrid -autoclean. Then use File->Load Mesh on the directory created by ElmerGrid to load the mesh.

HTH,

Matthias

Ob's
Posts: 5
Joined: 17 Nov 2012, 14:05
Antispam: Yes

Re: 2D modelers

Post by Ob's » 24 Nov 2012, 02:15

I posted a screenshot of my computer which is what I get when clicking in ElmerGUI File > Open > name.msh

http://dl.free.fr/k4GbA7h5z
and here with the node numbers :
http://dl.free.fr/riHb9gFmH

The edge points remain at their position but the mesh is compressed on a centered line.

Ob's

Ob's
Posts: 5
Joined: 17 Nov 2012, 14:05
Antispam: Yes

Re: 2D modelers

Post by Ob's » 24 Nov 2012, 16:41

After in ElmerGUI Open>name.msh
I saved the project, so that mesh.nodes, mesh.header, mesh.elements, mesh.boundary
files were created, then I opened them to compare with my file name.msh :
mesh.nodes had very curious coordinates, only integer values,
I replaced them by the coordinates of the nodes written in my name.msh file,
runned ElmerGUI, loaded the project, and my design appears good.

mzenker
Posts: 1902
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: 2D modelers

Post by mzenker » 26 Nov 2012, 14:44

Hi,

the screenshots look very strange indeed.
Could you post name.geo and name.msh (zipped)? I would like to have a look at them.

Matthias

Post Reply