[Gmsh] Controlling the order geometrical features are merged into geo file

James Gross jgross0227 at gmail.com
Mon Feb 26 12:35:01 CET 2018


Hi,

I am looking to use gmsh to merge a brep or stp file that contains a 2D
geometry, create a 2D mesh, and then extrude the mesh into 3D for a 2D
simulation in OpenFOAM. I need the geometry to be parameterizable such that
a variety of geometries can be generated in a script.

The issue is that when I merge the geometry file into gmsh, the order of
the lines are significantly affected by the geometry. This means that when
I extrude the geometry into 3D, the physical labels that I assign the
surfaces are greatly affected by the geometry i.e. for one geometry the
"inlet" surface could be described by out[11] (where out is the label of
the extrusion), but for another geometry the "inlet" surface is described
by out[7]. This is a huge issue when I am trying to automatically create,
label, and mesh geometries.

So for example, here is geometry 1.


​
​
It's "inlet" surface is described by

Physical Surface("inlet") = {out[3]};
>

Here is geometry 2.

​If I use the above specification for the inlet (i.e. out[3]), I get the
following "inlet":


​In fact, for the second geometry, the correct inlet is now is defined by:

Physical Surface("inlet") = {out[7]};
>

Is there any way to keep the ordering of this constant so that a variety of
geometries can be extruded, labeled and meshed using the same script?

Otherwise, if I can label the lines in FreeCAD, can I then use those lines
as the labels for the extrusion such that the correct labels are given for
the correct surfaces?

Here is the geo script that takes in the 2D geometry, extrudes and labels
it.

SetFactory("OpenCASCADE");
>
> Merge "Impeller.stp";
>
> Mesh.Algorithm = 6; // (1) MeshAdapt (2) Auto (5) Delaunay (6) frontal (7)
> BAMG (8) DelQuad
> Mesh.Smoothing = 100;
> Mesh.OptimizeNetgen = 1;
>
> lc = 0.01;
> y_plus = 2.1e-4;
>
> h = 0.001;
> n = 5;
>
> out[] = Extrude {0,0,h}
> {
>   Surface {1}; Layers{1}; Recombine;
> };
>
> Physical Surface("shroud") = {out[0],out[1]};
> Physical Surface("ggi_int") = {out[2]};
> Physical Surface("wall_blade") = {out[4]:out[23]};
> Physical Surface("inlet") = {out[3]};
> Physical Volume("internal") = {1};
>
​
Thank you any assistance you can offer.

Kind regards,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20180226/5c6902df/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Geometry2_Inlet.jpg
Type: image/jpeg
Size: 12862 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20180226/5c6902df/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Geometry2.jpg
Type: image/jpeg
Size: 218234 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20180226/5c6902df/attachment-0005.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Geometry1.jpg
Type: image/jpeg
Size: 295837 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20180226/5c6902df/attachment-0006.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Geometry1_Inlet.jpg
Type: image/jpeg
Size: 27288 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20180226/5c6902df/attachment-0007.jpg>


More information about the gmsh mailing list